From e5731161bb30dd6402462b8a96ccdf019e8fcd75 Mon Sep 17 00:00:00 2001 From: "Carl.Kenner" Date: Sat, 2 May 2009 22:28:34 +0000 Subject: [PATCH] DOSBox 0.70 --- ChangeLog | 80 + INSTALL | 3 +- Makefile.am | 2 +- Makefile.in | 284 +- NEWS | 80 + README | 584 +- THANKS | 4 + TODO | 1 - acinclude.m4 | 2 +- aclocal.m4 | 1470 ++- autogen.sh | 2 +- config.guess | 592 +- config.h.in | 24 +- config.sub | 124 +- configure | 9521 ++++++++++------- configure.in | 102 +- depcomp | 75 +- docs/Makefile.in | 115 +- docs/README.video | 3 + docs/dosbox.1 | 16 +- include/Makefile.in | 126 +- include/bios.h | 14 +- include/callback.h | 34 +- include/cpu.h | 30 +- include/cross.h | 14 +- include/debug.h | 2 +- include/dma.h | 4 +- include/dos_inc.h | 33 +- include/dos_system.h | 71 +- include/dosbox.h | 4 +- include/fpu.h | 113 +- include/hardware.h | 2 +- include/inout.h | 4 +- include/ipx.h | 32 +- include/ipxserver.h | 2 +- include/joystick.h | 6 +- include/keyboard.h | 2 +- include/logging.h | 34 +- include/mapper.h | 4 +- include/mem.h | 3 +- include/mixer.h | 8 +- include/mouse.h | 4 +- include/paging.h | 5 +- include/pic.h | 13 +- include/programs.h | 4 +- include/regs.h | 2 +- include/render.h | 13 +- include/serialport.h | 235 +- include/setup.h | 112 +- include/shell.h | 21 +- include/support.h | 4 +- include/timer.h | 2 +- include/vga.h | 105 +- include/video.h | 12 +- install-sh | 434 +- missing | 127 +- mkinstalldirs | 111 + src/Makefile.in | 307 +- src/cpu/Makefile.in | 263 +- src/cpu/callback.cpp | 386 +- src/cpu/core_dyn_x86.cpp | 148 +- src/cpu/core_dyn_x86/Makefile.am | 3 +- src/cpu/core_dyn_x86/Makefile.in | 130 +- src/cpu/core_dyn_x86/cache.h | 196 +- src/cpu/core_dyn_x86/decoder.h | 1082 +- src/cpu/core_dyn_x86/dyn_fpu.h | 665 ++ src/cpu/core_dyn_x86/dyn_fpu_dh.h | 494 + src/cpu/core_dyn_x86/risc_x86.h | 242 +- src/cpu/core_dyn_x86/string.h | 2 +- src/cpu/core_full.cpp | 2 +- src/cpu/core_full/Makefile.in | 127 +- src/cpu/core_full/load.h | 4 +- src/cpu/core_full/op.h | 11 + src/cpu/core_full/optable.h | 8 +- src/cpu/core_full/support.h | 1 + src/cpu/core_normal.cpp | 13 +- src/cpu/core_normal/Makefile.in | 127 +- src/cpu/core_normal/helpers.h | 2 +- src/cpu/core_normal/prefix_0f.h | 32 +- src/cpu/core_normal/prefix_66.h | 4 +- src/cpu/core_normal/prefix_66_0f.h | 6 +- src/cpu/core_normal/prefix_none.h | 26 +- src/cpu/core_normal/support.h | 2 +- src/cpu/core_normal/table_ea.h | 2 +- src/cpu/core_simple.cpp | 20 +- src/cpu/cpu.cpp | 280 +- src/cpu/flags.cpp | 23 +- src/cpu/instructions.h | 132 +- src/cpu/lazyflags.h | 2 +- src/cpu/modrm.cpp | 2 +- src/cpu/modrm.h | 2 +- src/cpu/paging.cpp | 12 +- src/debug/Makefile.in | 194 +- src/debug/debug.cpp | 1058 +- src/debug/debug_gui.cpp | 21 +- src/debug/debug_inc.h | 4 +- src/debug/debug_win32.cpp | 2 +- src/debug/disasm_tables.h | 2 +- src/dos/Makefile.am | 4 +- src/dos/Makefile.in | 231 +- src/dos/cdrom.cpp | 6 +- src/dos/cdrom_aspi_win32.cpp | 4 +- src/dos/cdrom_image.cpp | 36 +- src/dos/cdrom_ioctl_linux.cpp | 2 +- src/dos/cdrom_ioctl_os2.cpp | 4 +- src/dos/cdrom_ioctl_win32.cpp | 4 +- src/dos/dev_con.h | 64 +- src/dos/dos.cpp | 93 +- src/dos/dos_classes.cpp | 11 +- src/dos/dos_codepages.h | 1131 ++ src/dos/dos_devices.cpp | 52 +- src/dos/dos_execute.cpp | 46 +- src/dos/dos_files.cpp | 58 +- src/dos/dos_ioctl.cpp | 45 +- src/dos/dos_keyboard_layout.cpp | 1058 ++ src/dos/dos_keyboard_layout_data.h | 796 ++ src/dos/dos_memory.cpp | 57 +- src/dos/dos_misc.cpp | 4 +- src/dos/dos_mscdex.cpp | 622 +- src/dos/dos_programs.cpp | 563 +- src/dos/dos_tables.cpp | 41 +- src/dos/drive_cache.cpp | 48 +- src/dos/drive_fat.cpp | 202 +- src/dos/drive_iso.cpp | 58 +- src/dos/drive_local.cpp | 135 +- src/dos/drive_virtual.cpp | 19 +- src/dos/drives.cpp | 113 +- src/dos/drives.h | 41 +- src/dosbox.cpp | 111 +- src/dosbox.ico | Bin 114926 -> 0 bytes src/fpu/Makefile.am | 2 +- src/fpu/Makefile.in | 193 +- src/fpu/fpu.cpp | 101 +- src/fpu/fpu_instructions.h | 44 +- src/fpu/fpu_instructions_x86.h | 449 +- src/fpu/fpu_types.h | 64 - src/gui/Makefile.am | 2 + src/gui/Makefile.in | 197 +- src/gui/dosbox_logo.h | 4 +- src/gui/midi.cpp | 2 +- src/gui/midi_alsa.h | 5 +- src/gui/midi_coreaudio.h | 2 +- src/gui/midi_oss.h | 4 +- src/gui/midi_win32.h | 4 +- src/gui/render.cpp | 214 +- src/gui/render_loops.h | 28 +- src/gui/render_scalers.cpp | 67 +- src/gui/render_scalers.h | 16 +- src/gui/render_simple.h | 39 +- src/gui/render_templates.h | 113 +- src/gui/render_templates_hq.h | 85 + src/gui/render_templates_hq2x.h | 1896 ++++ src/gui/render_templates_hq3x.h | 2872 +++++ src/gui/render_templates_sai.h | 229 + src/gui/sdl_mapper.cpp | 1252 ++- src/gui/sdlmain.cpp | 197 +- src/hardware/Makefile.in | 282 +- src/hardware/adlib.cpp | 2 +- src/hardware/cmos.cpp | 10 +- src/hardware/disney.cpp | 10 +- src/hardware/dma.cpp | 2 +- src/hardware/gameblaster.cpp | 2 +- src/hardware/gus.cpp | 28 +- src/hardware/hardware.cpp | 6 +- src/hardware/iohandler.cpp | 90 +- src/hardware/ipx.cpp | 375 +- src/hardware/ipxserver.cpp | 6 +- src/hardware/joystick.cpp | 93 +- src/hardware/keyboard.cpp | 5 +- src/hardware/memory.cpp | 17 +- src/hardware/mixer.cpp | 62 +- src/hardware/mpu401.cpp | 64 +- src/hardware/pcspeaker.cpp | 4 +- src/hardware/pic.cpp | 56 +- src/hardware/sblaster.cpp | 278 +- src/hardware/serialport/Makefile.am | 6 +- src/hardware/serialport/Makefile.in | 211 +- src/hardware/serialport/directserial_os2.cpp | 473 +- src/hardware/serialport/directserial_os2.h | 50 +- .../serialport/directserial_posix.cpp | 361 + src/hardware/serialport/directserial_posix.h | 69 + .../serialport/directserial_win32.cpp | 411 +- src/hardware/serialport/directserial_win32.h | 52 +- src/hardware/serialport/misc_util.cpp | 329 + src/hardware/serialport/misc_util.h | 79 + src/hardware/serialport/nullmodem.cpp | 496 + src/hardware/serialport/nullmodem.h | 105 + src/hardware/serialport/serialdummy.cpp | 86 +- src/hardware/serialport/serialdummy.h | 41 +- src/hardware/serialport/serialport.cpp | 1582 +-- src/hardware/serialport/softmodem.cpp | 515 +- src/hardware/serialport/softmodem.h | 54 +- src/hardware/tandy_sound.cpp | 2 +- src/hardware/timer.cpp | 164 +- src/hardware/vga.cpp | 3 +- src/hardware/vga_attr.cpp | 9 +- src/hardware/vga_crtc.cpp | 32 +- src/hardware/vga_dac.cpp | 47 +- src/hardware/vga_draw.cpp | 680 +- src/hardware/vga_gfx.cpp | 2 +- src/hardware/vga_memory.cpp | 593 +- src/hardware/vga_misc.cpp | 58 +- src/hardware/vga_other.cpp | 135 +- src/hardware/vga_s3.cpp | 28 +- src/hardware/vga_seq.cpp | 6 +- src/hardware/vga_xga.cpp | 230 +- src/ints/Makefile.in | 208 +- src/ints/bios.cpp | 397 +- src/ints/bios_disk.cpp | 71 +- src/ints/bios_keyboard.cpp | 148 +- src/ints/ems.cpp | 224 +- src/ints/int10.cpp | 15 +- src/ints/int10.h | 2 +- src/ints/int10_char.cpp | 18 +- src/ints/int10_memory.cpp | 26 +- src/ints/int10_misc.cpp | 2 +- src/ints/int10_modes.cpp | 33 +- src/ints/int10_pal.cpp | 4 +- src/ints/int10_put_pixel.cpp | 6 +- src/ints/int10_vesa.cpp | 18 +- src/ints/mouse.cpp | 150 +- src/ints/xms.cpp | 134 +- src/ints/xms.h | 2 +- src/libs/Makefile.in | 183 +- src/libs/zmbv/Makefile.in | 91 +- src/libs/zmbv/zmbv.cpp | 2 +- src/libs/zmbv/zmbv.h | 2 +- src/misc/Makefile.in | 186 +- src/misc/messages.cpp | 4 +- src/misc/programs.cpp | 8 +- src/misc/setup.cpp | 119 +- src/misc/support.cpp | 8 +- src/platform/Makefile.in | 182 +- src/platform/visualc/Makefile.in | 91 +- src/platform/visualc/config.h | 6 +- src/shell/Makefile.in | 186 +- src/shell/shell.cpp | 128 +- src/shell/shell_batch.cpp | 9 +- src/shell/shell_cmds.cpp | 381 +- src/shell/shell_misc.cpp | 104 +- visualc/Makefile.am | 1 - visualc/Makefile.in | 305 - visualc/dosbox.dsp | 779 -- visualc/dosbox.dsw | 29 - visualc_net/Makefile.in | 91 +- visualc_net/dosbox.vcproj | 118 +- 246 files changed, 32877 insertions(+), 14504 deletions(-) delete mode 100644 TODO create mode 100644 mkinstalldirs create mode 100644 src/cpu/core_dyn_x86/dyn_fpu.h create mode 100644 src/cpu/core_dyn_x86/dyn_fpu_dh.h create mode 100644 src/dos/dos_codepages.h create mode 100644 src/dos/dos_keyboard_layout.cpp create mode 100644 src/dos/dos_keyboard_layout_data.h delete mode 100644 src/dosbox.ico delete mode 100644 src/fpu/fpu_types.h create mode 100644 src/gui/render_templates_hq.h create mode 100644 src/gui/render_templates_hq2x.h create mode 100644 src/gui/render_templates_hq3x.h create mode 100644 src/gui/render_templates_sai.h create mode 100644 src/hardware/serialport/directserial_posix.cpp create mode 100644 src/hardware/serialport/directserial_posix.h create mode 100644 src/hardware/serialport/misc_util.cpp create mode 100644 src/hardware/serialport/misc_util.h create mode 100644 src/hardware/serialport/nullmodem.cpp create mode 100644 src/hardware/serialport/nullmodem.h delete mode 100644 visualc/Makefile.am delete mode 100644 visualc/Makefile.in delete mode 100644 visualc/dosbox.dsp delete mode 100644 visualc/dosbox.dsw diff --git a/ChangeLog b/ChangeLog index 4608e00..3573896 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,83 @@ +0.70 + - Improve register handling and support with XMS. + - Fix some issues with deleting open files.(windows only issue) + - Add dummpy LPT1 class. (windows only issue) + - Improve some of the internal dos commands. (choice, copy and shift) + - Improve ROM area. (for games that use it for random numbers or + overwrite it as some sort of detection thing) + - Improve compatibility of dynamic core by making it handle certain + pagefaults earlier. + - Move internal dos tables around so we have more umb memory. + - Add some dos tables. + - Dynamic core supports io exceptions. + - Move some interrupt handlers to XT Bios locations. + - Add a dynamic fpu on x86. + - Improve fpu on non-x86. + - Trapflag gets strickt priority over hardware IRQs. + - Trapflag support for the dynamic core. + - Add dummy TRx handling. + - Fix a few rarely used character functions. + - Improve auto cycle guessing code. + - Improve and extend the joystick support. + - Add autofire support. + - Improve the mapper so you can map keys to the joystick and vice versa. + - A few game specific video card fixes. + - Fix some 64 bit cpu bugs. + - Add support for certain cdrom detection schemes. + - Improve HSG/Red Book support. + - Improve MSCDEX. + - Improve dynamic core support under intel macs. + - Add basic support for clipper programs. + - Add support for different keyboard layouts. + - Add auto core guessing. + - Fix a few flags bugs. + - Fix a few small cpu bugs. + - Improve soundblaster detection rate by various programs. + - Improve EMS emulation. (allow mapping of non standard regions) + - Improve keyboard input codes on various OS-es. + - Fix problems with filenames having stackdata in them. + - Changed a few basic operations in DOSBox so they take emulated time. + - Improve dos ioctl functions. + - Extend cpu core so they are capable of detecting and raising a few + more exception types. + - Improve DOS functions when dealing with virtual drive. + - Improve FAT drives. + - Better handling of volume-labels in file functions. + - Image disk cycling capability. (prompt) + - Try to reduce the impact of using an analog joystick. + - Several measures to avoid code invalidation on certain types + of self modification in the dynamic core. + - Add dynamic core memory function inlining. + - A few small mouse improvements. (some games are using things they + shouldn't) + - Add nullmodem emulation.(h-a-l-9000) + - Some small cga and hercules fixes. + - Add more scalers (hq2x/hq3x/sai). (Kronuz) + - Change configuration file loading support. It now supports + multiple configuration files. + - Make dynamic core capable of running some win32s programs. + - Fix and add some rare soundblaster modes. (Srecko) + - Better soundblaster mixer controls. (Srecko) + - Make soundblaster installation under windows much easier. + - Add device control channel handling. + - GEMMIS support (ems under windows). + - Support more colours in win 3. (vasyl) + - Don't show unmounted drives in windows filemanager. + - Fix some bugs in the int13 handler. + - Simulate some side-effects of bios interrupt handlers on flags. + - Add IPX functions needed by netbios. + - Make ports take emulated time. + - Tabcompletion is now aware of the CD command. + - Add suppport for the dac pel mask. + - Fixes to hercules emulation, better detection and bank switching. + - Fixes to tandy emulation, 640x200x16 mode and different sizes bank. + - EGA/VGA memory changes detection for faster rendering. + - Gus 16 bit fixes. + - Many timer improvements. + - Some pcjr fixes. + - Some booter fixes. + - Many small fixes. + 0.65 - Fixed FAT writing. - Added some more missing DOS functions. diff --git a/INSTALL b/INSTALL index e500002..56e6281 100644 --- a/INSTALL +++ b/INSTALL @@ -22,10 +22,11 @@ SDL_Net SDL_Sound For compressed audio on diskimages. (optional) + This is for cue/bin cdrom images with compressed (mp3/ogg) audio tracks. ALSA_Headers (optional) - ???????? for Alsa support under linux + for Alsa support under linux. Part of the linux kernel sources If you want compile from the CVS under a unix system, you'll also need automake (>=1.6), autoconf(>=2.50). Should be available at http://www.gnu.org diff --git a/Makefile.am b/Makefile.am index 6376bf3..31fcda1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ # Main Makefile for DOSBox EXTRA_DIST = autogen.sh -SUBDIRS = src include visualc docs visualc_net +SUBDIRS = src include docs visualc_net diff --git a/Makefile.in b/Makefile.in index 9519ad5..c931043 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +15,7 @@ @SET_MAKE@ # Main Makefile for DOSBox + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -22,6 +23,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -35,46 +37,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ - THANKS TODO config.guess config.sub depcomp install-sh missing -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno configure.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -101,6 +64,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -131,9 +95,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -141,8 +102,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -150,23 +109,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -175,44 +140,45 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ + EXTRA_DIST = autogen.sh -SUBDIRS = src include visualc docs visualc_net +SUBDIRS = src include docs visualc_net +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL Makefile.am NEWS THANKS acinclude.m4 \ + aclocal.m4 config.guess config.h.in config.sub configure \ + configure.in depcomp install-sh missing mkinstalldirs +DIST_SUBDIRS = $(SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -am--refresh: - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnits '; \ - cd $(srcdir) && $(AUTOMAKE) --gnits \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile'; \ + +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) + +$(ACLOCAL_M4): configure.in acinclude.m4 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @@ -224,10 +190,10 @@ config.h: stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) + +$(srcdir)/config.h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) - rm -f stamp-h1 - touch $@ + touch $(srcdir)/config.h.in distclean-hdr: -rm -f config.h stamp-h1 @@ -240,13 +206,7 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -258,7 +218,7 @@ $(RECURSIVE_TARGETS): local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -266,13 +226,7 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -293,7 +247,7 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -304,6 +258,14 @@ ctags-recursive: test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -312,22 +274,19 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ - empty_fix=.; \ else \ include_option=--include; \ - empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ + test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -337,11 +296,10 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -364,14 +322,21 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +distdir = $(PACKAGE)-$(VERSION) + +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) - @case `sed 15q $(srcdir)/NEWS` in \ - *"$(VERSION)"*) : ;; \ - *) \ - echo "NEWS not updated; not releasing" 1>&2; \ - exit 1;; \ - esac $(am__remove_distdir) mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -385,7 +350,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -400,17 +365,15 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ @@ -421,46 +384,19 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst @@ -480,20 +416,19 @@ distcheck: dist distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ + && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ @@ -517,6 +452,7 @@ check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: + install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -536,7 +472,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -554,8 +490,6 @@ dvi: dvi-recursive dvi-am: -html: html-recursive - info: info-recursive info-am: @@ -592,20 +526,22 @@ uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ - check-am clean clean-generic clean-recursive ctags \ - ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ - dist-tarZ dist-zip distcheck distclean distclean-generic \ - distclean-hdr distclean-recursive distclean-tags \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ - pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-info-am +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-recursive ctags ctags-recursive dist \ + dist-all dist-gzip distcheck distclean distclean-generic \ + distclean-hdr distclean-recursive distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am dvi-recursive info \ + info-am info-recursive install install-am install-data \ + install-data-am install-data-recursive install-exec \ + install-exec-am install-exec-recursive install-info \ + install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ + ps-recursive tags tags-recursive uninstall uninstall-am \ + uninstall-info-am uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/NEWS b/NEWS index 705cb4f..df85252 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,83 @@ +0.70 + - Improve register handling and support with XMS. + - Fix some issues with deleting open files.(windows only issue) + - Add dummpy LPT1 class. (windows only issue) + - Improve some of the internal dos commands. (choice, copy and shift) + - Improve ROM area. (for games that use it for random numbers or + overwrite it as some sort of detection thing) + - Improve compatibility of dynamic core by making it handle certain + pagefaults earlier. + - Move internal dos tables around so we have more umb memory. + - Add some dos tables. + - Dynamic core supports io exceptions. + - Move some interrupt handlers to XT Bios locations. + - Add a dynamic fpu on x86. + - Improve fpu on non-x86. + - Trapflag gets strickt priority over hardware IRQs. + - Trapflag support for the dynamic core. + - Add dummy TRx handling. + - Fix a few rarely used character functions. + - Improve auto cycle guessing code. + - Improve and extend the joystick support. + - Add autofire support. + - Improve the mapper so you can map keys to the joystick and vice versa. + - A few game specific video card fixes. + - Fix some 64 bit cpu bugs. + - Add support for certain cdrom detection schemes. + - Improve HSG/Red Book support. + - Improve MSCDEX. + - Improve dynamic core support under intel macs. + - Add basic support for clipper programs. + - Add support for different keyboard layouts. + - Add auto core guessing. + - Fix a few flags bugs. + - Fix a few small cpu bugs. + - Improve soundblaster detection rate by various programs. + - Improve EMS emulation. (allow mapping of non standard regions) + - Improve keyboard input codes on various OS-es. + - Fix problems with filenames having stackdata in them. + - Changed a few basic operations in DOSBox so they take emulated time. + - Improve dos ioctl functions. + - Extend cpu core so they are capable of detecting and raising a few + more exception types. + - Improve DOS functions when dealing with virtual drive. + - Improve FAT drives. + - Better handling of volume-labels in file functions. + - Image disk cycling capability. (prompt) + - Try to reduce the impact of using an analog joystick. + - Several measures to avoid code invalidation on certain types + of self modification in the dynamic core. + - Add dynamic core memory function inlining. + - A few small mouse improvements. (some games are using things they + shouldn't) + - Add nullmodem emulation.(h-a-l-9000) + - Some small cga and hercules fixes. + - Add more scalers (hq2x/hq3x/sai). (Kronuz) + - Change configuration file loading support. It now supports + multiple configuration files. + - Make dynamic core capable of running some win32s programs. + - Fix and add some rare soundblaster modes. (Srecko) + - Better soundblaster mixer controls. (Srecko) + - Make soundblaster installation under windows much easier. + - Add device control channel handling. + - GEMMIS support (ems under windows). + - Support more colours in win 3. (vasyl) + - Don't show unmounted drives in windows filemanager. + - Fix some bugs in the int13 handler. + - Simulate some side-effects of bios interrupt handlers on flags. + - Add IPX functions needed by netbios. + - Make ports take emulated time. + - Tabcompletion is now aware of the CD command. + - Add suppport for the dac pel mask. + - Fixes to hercules emulation, better detection and bank switching. + - Fixes to tandy emulation, 640x200x16 mode and different sizes bank. + - EGA/VGA memory changes detection for faster rendering. + - Gus 16 bit fixes. + - Many timer improvements. + - Some pcjr fixes. + - Some booter fixes. + - Many small fixes. + 0.65 - Fixed FAT writing. - Added some more missing DOS functions. diff --git a/README b/README index 1a6eac8..e1ed8f4 100644 --- a/README +++ b/README @@ -1,19 +1,15 @@ -DOSBox v0.65 +DOSBox v0.70 ===== NOTE: ===== -While we are hoping that one day, DOSBox will run all programs -ever made for the PC, we are not there yet. At present, DOSBox running on a -high-end machine will roughly be the equivalent of a 486 PC. The 0.60 -release has added support for "protected mode" allowing for more complex and -recent programs, but note that this support is still in an early stage of -development and unlike the support for 386 real-mode games (or earlier) hasn't -been completed yet. Also note that "protected mode" games need substantially -more resources and may require a much faster processor for you to run them -properly in DOSBox. +While we are hoping that one day DOSBox will run all programs ever +made for the PC, we are not there yet. At present, DOSBox running +on a high-end machine will roughly be the equivalent of a 486 PC. +DOSBox can be configured to run a wide range of DOS games, from +CGA/Tandy/PCjr classics up to games from the Quake era. @@ -25,14 +21,16 @@ INDEX: 3. Usage 4. Internal Programs 5. Special Keys -6. Keymapper -7. System Requirements -8. To run resource-demanding games -9. The config file -10. The language file -11. Building your own version of DOSBox -12. Special thanks -13. Contact +6. Mapper +7. Keyboard Layout +8. Serial Multiplayer feature +9. How to run resource-demanding games +10. Troubleshooting +11. The config file +12. The language file +13. Building your own version of DOSBox +14. Special thanks +15. Contact ============== @@ -49,13 +47,15 @@ Type INTRO in DOSBox. That's it. Some Frequently Asked Questions: Q: I've got a Z instead of a C at the prompt. -Q: My game crashes when using opengl/nb or is much slower. +Q: How do I change to fullscreen ? Q: My CD-ROM doesn't work. Q: The mouse doesn't work. +Q: There is no sound. Q: The sound stutters or sounds stretched/weird. Q: I can't type \ or : in DOSBox. Q: The game/application can't find its CD-ROM. Q: The game/application runs much too slow! +Q: Can DOSBox harm my computer? Q: I would like to change the memory size/cpu speed/ems/soundblaster IRQ. Q: What sound hardware does DOSBox presently emulate? Q: DOSBox crashes on startup and I'm running arts @@ -71,11 +71,16 @@ A: You have to make your directories available as drives in DOSBox by using you a C drive in DOSBox which points to your Windows D:\GAMES directory. In Linux, "mount c /home/username" will give you a C drive in DOSBox which points to /home/username in Linux. + To change to the drive mounted like above, type "C:". If everything went + fine, DOSBox will display the prompt "C:\>". -Q: My game crashes when using opengl/nb or is much slower. -A: Somehow our opengl code isn't entirely stable on some platforms. - Use surface instead. +Q: How do I change to fullscreen ? +A: Press alt-enter. Alternatively: Edit the configuration file of DOSBox and + change the option fullscreen=false to fullscreen=true. If fullscreen looks + wrong in your opinion: Play with the option fullresolution in the + configuration file of DOSBox. To get back from fullscreen mode: + Press alt-enter again. Q: My CD-ROM doesn't work. @@ -88,7 +93,7 @@ A: To mount your CD-ROM in DOSBox you have to specify some additional options To enable low-level ioctl-support(win2k/xp/linux): - mount d f:\ -t cdrom -usecd 0 -ioctl To enable low-level aspi-support (win98 with aspi-layer installed): - - mount d f:\ -t cdrom -usecd 0 -apsi + - mount d f:\ -t cdrom -usecd 0 -aspi In the commands: - d driveletter you will get in DOSBox - f:\ location of cdrom on your PC. @@ -103,43 +108,70 @@ A: Usually, DOSBox detects when a game uses mouse control. When you click on you will have to lock the mouse manually by pressing CTRL-F10. +Q: There is no sound. +A: Be sure that the sound is correctly configured in the game. This might be + done during the installation or with a setup/setsound utility that + accompanies the game. First see if an autodetection option is provided. If + there is none try selecting soundblaster or soundblaster16 with the default + settings being "address=220 irq=7 dma=1". You might also want to select + midi at address 330 as music device. + The parameters of the emulated soundcards can be changed in the DOSBox + configuration file. + If you still don't get any sound set the core to normal and use some lower + fixed cycles value (like cycles=2000). Also assure that your host operating + sound does provide sound. + + Q: The sound stutters or sounds stretched/weird. A: You're using too much cpu power to keep DOSBox running at the current speed. You can lower the cycles, skip frames or get a faster machine. You can also increase the prebuffer in the configfile. + If you are using cycles=max or =auto, then make sure that there no + background processes interfering! (especially if they acces the harddisk) Q: I can't type \ or : in DOSBox. A: This is a known problem. It only occurs if your keyboard layout isn't US. Some possible fixes: - 1. Switch your keyboard layout. + 1. Switch the keyboard layout of your operating system. 2. Use / instead. 3. Open dosbox.conf and change usescancodes=false to usescancodes=true. 4. Add the commands you want to execute to the "configfile". - 5. Start the keymapper (CTRL-F1 or add -startmapper switch to DOSBox). + 5. Change the dos keyboard layout (see Section 7 Keyboard Layout). 6. Use ALT-58 for : and ALT-92 for \. 7. for \ try the keys around "enter". For ":" try shift and the keys between "enter" and "l" (US keyboard layout). - 8. Use keyb.com from FreeDOS (http://projects.freedos.net/keyb/). + 8. Try keyb.com from FreeDOS (http://projects.freedos.net/keyb/). + Look for keyb2.0 pre4 as older and newer versions are known to + have a bug in the loader routines. Q: The game/application can't find its CD-ROM. -A: Be sure to mount the CD-ROM with -t cdrom switch. Also try adding the - correct label (-label LABEL). To enable more low-level CD-ROM support, add - the following switch to mount: -usecd #, where # is the number of your - CD-ROM drive reported by mount -cd. If you run Win32 you can specify -ioctl - or -aspi. Look at the description elsewhere in this document for their - meaning. +A: Be sure to mount the CD-ROM with -t cdrom switch, this will enable the + MSCDEX interface required by DOS games to interface with CD-ROMs. + Also try adding the correct label (-label LABEL). To enable lower-level + CD-ROM support, add the following switch to mount: -usecd #, where # is + the number of your CD-ROM drive reported by mount -cd. Under Windows you + can specify -ioctl or -aspi. Look at the description elsewhere in this + document for their meaning. Q: The game/application runs much too slow! -A: Look at the section "To run resource-demanding games" for more information. +A: Look at the section "How to run resource-demanding games" for more + information. + + +Q: Can DOSBox harm my computer? +A: DOSBox can not harm your computer more than any other resource demanding + program. Increasing the cycles does not overclock your real CPU. + Setting the cycles too high has a negative performance effect on the + software running inside DOSBox. Q: I would like to change the memory size/cpu speed/ems/soundblaster IRQ. -A: This is possible! Just create a config file: config -writeconf configfile . - Start your favourite editor and look at all the settings present. To - start DOSBox with your new settings: dosbox -conf configfile +A: This is possible! Just create a config file: config -writeconf configfile. + Start your favourite editor and look through the settings. To start DOSBox + with your new settings: dosbox -conf configfile Q: What sound hardware does DOSBox presently emulate? @@ -155,6 +187,10 @@ A: DOSBox emulates several legacy sound devices: The emulation of this sound hardware is complete with the exception of the noise channel. The noise channel is not very well documented and as such is only a best guess as to the sound's accuracy. + - Tandy DAC + Emulation of the Tandy DAC utilizes the soundblaster emulation, thus + be sure the soundblaster is not disabled in the DOSBox configuration + file. The Tandy DAC is only emulated at the BIOS level. - Adlib Borrowed from MAME, this emulation is almost perfect and includes the Adlib's ability to almost play digitized sound. @@ -172,15 +208,16 @@ A: DOSBox emulates several legacy sound devices: A MIDI passthrough interface is also emulated. This method of sound output will only work when used with a General Midi or MT-32 device. + Q: DOSBox crashes on startup and I'm running arts. A: This isn't really a DOSBox problem, but the solution is to set the environment variable SDL_AUDIODRIVER to alsa or oss. + Q: Great README, but I still don't get it. -A: While unlikely, this seems to happen. A look at "The Newbie's - pictorial guide to DOSBox" located at +A: A look at "The Newbie's pictorial guide to DOSBox" located at http://vogons.zetafleet.com/viewforum.php?f=39 might help you. - You could also try the wiki of dosbox: + Also try the wiki of dosbox: http://dosbox.sourceforge.net/wiki/ @@ -226,14 +263,15 @@ dosbox -version -conf configfile Start DOSBox with the options specified in "configfile". - See Chapter 9 for more details. + Multiple -conf options may be present. + See Chapter 10 for more details. -lang languagefile Start DOSBox using the language specified in "languagefile". -noconsole (Windows Only) Start DOSBox without showing the console window. Output will - be redirected to stdout.txt and stderr.txt + be redirected to stdout.txt and stderr.txt -machine machinetype Setup DOSBox to emulate a specific type of machine. Valid choices are: @@ -252,7 +290,13 @@ dosbox -version Note: If a name/command/configfile/languagefile contains a space, put the whole name/command/configfile/languagefile between quotes - ("command or file name"). + ("command or file name"). If you need to use quotes within quotes + (most likely with -c and mount). + Windows and OS/2 users can use single quotes inside the double quotes. + Other people should be able to use escaped double quotes inside the + double quotes. + win -c "mount c 'c:\program files\'" + linux -c "mount c \"/tmp/name with space\"" For example: @@ -268,7 +312,9 @@ In Windows, you can also drag directories/files onto the DOSBox executable. 4. Internal Programs: ===================== -DOSBox supports most of the DOS commands found in command.com. +DOSBox supports most of the DOS commands found in command.com. +To get a list of the internal commands type "HELP" at the prompt. + In addition, the following commands are available: MOUNT "Emulated Drive letter" "Real Drive or Directory" @@ -282,21 +328,19 @@ MOUNT -u "Emulated Drive letter" "Emulated Drive letter" The driveletter inside dosbox (eg. C). - "Real Drive letter or Directory" - The local directory you want to have inside dosbox. - (Under Win32 usually the same as "Emulated Drive letter". - For Example: mount c c:\ ) + "Real Drive letter (usually for CD-ROMs in Windows) or Directory" + The local directory you want accessible inside dosbox. -t type - Type of the mounted directory. Supported are: dir (standard), + Type of the mounted directory. Supported are: dir (default), floppy, cdrom. -size drivesize Sets the size of the drive. -freesize size_in_mb - Sets the amount of free space available on a drive in MB's. This - is a simpler version of -size. + Sets the amount of free space available on a drive in megabytes. + This is a simpler version of -size. -label drivelabel Sets the name of the drive to "drivelabel". Needed on some @@ -330,21 +374,23 @@ MOUNT -u "Emulated Drive letter" Note: It's possible to mount a local directory as cdrom drive. Hardware support is then missing. - Basically, MOUNT allows you to connect real hardware to DOSBox's "emulated" - PC. So MOUNT C C:\GAMES tells DOSBox to use your C:\GAMES directory as drive - C: in DOSBox. It also allows you to change the drive's letter identification + Basically MOUNT allows you to connect real hardware to DOSBox's emulated PC. + So MOUNT C C:\GAMES tells DOSBox to use your C:\GAMES directory as drive C: + in DOSBox. It also allows you to change the drive's letter identification for programs that demand specific drive letters. For example: Touche: Adventures of The Fifth Musketeer must be run on your C: drive. Using DOSBox and its mount command, you can trick the game into believing it is on the C drive, while you can still place it where you - want it. For example, if the game is in D:\TOUCHE, the command MOUNT C D:\ - will allow you to run Touche from the D drive. + like. For example, if the game is in D:\OLDGAMES\TOUCHE, the command + MOUNT C D:\OLDGAMES will allow you to run Touche from the D drive. - Mounting your entire C drive with MOUNT C C:\ is NOT recommended! - If you or DOSBox makes a mistake you may loose all your files. - It's recommended to put all your applications/games in a subdirectory and - mount that. + Mounting your entire C drive with MOUNT C C:\ is NOT recommended! The same + is true for mounting the root of any other drive, except for CD-ROMs (due to + their read-only nature). Otherwise if you or DOSBox make a mistakes you may + loose all your files. + It is recommended to put all your applications/games into a subdirectory + and mount that. General MOUNT Examples: 1. To mount c:\DirX as a floppy : @@ -361,9 +407,11 @@ MOUNT -u "Emulated Drive letter" 6. To mount /home/user/dirY as drive C in DOSBox: mount c /home/user/dirY + MEM Program to display the amount of free memory. + CONFIG [-writeconf] [-writelang] localfile CONFIG -set "section property=value" CONFIG -get "section property" @@ -371,7 +419,7 @@ CONFIG -get "section property" CONFIG can be used to change or query various settings of DOSBox during runtime. It can save the current settings and language strings to disk. Information about all possible sections and properties can - be found in section 9 (The Config File). + be found in section 11 (The Config File). -writeconf localfile Write the current configuration settings to file. "localfile" is @@ -379,7 +427,7 @@ CONFIG -get "section property" The configuration file controls various settings of DOSBox: the amount of emulated memory, the emulated soundcards and many more things. It allows access to AUTOEXEC.BAT as well. - See section 9 (The Config File) for more information. + See section 11 (The Config File) for more information. -writelang localfile Write the current language settings to file. "localfile" is @@ -409,13 +457,14 @@ CONFIG -get "section property" 4. To check which cpu core is being used. config -get "cpu core" + LOADFIX [-size] [program] [program-parameters] LOADFIX -f Program to reduce the amount of memory available. Useful for old programs which don't expect much memory to be free. -size - number of kb to "eat up", default = 64kb + number of kilobytes to "eat up", default = 64kb -f frees all previously allocated memory @@ -467,9 +516,11 @@ IMGMOUNT -size [sectorsbytesize, sectorsperhead, heads, cylinders] imagefile - Location of the image files to mount in DOSBox. The location is on a - mounted drive inside DOSBox. CD-ROM images can be mounted - directly as well. They don't have to be on a mounted drive. + Location of the image files to mount in DOSBox. The location can + be on a mounted drive inside DOSBox, or on your real disk. It is + possible to mount CD-ROM images (ISOs or CUE/BIN) as well, if you + need CD swapping capabilities specify all images in succession. + The CDs can be swapped with CTRL-F4 at any time. -t The following are valid image types: @@ -502,7 +553,7 @@ IMGMOUNT The Cylinders, Heads and Sectors specification of the drive. Required to mount hard drive images. - An example of CD-ROM images: + An example how to mount CD-ROM images: 1a. mount c /tmp 1b. imgmount d c:\myiso.iso -t iso or (which also works): @@ -511,10 +562,13 @@ IMGMOUNT BOOT Boot will start floppy images or hard disk images independent of the - operating system emulation offered by DOSBox. This will allow you to play - booter floppies or boot to other operating systems inside DOSBox. + operating system emulation offered by DOSBox. This will allow you to + play booter floppies or boot other operating systems inside DOSBox. + If the target emulated system is PCjr (machine=pcjr) the boot command + can be used to load PCjr cartridges (.jrc). BOOT [diskimg1.img diskimg2.img .. diskimgN.img] [-l driveletter] + BOOT [cart.jrc] (PCjr only) diskimgN.img This can be any number of floppy disk images one wants mounted after @@ -528,6 +582,10 @@ BOOT The default is the A drive, the floppy drive. You can also boot a hard drive image mounted as master by specifying "-l C" without the quotes, or the drive as slave by specifying "-l D" + + cart.jrc (PCjr only) + When emulation of a PCjr is enabled, cartridges can be loaded with + the BOOT command. Support is still limited. IPX @@ -548,6 +606,10 @@ IPX For example, if your server is at bob.dosbox.com, you would type "IPXNET CONNECT bob.dosbox.com" on every non-server system. + To play games that need Netbios a file named NETBIOS.EXE from Novell is + needed. Establish the IPX connection as explained above, then run + "netbios.exe". + The following is an IPXNET command reference: IPXNET CONNECT @@ -578,6 +640,12 @@ IPX The syntax for IPXNET STARTSERVER is: IPXNET STARTSERVER + If the server is behind a router, UDP port needs to be forwarded + to that computer. + + On Linux/Unix-based systems port numbers smaller than 1023 can only be + used with root privileges. Use ports greater than 1023 on those systems. + IPXNET STOPSERVER IPXNET STOPSERVER stops the IPX tunnelling server running on this DOSBox @@ -603,8 +671,42 @@ IPX IPX tunnelling network. For a list of all computers connected to the network use the IPXNET PING command. -The syntax for IPXNET STATUS is: -IPXNET STATUS + The syntax for IPXNET STATUS is: + IPXNET STATUS + + +KEYB [languagecode [codepage [codepagefile]]] + Change the keyboard layout. For detailed information about keyboard + layouts please see Section 7. + + [languagecode] is a string consisting of two (in special cases more) + characters, examples are GK (Greece) or IT (Italy). It specifies + the keyboard layout to be used. + + [codepage] is the number of the codepage to be used. The keyboard layout + has to provide support for the specified codepage, otherwise the layout + loading will fail. + If no codepage is specified, an appropriate codepage for the requested + layout is chosen automatically. + + [codepagefile] can be used to load codepages that are yet not compiled + into DOSBox. This is only needed when DOSBox does not find the codepage. + + + Examples: + 1) To load the german keyboard layout (automatically uses codepage 858): + keyb gr + 2) To load the russian keyboard layout with codepage 866: + keyb ru 866 + In order to type russian characters press ALT+RIGHT-SHIFT. + 3) To load the french keyboard layout with codepage 850 (where the + codepage is defined in EGACPI.DAT): + keyb fr 850 EGACPI.DAT + 4) To load codepage 858 (without a keyboard layout): + keyb none 858 + This can be used to change the codepage for the freedos keyb2 utility. + + For more information use the /? command line switch with the programs. @@ -619,8 +721,8 @@ ALT-ENTER Switch to full screen and back. ALT-PAUSE Pause emulation. CTRL-F1 Start the keymapper. CTRL-F4 Change between mounted disk-images. Update directory cache for all drives! -CTRL-ALT-F5 Start/Stop creating a movie of the screen. -CTRL-F5 Save a screenshot.(png) +CTRL-ALT-F5 Start/Stop creating a movie of the screen. (avi video capturing) +CTRL-F5 Save a screenshot. (png) CTRL-F6 Start/Stop recording sound output to a wave file. CTRL-ALT-F7 Start/Stop recording of OPL commands. CTRL-ALT-F8 Start/Stop the recording of raw MIDI commands. @@ -642,21 +744,22 @@ gets saved/recorded ! NOTE: Once you increase your DOSBox cycles beyond your computer's maximum capacity, it will produce the same effect as slowing down the emulation. -This maximum will vary from computer to computer; there is no standard. +This maximum will vary from computer to computer. -============= -6. Keymapper: -============= +========== +6. Mapper: +========== -When you start the keymapper (either with CTRL-F1 or -startmapper as a -command line argument to the DOSBox executable) you are presented with -a virtual keyboard. +When you start the DOSBox mapper (either with CTRL-F1 or -startmapper as +a command line argument to the DOSBox executable) you are presented with +a virtual keyboard and a virtual joystick. -This virtual keyboard corresponds to the keys DOSBox will report to its -applications. If you click on a key with your mouse, you can see in the -lower left corner which key on your keyboard corresponds to it. +These virtual devices correspond to the keys DOSBox will report to the +DOS applications. If you click on a key with your mouse, you can see in +the lower left corner with which event it is associated (EVENT) and to +what events it is currently bound. Event: EVENT BIND: BIND @@ -667,22 +770,24 @@ mod3 EVENT - The key DOSBox will report to the applications being emulated. + The key or joystick axis/button/hat DOSBox will report to DOS applications. BIND - The key on your keyboard (as reported by SDL) which is connected to the - EVENT. + The key on your real keyboard or the axis/button/hat on your real + joystick(s) (as reported by SDL) which is connected to the EVENT. mod1,2,3 - Modfiers. These are keys you need to have pressed as well, while pressing - BIND. mod1 = CTRL and mod2 = ALT. These are generally only used when you + Modfiers. These are keys you need to have to be pressed while pressing + BIND. mod1 = CTRL and mod2 = ALT. These are generally only used when you want to change the special keys of DOSBox. Add - Add a new BIND to this EVENT. Basically add a key from your keyboard which - will produce the key EVENT in DOSBox. + Add a new BIND to this EVENT. Basically add a key from your keyboard or an + event from the joystick (button press, axis/hat movement) which will + produce the EVENT in DOSBox. Del - Delete the BIND to this EVENT. If an EVENT has no BINDS, then it's not - possible to type this key in DOSBox. + Delete the BIND to this EVENT. If an EVENT has no BINDS, then it is not + possible to trigger this event in DOSBox (that is there's no way to type + the key or use the respective action of the joystick). Next - Go through the list of keys(BINDS) which map to this EVENT. + Go through the list of bindings which map to this EVENT. Example: @@ -702,60 +807,242 @@ Q3. If you try it out in DOSBox, you will notice that pressing X makes ZX mapped key X. Click "Del". -If you change the default mapping, you can save your changes by pressing +Examples about remapping the joystick: + You have a joystick attached, it is working fine under DOSBox and you + want to play some keyboard-only game with the joystick (it is assumed + that the game is controlled by the arrows on the keyboard): + 1) Start the mapper, then klick on one of the arrows in the middle + of the left part of the screen (right above the Mod1/Mod2 buttons). + EVENT should be key_left. Now klick on Add and move your joystick + in the respective direction, this should add an event to the BIND. + 2) Repeat the above for the missing three directions, additionally + the buttons of the joystick can be remapped as well (fire/jump). + 3) Click on Save, then on Exit and test it with some game. + + You want to swap the y-axis of the joystick because some flightsim uses + the up/down joystick movement in a way you don't like, and it is not + configurable in the game itself: + 1) Start the mapper and klick on Y- in the upper joystick field (this + is for the first joystick if you have two joysticks attached) or the + lower joystick field (second joystick or, if you have only one + joystick attached, the second axes cross). + EVENT should be jaxis_0_1- (or jaxis_1_1-). + 2) Click on Del to remove the current binding, then klick Add and move + your joystick downwards. A new bind should be created. + 3) Repeat this for Y+, save the layout and finally test it with some game. + + + +If you change the default mapping, you can save your changes by clicking on "Save". DOSBox will save the mapping to a location specified in the configfile -(mapperfile=mapper.txt). At startup, DOSBox will load your mapperfile, if it's -present in the configfile. - - - -======================= -7. System requirements: -======================= - -Fast machine. My guess would be pentium-2 400+ to get decent emulation -of games written for an 286 machine. -For protected mode games a 1 Ghz machine is recommended - don't expect -them to run fast, though! Be sure to read the next section on how to speed -it up somewhat. - - - -=================================== -8. To run resource-demanding games: -=================================== - -DOSBox emulates the CPU, the sound and graphic cards, and some other -stuff, all at the same time. You can overclock DOSBox by using CTRL-F12, but -you'll be limited by the power of your actual CPU. You can see how much free -time your true CPU has by looking at the Task Manager in Windows 2000/XP and -the System Monitor in Windows 95/98/ME. Once 100% of your real CPU time is -used there is no further way to speed up DOSBox unless you reduce the load -generated by the non-CPU parts of DOSBox. - -So: - -Close every program but DOSBox - -Overclock DOSBox until 100% of your CPU is used (use the utilities above to -check) - -Since VGA emulation is the most demanding part of DOSBox in terms of actual -CPU usage, we'll start there. Increase the number of frames skipped (in -increments of one) by pressing CTRL-F8. Your CPU usage should decrease. -Go back one step and repeat this until the game runs fast enough for you. -Please note that this is a trade-off: you lose in fluidity of video what you -gain in speed - -You can also try to disable the sound through the setup utility of the game -to reduce load on your CPU further. +(mapperfile=mapper.txt). At startup, DOSBox will load your mapperfile, if it +is present in the configfile. =================== -9. The Config File: +7. Keyboard Layout: =================== +To switch to a different keyboard layout, either the entry "keyboardlayout" +in the [dos]-section in dosbox.conf can be used, or the internal DOSBox +program keyb.com. Both accept dos-conform language codes (see below), but +only by using keyb.com a custom codepage can be specified. + +Layout switching + DOSBox supports a number of keyboard layouts and codepages by default, + in this case just the layout identifier needs to be specified (like + keyboardlayout=sv in the DOSBox config file, or using "keyb sv" at + the DOSBox command prompt). + + Internally supported keyboard layouts: + BG (Bulgaria), CZ243 (Czech Republic), FR (France), GK (Greece), + GR (Germany), HR (Croatia), HU (Hungary), IT (Italy), NL (Netherlands), + NO (Norway), PL (Poland), RU (Russian Federation), SK (Slovakia), SP (Spain), + SU (Finland), SV (Sweden) + + When a keyboard layout is loaded, it is possible to switch between the + foreign layout and the US-layout by pressing CTRL+ALT+F2. + Some keyboard layouts (for example layout GK codepage 869 and layout RU + codepage 808) have support for dual-layouts that can be activated by + pressing LEFT-ALT+RIGHT-SHIFT and deactivated by LEFT-ALT+LEFT-SHIFT. + +Supported external files + The freedos .kl files are supported (freedos keyb2 keyboard layoutfiles) as + well as the freedos keyboard.sys/keybrd2.sys/keybrd3.sys libraries which + consist of all available .kl files. + See http://projects.freedos.net/keyb/ for precompiled keyboard layouts. + + Both .CPI (MSDOS/compatible codepage files) and .CPX (freedos UPX-compressed + codepage files) can be used. Some codepages are compiled into DOSBox so it + is mostly not needed to care about external codepage files. If you need + a different (or custom) codepage file, copy it into the directory of the + DOSBox configuration file so it is accessible for DOSBox. + + Additional layouts can be added by copying the corresponding .kl-file into + the directory of dosbox.conf and using the first part of the filename as + language code. + Example: For the file UZ.KL (keyboard layout for Uzbekistan) specify + "keyboardlayout=uz" in dosbox.conf. + + +Note that the keyboard layout allows foreign characters to be entered, but +there is NO support for them in filenames. Try to avoid them both inside +DOSBox as well as in files on your host operating system that are accessible +by DOSBox. + + + +============================== +8. Serial Multiplayer feature: +============================== + +DOSBox can emulate a serial nullmodem cable over network and internet. +It can be configured through the [serialports] section in the DOSBox +configuration file. + +To create a nullmodem connection, one side needs to act as the server and +one as the client. + +The server needs to be set up in the DOSBox configuration file like this: + serial1=nullmodem + +The client: + serial1=nullmodem server: + +Now start your game and choose nullmodem / serial cable / already connected +as multiplayer method on COM1. Set the same baudrate on both computers. + +Furthermore, additional parameters can be specified to control the behavior +of the nullmodem connection. These are all parameters: + + * port: - TCP port number. Default: 23 + * rxdelay: - how long (milliseconds) to delay received data if the + interface is not ready. Increase this value if you encounter + overrun errors in the DOSBox Status Window. Default: 100 + * txdelay: - how long to gather data before sending a packet. Default: 12 + (reduces Network overhead) + * server: - This nullmodem will be a client connecting to the specified + server. (No server argument: be a server.) + * transparent:1 - Only send the serial data, no RTS/DTR handshake. Use this + when connecting to anyting other than a nullmodem. + * telnet:1 - Interpret Telnet data from the remote site. Automatically + sets transparent. + * usedtr:1 - The connection will not be established until DTR is switched + on by the DOS program. Useful for modem terminals. + Automatically sets transparent. + * inhsocket:1 - Use a socket passed to DOSBox by command line. Automatically + sets transparent. (Socket Inheritance: It is used for + playing old DOS door games on new BBS software.) + +Example: Be a server listening on TCP port 5000. + serial1=nullmodem server: port:5000 rxdelay:1000 + + + +======================================= +9. How to run resource-demanding games: +======================================= + +DOSBox emulates the CPU, the sound and graphic cards, and other peripherals +of a PC, all at the same time. The speed of an emulated DOS application +depends on how many instructions can be emulated, which is adjustable +(number of cycles). + +CPU Cycles + By default (cycles=auto) DOSBox tries to detect whether a game needs to + be run with as many instructions emulated per time interval as possible. + You can force this behaviour by setting cycles=max in the DOSBox + configuration file. The DOSBox window will display a line "Cpu Cyles: max" + at the top then. In this mode you can reduce the amount of cycles on a + percentage-basis (hit CTRL-F11) or raise it again (CTRL-F12). + + Sometimes customly setting the number of cycles achieves better results, + in the DOSBox configuration file specify for example cycles=30000. When + running some DOS application you can raise the cycles with CTRL-F12 even + more, but you will be limited by the power of your actual CPU. You can see + how much free time your true CPU has by looking at the Task Manager in + Windows 2000/XP and the System Monitor in Windows 95/98/ME. Once 100% of + your real CPU time is used there is no further way to speed up DOSBox + unless you reduce the load generated by the non-CPU parts of DOSBox. + +CPU Cores + On x86 architectures you can try to force the usage of a dynamically + recompiling core (set core=dynamic in the DOSBox configuration file). + This usually gives better results if the auto detection (core=auto) fails. + It is best accompanied by cycles=max. Note that there might be games + that work worse with the dynamic core, or do not work at all! + +Graphics emulation + VGA emulation is a very demanding part of DOSBox in terms of actual CPU + usage. Increase the number of frames skipped (in increments of one) by + pressing CTRL-F8. Your CPU usage should decrease when using a fixed + cycle setting. + Go back one step and repeat this until the game runs fast enough for you. + Please note that this is a trade-off: you lose in fluidity of video what + you gain in speed. + +Sound emulation + You can also try to disable the sound through the setup utility of the game + to reduce load on your CPU further. Setting nosound=true does NOT disable + the emulation of sound devices, just the sound output will be disabled. + +Also try to close every program but DOSBox to reserve as much resources +as possible for DOSBox. + + +Advanced cycles configuration: +The cycles=auto and cycles=max settings can be parametrized to have +different startup defaults. The syntax is + cycles=auto ["realmode default"] ["protected mode default"%] + [limit "cycle limit"] + cycles=max ["protected mode default"%] [limit "cycle limit"] +Example: + cycles=auto 1000 80% limit 20000 + will use cycles=1000 for real mode games, 80% cpu throttling for + protected mode games along with a hard cycle limit of 20000 + + + +==================== +10. Troubleshooting: +==================== + +DOSBox crashes right after starting it: + - use different values for the output= entry in your DOSBox + configuration file + - try to update your graphics card driver and DirectX + +Running a certain game closes DOSBox, crashes with some message or hangs: + - see if it works with a default DOSBox installation + (unmodified configuration file) + - try it with sound disabled (use the sound configuration + program that comes with the game, additionally you can + use sbtype=none and gus=false) + - change some entries of the DOSBox configuration file, especially try: + core=normal + fixed cycles (for example cycles=10000) + ems=false + xms=false + or combinations of the above settings + - use loadfix before starting the game + +The game exits to the DOSBox prompt with some error message: + - read the error message closely and try to locate the error + - try the hints at the above sections + - mount differently as some games are picky about the locations, + for example if you used "mount d d:\oldgames\game" try + "mount c d:\oldgames\game" and "mount c d:\oldgames" + - if the game requires a cdrom be sure you used "-t cdrom" when + mounting and try different additional parameters + - check the file permissions of the game files (remove read-only + attributes, add write permissions etc.) + - try reinstalling the game within dosbox + +==================== +11. The Config File: +==================== + A config file can be generated by CONFIG.COM, which can be found on the internal dosbox Z: drive when you start up dosbox. Look in the internal programs section of the readme for usage of CONFIG.COM. @@ -767,14 +1054,16 @@ Some sections have options you can set. The generated configfile contains the current settings. You can alter them and start DOSBox with the -conf switch to load the file and use these settings. -If no configfile is specified with the -conf switch, DOSBox will look in the -current directory for dosbox.conf. Then it will look for ~/.dosboxrc (Linux), -~\dosbox.conf (Win32) or "~/Library/Preferences/DOSBox Preferences" (MACOSX). +DOSBox will first parse the settings in ~/.dosboxrc (Linux), +~\dosbox.conf (Win32) or "~/Library/Preferences/DOSBox Preferences" +(MACOSX). Afterwards DOSBox will parse all configfiles specified with the +-conf switch. If no configfile is specified with the -conf switch, DOSBox will +look in the current directory for dosbox.conf. ====================== -10. The Language File: +12. The Language File: ====================== A language file can be generated by CONFIG.COM. @@ -786,7 +1075,7 @@ section. There's a language= entry that can be changed with the filename. ======================================== -11. Building your own version of DOSBox: +13. Building your own version of DOSBox: ======================================== Download the source. @@ -795,7 +1084,7 @@ Check the INSTALL in the source distribution. =================== -12. Special Thanks: +14. Special thanks: =================== Vlad R. of the VDMSound project for excellent SoundBlaster info. @@ -804,12 +1093,15 @@ The Bochs and DOSemu projects, which I used for information. Freedos for ideas in making my shell. Pierre-Yves Gérardy for hosting the old Beta Board. Colin Snover for hosting our forum. +Jantien for the version management. +Shawn and Johannes for creating the MAC OS X PPC version. +Ido Beeri for the icon. The Beta Testers. ============ -13. Contact: +15. Contact: ============ See the site: diff --git a/THANKS b/THANKS index b3454f3..d48a61d 100644 --- a/THANKS +++ b/THANKS @@ -14,6 +14,10 @@ Colin Snover for hosting our forum. Sourceforge for hosting our homepage and other development tools. Mirek Luza for his moderation of the forums. c2woody for his debug work. + +Jantien for the version management. +Shawn and Johannes for creating the MAC OS X PPC version. +Ido Beeri for the icon. All the people who submitted a bug. The Beta Testers. diff --git a/TODO b/TODO deleted file mode 100644 index d86eeac..0000000 --- a/TODO +++ /dev/null @@ -1 +0,0 @@ -perharps check if console exists before setting name. diff --git a/acinclude.m4 b/acinclude.m4 index 7ee0692..2b5d94a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -305,7 +305,7 @@ AC_SUBST(ALSA_LIBS) AH_TOP([ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/aclocal.m4 b/aclocal.m4 index 6d88897..ded43e3 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ -# generated automatically by aclocal 1.9.5 -*- Autoconf -*- +# generated automatically by aclocal 1.7.9 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,32 +11,718 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS +dnl +AC_DEFUN([AM_PATH_SDL], +[dnl +dnl Get the cflags and libraries from the sdl-config script +dnl +AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], + sdl_prefix="$withval", sdl_prefix="") +AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], + sdl_exec_prefix="$withval", sdl_exec_prefix="") +AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], + , enable_sdltest=yes) + + if test x$sdl_exec_prefix != x ; then + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_args="$sdl_args --prefix=$sdl_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_prefix/bin/sdl-config + fi + fi + + AC_PATH_PROG(SDL_CONFIG, sdl-config, no) + min_sdl_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" +dnl +dnl Now check if the installed SDL is sufficiently new. (Also sanity +dnl checks the results of sdl-config to some extent +dnl + rm -f conf.sdltest + AC_TRY_RUN([ +#include +#include +#include +#include "SDL.h" + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); + printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SDL_CONFIG" = "no" ; then + echo "*** The sdl-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL_CONFIG environment variable to the" + echo "*** full path to sdl-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + AC_TRY_LINK([ +#include +#include "SDL.h" +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + rm -f conf.sdltest +]) + +dnl Configure Paths for Alsa +dnl Some modifications by Richard Boulton +dnl Christopher Lansdown +dnl Jaroslav Kysela +dnl Last modification: alsa.m4,v 1.22 2002/05/27 11:14:20 tiwai Exp +dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. +dnl enables arguments --with-alsa-prefix= +dnl --with-alsa-enc-prefix= +dnl --disable-alsatest (this has no effect, as yet) +dnl +dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, +dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. +dnl +AC_DEFUN([AM_PATH_ALSA], +[dnl Save the original CFLAGS, LDFLAGS, and LIBS +alsa_save_CFLAGS="$CFLAGS" +alsa_save_LDFLAGS="$LDFLAGS" +alsa_save_LIBS="$LIBS" +alsa_found=yes + +dnl +dnl Get the cflags and libraries for alsa +dnl +AC_ARG_WITH(alsa-prefix, +[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)], +[alsa_prefix="$withval"], [alsa_prefix=""]) + +AC_ARG_WITH(alsa-inc-prefix, +[ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)], +[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) + +dnl FIXME: this is not yet implemented +AC_ARG_ENABLE(alsatest, +[ --disable-alsatest Do not try to compile and run a test Alsa program], +[enable_alsatest=no], +[enable_alsatest=yes]) + +dnl Add any special include directories +AC_MSG_CHECKING(for ALSA CFLAGS) +if test "$alsa_inc_prefix" != "" ; then + ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" + CFLAGS="$CFLAGS -I$alsa_inc_prefix" +fi +AC_MSG_RESULT($ALSA_CFLAGS) + +dnl add any special lib dirs +AC_MSG_CHECKING(for ALSA LDFLAGS) +if test "$alsa_prefix" != "" ; then + ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" + LDFLAGS="$LDFLAGS $ALSA_LIBS" +fi + +dnl add the alsa library +ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread" +LIBS=`echo $LIBS | sed 's/-lm//'` +LIBS=`echo $LIBS | sed 's/-ldl//'` +LIBS=`echo $LIBS | sed 's/-lpthread//'` +LIBS=`echo $LIBS | sed 's/ //'` +LIBS="$ALSA_LIBS $LIBS" +AC_MSG_RESULT($ALSA_LIBS) + +dnl Check for a working version of libasound that is of the right version. +min_alsa_version=ifelse([$1], ,0.1.1,$1) +AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version) +no_alsa="" + alsa_min_major_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + alsa_min_minor_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + alsa_min_micro_version=`echo $min_alsa_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + +AC_LANG_SAVE +AC_LANG_C +AC_TRY_COMPILE([ +#include +], [ +/* ensure backward compatibility */ +#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR) +#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR +#endif +#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR) +#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR +#endif +#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR) +#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR +#endif + +# if(SND_LIB_MAJOR > $alsa_min_major_version) + exit(0); +# else +# if(SND_LIB_MAJOR < $alsa_min_major_version) +# error not present +# endif + +# if(SND_LIB_MINOR > $alsa_min_minor_version) + exit(0); +# else +# if(SND_LIB_MINOR < $alsa_min_minor_version) +# error not present +# endif + +# if(SND_LIB_SUBMINOR < $alsa_min_micro_version) +# error not present +# endif +# endif +# endif +exit(0); +], + [AC_MSG_RESULT(found.)], + [AC_MSG_RESULT(not present.) + ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)]) + alsa_found=no] +) +AC_LANG_RESTORE + +dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. +AC_CHECK_LIB([asound], [snd_ctl_open],, + [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) + alsa_found=no] +) + +if test "x$alsa_found" = "xyes" ; then + ifelse([$2], , :, [$2]) + LIBS=`echo $LIBS | sed 's/-lasound//g'` + LIBS=`echo $LIBS | sed 's/ //'` + LIBS="-lasound $LIBS" +fi +if test "x$alsa_found" = "xno" ; then + ifelse([$3], , :, [$3]) + CFLAGS="$alsa_save_CFLAGS" + LDFLAGS="$alsa_save_LDFLAGS" + LIBS="$alsa_save_LIBS" + ALSA_CFLAGS="" + ALSA_LIBS="" +fi + +dnl That should be it. Now just export out symbols: +AC_SUBST(ALSA_CFLAGS) +AC_SUBST(ALSA_LIBS) +]) + +AH_TOP([ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +]) + +AH_BOTTOM([#define INLINE inline]) + +AH_BOTTOM([#if C_HAS_ATTRIBUTE +#define GCC_ATTRIBUTE(x) __attribute__ ((x)) +#else +#define GCC_ATTRIBUTE(x) /* attribute not supported */ +#endif]) + +AH_BOTTOM([#if C_HAS_BUILTIN_EXPECT +#define GCC_UNLIKELY(x) __builtin_expect((x),0) +#else +#define GCC_UNLIKELY(x) (x) +#endif]) + +AH_BOTTOM([ +typedef double Real64; + +#if SIZEOF_UNSIGNED_CHAR != 1 +# error "sizeof (unsigned char) != 1" +#else + typedef unsigned char Bit8u; + typedef signed char Bit8s; +#endif + +#if SIZEOF_UNSIGNED_SHORT != 2 +# error "sizeof (unsigned short) != 2" +#else + typedef unsigned short Bit16u; + typedef signed short Bit16s; +#endif + +#if SIZEOF_UNSIGNED_INT == 4 + typedef unsigned int Bit32u; + typedef signed int Bit32s; +#elif SIZEOF_UNSIGNED_LONG == 4 + typedef unsigned long Bit32u; + typedef signed long Bit32s; +#else +# error "can't find sizeof(type) of 4 bytes!" +#endif + +#if SIZEOF_UNSIGNED_LONG == 8 + typedef unsigned long Bit64u; + typedef signed long Bit64s; +#elif SIZEOF_UNSIGNED_LONG_LONG == 8 + typedef unsigned long long Bit64u; + typedef signed long long Bit64s; +#else +# error "can't find data type of 8 bytes" +#endif + +#if SIZEOF_INT_P == 4 + typedef Bit32u Bitu; + typedef Bit32s Bits; + #else + typedef Bit64u Bitu; + typedef Bit64s Bits; + #endif + +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 10 + +AC_PREREQ([2.54]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.9.5])]) + [AM_AUTOMAKE_VERSION([1.7.9])]) -# AM_AUX_DIR_EXPAND -*- Autoconf -*- +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Check to make sure that the build environment is sane. +# + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# -*- Autoconf -*- + + +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to @@ -76,55 +762,131 @@ AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl +# Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) -# AM_CONDITIONAL -*- Autoconf -*- +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Copyright 2001 Free Software Foundation, Inc. -# serial 7 +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# serial 5 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. -# serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -133,6 +895,7 @@ fi])]) # CC etc. in the Makefile, will ask for an AC_PROG_CC use... + # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. @@ -191,9 +954,7 @@ AC_CACHE_CHECK([dependency style of $depcc], : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf @@ -221,14 +982,9 @@ AC_CACHE_CHECK([dependency style of $depcc], grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + # (even with -Werror). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi @@ -262,8 +1018,8 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -272,16 +1028,26 @@ AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) -# Generate code to set up dependency tracking. -*- Autoconf -*- +# Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. -#serial 3 +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ @@ -300,21 +1066,27 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], else continue fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue @@ -340,177 +1112,27 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Check to see how 'make' treats includes. -*- Autoconf -*- -# serial 8 +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. -# Do all the work for Automake. -*- Autoconf -*- +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 12 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.58])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -]) -]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $1 | $1:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. # serial 2 -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 3 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -553,311 +1175,73 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- +# AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. -# serial 4 +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +# serial 5 + +AC_PREREQ(2.52) + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + $1_TRUE='#' + $1_FALSE= fi -]) +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) -# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- -# AM_PROG_MKDIR_P -# --------------- -# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. -# -# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories -# created by `make install' are always world readable, even if the -# installer happens to have an overly restrictive umask (e.g. 077). -# This was a mistake. There are at least two reasons why we must not -# use `-m 0755': -# - it causes special bits like SGID to be ignored, -# - it may be too restrictive (some setups expect 775 directories). -# -# Do not use -m 0755 and let people choose whatever they expect by -# setting umask. -# -# We cannot accept any implementation of `mkdir' that recognizes `-p'. -# Some implementations (such as Solaris 8's) are not thread-safe: if a -# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' -# concurrently, both version can detect that a/ is missing, but only -# one can create it and the other will error out. Consequently we -# restrict ourselves to GNU make (using the --version option ensures -# this.) -AC_DEFUN([AM_PROG_MKDIR_P], -[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi -AC_SUBST([mkdir_p])]) +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. -# Helper functions for option handling. -*- Autoconf -*- +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. -# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -# serial 3 +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +AC_PREREQ([2.52]) -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +# serial 6 -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -m4_include([acinclude.m4]) diff --git a/autogen.sh b/autogen.sh index 5e6dff9..4d7d5ba 100644 --- a/autogen.sh +++ b/autogen.sh @@ -7,7 +7,7 @@ echo "This may take a while ..." aclocal autoheader -automake --gnits --include-deps --add-missing --copy +automake --include-deps --add-missing --copy autoconf echo "Now you are ready to run ./configure." diff --git a/config.guess b/config.guess index 77c7cba..c38553d 100644 --- a/config.guess +++ b/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2004-08-13' +timestamp='2006-02-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,13 +17,15 @@ timestamp='2004-08-13' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. @@ -53,7 +55,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -66,11 +68,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -104,7 +106,7 @@ set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; @@ -123,7 +125,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' +esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -196,55 +198,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" - exit 0 ;; - amd64:OpenBSD:*:*) - echo x86_64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - cats:OpenBSD:*:*) - echo arm-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - luna88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit 0 ;; + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -297,37 +267,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; + exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix - exit 0 ;; + exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 - exit 0 ;; + exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 - exit 0;; + exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; + exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; + exit ;; *:OS/390:*:*) echo i370-ibm-openedition - exit 0 ;; + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; *:OS400:*:*) echo powerpc-ibm-os400 - exit 0 ;; + exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp - exit 0;; + exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then @@ -335,32 +311,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in else echo pyramid-pyramid-bsd fi - exit 0 ;; + exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 - exit 0 ;; + exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; + sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) @@ -369,10 +345,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; + exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 @@ -384,10 +360,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-sunos${UNAME_RELEASE} ;; esac - exit 0 ;; + exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; + exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -398,40 +374,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; + exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 - exit 0 ;; + exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; + exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; + exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -455,32 +431,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; + exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax - exit 0 ;; + exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax - exit 0 ;; + exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix - exit 0 ;; + exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 - exit 0 ;; + exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 - exit 0 ;; + exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` @@ -496,29 +473,29 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit 0 ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 - exit 0 ;; + exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 - exit 0 ;; + exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 - exit 0 ;; + exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd - exit 0 ;; + exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; + exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix - exit 0 ;; + exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` @@ -526,7 +503,7 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build @@ -541,14 +518,18 @@ EOF exit(0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi - exit 0 ;; + exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then @@ -562,28 +543,28 @@ EOF IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; + exit ;; *:AIX:*:*) echo rs6000-ibm-aix - exit 0 ;; + exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 - exit 0 ;; + exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 + exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx - exit 0 ;; + exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 - exit 0 ;; + exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd - exit 0 ;; + exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 - exit 0 ;; + exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in @@ -645,9 +626,19 @@ EOF esac if [ ${HP_ARCH} = "hppa2.0w" ] then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else @@ -655,11 +646,11 @@ EOF fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; + exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -687,152 +678,177 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 - exit 0 ;; + exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd - exit 0 ;; + exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd - exit 0 ;; + exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix - exit 0 ;; + exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf - exit 0 ;; + exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf - exit 0 ;; + exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi - exit 0 ;; + exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites - exit 0 ;; + exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit 0 ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit 0 ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit 0 ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit 0 ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; + exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; + exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; + exit ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; + exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; + exit ;; + i*:MSYS_NT-*:*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; + exit ;; + x86:Interix*:[345]*) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T:Interix*:[345]*) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix - exit 0 ;; + exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin - exit 0 ;; + exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; + exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; + exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit 0 ;; + exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; + exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu - exit 0 ;; + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c @@ -849,8 +865,12 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build @@ -868,15 +888,22 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu - exit 0 ;; + exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu - exit 0 ;; + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -890,7 +917,7 @@ EOF objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -898,25 +925,28 @@ EOF PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac - exit 0 ;; + exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu - exit 0 ;; + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; + exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu - exit 0 ;; + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent @@ -934,15 +964,15 @@ EOF ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; + exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; + exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -959,7 +989,7 @@ EOF LIBC=gnulibc1 # endif #else - #ifdef __INTEL_COMPILER + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun) LIBC=gnu #else LIBC=gnuaout @@ -969,16 +999,23 @@ EOF LIBC=dietlibc #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 - exit 0 ;; + exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... @@ -986,27 +1023,27 @@ EOF # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; + exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; + exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:syllable:*:*) + exit ;; + i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable - exit 0 ;; + exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; + exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -1014,15 +1051,16 @@ EOF else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi - exit 0 ;; - i*86:*:5:[78]*) + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; + exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi - exit 0 ;; + exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv - exit 0 ;; + exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv - exit 0 ;; + exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix - exit 0 ;; + exit ;; M68*:*:R3V[5678]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; + && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 - exit 0 ;; + exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; + exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; + exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 - exit 0 ;; + exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` @@ -1114,69 +1152,72 @@ EOF else echo ns32k-sni-sysv fi - exit 0 ;; + exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 - exit 0 ;; + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 - exit 0 ;; + exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 - exit 0 ;; + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos - exit 0 ;; + exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; + exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 - exit 0 ;; + exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit 0 ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos - exit 0 ;; + exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos - exit 0 ;; + exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos - exit 0 ;; + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in - *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; + exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then @@ -1184,22 +1225,25 @@ EOF UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; + exit ;; *:QNX:*:4*) echo i386-pc-qnx - exit 0 ;; + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; + exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux - exit 0 ;; + exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv - exit 0 ;; + exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; + exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 @@ -1210,38 +1254,47 @@ EOF UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; + exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 - exit 0 ;; + exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex - exit 0 ;; + exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 - exit 0 ;; + exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 - exit 0 ;; + exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 - exit 0 ;; + exit ;; *:ITS:*:*) echo pdp10-unknown-its - exit 0 ;; + exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; + exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; + exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms && exit 0 ;; - I*) echo ia64-dec-vms && exit 0 ;; - V*) echo vax-dec-vms && exit 0 ;; - esac + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 @@ -1273,7 +1326,7 @@ main () #endif #if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); + printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) @@ -1362,11 +1415,12 @@ main () } EOF -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) @@ -1375,22 +1429,22 @@ then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd - exit 0 ;; + exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit 0 ;; + exit ;; c34*) echo c34-convex-bsd - exit 0 ;; + exit ;; c38*) echo c38-convex-bsd - exit 0 ;; + exit ;; c4*) echo c4-convex-bsd - exit 0 ;; + exit ;; esac fi @@ -1401,7 +1455,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - ftp://ftp.gnu.org/pub/gnu/config/ + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess +and + http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub If the version you run ($0) is already up to date, please send the following data and any information you think might be diff --git a/config.h.in b/config.h.in index 1b92b29..44c5135 100644 --- a/config.h.in +++ b/config.h.in @@ -2,7 +2,7 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ /* Define to 1 to enable internal debugger, requires libcurses */ #undef C_DEBUG -/* Define to 1 if you want serial passthrough support (Win32 and OS/2 only). +/* Define to 1 if you want serial passthrough support (Win32, Posix and OS/2). */ #undef C_DIRECTSERIAL @@ -76,6 +76,9 @@ /* Define to 1 to use a unaligned memory access */ #undef C_UNALIGNED_MEMORY +/* libm doesn't include powf */ +#undef DB_HAVE_NO_POWF + /* environ can be included */ #undef ENVIRON_INCLUDED @@ -94,6 +97,9 @@ /* Define to 1 if you have the `asound' library (-lasound). */ #undef HAVE_LIBASOUND +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -145,22 +151,22 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The size of a `int *', as computed by sizeof. */ +/* The size of `int *', as computed by sizeof. */ #undef SIZEOF_INT_P -/* The size of a `unsigned char', as computed by sizeof. */ +/* The size of `unsigned char', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_CHAR -/* The size of a `unsigned int', as computed by sizeof. */ +/* The size of `unsigned int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_INT -/* The size of a `unsigned long', as computed by sizeof. */ +/* The size of `unsigned long', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG -/* The size of a `unsigned long long', as computed by sizeof. */ +/* The size of `unsigned long long', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG_LONG -/* The size of a `unsigned short', as computed by sizeof. */ +/* The size of `unsigned short', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_SHORT /* Define to 1 if you have the ANSI C header files. */ @@ -185,7 +191,7 @@ #undef inline #endif -/* Define to `unsigned' if does not define. */ +/* Define to `unsigned int' if does not define. */ #undef size_t #define INLINE inline diff --git a/config.sub b/config.sub index ac6de98..ad9f395 100644 --- a/config.sub +++ b/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2004-06-24' +timestamp='2006-02-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,14 +21,15 @@ timestamp='2004-06-24' # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. + # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # @@ -70,7 +71,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -83,11 +84,11 @@ Try \`$me --help' for more information." while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; + echo "$timestamp" ; exit ;; --version | -v ) - echo "$version" ; exit 0 ;; + echo "$version" ; exit ;; --help | --h* | -h ) - echo "$usage"; exit 0 ;; + echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -99,7 +100,7 @@ while test $# -gt 0 ; do *local*) # First pass through any local machine types. echo $1 - exit 0;; + exit ;; * ) break ;; @@ -118,8 +119,9 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -170,6 +172,10 @@ case $os in -hiux*) os=-hiuxwe2 ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -186,6 +192,10 @@ case $os in # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` @@ -231,13 +241,14 @@ case $basic_machine in | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | mcore \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -246,6 +257,7 @@ case $basic_machine in | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ @@ -254,23 +266,29 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | mt \ | msp430 \ + | nios | nios2 \ | ns16k | ns32k \ - | openrisc | or32 \ + | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ - | x86 | xscale | xstormy16 | xtensa \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; + m32c) + basic_machine=$basic_machine-unknown + ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown @@ -278,6 +296,9 @@ case $basic_machine in ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; + ms1) + basic_machine=mt-unknown + ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and @@ -298,7 +319,7 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ - | bs2000-* \ + | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ @@ -310,7 +331,7 @@ case $basic_machine in | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -319,6 +340,7 @@ case $basic_machine in | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ @@ -327,27 +349,32 @@ case $basic_machine in | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ + | mt-* \ | msp430-* \ + | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; + m32c-*) + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -457,6 +484,9 @@ case $basic_machine in crds | unos) basic_machine=m68k-crds ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; @@ -486,6 +516,10 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx @@ -676,6 +710,9 @@ case $basic_machine in basic_machine=i386-pc os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; mvs) basic_machine=i370-ibm os=-mvs @@ -751,9 +788,8 @@ case $basic_machine in basic_machine=hppa1.1-oki os=-proelf ;; - or32 | or32-*) + openrisc | openrisc-*) basic_machine=or32-unknown - os=-coff ;; os400) basic_machine=powerpc-ibm @@ -784,6 +820,12 @@ case $basic_machine in pc532 | pc532-*) basic_machine=ns32k-pc532 ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; @@ -840,6 +882,10 @@ case $basic_machine in basic_machine=i586-unknown os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k os=-coff @@ -1026,6 +1072,10 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; xps | xps100) basic_machine=xps100-honeywell ;; @@ -1075,12 +1125,9 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; @@ -1154,20 +1201,23 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1185,7 +1235,7 @@ case $os in os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) @@ -1294,6 +1344,9 @@ case $os in -kaos*) os=-kaos ;; + -zvmoe) + os=-zvmoe + ;; -none) ;; *) @@ -1371,6 +1424,9 @@ case $basic_machine in *-be) os=-beos ;; + *-haiku) + os=-haiku + ;; *-ibm) os=-aix ;; @@ -1542,7 +1598,7 @@ case $basic_machine in esac echo $basic_machine$os -exit 0 +exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/configure b/configure index 416d8ff..7cc6d1b 100644 --- a/configure +++ b/configure @@ -1,8 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for dosbox 0.65. +# Generated by GNU Autoconf 2.60a for dosbox 0.70. # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -16,66 +17,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -96,124 +46,464 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done +IFS=$as_save_IFS - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -222,7 +512,19 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -231,86 +533,187 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME='dosbox' PACKAGE_TARNAME='dosbox' -PACKAGE_VERSION='0.65' -PACKAGE_STRING='dosbox 0.65' +PACKAGE_VERSION='0.70' +PACKAGE_STRING='dosbox 0.70' PACKAGE_BUGREPORT='' ac_unique_file="README" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE RANLIB ac_ct_RANLIB SDL_CONFIG SDL_CFLAGS SDL_LIBS EGREP ALSA_CFLAGS ALSA_LIBS WINDRES ac_ct_WINDRES HAVE_WINDRES_TRUE HAVE_WINDRES_FALSE LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +AMTAR +install_sh +STRIP +INSTALL_STRIP_PROGRAM +AWK +SET_MAKE +am__leading_dot +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +CPP +CXX +CXXFLAGS +ac_ct_CXX +CXXDEPMODE +am__fastdepCXX_TRUE +am__fastdepCXX_FALSE +RANLIB +SDL_CONFIG +SDL_CFLAGS +SDL_LIBS +GREP +EGREP +ALSA_CFLAGS +ALSA_LIBS +WINDRES +HAVE_WINDRES_TRUE +HAVE_WINDRES_FALSE +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC' + # Initialize some variables set by options. ac_init_help= @@ -337,34 +740,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -386,12 +803,18 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. @@ -399,7 +822,17 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` @@ -408,11 +841,7 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -439,6 +868,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -463,13 +898,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -534,6 +972,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -590,11 +1038,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` @@ -603,7 +1047,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -634,8 +1078,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -655,27 +1098,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -702,82 +1137,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP -ac_env_CXX_set=${CXX+set} -ac_env_CXX_value=$CXX -ac_cv_env_CXX_set=${CXX+set} -ac_cv_env_CXX_value=$CXX -ac_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_env_CXXFLAGS_value=$CXXFLAGS -ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_cv_env_CXXFLAGS_value=$CXXFLAGS + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -786,7 +1215,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures dosbox 0.65 to adapt to many kinds of systems. +\`configure' configures dosbox 0.70 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -806,9 +1235,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -826,15 +1252,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/dosbox] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -853,15 +1286,15 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of dosbox 0.65:";; + short | recursive ) echo "Configuration of dosbox 0.70:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors --disable-sdltest Do not try to compile and run a test SDL program --disable-alsatest Do not try to compile and run a test Alsa program --enable-debug Enable debug mode @@ -886,8 +1319,8 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags @@ -896,120 +1329,86 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd "$ac_popdir" + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -dosbox configure 0.65 -generated by GNU Autoconf 2.59 +dosbox configure 0.70 +generated by GNU Autoconf 2.60a -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by dosbox $as_me 0.65, which was -generated by GNU Autoconf 2.59. Invocation command line was +It was created by dosbox $as_me 0.70, which was +generated by GNU Autoconf 2.60a. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1028,7 +1427,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1042,6 +1441,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1063,7 +1463,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1074,7 +1473,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1096,9 +1495,7 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1109,8 +1506,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1123,20 +1520,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1147,22 +1558,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1174,26 +1591,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1224,14 +1639,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1247,8 +1665,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1260,12 +1678,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1290,8 +1707,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1308,6 +1724,30 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi + + + + + + + + + + + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1318,130 +1758,155 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -1451,7 +1916,7 @@ test -n "$target_alias" && NONENONEs,x,x, && program_prefix=${target_alias}- -am__api_version="1.9" +am__api_version="1.7" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -1465,8 +1930,8 @@ am__api_version="1.9" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1488,7 +1953,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1507,21 +1972,22 @@ case $as_dir/ in ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1531,8 +1997,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file @@ -1574,20 +2040,21 @@ echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" + program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" + program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed +rm -f conftest.sed + # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -1602,45 +2069,12 @@ else echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi -if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then - # We used to keeping the `.' as first argument, in order to - # allow $(mkdir_p) to be used without argument. As in - # $(mkdir_p) $(somedir) - # where $(somedir) is conditionally defined. However this is wrong - # for two reasons: - # 1. if the package is installed by a user who cannot write `.' - # make install will fail, - # 2. the above comment should most certainly read - # $(mkdir_p) $(DESTDIR)$(somedir) - # so it does not work when $(somedir) is undefined and - # $(DESTDIR) is not. - # To support the latter case, we have to write - # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), - # so the `.' trick is pointless. - mkdir_p='mkdir -p --' -else - # On NextStep and OpenStep, the `mkdir' command does not - # recognize any option. It will interpret all options as - # directories to create, and then abort because `.' already - # exists. - for d in ./-p ./--version; - do - test -d $d && rmdir $d - done - # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. - if test -f "$ac_aux_dir/mkinstalldirs"; then - mkdir_p='$(mkinstalldirs)' - else - mkdir_p='$(install_sh) -d' - fi -fi - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1653,54 +2087,57 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -1713,7 +2150,7 @@ else fi rmdir .tst 2>/dev/null -# test to see if srcdir already configured + # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 @@ -1733,7 +2170,7 @@ fi # Define the identity of the package. PACKAGE='dosbox' - VERSION='0.65' + VERSION='0.70' cat >>confdefs.h <<_ACEOF @@ -1761,6 +2198,9 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +AMTAR=${AMTAR-"${am_missing_run}tar"} + install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user @@ -1771,8 +2211,8 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1785,32 +2225,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1823,27 +2265,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -1853,45 +2309,39 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +ac_config_headers="$ac_config_headers config.h" - ac_config_headers="$ac_config_headers config.h" - - -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -1903,8 +2353,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1917,32 +2367,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1955,36 +2407,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1997,74 +2464,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2078,7 +2505,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2089,6 +2516,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -2106,22 +2534,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2134,36 +2563,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2176,29 +2607,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -2211,21 +2658,35 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2250,47 +2711,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2302,19 +2793,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2333,22 +2826,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2359,9 +2857,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2375,14 +2872,14 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2402,14 +2899,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2427,12 +2930,12 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2455,23 +2958,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2480,24 +2996,28 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2513,23 +3033,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2538,12 +3071,131 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2559,12 +3211,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2598,12 +3250,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2618,201 +3275,74 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2820,7 +3350,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" - ac_config_commands="$ac_config_commands depfiles" +ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} @@ -2830,8 +3360,8 @@ am__doit: .PHONY: am__doit END # If we don't find an include directive, just comment out the code. -echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none @@ -2858,15 +3388,15 @@ if test "$am__include" = "#"; then fi -echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6 +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +# Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then - enableval="$enable_dependency_tracking" + enableval=$enable_dependency_tracking; +fi -fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -2886,8 +3416,8 @@ fi depcc="$CC" am_compiler_list= -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2925,9 +3455,7 @@ else : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf @@ -2955,14 +3483,9 @@ else grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + # (even with -Werror). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi @@ -2976,8 +3499,8 @@ else fi fi -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type @@ -2998,8 +3521,8 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3033,8 +3556,13 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3059,9 +3587,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3071,8 +3600,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3099,6 +3633,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3116,8 +3651,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3140,8 +3675,13 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3166,9 +3706,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3178,8 +3719,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3206,6 +3752,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3227,18 +3774,22 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=cc +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3251,36 +3802,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3293,55 +3846,85 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CXX" && break done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - CXX=$ac_ct_CXX + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi fi - + fi +fi # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3364,23 +3947,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3389,24 +3985,28 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3422,23 +4022,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3447,12 +4060,131 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cxx_g=no + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then @@ -3468,110 +4200,6 @@ else CXXFLAGS= fi fi -for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3580,8 +4208,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3619,9 +4247,7 @@ else : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf @@ -3649,14 +4275,9 @@ else grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + # (even with -Werror). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi @@ -3670,8 +4291,8 @@ else fi fi -echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type @@ -3700,8 +4321,8 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3723,7 +4344,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -3742,21 +4363,22 @@ case $as_dir/ in ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -3769,8 +4391,8 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3783,32 +4405,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3821,27 +4445,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -3856,28 +4494,28 @@ fi SDL_VERSION=1.2.0 -# Check whether --with-sdl-prefix or --without-sdl-prefix was given. +# Check whether --with-sdl-prefix was given. if test "${with_sdl_prefix+set}" = set; then - withval="$with_sdl_prefix" - sdl_prefix="$withval" + withval=$with_sdl_prefix; sdl_prefix="$withval" else sdl_prefix="" -fi; +fi -# Check whether --with-sdl-exec-prefix or --without-sdl-exec-prefix was given. + +# Check whether --with-sdl-exec-prefix was given. if test "${with_sdl_exec_prefix+set}" = set; then - withval="$with_sdl_exec_prefix" - sdl_exec_prefix="$withval" + withval=$with_sdl_exec_prefix; sdl_exec_prefix="$withval" else sdl_exec_prefix="" -fi; -# Check whether --enable-sdltest or --disable-sdltest was given. -if test "${enable_sdltest+set}" = set; then - enableval="$enable_sdltest" +fi +# Check whether --enable-sdltest was given. +if test "${enable_sdltest+set}" = set; then + enableval=$enable_sdltest; else enable_sdltest=yes -fi; +fi + if test x$sdl_exec_prefix != x ; then sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" @@ -3894,8 +4532,8 @@ fi; # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_SDL_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3910,31 +4548,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no" ;; esac fi SDL_CONFIG=$ac_cv_path_SDL_CONFIG - if test -n "$SDL_CONFIG"; then - echo "$as_me:$LINENO: result: $SDL_CONFIG" >&5 -echo "${ECHO_T}$SDL_CONFIG" >&6 + { echo "$as_me:$LINENO: result: $SDL_CONFIG" >&5 +echo "${ECHO_T}$SDL_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + min_sdl_version=$SDL_VERSION - echo "$as_me:$LINENO: checking for SDL - version >= $min_sdl_version" >&5 -echo $ECHO_N "checking for SDL - version >= $min_sdl_version... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for SDL - version >= $min_sdl_version" >&5 +echo $ECHO_N "checking for SDL - version >= $min_sdl_version... $ECHO_C" >&6; } no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes @@ -4023,13 +4662,22 @@ int main (int argc, char *argv[]) _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4042,19 +4690,21 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_sdl=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sdl" = x ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } : else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } if test "$SDL_CONFIG" = "no" ; then echo "*** The sdl-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" @@ -4086,23 +4736,36 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4119,12 +4782,13 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" echo "*** or that you have moved SDL since it was installed. In the latter case, you" echo "*** may want to edit the sdl-config script: $SDL_CONFIG" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" @@ -4145,8 +4809,8 @@ LIBS="$LIBS $SDL_LIBS" CPPFLAGS="$CPPFLAGS $SDL_CFLAGS" -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4164,10 +4828,10 @@ main () #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; - const charset x; + const charset cs; /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; + char const *const *pcpcc; + char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; @@ -4176,16 +4840,17 @@ main () an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; - ccp = &g + (g ? g-g : 0); + pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; + if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; @@ -4204,7 +4869,9 @@ main () } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; + if (!foo) return 0; } + return !cs[0] && !zero.x; #endif ; @@ -4212,23 +4879,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4237,12 +4917,13 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_const=no + ac_cv_c_const=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF @@ -4251,8 +4932,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for inline" >&5 -echo $ECHO_N "checking for inline... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4272,38 +4953,54 @@ $ac_kw foo_t foo () {return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_c_inline=$ac_kw; break + ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break done fi -echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 -echo "${ECHO_T}$ac_cv_c_inline" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in @@ -4322,23 +5019,170 @@ _ACEOF esac -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4362,23 +5206,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4387,9 +5244,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -4445,6 +5303,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -4464,18 +5323,27 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4488,12 +5356,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + fi fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -4516,9 +5386,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4532,23 +5402,36 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4557,12 +5440,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -4573,8 +5458,8 @@ fi done -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4585,35 +5470,49 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef size_t ac__type_new_; int main () { -if ((size_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (size_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4622,24 +5521,25 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_size_t=no + ac_cv_type_size_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF -#define size_t unsigned +#define size_t unsigned int _ACEOF fi -echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4661,23 +5561,36 @@ struct tm *tp; tp->tm_sec; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4686,12 +5599,13 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_struct_tm=sys/time.h + ac_cv_struct_tm=sys/time.h fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -4700,8 +5614,8 @@ _ACEOF fi -echo "$as_me:$LINENO: checking for unsigned char" >&5 -echo $ECHO_N "checking for unsigned char... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for unsigned char" >&5 +echo $ECHO_N "checking for unsigned char... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4712,35 +5626,49 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef unsigned char ac__type_new_; int main () { -if ((unsigned char *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (unsigned char)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4749,23 +5677,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_unsigned_char=no + ac_cv_type_unsigned_char=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_char" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_char" >&6 -echo "$as_me:$LINENO: checking size of unsigned char" >&5 -echo $ECHO_N "checking size of unsigned char... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_char" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_char" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of unsigned char" >&5 +echo $ECHO_N "checking size of unsigned char... $ECHO_C" >&6; } if test "${ac_cv_sizeof_unsigned_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_unsigned_char" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4775,10 +5703,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned char ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4786,23 +5716,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4815,10 +5758,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned char ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4826,23 +5771,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4851,30 +5809,33 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned char ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4882,23 +5843,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4911,10 +5885,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned char ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4922,23 +5898,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4947,24 +5936,27 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4975,10 +5967,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned char ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned char))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4986,23 +5980,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5011,23 +6018,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_char=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char), 77 +'') if test "$ac_cv_type_unsigned_char" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned char), 77 +echo "$as_me: error: cannot compute sizeof (unsigned char) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_char=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5036,8 +6043,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (unsigned char)); } -unsigned long ulongval () { return (long) (sizeof (unsigned char)); } + typedef unsigned char ac__type_sizeof_; + +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5046,35 +6055,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (unsigned char))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (unsigned char)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (unsigned char)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5085,29 +6103,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char), 77 +if test "$ac_cv_type_unsigned_char" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned char) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned char), 77 +echo "$as_me: error: cannot compute sizeof (unsigned char) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_char=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_unsigned_char=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_char" >&5 -echo "${ECHO_T}$ac_cv_sizeof_unsigned_char" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_char" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_char" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_CHAR $ac_cv_sizeof_unsigned_char _ACEOF -echo "$as_me:$LINENO: checking for unsigned short" >&5 -echo $ECHO_N "checking for unsigned short... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for unsigned short" >&5 +echo $ECHO_N "checking for unsigned short... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5118,35 +6139,49 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef unsigned short ac__type_new_; int main () { -if ((unsigned short *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (unsigned short)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5155,23 +6190,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_unsigned_short=no + ac_cv_type_unsigned_short=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_short" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_short" >&6 -echo "$as_me:$LINENO: checking size of unsigned short" >&5 -echo $ECHO_N "checking size of unsigned short... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_short" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_short" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of unsigned short" >&5 +echo $ECHO_N "checking size of unsigned short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_unsigned_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_unsigned_short" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -5181,10 +6216,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned short ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5192,23 +6229,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5221,10 +6271,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned short ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5232,23 +6284,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5257,30 +6322,33 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned short ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5288,23 +6356,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5317,10 +6398,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned short ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5328,23 +6411,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5353,24 +6449,27 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5381,10 +6480,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned short ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5392,23 +6493,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5417,23 +6531,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_short=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short), 77 +'') if test "$ac_cv_type_unsigned_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned short), 77 +echo "$as_me: error: cannot compute sizeof (unsigned short) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_short=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5442,8 +6556,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (unsigned short)); } -unsigned long ulongval () { return (long) (sizeof (unsigned short)); } + typedef unsigned short ac__type_sizeof_; + +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5452,35 +6568,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (unsigned short))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (unsigned short)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (unsigned short)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5491,29 +6616,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short), 77 +if test "$ac_cv_type_unsigned_short" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned short), 77 +echo "$as_me: error: cannot compute sizeof (unsigned short) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_short=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_unsigned_short=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_unsigned_short" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_short" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short _ACEOF -echo "$as_me:$LINENO: checking for unsigned int" >&5 -echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for unsigned int" >&5 +echo $ECHO_N "checking for unsigned int... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5524,35 +6652,49 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef unsigned int ac__type_new_; int main () { -if ((unsigned int *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (unsigned int)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5561,23 +6703,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_unsigned_int=no + ac_cv_type_unsigned_int=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_int" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6 -echo "$as_me:$LINENO: checking size of unsigned int" >&5 -echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_int" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_int" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of unsigned int" >&5 +echo $ECHO_N "checking size of unsigned int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_unsigned_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_unsigned_int" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -5587,10 +6729,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned int ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5598,23 +6742,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5627,10 +6784,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned int ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5638,23 +6797,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5663,30 +6835,33 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned int ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5694,23 +6869,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5723,10 +6911,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned int ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5734,23 +6924,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5759,24 +6962,27 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5787,10 +6993,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned int ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5798,23 +7006,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5823,23 +7044,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_int=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77 +'') if test "$ac_cv_type_unsigned_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned int), 77 +echo "$as_me: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_int=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5848,8 +7069,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (unsigned int)); } -unsigned long ulongval () { return (long) (sizeof (unsigned int)); } + typedef unsigned int ac__type_sizeof_; + +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5858,35 +7081,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (unsigned int))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (unsigned int)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (unsigned int)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5897,29 +7129,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int), 77 +if test "$ac_cv_type_unsigned_int" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned int), 77 +echo "$as_me: error: cannot compute sizeof (unsigned int) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_int=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_unsigned_int=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_int" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int _ACEOF -echo "$as_me:$LINENO: checking for unsigned long" >&5 -echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for unsigned long" >&5 +echo $ECHO_N "checking for unsigned long... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5930,35 +7165,49 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef unsigned long ac__type_new_; int main () { -if ((unsigned long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (unsigned long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5967,23 +7216,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_unsigned_long=no + ac_cv_type_unsigned_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6 -echo "$as_me:$LINENO: checking size of unsigned long" >&5 -echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of unsigned long" >&5 +echo $ECHO_N "checking size of unsigned long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_unsigned_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_unsigned_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -5993,10 +7242,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -6004,23 +7255,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6033,10 +7297,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -6044,23 +7310,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6069,30 +7348,33 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -6100,23 +7382,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6129,10 +7424,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -6140,23 +7437,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6165,24 +7475,27 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -6193,10 +7506,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -6204,23 +7519,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6229,23 +7557,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long), 77 +'') if test "$ac_cv_type_unsigned_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned long), 77 +echo "$as_me: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_long=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6254,8 +7582,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (unsigned long)); } -unsigned long ulongval () { return (long) (sizeof (unsigned long)); } + typedef unsigned long ac__type_sizeof_; + +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -6264,35 +7594,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (unsigned long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (unsigned long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (unsigned long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6303,29 +7642,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long), 77 +if test "$ac_cv_type_unsigned_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned long), 77 +echo "$as_me: error: cannot compute sizeof (unsigned long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_unsigned_long=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long _ACEOF -echo "$as_me:$LINENO: checking for unsigned long long" >&5 -echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for unsigned long long" >&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6; } if test "${ac_cv_type_unsigned_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6336,35 +7678,49 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef unsigned long long ac__type_new_; int main () { -if ((unsigned long long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (unsigned long long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6373,23 +7729,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_unsigned_long_long=no + ac_cv_type_unsigned_long_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6 -echo "$as_me:$LINENO: checking size of unsigned long long" >&5 -echo $ECHO_N "checking size of unsigned long long... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_unsigned_long_long" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of unsigned long long" >&5 +echo $ECHO_N "checking size of unsigned long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_unsigned_long_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_unsigned_long_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -6399,10 +7755,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -6410,23 +7768,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6439,10 +7810,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -6450,23 +7823,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6475,30 +7861,33 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -6506,23 +7895,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6535,10 +7937,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -6546,23 +7950,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6571,24 +7988,27 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -6599,10 +8019,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef unsigned long long ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (unsigned long long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -6610,23 +8032,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6635,23 +8070,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_unsigned_long_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long), 77 +'') if test "$ac_cv_type_unsigned_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned long long), 77 +echo "$as_me: error: cannot compute sizeof (unsigned long long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_long_long=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6660,8 +8095,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (unsigned long long)); } -unsigned long ulongval () { return (long) (sizeof (unsigned long long)); } + typedef unsigned long long ac__type_sizeof_; + +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -6670,35 +8107,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (unsigned long long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (unsigned long long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (unsigned long long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6709,29 +8155,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long), 77 +if test "$ac_cv_type_unsigned_long_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (unsigned long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (unsigned long long), 77 +echo "$as_me: error: cannot compute sizeof (unsigned long long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_unsigned_long_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_unsigned_long_long=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_unsigned_long_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_unsigned_long_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long _ACEOF -echo "$as_me:$LINENO: checking for int *" >&5 -echo $ECHO_N "checking for int *... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for int *" >&5 +echo $ECHO_N "checking for int *... $ECHO_C" >&6; } if test "${ac_cv_type_int_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6742,35 +8191,49 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int * ac__type_new_; int main () { -if ((int * *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (int *)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6779,23 +8242,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_int_p=no + ac_cv_type_int_p=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_int_p" >&5 -echo "${ECHO_T}$ac_cv_type_int_p" >&6 -echo "$as_me:$LINENO: checking size of int *" >&5 -echo $ECHO_N "checking size of int *... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_int_p" >&5 +echo "${ECHO_T}$ac_cv_type_int_p" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of int *" >&5 +echo $ECHO_N "checking size of int *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_int_p" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -6805,10 +8268,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int * ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -6816,23 +8281,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6845,10 +8323,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int * ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -6856,23 +8336,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6881,30 +8374,33 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int * ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -6912,23 +8408,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6941,10 +8450,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int * ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -6952,23 +8463,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6977,24 +8501,27 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -7005,10 +8532,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int * ac__type_sizeof_; + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (int *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7016,23 +8545,36 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7041,23 +8583,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_int_p=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int *), 77 +'') if test "$ac_cv_type_int_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int *), 77 +echo "$as_me: error: cannot compute sizeof (int *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int_p=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 -echo "$as_me: error: internal error: not reached in cross-compile" >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7066,8 +8608,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (int *)); } -unsigned long ulongval () { return (long) (sizeof (int *)); } + typedef int * ac__type_sizeof_; + +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -7076,35 +8620,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (int *))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (int *)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (int *)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7115,36 +8668,40 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int *), 77 +if test "$ac_cv_type_int_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int *), 77 +echo "$as_me: error: cannot compute sizeof (int *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_int_p=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_int_p=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int_p" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_INT_P $ac_cv_sizeof_int_p _ACEOF -echo "$as_me:$LINENO: checking if environ can be included" >&5 -echo $ECHO_N "checking if environ can be included... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if environ can be included" >&5 +echo $ECHO_N "checking if environ can be included... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + #include #include int @@ -7156,28 +8713,41 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; }; cat >>confdefs.h <<\_ACEOF #define ENVIRON_INCLUDED 1 _ACEOF @@ -7186,13 +8756,15 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -echo "$as_me:$LINENO: checking if environ can be linked" >&5 -echo $ECHO_N "checking if environ can be linked... $ECHO_C" >&6 + +{ echo "$as_me:$LINENO: checking if environ can be linked" >&5 +echo $ECHO_N "checking if environ can be linked... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7209,28 +8781,41 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; }; cat >>confdefs.h <<\_ACEOF #define ENVIRON_LINKED 1 _ACEOF @@ -7239,18 +8824,94 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext +if test x$target = xi386-pc-os2-emx ; then + { echo "$as_me:$LINENO: checking for powf in libm" >&5 +echo $ECHO_N "checking for powf in libm... $ECHO_C" >&6; }; + LIBS_BACKUP=$LIBS; + LIBS="$LIBS -lm"; + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ -#Check if the compiler support attributes + powf(1.0f, 1.0f); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: checking if compiler allows __attribute__" >&5 -echo $ECHO_N "checking if compiler allows __attribute__... $ECHO_C" >&6 +cat >>confdefs.h <<\_ACEOF +#define DB_HAVE_NO_POWF 1 +_ACEOF + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$LIBS_BACKUP +else + +{ echo "$as_me:$LINENO: checking for powf in -lm" >&5 +echo $ECHO_N "checking for powf in -lm... $ECHO_C" >&6; } +if test "${ac_cv_lib_m_powf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7258,37 +8919,144 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char powf (); int main () { -typedef struct { } __attribute__ ((packed)) junk; +return powf (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_m_powf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_m_powf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_m_powf" >&5 +echo "${ECHO_T}$ac_cv_lib_m_powf" >&6; } +if test $ac_cv_lib_m_powf = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBM 1 +_ACEOF + + LIBS="-lm $LIBS" + +else + +cat >>confdefs.h <<\_ACEOF +#define DB_HAVE_NO_POWF 1 +_ACEOF + +fi + +fi + + +#Check if the compiler support attributes + + +{ echo "$as_me:$LINENO: checking if compiler allows __attribute__" >&5 +echo $ECHO_N "checking if compiler allows __attribute__... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +typedef struct { } __attribute__((packed)) junk; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6;cat >>confdefs.h <<\_ACEOF + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; };cat >>confdefs.h <<\_ACEOF #define C_HAS_ATTRIBUTE 1 _ACEOF @@ -7296,16 +9064,25 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #Check if the compiler supports __builtin_expect +#Switch language to c++ +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:$LINENO: checking if compiler allows __builtin_expect" >&5 -echo $ECHO_N "checking if compiler allows __builtin_expect... $ECHO_C" >&6 + +{ echo "$as_me:$LINENO: checking if compiler allows __builtin_expect" >&5 +echo $ECHO_N "checking if compiler allows __builtin_expect... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7317,38 +9094,48 @@ int main () { -int main(int argc,char* argv[]){ int x=10;if( __builtin_expect ((x==1),0) ) ; -return 0; -} ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6;cat >>confdefs.h <<\_ACEOF + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; };cat >>confdefs.h <<\_ACEOF #define C_HAS_BUILTIN_EXPECT 1 _ACEOF @@ -7356,10 +9143,17 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +#switch language back +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu alsa_save_CFLAGS="$CFLAGS" @@ -7368,42 +9162,42 @@ alsa_save_LIBS="$LIBS" alsa_found=yes -# Check whether --with-alsa-prefix or --without-alsa-prefix was given. +# Check whether --with-alsa-prefix was given. if test "${with_alsa_prefix+set}" = set; then - withval="$with_alsa_prefix" - alsa_prefix="$withval" + withval=$with_alsa_prefix; alsa_prefix="$withval" else alsa_prefix="" -fi; +fi -# Check whether --with-alsa-inc-prefix or --without-alsa-inc-prefix was given. + +# Check whether --with-alsa-inc-prefix was given. if test "${with_alsa_inc_prefix+set}" = set; then - withval="$with_alsa_inc_prefix" - alsa_inc_prefix="$withval" + withval=$with_alsa_inc_prefix; alsa_inc_prefix="$withval" else alsa_inc_prefix="" -fi; +fi -# Check whether --enable-alsatest or --disable-alsatest was given. + +# Check whether --enable-alsatest was given. if test "${enable_alsatest+set}" = set; then - enableval="$enable_alsatest" - enable_alsatest=no + enableval=$enable_alsatest; enable_alsatest=no else enable_alsatest=yes -fi; +fi -echo "$as_me:$LINENO: checking for ALSA CFLAGS" >&5 -echo $ECHO_N "checking for ALSA CFLAGS... $ECHO_C" >&6 + +{ echo "$as_me:$LINENO: checking for ALSA CFLAGS" >&5 +echo $ECHO_N "checking for ALSA CFLAGS... $ECHO_C" >&6; } if test "$alsa_inc_prefix" != "" ; then ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix" CFLAGS="$CFLAGS -I$alsa_inc_prefix" fi -echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5 -echo "${ECHO_T}$ALSA_CFLAGS" >&6 +{ echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5 +echo "${ECHO_T}$ALSA_CFLAGS" >&6; } -echo "$as_me:$LINENO: checking for ALSA LDFLAGS" >&5 -echo $ECHO_N "checking for ALSA LDFLAGS... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ALSA LDFLAGS" >&5 +echo $ECHO_N "checking for ALSA LDFLAGS... $ECHO_C" >&6; } if test "$alsa_prefix" != "" ; then ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix" LDFLAGS="$LDFLAGS $ALSA_LIBS" @@ -7415,12 +9209,12 @@ LIBS=`echo $LIBS | sed 's/-ldl//'` LIBS=`echo $LIBS | sed 's/-lpthread//'` LIBS=`echo $LIBS | sed 's/ //'` LIBS="$ALSA_LIBS $LIBS" -echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5 -echo "${ECHO_T}$ALSA_LIBS" >&6 +{ echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5 +echo "${ECHO_T}$ALSA_LIBS" >&6; } min_alsa_version=0.9.0 -echo "$as_me:$LINENO: checking for libasound headers version >= $min_alsa_version" >&5 -echo $ECHO_N "checking for libasound headers version >= $min_alsa_version... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for libasound headers version >= $min_alsa_version" >&5 +echo $ECHO_N "checking for libasound headers version >= $min_alsa_version... $ECHO_C" >&6; } no_alsa="" alsa_min_major_version=`echo $min_alsa_version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` @@ -7430,7 +9224,6 @@ no_alsa="" sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7487,39 +9280,53 @@ exit(0); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: found." >&5 -echo "${ECHO_T}found." >&6 + { echo "$as_me:$LINENO: result: found." >&5 +echo "${ECHO_T}found." >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: not present." >&5 -echo "${ECHO_T}not present." >&6 + { echo "$as_me:$LINENO: result: not present." >&5 +echo "${ECHO_T}not present." >&6; } alsa_found=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7528,8 +9335,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for snd_ctl_open in -lasound" >&5 -echo $ECHO_N "checking for snd_ctl_open in -lasound... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for snd_ctl_open in -lasound" >&5 +echo $ECHO_N "checking for snd_ctl_open in -lasound... $ECHO_C" >&6; } if test "${ac_cv_lib_asound_snd_ctl_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7542,39 +9349,52 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char snd_ctl_open (); int main () { -snd_ctl_open (); +return snd_ctl_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7583,14 +9403,15 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_asound_snd_ctl_open=no + ac_cv_lib_asound_snd_ctl_open=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_ctl_open" >&5 -echo "${ECHO_T}$ac_cv_lib_asound_snd_ctl_open" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_asound_snd_ctl_open" >&5 +echo "${ECHO_T}$ac_cv_lib_asound_snd_ctl_open" >&6; } if test $ac_cv_lib_asound_snd_ctl_open = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBASOUND 1 @@ -7629,8 +9450,8 @@ fi #Check for big endian machine, should #define WORDS_BIGENDIAN if so -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7647,7 +9468,8 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif @@ -7656,23 +9478,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7698,23 +9533,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7723,14 +9571,15 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -# It does not; compile a test program. + # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown @@ -7740,11 +9589,11 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () @@ -7755,23 +9604,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7790,8 +9652,10 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7799,27 +9663,41 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default int main () { + /* Are we little or big endian? From Harbison&Steele. */ union { - long l; - char c[sizeof (long)]; + long int l; + char c[sizeof (long int)]; } u; u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7832,13 +9710,16 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in yes) @@ -7862,22 +9743,21 @@ esac -# Check whether --enable-debug or --disable-debug was given. +# Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then - enableval="$enable_debug" - + enableval=$enable_debug; if test "${ac_cv_header_curses_h+set}" = set; then - echo "$as_me:$LINENO: checking for curses.h" >&5 -echo $ECHO_N "checking for curses.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for curses.h" >&5 +echo $ECHO_N "checking for curses.h... $ECHO_C" >&6; } if test "${ac_cv_header_curses_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5 -echo "${ECHO_T}$ac_cv_header_curses_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5 +echo "${ECHO_T}$ac_cv_header_curses_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking curses.h usability" >&5 -echo $ECHO_N "checking curses.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking curses.h usability" >&5 +echo $ECHO_N "checking curses.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7888,23 +9768,36 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7913,15 +9806,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking curses.h presence" >&5 -echo $ECHO_N "checking curses.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking curses.h presence" >&5 +echo $ECHO_N "checking curses.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7930,8 +9824,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -7955,9 +9854,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7981,25 +9881,18 @@ echo "$as_me: WARNING: curses.h: section \"Present But Cannot Be Compiled\"" echo "$as_me: WARNING: curses.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: curses.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: curses.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## --------------------------------- ## -## Report this to the dosbox lists. ## -## --------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for curses.h" >&5 -echo $ECHO_N "checking for curses.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for curses.h" >&5 +echo $ECHO_N "checking for curses.h... $ECHO_C" >&6; } if test "${ac_cv_header_curses_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_curses_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5 -echo "${ECHO_T}$ac_cv_header_curses_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_curses_h" >&5 +echo "${ECHO_T}$ac_cv_header_curses_h" >&6; } fi if test $ac_cv_header_curses_h = yes; then @@ -8007,8 +9900,8 @@ if test $ac_cv_header_curses_h = yes; then fi - echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5 -echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for initscr in -lcurses" >&5 +echo $ECHO_N "checking for initscr in -lcurses... $ECHO_C" >&6; } if test "${ac_cv_lib_curses_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8021,39 +9914,52 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char initscr (); int main () { -initscr (); +return initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8062,20 +9968,21 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_curses_initscr=no + ac_cv_lib_curses_initscr=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_initscr" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_initscr" >&6; } if test $ac_cv_lib_curses_initscr = yes; then have_curses_lib=yes fi - echo "$as_me:$LINENO: checking for initscr in -lpdcurses" >&5 -echo $ECHO_N "checking for initscr in -lpdcurses... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for initscr in -lpdcurses" >&5 +echo $ECHO_N "checking for initscr in -lpdcurses... $ECHO_C" >&6; } if test "${ac_cv_lib_pdcurses_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8088,39 +9995,52 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char initscr (); int main () { -initscr (); +return initscr (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8129,22 +10049,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_pdcurses_initscr=no + ac_cv_lib_pdcurses_initscr=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pdcurses_initscr" >&5 -echo "${ECHO_T}$ac_cv_lib_pdcurses_initscr" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pdcurses_initscr" >&5 +echo "${ECHO_T}$ac_cv_lib_pdcurses_initscr" >&6; } if test $ac_cv_lib_pdcurses_initscr = yes; then have_pdcurses_lib=yes fi if test x$enable_debug = xno; then - echo "$as_me:$LINENO: result: Debugger not enabled" >&5 -echo "${ECHO_T}Debugger not enabled" >&6 + { echo "$as_me:$LINENO: result: Debugger not enabled" >&5 +echo "${ECHO_T}Debugger not enabled" >&6; } elif test x$have_curses_lib = xyes -a x$have_curses_h = xyes ; then LIBS="$LIBS -lcurses" cat >>confdefs.h <<\_ACEOF @@ -8174,38 +10095,39 @@ _ACEOF echo "$as_me: WARNING: Can't find curses, debug mode disabled" >&2;} fi -fi; +fi -# Check whether --enable-core-inline or --disable-core-inline was given. + +# Check whether --enable-core-inline was given. if test "${enable_core_inline+set}" = set; then - enableval="$enable_core_inline" - + enableval=$enable_core_inline; if test x$enable_core_inline = xyes ; then - echo "$as_me:$LINENO: result: enabling inlined memory handling in CPU Core" >&5 -echo "${ECHO_T}enabling inlined memory handling in CPU Core" >&6 + { echo "$as_me:$LINENO: result: enabling inlined memory handling in CPU Core" >&5 +echo "${ECHO_T}enabling inlined memory handling in CPU Core" >&6; } cat >>confdefs.h <<\_ACEOF #define C_CORE_INLINE 1 _ACEOF fi -fi; +fi -echo "$as_me:$LINENO: checking for target cpu type" >&5 -echo $ECHO_N "checking for target cpu type... $ECHO_C" >&6 + +{ echo "$as_me:$LINENO: checking for target cpu type" >&5 +echo $ECHO_N "checking for target cpu type... $ECHO_C" >&6; } case "$target_cpu" in i?86) cat >>confdefs.h <<\_ACEOF #define C_HOSTCPU X86 _ACEOF - echo "$as_me:$LINENO: result: x86 compatible" >&5 -echo "${ECHO_T}x86 compatible" >&6 + { echo "$as_me:$LINENO: result: x86 compatible" >&5 +echo "${ECHO_T}x86 compatible" >&6; } c_hostcpu="x86" c_unalignedmemory=yes ;; @@ -8214,8 +10136,8 @@ echo "${ECHO_T}x86 compatible" >&6 #define C_HOSTCPU POWERPC _ACEOF - echo "$as_me:$LINENO: result: Power PC" >&5 -echo "${ECHO_T}Power PC" >&6 + { echo "$as_me:$LINENO: result: Power PC" >&5 +echo "${ECHO_T}Power PC" >&6; } c_hostcpu="powerpc" c_unalignedmemory=yes ;; @@ -8224,8 +10146,8 @@ echo "${ECHO_T}Power PC" >&6 #define C_HOSTCPU M68K _ACEOF - echo "$as_me:$LINENO: result: Motorola 68000" >&5 -echo "${ECHO_T}Motorola 68000" >&6 + { echo "$as_me:$LINENO: result: Motorola 68000" >&5 +echo "${ECHO_T}Motorola 68000" >&6; } c_hostcpu="m68k" c_unalignedmemory=yes ;; @@ -8234,77 +10156,77 @@ echo "${ECHO_T}Motorola 68000" >&6 #define C_HOSTCPU UNKOWN _ACEOF - echo "$as_me:$LINENO: result: unknown" >&5 -echo "${ECHO_T}unknown" >&6 + { echo "$as_me:$LINENO: result: unknown" >&5 +echo "${ECHO_T}unknown" >&6; } c_unalignedmemory=no ;; esac -# Check whether --enable-dynamic-x86 or --disable-dynamic-x86 was given. +# Check whether --enable-dynamic-x86 was given. if test "${enable_dynamic_x86+set}" = set; then - enableval="$enable_dynamic_x86" - + enableval=$enable_dynamic_x86; else enable_dynamic_x86=yes -fi; -echo "$as_me:$LINENO: checking whether x86 dynamic cpu core will be enabled" >&5 -echo $ECHO_N "checking whether x86 dynamic cpu core will be enabled... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking whether x86 dynamic cpu core will be enabled" >&5 +echo $ECHO_N "checking whether x86 dynamic cpu core will be enabled... $ECHO_C" >&6; } if test x$enable_dynamic_x86 = xno ; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } else if test x$c_hostcpu = xx86 ; then cat >>confdefs.h <<\_ACEOF #define C_DYNAMIC_X86 1 _ACEOF - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi fi -# Check whether --enable-fpu or --disable-fpu was given. +# Check whether --enable-fpu was given. if test "${enable_fpu+set}" = set; then - enableval="$enable_fpu" - + enableval=$enable_fpu; else enable_fpu=yes -fi; -echo "$as_me:$LINENO: checking whether fpu emulation will be enabled" >&5 -echo $ECHO_N "checking whether fpu emulation will be enabled... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking whether fpu emulation will be enabled" >&5 +echo $ECHO_N "checking whether fpu emulation will be enabled... $ECHO_C" >&6; } if test x$enable_fpu = xyes ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define C_FPU 1 _ACEOF else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -# Check whether --enable-fpu-x86 or --disable-fpu-x86 was given. +# Check whether --enable-fpu-x86 was given. if test "${enable_fpu_x86+set}" = set; then - enableval="$enable_fpu_x86" - + enableval=$enable_fpu_x86; else enable_fpu_x86=yes -fi; -echo "$as_me:$LINENO: checking whether x86 assembly fpu core will be enabled" >&5 -echo $ECHO_N "checking whether x86 assembly fpu core will be enabled... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking whether x86 assembly fpu core will be enabled" >&5 +echo $ECHO_N "checking whether x86 assembly fpu core will be enabled... $ECHO_C" >&6; } if test x$enable_fpu_x86 = xno ; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } else if test x$enable_fpu = xyes; then if test x$c_hostcpu = xx86 ; then @@ -8312,55 +10234,55 @@ else #define C_FPU_X86 1 _ACEOF - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi fi -# Check whether --enable-unaligned_memory or --disable-unaligned_memory was given. +# Check whether --enable-unaligned_memory was given. if test "${enable_unaligned_memory+set}" = set; then - enableval="$enable_unaligned_memory" - + enableval=$enable_unaligned_memory; else enable_unaligned_memory=yes -fi; -echo "$as_me:$LINENO: checking whether to enable unaligned memory access" >&5 -echo $ECHO_N "checking whether to enable unaligned memory access... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking whether to enable unaligned memory access" >&5 +echo $ECHO_N "checking whether to enable unaligned memory access... $ECHO_C" >&6; } if test x$enable_unaligned_memory = xyes -a x$c_unalignedmemory = xyes; then cat >>confdefs.h <<\_ACEOF #define C_UNALIGNED_MEMORY 1 _ACEOF - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "${ac_cv_header_png_h+set}" = set; then - echo "$as_me:$LINENO: checking for png.h" >&5 -echo $ECHO_N "checking for png.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for png.h" >&5 +echo $ECHO_N "checking for png.h... $ECHO_C" >&6; } if test "${ac_cv_header_png_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_png_h" >&5 -echo "${ECHO_T}$ac_cv_header_png_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_png_h" >&5 +echo "${ECHO_T}$ac_cv_header_png_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking png.h usability" >&5 -echo $ECHO_N "checking png.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking png.h usability" >&5 +echo $ECHO_N "checking png.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8371,23 +10293,36 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8396,15 +10331,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking png.h presence" >&5 -echo $ECHO_N "checking png.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking png.h presence" >&5 +echo $ECHO_N "checking png.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8413,8 +10349,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -8438,9 +10379,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -8464,25 +10406,18 @@ echo "$as_me: WARNING: png.h: section \"Present But Cannot Be Compiled\"" >& echo "$as_me: WARNING: png.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: png.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: png.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## --------------------------------- ## -## Report this to the dosbox lists. ## -## --------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for png.h" >&5 -echo $ECHO_N "checking for png.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for png.h" >&5 +echo $ECHO_N "checking for png.h... $ECHO_C" >&6; } if test "${ac_cv_header_png_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_png_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_png_h" >&5 -echo "${ECHO_T}$ac_cv_header_png_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_png_h" >&5 +echo "${ECHO_T}$ac_cv_header_png_h" >&6; } fi if test $ac_cv_header_png_h = yes; then @@ -8490,8 +10425,8 @@ if test $ac_cv_header_png_h = yes; then fi -echo "$as_me:$LINENO: checking for png_check_sig in -lpng" >&5 -echo $ECHO_N "checking for png_check_sig in -lpng... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for png_check_sig in -lpng" >&5 +echo $ECHO_N "checking for png_check_sig in -lpng... $ECHO_C" >&6; } if test "${ac_cv_lib_png_png_check_sig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8504,39 +10439,52 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char png_check_sig (); int main () { -png_check_sig (); +return png_check_sig (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8545,14 +10493,15 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_png_png_check_sig=no + ac_cv_lib_png_png_check_sig=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_check_sig" >&5 -echo "${ECHO_T}$ac_cv_lib_png_png_check_sig" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_check_sig" >&5 +echo "${ECHO_T}$ac_cv_lib_png_png_check_sig" >&6; } if test $ac_cv_lib_png_png_check_sig = yes; then have_png_lib=yes fi @@ -8573,17 +10522,17 @@ fi if test "${ac_cv_header_SDL_net_h+set}" = set; then - echo "$as_me:$LINENO: checking for SDL_net.h" >&5 -echo $ECHO_N "checking for SDL_net.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for SDL_net.h" >&5 +echo $ECHO_N "checking for SDL_net.h... $ECHO_C" >&6; } if test "${ac_cv_header_SDL_net_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_SDL_net_h" >&5 -echo "${ECHO_T}$ac_cv_header_SDL_net_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_SDL_net_h" >&5 +echo "${ECHO_T}$ac_cv_header_SDL_net_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking SDL_net.h usability" >&5 -echo $ECHO_N "checking SDL_net.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking SDL_net.h usability" >&5 +echo $ECHO_N "checking SDL_net.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8594,23 +10543,36 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8619,15 +10581,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking SDL_net.h presence" >&5 -echo $ECHO_N "checking SDL_net.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking SDL_net.h presence" >&5 +echo $ECHO_N "checking SDL_net.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8636,8 +10599,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -8661,9 +10629,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -8687,25 +10656,18 @@ echo "$as_me: WARNING: SDL_net.h: section \"Present But Cannot Be Compiled\" echo "$as_me: WARNING: SDL_net.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: SDL_net.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: SDL_net.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## --------------------------------- ## -## Report this to the dosbox lists. ## -## --------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for SDL_net.h" >&5 -echo $ECHO_N "checking for SDL_net.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for SDL_net.h" >&5 +echo $ECHO_N "checking for SDL_net.h... $ECHO_C" >&6; } if test "${ac_cv_header_SDL_net_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_SDL_net_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_SDL_net_h" >&5 -echo "${ECHO_T}$ac_cv_header_SDL_net_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_SDL_net_h" >&5 +echo "${ECHO_T}$ac_cv_header_SDL_net_h" >&6; } fi if test $ac_cv_header_SDL_net_h = yes; then @@ -8715,54 +10677,77 @@ fi if test x$target = xi386-pc-os2-emx ; then - echo "$as_me:$LINENO: checking for SDLNet_Init in SDL_net" >&5 -echo $ECHO_N "checking for SDLNet_Init in SDL_net... $ECHO_C" >&6; + { echo "$as_me:$LINENO: checking for SDLNet_Init in SDL_net" >&5 +echo $ECHO_N "checking for SDLNet_Init in SDL_net... $ECHO_C" >&6; }; LIBS_BACKUP=$LIBS; LIBS="$LIBS -lSDL_Net"; cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ - #include - int main(int argc,char * argv) { - return SDLNet_Init (); - }; + SDLNet_Init (); + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; have_sdl_net_lib=yes + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; }; have_sdl_net_lib=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$LIBS_BACKUP else -echo "$as_me:$LINENO: checking for SDLNet_Init in -lSDL_net" >&5 -echo $ECHO_N "checking for SDLNet_Init in -lSDL_net... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for SDLNet_Init in -lSDL_net" >&5 +echo $ECHO_N "checking for SDLNet_Init in -lSDL_net... $ECHO_C" >&6; } if test "${ac_cv_lib_SDL_net_SDLNet_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8775,39 +10760,52 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char SDLNet_Init (); int main () { -SDLNet_Init (); +return SDLNet_Init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8816,21 +10814,22 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_SDL_net_SDLNet_Init=no + ac_cv_lib_SDL_net_SDLNet_Init=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_net_SDLNet_Init" >&5 -echo "${ECHO_T}$ac_cv_lib_SDL_net_SDLNet_Init" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_net_SDLNet_Init" >&5 +echo "${ECHO_T}$ac_cv_lib_SDL_net_SDLNet_Init" >&6; } if test $ac_cv_lib_SDL_net_SDLNet_Init = yes; then have_sdl_net_lib=yes fi fi if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then - LIBS="$LIBS -lSDL_net" + LIBS="$LIBS -lSDL_net" cat >>confdefs.h <<\_ACEOF #define C_MODEM 1 _ACEOF @@ -8846,15 +10845,29 @@ fi -# Check whether --enable-opengl or --disable-opengl was given. +# Check whether --enable-opengl was given. if test "${enable_opengl+set}" = set; then - enableval="$enable_opengl" - + enableval=$enable_opengl; else enable_opengl=yes -fi; -echo "$as_me:$LINENO: checking for main in -lGL" >&5 -echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6 +fi + +{ echo "$as_me:$LINENO: checking whether opengl display output will be enabled" >&5 +echo $ECHO_N "checking whether opengl display output will be enabled... $ECHO_C" >&6; } +if test x$enable_opengl = xyes; then +case "$target" in + *-*-darwin*) + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + LIBS="$LIBS -framework OpenGL" + cat >>confdefs.h <<\_ACEOF +#define C_OPENGL 1 +_ACEOF + + ;; + *) + { echo "$as_me:$LINENO: checking for main in -lGL" >&5 +echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6; } if test "${ac_cv_lib_GL_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8871,29 +10884,42 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8902,22 +10928,23 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_GL_main=no + ac_cv_lib_GL_main=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5 -echo "${ECHO_T}$ac_cv_lib_GL_main" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5 +echo "${ECHO_T}$ac_cv_lib_GL_main" >&6; } if test $ac_cv_lib_GL_main = yes; then have_gl_lib=yes else have_gl_lib=no fi -echo "$as_me:$LINENO: checking for main in -lopengl32" >&5 -echo $ECHO_N "checking for main in -lopengl32... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for main in -lopengl32" >&5 +echo $ECHO_N "checking for main in -lopengl32... $ECHO_C" >&6; } if test "${ac_cv_lib_opengl32_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8934,29 +10961,42 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -8965,32 +11005,33 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_opengl32_main=no + ac_cv_lib_opengl32_main=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_opengl32_main" >&5 -echo "${ECHO_T}$ac_cv_lib_opengl32_main" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_opengl32_main" >&5 +echo "${ECHO_T}$ac_cv_lib_opengl32_main" >&6; } if test $ac_cv_lib_opengl32_main = yes; then have_opengl32_lib=yes else have_opengl32_lib=no fi -if test "${ac_cv_header_GL_gl_h+set}" = set; then - echo "$as_me:$LINENO: checking for GL/gl.h" >&5 -echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 + if test "${ac_cv_header_GL_gl_h+set}" = set; then + { echo "$as_me:$LINENO: checking for GL/gl.h" >&5 +echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6; } if test "${ac_cv_header_GL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 -echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 +echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking GL/gl.h usability" >&5 -echo $ECHO_N "checking GL/gl.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking GL/gl.h usability" >&5 +echo $ECHO_N "checking GL/gl.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9001,23 +11042,36 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9026,15 +11080,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking GL/gl.h presence" >&5 -echo $ECHO_N "checking GL/gl.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking GL/gl.h presence" >&5 +echo $ECHO_N "checking GL/gl.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9043,8 +11098,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -9068,9 +11128,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -9094,25 +11155,18 @@ echo "$as_me: WARNING: GL/gl.h: section \"Present But Cannot Be Compiled\"" echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: GL/gl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: GL/gl.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## --------------------------------- ## -## Report this to the dosbox lists. ## -## --------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for GL/gl.h" >&5 -echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for GL/gl.h" >&5 +echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6; } if test "${ac_cv_header_GL_gl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_GL_gl_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 -echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 +echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6; } fi if test $ac_cv_header_GL_gl_h = yes; then @@ -9122,43 +11176,44 @@ else fi -echo "$as_me:$LINENO: checking whether opengl display output will be enabled" >&5 -echo $ECHO_N "checking whether opengl display output will be enabled... $ECHO_C" >&6 -if test x$enable_opengl = xyes -a x$have_gl_h = xyes -a x$have_gl_lib = xyes ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - LIBS="$LIBS -lGL" - cat >>confdefs.h <<\_ACEOF + if test x$have_gl_h = xyes -a x$have_gl_lib = xyes ; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + LIBS="$LIBS -lGL" + cat >>confdefs.h <<\_ACEOF #define C_OPENGL 1 _ACEOF -elif test x$enable_opengl = xyes -a x$have_gl_h = xyes -a x$have_opengl32_lib = xyes ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - LIBS="$LIBS -lopengl32" - cat >>confdefs.h <<\_ACEOF + elif test x$have_gl_h = xyes -a x$have_opengl32_lib = xyes ; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + LIBS="$LIBS -lopengl32" + cat >>confdefs.h <<\_ACEOF #define C_OPENGL 1 _ACEOF -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi + ;; +esac fi -if test "${ac_cv_header_SDL_SDL_sound_h+set}" = set; then - echo "$as_me:$LINENO: checking for SDL/SDL_sound.h" >&5 -echo $ECHO_N "checking for SDL/SDL_sound.h... $ECHO_C" >&6 -if test "${ac_cv_header_SDL_SDL_sound_h+set}" = set; then +if test "${ac_cv_header_SDL_sound_h+set}" = set; then + { echo "$as_me:$LINENO: checking for SDL_sound.h" >&5 +echo $ECHO_N "checking for SDL_sound.h... $ECHO_C" >&6; } +if test "${ac_cv_header_SDL_sound_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_SDL_SDL_sound_h" >&5 -echo "${ECHO_T}$ac_cv_header_SDL_SDL_sound_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_SDL_sound_h" >&5 +echo "${ECHO_T}$ac_cv_header_SDL_sound_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking SDL/SDL_sound.h usability" >&5 -echo $ECHO_N "checking SDL/SDL_sound.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking SDL_sound.h usability" >&5 +echo $ECHO_N "checking SDL_sound.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9166,26 +11221,39 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9194,25 +11262,31 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking SDL/SDL_sound.h presence" >&5 -echo $ECHO_N "checking SDL/SDL_sound.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking SDL_sound.h presence" >&5 +echo $ECHO_N "checking SDL_sound.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -9236,60 +11310,54 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: SDL/SDL_sound.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: SDL/SDL_sound.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: SDL/SDL_sound.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: SDL/SDL_sound.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: SDL_sound.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: SDL_sound.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: SDL_sound.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: SDL_sound.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: SDL/SDL_sound.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: SDL/SDL_sound.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: SDL/SDL_sound.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: SDL/SDL_sound.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: SDL/SDL_sound.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: SDL/SDL_sound.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: SDL/SDL_sound.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: SDL/SDL_sound.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: SDL/SDL_sound.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: SDL/SDL_sound.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: SDL/SDL_sound.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: SDL/SDL_sound.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## --------------------------------- ## -## Report this to the dosbox lists. ## -## --------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: SDL_sound.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: SDL_sound.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: SDL_sound.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: SDL_sound.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: SDL_sound.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: SDL_sound.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: SDL_sound.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: SDL_sound.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: SDL_sound.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: SDL_sound.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: SDL_sound.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: SDL_sound.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for SDL/SDL_sound.h" >&5 -echo $ECHO_N "checking for SDL/SDL_sound.h... $ECHO_C" >&6 -if test "${ac_cv_header_SDL_SDL_sound_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for SDL_sound.h" >&5 +echo $ECHO_N "checking for SDL_sound.h... $ECHO_C" >&6; } +if test "${ac_cv_header_SDL_sound_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_SDL_SDL_sound_h=$ac_header_preproc + ac_cv_header_SDL_sound_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_SDL_SDL_sound_h" >&5 -echo "${ECHO_T}$ac_cv_header_SDL_SDL_sound_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_SDL_sound_h" >&5 +echo "${ECHO_T}$ac_cv_header_SDL_sound_h" >&6; } fi -if test $ac_cv_header_SDL_SDL_sound_h = yes; then +if test $ac_cv_header_SDL_sound_h = yes; then have_SDL_sound_h=yes fi -echo "$as_me:$LINENO: checking for Sound_Init in -lSDL_sound" >&5 -echo $ECHO_N "checking for Sound_Init in -lSDL_sound... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for Sound_Init in -lSDL_sound" >&5 +echo $ECHO_N "checking for Sound_Init in -lSDL_sound... $ECHO_C" >&6; } if test "${ac_cv_lib_SDL_sound_Sound_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9302,39 +11370,52 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char Sound_Init (); int main () { -Sound_Init (); +return Sound_Init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9343,20 +11424,21 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_SDL_sound_Sound_Init=no + ac_cv_lib_SDL_sound_Sound_Init=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_sound_Sound_Init" >&5 -echo "${ECHO_T}$ac_cv_lib_SDL_sound_Sound_Init" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_sound_Sound_Init" >&5 +echo "${ECHO_T}$ac_cv_lib_SDL_sound_Sound_Init" >&6; } if test $ac_cv_lib_SDL_sound_Sound_Init = yes; then have_SDL_sound_init=yes fi -echo "$as_me:$LINENO: checking for Sound_Seek in -lSDL_sound" >&5 -echo $ECHO_N "checking for Sound_Seek in -lSDL_sound... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for Sound_Seek in -lSDL_sound" >&5 +echo $ECHO_N "checking for Sound_Seek in -lSDL_sound... $ECHO_C" >&6; } if test "${ac_cv_lib_SDL_sound_Sound_Seek+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9369,39 +11451,52 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char Sound_Seek (); int main () { -Sound_Seek (); +return Sound_Seek (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9410,14 +11505,15 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_SDL_sound_Sound_Seek=no + ac_cv_lib_SDL_sound_Sound_Seek=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_sound_Sound_Seek" >&5 -echo "${ECHO_T}$ac_cv_lib_SDL_sound_Sound_Seek" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_sound_Sound_Seek" >&5 +echo "${ECHO_T}$ac_cv_lib_SDL_sound_Sound_Seek" >&6; } if test $ac_cv_lib_SDL_sound_Sound_Seek = yes; then have_SDL_sound_seek=yes fi @@ -9441,17 +11537,17 @@ fi if test "${ac_cv_header_sys_mman_h+set}" = set; then - echo "$as_me:$LINENO: checking for sys/mman.h" >&5 -echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for sys/mman.h" >&5 +echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mman_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking sys/mman.h usability" >&5 -echo $ECHO_N "checking sys/mman.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking sys/mman.h usability" >&5 +echo $ECHO_N "checking sys/mman.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9462,23 +11558,36 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9487,15 +11596,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking sys/mman.h presence" >&5 -echo $ECHO_N "checking sys/mman.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking sys/mman.h presence" >&5 +echo $ECHO_N "checking sys/mman.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9504,8 +11614,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -9529,9 +11644,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -9555,31 +11671,24 @@ echo "$as_me: WARNING: sys/mman.h: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/mman.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## --------------------------------- ## -## Report this to the dosbox lists. ## -## --------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for sys/mman.h" >&5 -echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for sys/mman.h" >&5 +echo $ECHO_N "checking for sys/mman.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mman_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_mman_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mman_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_mman_h" >&6; } fi if test $ac_cv_header_sys_mman_h = yes; then -echo "$as_me:$LINENO: checking for mprotect" >&5 -echo $ECHO_N "checking for mprotect... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for mprotect" >&5 +echo $ECHO_N "checking for mprotect... $ECHO_C" >&6; } if test "${ac_cv_func_mprotect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9606,52 +11715,59 @@ cat >>conftest.$ac_ext <<_ACEOF #undef mprotect -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char mprotect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_mprotect) || defined (__stub___mprotect) +#if defined __stub_mprotect || defined __stub___mprotect choke me -#else -char (*f) () = mprotect; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != mprotect; +return mprotect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9660,13 +11776,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_mprotect=no + ac_cv_func_mprotect=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_mprotect" >&5 -echo "${ECHO_T}$ac_cv_func_mprotect" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_mprotect" >&5 +echo "${ECHO_T}$ac_cv_func_mprotect" >&6; } if test $ac_cv_func_mprotect = yes; then cat >>confdefs.h <<\_ACEOF #define C_HAVE_MPROTECT 1 @@ -9681,8 +11798,8 @@ fi -echo "$as_me:$LINENO: checking for setpriority support" >&5 -echo $ECHO_N "checking for setpriority support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for setpriority support" >&5 +echo $ECHO_N "checking for setpriority support... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF #include @@ -9692,28 +11809,41 @@ int main(int argc,char * argv) { _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6;cat >>confdefs.h <<\_ACEOF + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; };cat >>confdefs.h <<\_ACEOF #define C_SET_PRIORITY 1 _ACEOF @@ -9721,10 +11851,11 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext @@ -9735,18 +11866,19 @@ case "$target" in for ac_header in ddraw.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9757,23 +11889,36 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -9782,15 +11927,16 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9799,8 +11945,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -9824,9 +11975,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -9850,25 +12002,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## --------------------------------- ## -## Report this to the dosbox lists. ## -## --------------------------------- ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -9885,6 +12031,9 @@ cat >>confdefs.h <<\_ACEOF #define C_DIRECTSERIAL 1 _ACEOF + if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then + LIBS="$LIBS -lws2_32" + fi ;; *-*-darwin*) @@ -9900,6 +12049,11 @@ cat >>confdefs.h <<\_ACEOF #define LINUX 1 _ACEOF + +cat >>confdefs.h <<\_ACEOF +#define C_DIRECTSERIAL 1 +_ACEOF + ;; *-*-os2-emx*) @@ -9920,8 +12074,8 @@ case "$target" in if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_WINDRES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9934,32 +12088,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_WINDRES="${ac_tool_prefix}windres" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi WINDRES=$ac_cv_prog_WINDRES if test -n "$WINDRES"; then - echo "$as_me:$LINENO: result: $WINDRES" >&5 -echo "${ECHO_T}$WINDRES" >&6 + { echo "$as_me:$LINENO: result: $WINDRES" >&5 +echo "${ECHO_T}$WINDRES" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_WINDRES"; then ac_ct_WINDRES=$WINDRES # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -9972,27 +12128,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_WINDRES="windres" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_WINDRES" && ac_cv_prog_ac_ct_WINDRES=":" fi fi ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES if test -n "$ac_ct_WINDRES"; then - echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5 -echo "${ECHO_T}$ac_ct_WINDRES" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5 +echo "${ECHO_T}$ac_ct_WINDRES" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - WINDRES=$ac_ct_WINDRES + if test "x$ac_ct_WINDRES" = x; then + WINDRES=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + WINDRES=$ac_ct_WINDRES + fi else WINDRES="$ac_cv_prog_WINDRES" fi @@ -10015,7 +12185,8 @@ fi - ac_config_files="$ac_config_files Makefile src/Makefile src/cpu/Makefile src/cpu/core_full/Makefile src/cpu/core_normal/Makefile src/cpu/core_dyn_x86/Makefile src/debug/Makefile src/dos/Makefile src/fpu/Makefile src/gui/Makefile src/hardware/Makefile src/hardware/serialport/Makefile src/ints/Makefile src/libs/Makefile src/libs/zmbv/Makefile src/misc/Makefile src/shell/Makefile src/platform/Makefile src/platform/visualc/Makefile visualc/Makefile visualc_net/Makefile include/Makefile docs/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile src/cpu/Makefile src/cpu/core_full/Makefile src/cpu/core_normal/Makefile src/cpu/core_dyn_x86/Makefile src/debug/Makefile src/dos/Makefile src/fpu/Makefile src/gui/Makefile src/hardware/Makefile src/hardware/serialport/Makefile src/ints/Makefile src/libs/Makefile src/libs/zmbv/Makefile src/misc/Makefile src/shell/Makefile src/platform/Makefile src/platform/visualc/Makefile visualc_net/Makefile include/Makefile docs/Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -10034,39 +12205,58 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -10075,32 +12265,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -10166,66 +12342,15 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -10246,126 +12371,198 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done +IFS=$as_save_IFS - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -10374,7 +12571,19 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -10383,31 +12592,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - -This file was extended by dosbox $as_me 0.65, which was -generated by GNU Autoconf 2.59. Invocation command line was +# values after options handling. +ac_log=" +This file was extended by dosbox $as_me 0.70, which was +generated by GNU Autoconf 2.60a. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -10415,30 +12607,20 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -10446,7 +12628,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -10465,19 +12647,21 @@ Configuration commands: $config_commands Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -dosbox config.status 0.65 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +dosbox config.status 0.70 +configured by $0, generated by GNU Autoconf 2.60a, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -10488,39 +12672,24 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -10530,18 +12699,24 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -10557,59 +12732,70 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "src/cpu/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/cpu/Makefile" ;; - "src/cpu/core_full/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/cpu/core_full/Makefile" ;; - "src/cpu/core_normal/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/cpu/core_normal/Makefile" ;; - "src/cpu/core_dyn_x86/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/cpu/core_dyn_x86/Makefile" ;; - "src/debug/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/debug/Makefile" ;; - "src/dos/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/dos/Makefile" ;; - "src/fpu/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/fpu/Makefile" ;; - "src/gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/gui/Makefile" ;; - "src/hardware/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/hardware/Makefile" ;; - "src/hardware/serialport/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/hardware/serialport/Makefile" ;; - "src/ints/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/ints/Makefile" ;; - "src/libs/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libs/Makefile" ;; - "src/libs/zmbv/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/libs/zmbv/Makefile" ;; - "src/misc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/misc/Makefile" ;; - "src/shell/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/shell/Makefile" ;; - "src/platform/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/platform/Makefile" ;; - "src/platform/visualc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/platform/visualc/Makefile" ;; - "visualc/Makefile" ) CONFIG_FILES="$CONFIG_FILES visualc/Makefile" ;; - "visualc_net/Makefile" ) CONFIG_FILES="$CONFIG_FILES visualc_net/Makefile" ;; - "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; - "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/cpu/Makefile") CONFIG_FILES="$CONFIG_FILES src/cpu/Makefile" ;; + "src/cpu/core_full/Makefile") CONFIG_FILES="$CONFIG_FILES src/cpu/core_full/Makefile" ;; + "src/cpu/core_normal/Makefile") CONFIG_FILES="$CONFIG_FILES src/cpu/core_normal/Makefile" ;; + "src/cpu/core_dyn_x86/Makefile") CONFIG_FILES="$CONFIG_FILES src/cpu/core_dyn_x86/Makefile" ;; + "src/debug/Makefile") CONFIG_FILES="$CONFIG_FILES src/debug/Makefile" ;; + "src/dos/Makefile") CONFIG_FILES="$CONFIG_FILES src/dos/Makefile" ;; + "src/fpu/Makefile") CONFIG_FILES="$CONFIG_FILES src/fpu/Makefile" ;; + "src/gui/Makefile") CONFIG_FILES="$CONFIG_FILES src/gui/Makefile" ;; + "src/hardware/Makefile") CONFIG_FILES="$CONFIG_FILES src/hardware/Makefile" ;; + "src/hardware/serialport/Makefile") CONFIG_FILES="$CONFIG_FILES src/hardware/serialport/Makefile" ;; + "src/ints/Makefile") CONFIG_FILES="$CONFIG_FILES src/ints/Makefile" ;; + "src/libs/Makefile") CONFIG_FILES="$CONFIG_FILES src/libs/Makefile" ;; + "src/libs/zmbv/Makefile") CONFIG_FILES="$CONFIG_FILES src/libs/zmbv/Makefile" ;; + "src/misc/Makefile") CONFIG_FILES="$CONFIG_FILES src/misc/Makefile" ;; + "src/shell/Makefile") CONFIG_FILES="$CONFIG_FILES src/shell/Makefile" ;; + "src/platform/Makefile") CONFIG_FILES="$CONFIG_FILES src/platform/Makefile" ;; + "src/platform/visualc/Makefile") CONFIG_FILES="$CONFIG_FILES src/platform/visualc/Makefile" ;; + "visualc_net/Makefile") CONFIG_FILES="$CONFIG_FILES visualc_net/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -10621,356 +12807,458 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@CYGPATH_W@,$CYGPATH_W,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@install_sh@,$install_sh,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -s,@mkdir_p@,$mkdir_p,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@am__leading_dot@,$am__leading_dot,;t t -s,@AMTAR@,$AMTAR,;t t -s,@am__tar@,$am__tar,;t t -s,@am__untar@,$am__untar,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@DEPDIR@,$DEPDIR,;t t -s,@am__include@,$am__include,;t t -s,@am__quote@,$am__quote,;t t -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t -s,@CPP@,$CPP,;t t -s,@CXX@,$CXX,;t t -s,@CXXFLAGS@,$CXXFLAGS,;t t -s,@ac_ct_CXX@,$ac_ct_CXX,;t t -s,@CXXDEPMODE@,$CXXDEPMODE,;t t -s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t -s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@SDL_CONFIG@,$SDL_CONFIG,;t t -s,@SDL_CFLAGS@,$SDL_CFLAGS,;t t -s,@SDL_LIBS@,$SDL_LIBS,;t t -s,@EGREP@,$EGREP,;t t -s,@ALSA_CFLAGS@,$ALSA_CFLAGS,;t t -s,@ALSA_LIBS@,$ALSA_LIBS,;t t -s,@WINDRES@,$WINDRES,;t t -s,@ac_ct_WINDRES@,$ac_ct_WINDRES,;t t -s,@HAVE_WINDRES_TRUE@,$HAVE_WINDRES_TRUE,;t t -s,@HAVE_WINDRES_FALSE@,$HAVE_WINDRES_FALSE,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +AMTAR!$AMTAR$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +CPP!$CPP$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +CXXDEPMODE!$CXXDEPMODE$ac_delim +am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim +am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim +RANLIB!$RANLIB$ac_delim +SDL_CONFIG!$SDL_CONFIG$ac_delim +SDL_CFLAGS!$SDL_CFLAGS$ac_delim +SDL_LIBS!$SDL_LIBS$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ALSA_CFLAGS!$ALSA_CFLAGS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +ALSA_LIBS!$ALSA_LIBS$ac_delim +WINDRES!$WINDRES$ac_delim +HAVE_WINDRES_TRUE!$HAVE_WINDRES_TRUE$ac_delim +HAVE_WINDRES_FALSE!$HAVE_WINDRES_FALSE$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi _ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -10978,248 +13266,130 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac - - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - + ;; + :H) + # + # CONFIG_HEADER + # _ACEOF -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' -# This sed command replaces #undef with comments. This is necessary, for +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do @@ -11230,135 +13400,39 @@ for _am_header in $config_headers :; do _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ - X$ac_file : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'`/stamp-h$_am_stamp_count -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. @@ -11368,86 +13442,129 @@ echo "$as_me: executing $ac_dest commands" >&6;} # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` else continue fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue - fdir=`(dirname "$file") 2>/dev/null || + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p $dirpart/$fdir - else - as_dir=$dirpart/$fdir + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; - esac -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + esac +done # for ac_tag + { (exit 0); exit 0; } _ACEOF diff --git a/configure.in b/configure.in index 00cc1f8..c2fd357 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Init. -AC_INIT(dosbox,0.65) +AC_INIT(dosbox,0.70) AC_PREREQ(2.50) AC_CONFIG_SRCDIR(README) @@ -51,31 +51,47 @@ AC_CHECK_SIZEOF(unsigned long long) AC_CHECK_SIZEOF(int *) AC_MSG_CHECKING(if environ can be included) -AC_TRY_LINK([#include -#include ],[*environ;], +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#include +#include ]],[[*environ;]])], [AC_MSG_RESULT(yes);AC_DEFINE(ENVIRON_INCLUDED,1,[environ can be included])],AC_MSG_RESULT(no)) + AC_MSG_CHECKING(if environ can be linked) -AC_TRY_LINK([extern char ** environ;],[*environ;], +AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern char ** environ;]],[[*environ;]])], [AC_MSG_RESULT(yes);AC_DEFINE(ENVIRON_LINKED,1,[environ can be linked])],AC_MSG_RESULT(no)) +dnl Check for powf +if test x$target = xi386-pc-os2-emx ; then + AC_MSG_CHECKING(for powf in libm); + LIBS_BACKUP=$LIBS; + LIBS="$LIBS -lm"; + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],[[ + powf(1.0f, 1.0f); + ]])], [AC_MSG_RESULT(yes)], [AC_DEFINE([DB_HAVE_NO_POWF],[1],[libm doesn't include powf])]) + LIBS=$LIBS_BACKUP +else +AC_CHECK_LIB([m],[powf],,[AC_DEFINE([DB_HAVE_NO_POWF],[1],[libm doesn't include powf])]) +fi + dnl Checks for libraries. #Check if the compiler support attributes AH_TEMPLATE([C_HAS_ATTRIBUTE],[Determines if the compilers supports attributes for structures.]) AC_MSG_CHECKING(if compiler allows __attribute__) -AC_TRY_COMPILE([], [typedef struct { } __attribute__ ((packed)) junk;], - [ AC_MSG_RESULT(yes);AC_DEFINE(C_HAS_ATTRIBUTE)],AC_MSG_RESULT(no)) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +typedef struct { } __attribute__((packed)) junk;]], +[[ ]])],[ AC_MSG_RESULT(yes);AC_DEFINE(C_HAS_ATTRIBUTE)],AC_MSG_RESULT(no)) #Check if the compiler supports __builtin_expect +#Switch language to c++ +AC_LANG_PUSH(C++) AH_TEMPLATE([C_HAS_BUILTIN_EXPECT],[Determines if the compilers supports __builtin_expect for branch prediction.]) AC_MSG_CHECKING(if compiler allows __builtin_expect) -AC_TRY_COMPILE([],[ -int main(int argc,char* argv[]){ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[ int x=10;if( __builtin_expect ((x==1),0) ) ; -return 0; -} -], [ AC_MSG_RESULT(yes);AC_DEFINE(C_HAS_BUILTIN_EXPECT)],AC_MSG_RESULT(no)) - +]])], [ AC_MSG_RESULT(yes);AC_DEFINE(C_HAS_BUILTIN_EXPECT)],AC_MSG_RESULT(no)) +#switch language back +AC_LANG_POP(C++) AM_PATH_ALSA(0.9.0, AC_DEFINE(HAVE_ALSA,1,[Define to 1 to use ALSA for MIDI]) , : ) @@ -217,18 +233,15 @@ if test x$target = xi386-pc-os2-emx ; then AC_MSG_CHECKING(for SDLNet_Init in SDL_net); LIBS_BACKUP=$LIBS; LIBS="$LIBS -lSDL_Net"; - AC_LINK_IFELSE([ - #include - int main(int argc,char * argv[]) { - return SDLNet_Init (); - }; - ], [AC_MSG_RESULT(yes); have_sdl_net_lib=yes], AC_MSG_RESULT(no)) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],[[ + SDLNet_Init (); + ]])], [AC_MSG_RESULT(yes); have_sdl_net_lib=yes], AC_MSG_RESULT(no)) LIBS=$LIBS_BACKUP else AC_CHECK_LIB(SDL_net, SDLNet_Init, have_sdl_net_lib=yes, , ) fi if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then - LIBS="$LIBS -lSDL_net" + LIBS="$LIBS -lSDL_net" AC_DEFINE(C_MODEM,1) AC_DEFINE(C_IPX,1) else @@ -237,24 +250,35 @@ fi AH_TEMPLATE(C_OPENGL,[Define to 1 to use opengl display output support]) AC_ARG_ENABLE(opengl,AC_HELP_STRING([--disable-opengl],[Disable opengl support]),,enable_opengl=yes) -AC_CHECK_LIB(GL, main, have_gl_lib=yes, have_gl_lib=no , ) -AC_CHECK_LIB(opengl32, main, have_opengl32_lib=yes,have_opengl32_lib=no , ) -AC_CHECK_HEADER(GL/gl.h, have_gl_h=yes , have_gl_h=no , ) AC_MSG_CHECKING(whether opengl display output will be enabled) -if test x$enable_opengl = xyes -a x$have_gl_h = xyes -a x$have_gl_lib = xyes ; then - AC_MSG_RESULT(yes) - LIBS="$LIBS -lGL" - AC_DEFINE(C_OPENGL,1) -elif test x$enable_opengl = xyes -a x$have_gl_h = xyes -a x$have_opengl32_lib = xyes ; then - AC_MSG_RESULT(yes) - LIBS="$LIBS -lopengl32" - AC_DEFINE(C_OPENGL,1) -else - AC_MSG_RESULT(no) +if test x$enable_opengl = xyes; then +case "$target" in + *-*-darwin*) + AC_MSG_RESULT(yes) + LIBS="$LIBS -framework OpenGL" + AC_DEFINE(C_OPENGL,1) + ;; + *) + AC_CHECK_LIB(GL, main, have_gl_lib=yes, have_gl_lib=no , ) + AC_CHECK_LIB(opengl32, main, have_opengl32_lib=yes,have_opengl32_lib=no , ) + AC_CHECK_HEADER(GL/gl.h, have_gl_h=yes , have_gl_h=no , ) + if test x$have_gl_h = xyes -a x$have_gl_lib = xyes ; then + AC_MSG_RESULT(yes) + LIBS="$LIBS -lGL" + AC_DEFINE(C_OPENGL,1) + elif test x$have_gl_h = xyes -a x$have_opengl32_lib = xyes ; then + AC_MSG_RESULT(yes) + LIBS="$LIBS -lopengl32" + AC_DEFINE(C_OPENGL,1) + else + AC_MSG_RESULT(no) + fi + ;; +esac fi AH_TEMPLATE(C_SDL_SOUND,[Define to 1 to enable SDL_sound support]) -AC_CHECK_HEADER(SDL/SDL_sound.h,have_SDL_sound_h=yes,) +AC_CHECK_HEADER(SDL_sound.h,have_SDL_sound_h=yes,) AC_CHECK_LIB(SDL_sound, Sound_Init, have_SDL_sound_init=yes,,) AC_CHECK_LIB(SDL_sound, Sound_Seek, have_SDL_sound_seek=yes,,) if test x$have_SDL_sound_h = xyes -a x$have_SDL_sound_init = xyes ; then @@ -290,7 +314,10 @@ case "$target" in *-*-cygwin* | *-*-mingw32*) LIBS="$LIBS -lwinmm" AC_CHECK_HEADERS(ddraw.h) - AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32 and OS/2 only).]) + AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32, Posix and OS/2 only).]) + if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then + LIBS="$LIBS -lws2_32" + fi ;; *-*-darwin*) dnl We have a problem here: both MacOS X and Darwin report @@ -302,10 +329,11 @@ case "$target" in ;; *-*-linux-gnu*) AC_DEFINE(LINUX, 1, [Compiling on GNU/Linux]) + AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32, Posix and OS/2).]) ;; *-*-os2-emx*) AC_DEFINE(OS2, 1, [Compiling on OS/2 EMX]) - AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32 and OS/2 only).]) + AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32, Posix and OS/2).]) ;; esac @@ -323,7 +351,7 @@ esac AC_SUBST(WINDRES) -AC_OUTPUT([ +AC_CONFIG_FILES([ Makefile src/Makefile src/cpu/Makefile @@ -343,8 +371,8 @@ src/misc/Makefile src/shell/Makefile src/platform/Makefile src/platform/visualc/Makefile -visualc/Makefile visualc_net/Makefile include/Makefile docs/Makefile ]) +AC_OUTPUT diff --git a/depcomp b/depcomp index 11e2d3b..edb5d38 100644 --- a/depcomp +++ b/depcomp @@ -1,9 +1,7 @@ #! /bin/sh + # depcomp - compile a program generating dependencies as side-effects - -scriptversion=2004-05-31.23 - -# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. +# Copyright 1999, 2000, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,45 +25,22 @@ scriptversion=2004-05-31.23 # Originally written by Alexandre Oliva . -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit 0 - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit 0 - ;; -esac - if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi +# `libtool' can also be set to `yes' or `no'. + +if test -z "$depfile"; then + base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` + dir=`echo "$object" | sed 's,/.*$,/,'` + if test "$dir" = "$object"; then + dir= + fi + # FIXME: should be _deps on DOS. + depfile="$dir.deps/$base" +fi -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" @@ -287,35 +262,26 @@ tru64) base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then - # Dependencies are output in .lo.d with libtool 1.4. - # With libtool 1.5 they are output both in $dir.libs/$base.o.d - # and in $dir.libs/$base.o.d and $dir$base.o.d. We process the - # latter, because the former will be cleaned when $dir.libs is - # erased. tmpdepfile1="$dir.libs/$base.lo.d" - tmpdepfile2="$dir$base.o.d" - tmpdepfile3="$dir.libs/$base.d" + tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" - tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" - elif test -f "$tmpdepfile2"; then - tmpdepfile="$tmpdepfile2" else - tmpdepfile="$tmpdepfile3" + tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" @@ -511,12 +477,3 @@ none) esac exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/docs/Makefile.in b/docs/Makefile.in index 039924c..23deb41 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +15,7 @@ @SET_MAKE@ # Main Makefile for DOSBox + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -22,6 +23,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -35,26 +37,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = docs -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -man1dir = $(mandir)/man1 -am__installdirs = "$(DESTDIR)$(man1dir)" -NROFF = nroff -MANS = $(man_MANS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -81,6 +64,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -111,9 +95,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -121,8 +102,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -130,23 +109,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -155,44 +140,33 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ + man_MANS = dosbox.1 EXTRA_DIST = $(man_MANS) README.video +subdir = docs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +NROFF = nroff +MANS = $(man_MANS) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits docs/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits docs/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu docs/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: + +man1dir = $(mandir)/man1 install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" + $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ @@ -211,8 +185,8 @@ install-man1: $(man1_MANS) $(man_MANS) inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @@ -232,8 +206,8 @@ uninstall-man1: inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ - rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ done tags: TAGS TAGS: @@ -241,6 +215,10 @@ TAGS: ctags: CTAGS CTAGS: +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -254,7 +232,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -272,10 +250,9 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(MANS) + installdirs: - for dir in "$(DESTDIR)$(man1dir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done + $(mkinstalldirs) $(DESTDIR)$(man1dir) install: install-am install-exec: install-exec-am install-data: install-data-am @@ -295,7 +272,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -312,8 +289,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -349,8 +324,8 @@ uninstall-am: uninstall-info-am uninstall-man uninstall-man: uninstall-man1 .PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-man1 install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ diff --git a/docs/README.video b/docs/README.video index a79f802..1d15b4f 100644 --- a/docs/README.video +++ b/docs/README.video @@ -30,3 +30,6 @@ A: 1. Start DOSBox like this: dosbox -startmapper 4. Click exit. 5. You can make movies by pressing scroll lock or whichever key you selected. + +Q: The colours are wrong and I'm using 64 bit windows +A: Look here: http://vogons.zetafleet.com/viewtopic.php?t=12133 diff --git a/docs/dosbox.1 b/docs/dosbox.1 index f5c3065..8751a59 100644 --- a/docs/dosbox.1 +++ b/docs/dosbox.1 @@ -49,7 +49,8 @@ an Internal Program, a DOS command or an executable on a mounted drive. .BI \-conf " configfile .RB "Start " dosbox " with the options specified in " .IR configfile ". This file has a section in which you can put commands you " -wish to execute on startup. +wish to execute on startup. Multiple +.IR configfiles " can be present at the commandline." .TP .BI \-lang " langfile .RB "Start " dosbox " with the language specified in " @@ -158,7 +159,7 @@ the emulated soundcards and many .LP The language file controls all visible ouput of the internal commands and the internal dos. -.RB "See the secion " FILES " for more information." +.RB "See the section " FILES " for more information." .TP .B LOADFIX [\-size] [programname] [parameters] .LP @@ -211,9 +212,12 @@ Boot will start floppy images or hard disk images independent of the .RB "Read the " README " of " dosbox " for the full and correct syntax." .RE .SH FILES -Configuration and language files use a format similar to Windows .ini files. If a file named -.BR dosbox.conf " is found in the current directory, it will be" -automatically loaded, else ~/.dosboxrc (if present) will be loaded. +Configuration and language files use a format similar to Windows .ini files. +First ~/.dosboxrc (if present) will be loaded. If no +configfile is specified at the commandline, a file named +.BR dosbox.conf " (if present in the current directory) will be" +loaded automatically afterwards. If a configfile is specified at the commandline +that one will be used instead. .SH "SPECIAL KEYS" .TP 12m .IP ALT\-ENTER @@ -295,7 +299,7 @@ games (or earlier). Also note that "protected mode" games need substantially mor .RB "require a much faster processor for you to run it properly in " dosbox . .SH BUGS Not all DOS programs work properly. -.BR dosbox " will exit without warning if an error occured." +.BR dosbox " will exit without warning if an error occurred." .SH "SEE ALSO" The README in /usr/share/doc/dosbox .SH AUTHOR diff --git a/include/Makefile.in b/include/Makefile.in index e3dbcde..3011b5a 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -34,26 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = include -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -80,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -110,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -120,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -129,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -191,40 +175,33 @@ timer.h \ vga.h \ video.h +subdir = include +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in Makefile.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits include/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits include/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu include/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -233,7 +210,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -245,11 +221,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -272,6 +247,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -285,7 +264,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -303,6 +282,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(HEADERS) + installdirs: install: install-am install-exec: install-exec-am @@ -323,7 +303,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -340,8 +320,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -374,14 +352,14 @@ ps-am: uninstall-am: uninstall-info-am -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - ctags distclean distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic ctags \ + distclean distclean-generic distclean-tags distdir dvi dvi-am \ + info info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/include/bios.h b/include/bios.h index d222ef2..66b09ba 100644 --- a/include/bios.h +++ b/include/bios.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,9 +101,14 @@ #define BIOS_VIDEO_SAVEPTR 0x4a8 +/* maximum of scancodes handled by keyboard bios routines */ +#define MAX_SCAN_CODE 0x58 + /* The Section handling Bios Disk Access */ #define BIOS_MAX_DISK 10 +#define MAX_SWAPPABLE_DISKS 20 + struct diskGeo { Bit32u ksize; /* Size in kilobytes */ Bit16u secttrack; /* Sectors per track */ @@ -159,6 +164,7 @@ extern DOS_DTA *imgDTA; void swapInDisks(void); void swapInNextDisk(void); +bool getSwapRequest(void); void BIOS_ZeroExtendedSize(bool in); void char_out(Bit8u chr,Bit32u att,Bit8u page); @@ -169,4 +175,10 @@ void INT2F_StartUp(void); void INT33_StartUp(void); void INT13_StartUp(void); +bool BIOS_AddKeyToBuffer(Bit16u code); + +void INT10_ReloadRomFonts(); + +void BIOS_SetComPorts (Bit16u baseaddr[]); + #endif diff --git a/include/callback.h b/include/callback.h index 345e7ea..ccea2b1 100644 --- a/include/callback.h +++ b/include/callback.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: callback.h,v 1.16 2006/02/09 11:47:47 qbix79 Exp $ */ +/* $Id: callback.h,v 1.19 2007/01/08 19:45:37 qbix79 Exp $ */ #ifndef DOSBOX_CALLBACK_H #define DOSBOX_CALLBACK_H @@ -28,19 +28,29 @@ typedef Bitu (*CallBack_Handler)(void); extern CallBack_Handler CallBack_Handlers[]; -enum { CB_RETN, CB_RETF,CB_IRET,CB_IRET_STI }; +enum { CB_RETN,CB_RETF,CB_IRET,CB_IRETD,CB_IRET_STI,CB_IRET_EOI_PIC1, + CB_IRQ0,CB_IRQ1,CB_IRQ9,CB_IRQ12,CB_IRQ12_RET,CB_IRQ6_PCJR, + CB_INT29,CB_INT16,CB_HOOKABLE,CB_TDE_IRET,CB_IPXESR,CB_IPXESR_RET }; -#define CB_MAX 144 -#define CB_SEG 0xC800 -#define CB_BASE (CB_SEG << 4) +#define CB_MAX 128 +#define CB_SIZE 32 +#define CB_SEG 0xF100 enum { CBRET_NONE=0,CBRET_STOP=1 }; extern Bit8u lastint; + INLINE RealPt CALLBACK_RealPointer(Bitu callback) { - return RealMake(CB_SEG,callback << 4); + return RealMake(CB_SEG,callback*CB_SIZE); +} +INLINE PhysPt CALLBACK_PhysPointer(Bitu callback) { + return PhysMake(CB_SEG,callback*CB_SIZE); +} + +INLINE PhysPt CALLBACK_GetBase(void) { + return CB_SEG << 4; } Bitu CALLBACK_Allocate(); @@ -51,9 +61,8 @@ void CALLBACK_Idle(void); void CALLBACK_RunRealInt(Bit8u intnum); void CALLBACK_RunRealFar(Bit16u seg,Bit16u off); -bool CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,const char* description=0); -/* Returns with the size of the extra callback */ -Bitu CALLBACK_SetupExtra(Bitu callback, Bitu type, PhysPt physAddress); +bool CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,const char* descr); +Bitu CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,PhysPt addr,const char* descr); const char* CALLBACK_GetDescription(Bitu callback); bool CALLBACK_Free(Bitu callback); @@ -78,11 +87,12 @@ public: CALLBACK_HandlerObject():installed(false),m_type(NONE){vectorhandler.installed=false;} ~CALLBACK_HandlerObject(); //Install and allocate a callback. - void Install(CallBack_Handler handler,Bitu type,const char* description=0); + void Install(CallBack_Handler handler,Bitu type,const char* description); + void Install(CallBack_Handler handler,Bitu type,PhysPt addr,const char* description); //Only allocate a callback number void Allocate(CallBack_Handler handler,const char* description=0); Bit16u Get_callback(){return m_callback;} - RealPt Get_RealPointer(){ return RealMake(CB_SEG,m_callback << 4);} + RealPt Get_RealPointer(){ return CALLBACK_RealPointer(m_callback);} void Set_RealVec(Bit8u vec); }; #endif diff --git a/include/cpu.h b/include/cpu.h index 9e755a1..16e0d4c 100644 --- a/include/cpu.h +++ b/include/cpu.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,11 +29,23 @@ #include "mem.h" #endif +#define CPU_AUTODETERMINE_NONE 0x00 +#define CPU_AUTODETERMINE_CORE 0x01 +#define CPU_AUTODETERMINE_CYCLES 0x02 + +#define CPU_AUTODETERMINE_SHIFT 0x02 +#define CPU_AUTODETERMINE_MASK 0x03 + /* CPU Cycle Timing */ -extern Bits CPU_Cycles; -extern Bits CPU_CycleLeft; -extern Bits CPU_CycleMax; -extern bool CPU_CycleAuto; +extern Bit32s CPU_Cycles; +extern Bit32s CPU_CycleLeft; +extern Bit32s CPU_CycleMax; +extern Bit32s CPU_OldCycleMax; +extern Bit32s CPU_CyclePercUsed; +extern Bit32s CPU_CycleLimit; +extern Bit64s CPU_IODelayRemoved; +extern bool CPU_CycleAutoAdjust; +extern Bitu CPU_AutoDetermineMode; /* Some common Defines */ /* A CPU Handler */ @@ -45,6 +57,7 @@ Bits CPU_Core_Normal_Trap_Run(void); Bits CPU_Core_Simple_Run(void); Bits CPU_Core_Full_Run(void); Bits CPU_Core_Dyn_X86_Run(void); +Bits CPU_Core_Dyn_X86_Trap_Run(void); //CPU Stuff @@ -72,6 +85,9 @@ bool CPU_READ_CRX(Bitu cr,Bit32u & retvalue); bool CPU_WRITE_DRX(Bitu dr,Bitu value); bool CPU_READ_DRX(Bitu dr,Bit32u & retvalue); +bool CPU_WRITE_TRX(Bitu dr,Bitu value); +bool CPU_READ_TRX(Bitu dr,Bit32u & retvalue); + void CPU_SMSW(Bitu & word); Bitu CPU_LMSW(Bitu word); @@ -418,7 +434,7 @@ struct CPUBlock { GDTDescriptorTable gdt; DescriptorTable idt; struct { - Bitu mask; + Bitu mask,notmask; bool big; } stack; struct { @@ -432,7 +448,9 @@ struct CPUBlock { Bitu which,error; } exception; Bits direction; + bool trap_skip; Bit32u drx[8]; + Bit32u trx[8]; }; extern CPUBlock cpu; diff --git a/include/cross.h b/include/cross.h index 3d6e1ca..f57681d 100644 --- a/include/cross.h +++ b/include/cross.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,11 +16,15 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cross.h,v 1.16 2006/02/09 11:47:47 qbix79 Exp $ */ +/* $Id: cross.h,v 1.18 2007/01/08 19:45:37 qbix79 Exp $ */ #ifndef DOSBOX_CROSS_H #define DOSBOX_CROSS_H +#ifndef DOSBOX_DOSBOX_H +#include "dosbox.h" +#endif + #include #include #include @@ -56,4 +60,10 @@ #define ftruncate(blah,blah2) chsize(blah,blah2) #endif +//Solaris maybe others +#if defined (DB_HAVE_NO_POWF) +#include +static inline float powf (float x, float y) { return (float) pow (x,y); } +#endif + #endif diff --git a/include/debug.h b/include/debug.h index ce8a002..88cc254 100644 --- a/include/debug.h +++ b/include/debug.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/dma.h b/include/dma.h index a366895..42b183d 100644 --- a/include/dma.h +++ b/include/dma.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dma.h,v 1.16 2006/02/09 11:47:47 qbix79 Exp $ */ +/* $Id: dma.h,v 1.17 2007/01/08 19:45:37 qbix79 Exp $ */ #ifndef DOSBOX_DMA_H #define DOSBOX_DMA_H diff --git a/include/dos_inc.h b/include/dos_inc.h index 5bac4c5..8c6e179 100644 --- a/include/dos_inc.h +++ b/include/dos_inc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_inc.h,v 1.59 2006/02/09 11:47:47 qbix79 Exp $ */ +/* $Id: dos_inc.h,v 1.65 2007/01/08 20:36:53 qbix79 Exp $ */ #ifndef DOSBOX_DOS_INC_H #define DOSBOX_DOS_INC_H @@ -158,7 +158,7 @@ void DOS_FreeProcessMemory(Bit16u pspseg); Bit16u DOS_GetMemory(Bit16u pages); bool DOS_SetMemAllocStrategy(Bit16u strat); Bit16u DOS_GetMemAllocStrategy(void); -void DOS_BuildUMBChain(const char* use_umbs,bool ems_active); +void DOS_BuildUMBChain(bool umb_active,bool ems_active); bool DOS_LinkUMBsToMemChain(Bit16u linkstate); /* FCB stuff */ @@ -187,6 +187,20 @@ void DOS_SetupTables(void); /* Internal DOS Setup Programs */ void DOS_SetupPrograms(void); +/* Initialize Keyboard Layout */ +void DOS_KeyboardLayout_Init(Section* sec); + +bool DOS_LayoutKey(Bitu key, Bit8u flags1, Bit8u flags2, Bit8u flags3); + +enum { + KEYB_NOERROR=0, + KEYB_FILENOTFOUND, + KEYB_INVALIDFILE, + KEYB_LAYOUTNOTFOUND, + KEYB_INVALIDCPFILE +}; + + INLINE Bit16u long2para(Bit32u size) { if (size>0xFFFF0) return 0xffff; if (size&0xf) return (Bit16u)((size>>4)+1); @@ -367,6 +381,7 @@ public: Bit16u GetStartOfUMBChain(void); Bit8u GetUMBChainState(void); RealPt GetPointer(void); + Bit32u GetDeviceChain(void); #ifdef _MSC_VER #pragma pack(1) @@ -438,8 +453,10 @@ public: void GetSearchParams(Bit8u & _sattr,char * _spattern); void GetResult(char * _name,Bit32u & _size,Bit16u & _date,Bit16u & _time,Bit8u & _attr); - void SetDirID(Bit16u entry) { sSave(sDTA,dirID,entry); }; + void SetDirID(Bit16u entry) { sSave(sDTA,dirID,entry); }; + void SetDirIDCluster(Bit16u entry) { sSave(sDTA,dirCluster,entry); }; Bit16u GetDirID(void) { return sGet(sDTA,dirID); }; + Bit16u GetDirIDCluster(void) { return sGet(sDTA,dirCluster); }; private: #ifdef _MSC_VER #pragma pack(1) @@ -450,7 +467,8 @@ private: Bit8u sext[3]; /* The Search pattern for the extenstion */ Bit8u sattr; /* The Attributes that need to be found */ Bit16u dirID; /* custom: dir-search ID for multiple searches at the same time */ - Bit8u fill[6]; + Bit16u dirCluster; /* custom (drive_fat only): cluster number for multiple searches at the same time */ + Bit8u fill[4]; Bit8u attr; Bit16u time; Bit16u date; @@ -598,9 +616,12 @@ struct DOS_Block { RealPt mediaid; RealPt tempdta; RealPt tempdta_fcbdelete; - RealPt dcbs; + RealPt dbcs; + RealPt filenamechar; + RealPt collatingseq; Bit8u* country;//Will be copied to dos memory. resides in real mem } tables; + Bit16u loaded_codepage; }; extern DOS_Block dos; diff --git a/include/dos_system.h b/include/dos_system.h index d17bfdb..f695e10 100644 --- a/include/dos_system.h +++ b/include/dos_system.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,12 +16,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_system.h,v 1.31 2006/02/09 11:47:47 qbix79 Exp $ */ +/* $Id: dos_system.h,v 1.39 2007/01/21 16:21:22 c2woody Exp $ */ #ifndef DOSBOX_DOS_SYSTEM_H #define DOSBOX_DOS_SYSTEM_H - #include #ifndef DOSBOX_DOSBOX_H #include "dosbox.h" @@ -29,6 +28,12 @@ #ifndef DOSBOX_CROSS_H #include "cross.h" #endif +#ifndef DOSBOX_SUPPORT_H +#include "support.h" +#endif +#ifndef DOSBOX_MEM_H +#include "mem.h" +#endif #define DOS_NAMELENGTH 12 #define DOS_NAMELENGTH_ASCII (DOS_NAMELENGTH+1) @@ -57,7 +62,7 @@ class DOS_DTA; class DOS_File { public: - DOS_File():flags(0) { name=0; refCtr = 0; }; + DOS_File():flags(0) { name=0; refCtr = 0; hdrive=0xff; }; DOS_File(const DOS_File& orig); DOS_File & operator= (const DOS_File & orig); virtual ~DOS_File(){if(name) delete [] name;}; @@ -69,10 +74,12 @@ public: virtual void SetName(const char* _name) { if (name) delete[] name; name = new char[strlen(_name)+1]; strcpy(name,_name); } virtual char* GetName(void) { return name; }; virtual bool IsOpen() { return open; }; - virtual bool IsName(const char* _name) { if (!name) return false; return strcmp(name,_name)==0; }; + virtual bool IsName(const char* _name) { if (!name) return false; return strcasecmp(name,_name)==0; }; virtual void AddRef() { refCtr++; }; virtual Bits RemoveRef() { return --refCtr; }; virtual bool UpdateDateTimeFromHost() { return true; } + void SetDrive(Bit8u drv) { hdrive=drv;} + Bit8u GetDrive(void) { return hdrive;} Bit8u type; Bit32u flags; Bit16u time; @@ -83,14 +90,20 @@ public: bool open; char* name; /* Some Device Specific Stuff */ +private: + Bit8u hdrive; }; class DOS_Device : public DOS_File { public: - DOS_Device(const DOS_Device& orig):DOS_File(orig) {devnum=orig.devnum; } + DOS_Device(const DOS_Device& orig):DOS_File(orig) { + devnum=orig.devnum; + open=true; + } DOS_Device & operator= (const DOS_Device & orig) { DOS_File::operator=(orig); devnum=orig.devnum; + open=true; return *this; } DOS_Device():DOS_File(),devnum(0){}; @@ -99,13 +112,19 @@ public: virtual bool Seek(Bit32u * pos,Bit32u type); virtual bool Close(); virtual Bit16u GetInformation(void); + virtual bool ReadFromControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode); + virtual bool WriteToControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode); void SetDeviceNumber(Bitu num) { devnum=num;} private: Bitu devnum; }; +/* The following variable can be lowered to free up some memory. + * The negative side effect: The stored searches will be turned over faster. + * Should not have impact on systems with few directory entries. */ #define MAX_OPENDIRS 2048 //Can be high as it's only storage (16 bit variable) + class DOS_Drive_Cache { public: DOS_Drive_Cache (void); @@ -192,40 +211,6 @@ private: bool updatelabel; }; -class DOS_No_Drive_Cache { -public: - DOS_No_Drive_Cache (void) {}; - DOS_No_Drive_Cache (const char* path); - ~DOS_No_Drive_Cache (void) {}; - - typedef enum TDirSort { NOSORT, ALPHABETICAL, DIRALPHABETICAL, ALPHABETICALREV, DIRALPHABETICALREV }; - - void SetBaseDir (const char* path); - void SetDirSort (TDirSort sort) {}; - bool OpenDir (const char* path, Bit16u& id); - bool ReadDir (Bit16u id, char * &result); - - void ExpandName (char* path) {}; - char* GetExpandName (const char* path) { return (char*)path; }; - bool GetShortName (const char* fullname, char* shortname) { return false; }; - - void CacheOut (const char* path, bool ignoreLastDir = false) {}; - void AddEntry (const char* path, bool checkExists = false) {}; - void DeleteEntry (const char* path, bool ignoreLastDir = false) {}; - - void SetCurrentEntry (Bit16u entry) {}; - Bit16u GetCurrentEntry (void) { return 0; }; - - void EmptyCache (void) {}; - - void SetLabel (const char* name) {}; - char* GetLabel (void) {return "";}; - -public: - char basePath [CROSS_LEN]; - char dirPath [CROSS_LEN]; -}; - class DOS_Drive { public: DOS_Drive(); @@ -248,12 +233,18 @@ public: virtual void EmptyCache(void) { dirCache.EmptyCache(); }; virtual bool isRemote(void)=0; virtual bool isRemovable(void)=0; + virtual Bits UnMount(void)=0; + char * GetInfo(void); char curdir[DOS_PATHLENGTH]; char info[256]; /* Can be overridden for example in iso images */ virtual char const * GetLabel(){return dirCache.GetLabel();}; + DOS_Drive_Cache dirCache; + + // disk cycling functionality (request resources) + virtual void Activate(void) {}; }; enum { OPEN_READ=0,OPEN_WRITE=1,OPEN_READWRITE=2, DOS_NOT_INHERIT=128}; diff --git a/include/dosbox.h b/include/dosbox.h index cb84385..d74eb8e 100644 --- a/include/dosbox.h +++ b/include/dosbox.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ #include "config.h" -void E_Exit(char * message,...); +void E_Exit(const char * message,...) GCC_ATTRIBUTE( __format__(__printf__, 1, 2)); void MSG_Add(const char*,const char*); //add messages to the internal langaugefile const char* MSG_Get(char const *); //get messages from the internal langaugafile diff --git a/include/fpu.h b/include/fpu.h index 6bea5ce..50511ea 100644 --- a/include/fpu.h +++ b/include/fpu.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,4 +40,115 @@ void FPU_ESC6_EA(Bitu func,PhysPt ea); void FPU_ESC7_Normal(Bitu rm); void FPU_ESC7_EA(Bitu func,PhysPt ea); + +typedef union { + double d; +#ifndef WORDS_BIGENDIAN + struct { + Bit32u lower; + Bit32s upper; + } l; +#else + struct { + Bit32s upper; + Bit32u lower; + } l; +#endif + Bit64s ll; +} FPU_Reg; + +typedef struct { + Bit32u m1; + Bit32u m2; + Bit16u m3; + + Bit16u d1; + Bit32u d2; +} FPU_P_Reg; + +enum FPU_Tag { + TAG_Valid = 0, + TAG_Zero = 1, + TAG_Weird = 2, + TAG_Empty = 3 +}; + +enum FPU_Round { + ROUND_Nearest = 0, + ROUND_Down = 1, + ROUND_Up = 2, + ROUND_Chop = 3 +}; + +typedef struct { + FPU_Reg regs[9]; + FPU_P_Reg p_regs[9]; + FPU_Tag tags[9]; + Bit16u cw,cw_mask_all; + Bit16u sw; + Bitu top; + FPU_Round round; +} FPU_rec; + + +//get pi from a real library +#define PI 3.14159265358979323846 +#define L2E 1.4426950408889634 +#define L2T 3.3219280948873623 +#define LN2 0.69314718055994531 +#define LG2 0.3010299956639812 + + +extern FPU_rec fpu; + +#define TOP fpu.top +#define STV(i) ( (fpu.top+ (i) ) & 7 ) + + +Bit16u FPU_GetTag(void); +void FPU_FLDCW(PhysPt addr); + +INLINE void FPU_SetTag(Bit16u tag){ + for(Bitu i=0;i<8;i++) + fpu.tags[i] = static_cast((tag >>(2*i))&3); +} + +INLINE void FPU_SetCW(Bitu word){ + fpu.cw = word; + fpu.cw_mask_all = word | 0x3f; + fpu.round = (FPU_Round)((word >> 10) & 3); +} + + +INLINE Bitu FPU_GET_TOP(void) { + return (fpu.sw & 0x3800)>>11; +} + +INLINE void FPU_SET_TOP(Bitu val){ + fpu.sw &= ~0x3800; + fpu.sw |= (val&7)<<11; +} + + +INLINE void FPU_SET_C0(Bitu C){ + fpu.sw &= ~0x0100; + if(C) fpu.sw |= 0x0100; +} + +INLINE void FPU_SET_C1(Bitu C){ + fpu.sw &= ~0x0200; + if(C) fpu.sw |= 0x0200; +} + +INLINE void FPU_SET_C2(Bitu C){ + fpu.sw &= ~0x0400; + if(C) fpu.sw |= 0x0400; +} + +INLINE void FPU_SET_C3(Bitu C){ + fpu.sw &= ~0x4000; + if(C) fpu.sw |= 0x4000; +} + + #endif diff --git a/include/hardware.h b/include/hardware.h index fcfa4ac..680ae50 100644 --- a/include/hardware.h +++ b/include/hardware.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/inout.h b/include/inout.h index b61aa6c..6a60012 100644 --- a/include/inout.h +++ b/include/inout.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: inout.h,v 1.9 2006/02/09 11:47:47 qbix79 Exp $ */ +/* $Id: inout.h,v 1.10 2007/01/08 19:45:37 qbix79 Exp $ */ #ifndef DOSBOX_INOUT_H #define DOSBOX_INOUT_H diff --git a/include/ipx.h b/include/ipx.h index 2b16337..a522bcc 100644 --- a/include/ipx.h +++ b/include/ipx.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: ipx.h,v 1.9 2006/02/26 13:46:31 qbix79 Exp $ */ +/* $Id: ipx.h,v 1.12 2007/01/13 08:35:49 qbix79 Exp $ */ #ifndef DOSBOX_IPX_H #define DOSBOX_IPX_H @@ -24,6 +24,16 @@ // Uncomment this for a lot of debug messages: //#define IPX_DEBUGMSG +#ifdef IPX_DEBUGMSG +#define LOG_IPX LOG_MSG +#else +#if defined (_MSC_VER) +#define LOG_IPX +#else +#define LOG_IPX(...) +#endif +#endif + #ifndef DOSBOX_DOSBOX_H #include "dosbox.h" #endif @@ -70,7 +80,7 @@ struct PackedIP { struct nodeType { Uint8 node[6]; -}GCC_ATTRIBUTE(packed) ; +} GCC_ATTRIBUTE(packed) ; struct IPXHeader { Uint8 checkSum[2]; @@ -100,13 +110,18 @@ class ECBClass { public: RealPt ECBAddr; bool isInESRList; - ECBClass *prevECB; + ECBClass *prevECB; // Linked List ECBClass *nextECB; - Bit8u iuflag; + + Bit8u iuflag; // Need to save data since we are not always in + Bit16u mysocket; // real mode - #ifdef IPX_DEBUGMSG + Bit8u* databuffer; // received data is stored here until we get called + Bitu buflen; // by Interrupt + +#ifdef IPX_DEBUGMSG Bitu SerialNumber; - #endif +#endif ECBClass(Bit16u segment, Bit16u offset); Bit16u getSocket(void); @@ -119,6 +134,9 @@ public: Bit16u getFragCount(void); + bool writeData(); + void writeDataBuffer(Bit8u* buffer, Bit16u length); + void getFragDesc(Bit16u descNum, fragmentDescriptor *fragDesc); RealPt getESRAddr(void); diff --git a/include/ipxserver.h b/include/ipxserver.h index 041e541..9cb6db9 100644 --- a/include/ipxserver.h +++ b/include/ipxserver.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/joystick.h b/include/joystick.h index 7b2b64b..bd27f22 100644 --- a/include/joystick.h +++ b/include/joystick.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: joystick.h,v 1.8 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: joystick.h,v 1.11 2007/02/22 08:44:06 qbix79 Exp $ */ #ifndef DOSBOX_JOYSTICK_H #define DOSBOX_JOYSTICK_H void JOYSTICK_Enable(Bitu which,bool enabled); @@ -37,6 +37,7 @@ float JOYSTICK_GetMove_Y(Bitu which); enum JoystickType { JOY_NONE, + JOY_AUTO, JOY_2AXIS, JOY_4AXIS, JOY_FCS, @@ -44,4 +45,5 @@ enum JoystickType { }; extern JoystickType joytype; +extern bool button_wrapping_enabled; #endif diff --git a/include/keyboard.h b/include/keyboard.h index 76878d7..d56affd 100644 --- a/include/keyboard.h +++ b/include/keyboard.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/logging.h b/include/logging.h index 81ee253..bf16173 100644 --- a/include/logging.h +++ b/include/logging.h @@ -14,50 +14,50 @@ enum LOG_TYPES { enum LOG_SEVERITIES { LOG_NORMAL, - LOG_WARN, + LOG_WARN, LOG_ERROR, }; #if C_DEBUG class LOG { - LOG_TYPES d_type; - LOG_SEVERITIES d_severity; + LOG_TYPES d_type; + LOG_SEVERITIES d_severity; public: LOG (LOG_TYPES type , LOG_SEVERITIES severity): d_type(type), d_severity(severity) {} - void operator() (char* buf, ...); //../src/debug/debug_gui.cpp + void operator() (char const* buf, ...) GCC_ATTRIBUTE(__format__(__printf__, 2, 3)); //../src/debug/debug_gui.cpp }; -void DEBUG_ShowMsg(char * format,...); +void DEBUG_ShowMsg(char const* format,...) GCC_ATTRIBUTE(__format__(__printf__, 1, 2)); #define LOG_MSG DEBUG_ShowMsg #else //C_DEBUG struct LOG { - LOG(LOG_TYPES type, LOG_SEVERITIES severity) { return;} - void operator()(char const* buf) { return;} - void operator()(char const* buf, double f1) { return;} - void operator()(char const* buf, double f1, double f2) { return;} - void operator()(char const* buf, double f1, double f2, double f3) { return;} - void operator()(char const* buf, double f1, double f2, double f3, double f4) { return;} - void operator()(char const* buf, double f1, double f2, double f3, double f4, double f5) { return;} + LOG(LOG_TYPES , LOG_SEVERITIES ) { } + void operator()(char const* ) { } + void operator()(char const* , double ) { } + void operator()(char const* , double , double ) { } + void operator()(char const* , double , double , double ) { } + void operator()(char const* , double , double , double , double ) { } + void operator()(char const* , double , double , double , double , double ) { } - void operator()(char const* buf, char const* s1) { return;} - void operator()(char const* buf, char const* s1, double f1) { return;} - void operator()(char const* buf, char const* s1, double f1,double f2) { return;} - void operator()(char const* buf, double f1, char const* s1) { return;} + void operator()(char const* , char const* ) { } + void operator()(char const* , char const* , double ) { } + void operator()(char const* , char const* , double ,double ) { } + void operator()(char const* , double , char const* ) { } }; //add missing operators to here //try to avoid anything smaller than bit32... -void GFX_ShowMsg(char * format,...); +void GFX_ShowMsg(char const* format,...) GCC_ATTRIBUTE(__format__(__printf__, 1, 2)); #define LOG_MSG GFX_ShowMsg #endif //C_DEBUG diff --git a/include/mapper.h b/include/mapper.h index d789ded..c9b51f1 100644 --- a/include/mapper.h +++ b/include/mapper.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ enum MapKeys { }; typedef void (MAPPER_Handler)(bool pressed); -void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char * eventname,char * buttonname); +void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char const * const eventname,char const * const buttonname); void MAPPER_Init(void); void MAPPER_StartUp(Section * sec); void MAPPER_Run(bool pressed); diff --git a/include/mem.h b/include/mem.h index b91ff93..9c3a5df 100644 --- a/include/mem.h +++ b/include/mem.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,6 +44,7 @@ Bitu MEM_FreeLargest(void); //Largest free 4 kb pages block Bitu MEM_TotalPages(void); //Total amount of 4 kb pages Bitu MEM_AllocatedPages(MemHandle handle); // amount of allocated pages of handle MemHandle MEM_AllocatePages(Bitu pages,bool sequence); +MemHandle MEM_GetNextFreePage(void); PhysPt MEM_AllocatePage(void); void MEM_ReleasePages(MemHandle handle); bool MEM_ReAllocatePages(MemHandle & handle,Bitu pages,bool sequence); diff --git a/include/mixer.h b/include/mixer.h index c778bf5..da3fea7 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,12 +50,16 @@ public: void SetFreq(Bitu _freq); void Mix(Bitu _needed); void AddSilence(void); //Fill up until needed - template + template void AddSamples(Bitu len,void * data); void AddSamples_m8(Bitu len,Bit8u * data); void AddSamples_s8(Bitu len,Bit8u * data); + void AddSamples_m8s(Bitu len,Bit8s * data); + void AddSamples_s8s(Bitu len,Bit8s * data); void AddSamples_m16(Bitu len,Bit16s * data); void AddSamples_s16(Bitu len,Bit16s * data); + void AddSamples_m16u(Bitu len,Bit16u * data); + void AddSamples_s16u(Bitu len,Bit16u * data); void AddStretched(Bitu len,Bit16s * data); //Strech block up into needed data void FillUp(void); void Enable(bool _yesno); diff --git a/include/mouse.h b/include/mouse.h index 4dcb46a..ff6453d 100644 --- a/include/mouse.h +++ b/include/mouse.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: mouse.h,v 1.12 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: mouse.h,v 1.13 2007/01/08 19:45:37 qbix79 Exp $ */ #ifndef DOSBOX_MOUSE_H #define DOSBOX_MOUSE_H diff --git a/include/paging.h b/include/paging.h index 0309e74..f9c70e8 100644 --- a/include/paging.h +++ b/include/paging.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: paging.h,v 1.22 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: paging.h,v 1.24 2007/01/08 19:45:37 qbix79 Exp $ */ #ifndef DOSBOX_PAGING_H #define DOSBOX_PAGING_H @@ -48,6 +48,7 @@ class PageDirectory; class PageHandler { public: + virtual ~PageHandler(void) { } virtual Bitu readb(PhysPt addr); virtual Bitu readw(PhysPt addr); virtual Bitu readd(PhysPt addr); diff --git a/include/pic.h b/include/pic.h index 90a49b4..4d37ded 100644 --- a/include/pic.h +++ b/include/pic.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,9 +21,9 @@ /* CPU Cycle Timing */ -extern Bits CPU_Cycles; -extern Bits CPU_CycleLeft; -extern Bits CPU_CycleMax; +extern Bit32s CPU_Cycles; +extern Bit32s CPU_CycleLeft; +extern Bit32s CPU_CycleMax; typedef void (PIC_EOIHandler) (void); typedef void (* PIC_EventHandler)(Bitu val); @@ -40,6 +40,10 @@ INLINE float PIC_TickIndex(void) { return (CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)/(float)CPU_CycleMax; } +INLINE Bits PIC_TickIndexND(void) { + return CPU_CycleMax-CPU_CycleLeft-CPU_Cycles; +} + INLINE Bits PIC_MakeCycles(double amount) { return (Bits)(CPU_CycleMax*amount); } @@ -57,6 +61,7 @@ bool PIC_RunQueue(void); //Delay in milliseconds void PIC_AddEvent(PIC_EventHandler handler,float delay,Bitu val=0); void PIC_RemoveEvents(PIC_EventHandler handler); +void PIC_RemoveSpecificEvents(PIC_EventHandler handler, Bitu val); void PIC_SetIRQMask(Bitu irq, bool masked); #endif diff --git a/include/programs.h b/include/programs.h index 7d6be6a..868a436 100644 --- a/include/programs.h +++ b/include/programs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,6 +50,6 @@ public: }; typedef void (PROGRAMS_Main)(Program * * make); -void PROGRAMS_MakeFile(char * name,PROGRAMS_Main * main); +void PROGRAMS_MakeFile(char const * const name,PROGRAMS_Main * main); #endif diff --git a/include/regs.h b/include/regs.h index 02eb255..636b676 100644 --- a/include/regs.h +++ b/include/regs.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/render.h b/include/render.h index 539e40e..93d20f2 100644 --- a/include/render.h +++ b/include/render.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,6 +21,10 @@ #include "../src/gui/render_scalers.h" +#define RENDER_SKIP_CACHE 16 +//Enable this for scalers to support 0 input for empty lines +//#define RENDER_NULL_INPUT + typedef struct { struct { Bit8u red; @@ -40,7 +44,7 @@ typedef struct { typedef struct { struct { - Bitu width; + Bitu width, start; Bitu height; Bitu bpp; bool dblw,dblh; @@ -50,6 +54,8 @@ typedef struct { struct { Bitu count; Bitu max; + Bitu index; + Bit8u hadSkip[RENDER_SKIP_CACHE]; } frameskip; struct { Bitu size; @@ -71,13 +77,14 @@ typedef struct { bool updating; bool active; bool aspect; + bool fullFrame; } Render_t; extern Render_t render; extern ScalerLineHandler_t RENDER_DrawLine; void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool dblw,bool dblh); bool RENDER_StartUpdate(void); -void RENDER_EndUpdate( bool fullUpdate ); +void RENDER_EndUpdate( ); void RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue); diff --git a/include/serialport.h b/include/serialport.h index 12f62e9..b44a6a6 100644 --- a/include/serialport.h +++ b/include/serialport.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,13 +16,15 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: serialport.h,v 1.12 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: serialport.h,v 1.14 2007/01/13 08:35:49 qbix79 Exp $ */ #ifndef DOSBOX_SERIALPORT_H #define DOSBOX_SERIALPORT_H +#define SERIAL_DEBUG 0 + // Uncomment this for a lot of debug messages: -// #define SERIALPORT_DEBUGMSG +//#define LOG_UART #ifndef DOSBOX_DOSBOX_H #include "dosbox.h" @@ -34,31 +36,70 @@ #include "timer.h" #endif +#include "dos_inc.h" +#include "setup.h" -// Serial port interface // +#if SERIAL_DEBUG +#include "hardware.h" +#endif + +// Serial port interface class CSerial { public: - // Constructor takes base port (0x3f8, 0x2f8, 0x2e8, etc.), IRQ, and initial bps // - CSerial(IO_ReadHandler* rh, IO_WriteHandler* wh, - TIMER_TickHandler TimerHandler, - Bit16u initbase, Bit8u initirq, Bit32u initbps, - Bit8u bytesize, const char* parity, Bit8u stopbits); +#if SERIAL_DEBUG + FILE * debugfp; + bool dbg_modemcontrol; // RTS,CTS,DTR,DSR,RI,CD + bool dbg_serialtraffic; + bool dbg_register; + bool dbg_interrupt; + bool dbg_aux; + +#endif + + static bool getBituSubstring(const char* name,Bitu* data, CommandLine* cmd); + + bool InstallationSuccessful;// check after constructing. If + // something was wrong, delete it right away. + + // Constructor takes com port number (0-3) + CSerial(Bitu id, CommandLine* cmd); - TIMER_TickHandler TimerHnd; virtual ~CSerial(); - void InstallTimerHandler(TIMER_TickHandler); - + IO_ReadHandleObject ReadHandler[8]; IO_WriteHandleObject WriteHandler[8]; - void Timer(void); - virtual void Timer2(void)=0; + float bytetime; // how long a byte takes to transmit/receive in milliseconds + void changeLineProperties(); + Bitu idnumber; + + void setEvent(Bit16u type, float duration); + void removeEvent(Bit16u type); + void handleEvent(Bit16u type); + virtual void handleUpperEvent(Bit16u type)=0; - Bitu base; + // defines for event type +#define SERIAL_TX_LOOPBACK_EVENT 0 +#define SERIAL_THR_LOOPBACK_EVENT 1 +#define SERIAL_ERRMSG_EVENT 2 + +#define SERIAL_TX_EVENT 3 +#define SERIAL_RX_EVENT 4 +#define SERIAL_POLLING_EVENT 5 +#define SERIAL_THR_EVENT 6 + +#define SERIAL_BASE_EVENT_COUNT 6 + +#define COMNUMBER idnumber+1 + Bitu irq; + // CSerial requests an update of the input lines + virtual void updateMSR()=0; + + // Control lines from prepherial to serial port bool getDTR(); bool getRTS(); @@ -72,75 +113,75 @@ public: void setCD(bool value); void setCTS(bool value); + // From serial port to prepherial + // set output lines + virtual void setRTSDTR(bool rts, bool dtr)=0; + virtual void setRTS(bool val)=0; + virtual void setDTR(bool val)=0; + + // Register access void Write_THR(Bit8u data); - Bitu Read_RHR(); - Bitu Read_IER(); void Write_IER(Bit8u data); - Bitu Read_ISR(); - Bitu Read_LCR(); + void Write_FCR(Bit8u data); void Write_LCR(Bit8u data); - Bitu Read_MCR(); void Write_MCR(Bit8u data); - Bitu Read_LSR(); - // Really old hardware seems to have the delta part of this register writable void Write_MSR(Bit8u data); - - Bitu Read_MSR(); - Bitu Read_SPR(); void Write_SPR(Bit8u data); void Write_reserved(Bit8u data, Bit8u address); + + Bitu Read_RHR(); + Bitu Read_IER(); + Bitu Read_ISR(); + Bitu Read_LCR(); + Bitu Read_MCR(); + Bitu Read_LSR(); + Bitu Read_MSR(); + Bitu Read_SPR(); - // If a byte comes from wherever(loopback or real port or maybe - // that softmodem thingy), put it in here. + // If a byte comes from loopback or prepherial, put it in here. void receiveByte(Bit8u data); // If an error was received, put it here (in LSR register format) void receiveError(Bit8u errorword); + // depratched // connected device checks, if port can receive data: bool CanReceiveByte(); + // when THR was shifted to TX + void ByteTransmitting(); + // When done sending, notify here void ByteTransmitted(); - // Virtual app has read the received data - virtual void RXBufferEmpty()=0; - - // real transmit - virtual void transmitByte(Bit8u val)=0; + // Transmit byte to prepherial + virtual void transmitByte(Bit8u val, bool first)=0; // switch break state to the passed value virtual void setBreak(bool value)=0; - // set output lines - virtual void updateModemControlLines(/*Bit8u mcr*/)=0; - // change baudrate, number of bits, parity, word length al at once - virtual void updatePortConfig(Bit8u dll, Bit8u dlm, Bit8u lcr)=0; + virtual void updatePortConfig(Bit16u divider, Bit8u lcr)=0; - // CSerial requests an update of the input lines - virtual void updateMSR()=0; + void Init_Registers(); + + bool Putchar(Bit8u data, bool wait_dtr, bool wait_rts, Bitu timeout); + bool Getchar(Bit8u* data, bool wait_dsr, Bitu timeout); - // after update request, or some "real" changes, - // modify MSR here - void changeMSR(Bit8u data); // make public - - void Init_Registers(Bit32u initbps, - Bit8u bytesize, const char* parity, Bit8u stopbits); private: + DOS_Device* mydosdevice; + // I used this spec: http://www.exar.com/products/st16c450v420.pdf - void changeMSR_Loopback(Bit8u data); + void ComputeInterrupts(); - void WriteRealIER(Bit8u data); - // reason for an interrupt has occured - functions triggers interrupt - // if it is enabled and no higher-priority irq pending + // a sub-interrupt is triggered void rise(Bit8u priority); - // clears the pending interrupt + // clears the pending sub-interrupt void clear(Bit8u priority); #define ERROR_PRIORITY 4 // overrun, parity error, frame error, break @@ -149,18 +190,12 @@ private: #define MSR_PRIORITY 8 // CRS, DSR, RI, DCD change #define NONE_PRIORITY 0 - - Bit8u pending_interrupts; // stores triggered interupts - Bit8u current_priority; Bit8u waiting_interrupts; // these are on, but maybe not enabled // 16C450 (no FIFO) // read/write name - - Bit8u DLL; // r Baudrate divider low byte - Bit8u DLM; // r "" high byte - + Bit16u baud_divider; Bit8u RHR; // r Receive Holding Register, also LSB of Divisor Latch (r/w) #define RHR_OFFSET 0 // Data: whole byte @@ -169,13 +204,10 @@ private: #define THR_OFFSET 0 // Data: whole byte - Bit8u IER; // r/w Interrupt Enable Register, also MSB of Divisor Latch (r/w) + Bit8u IER; // r/w Interrupt Enable Register, also MSB of Divisor Latch #define IER_OFFSET 1 - // Data: - // bit0 receive holding register - // bit1 transmit holding register - // bit2 receive line status interrupt - // bit3 modem status interrupt + + bool irq_active; #define RHR_INT_Enable_MASK 0x1 #define THR_INT_Enable_MASK 0x2 @@ -222,23 +254,24 @@ private: #define LCR_STOPBITS_1 0x0 #define LCR_STOPBITS_MORE_THAN_1 0x4 - Bit8u MCR; // r/w Modem Control Register + // Modem Control Register + // r/w #define MCR_OFFSET 4 - // bit0: DTR - // bit1: RTS - // bit2: OP1 - // bit3: OP2 - // bit4: loop back enable + bool dtr; // bit0: DTR + bool rts; // bit1: RTS + bool op1; // bit2: OP1 + bool op2; // bit3: OP2 + bool loopback; // bit4: loop back enable - #define MCR_LOOPBACK_Enable_MASK 0x10 - #define MCR_LEVELS_MASK 0xf - #define MCR_DTR_MASK 0x1 #define MCR_RTS_MASK 0x2 #define MCR_OP1_MASK 0x4 - #define MCR_OP2_MASK 0x8 - + #define MCR_OP2_MASK 0x8 + #define MCR_LOOPBACK_Enable_MASK 0x10 +public: Bit8u LSR; // r Line Status Register +private: + #define LSR_OFFSET 5 #define LSR_RX_DATA_READY_MASK 0x1 @@ -251,17 +284,26 @@ private: #define LSR_ERROR_MASK 0x1e + // error printing + bool errormsg_pending; + Bitu framingErrors; + Bitu parityErrors; + Bitu overrunErrors; + Bitu overrunIF0; + Bitu breakErrors; - Bit8u MSR; // r Modem Status Register + + // Modem Status Register + // r #define MSR_OFFSET 6 - // bit0: deltaCTS - // bit1: deltaDSR - // bit2: deltaRI - // bit3: deltaCD - // bit4: CTS - // bit5: DSR - // bit6: RI - // bit7: CD + bool d_cts; // bit0: deltaCTS + bool d_dsr; // bit1: deltaDSR + bool d_ri; // bit2: deltaRI + bool d_cd; // bit3: deltaCD + bool cts; // bit4: CTS + bool dsr; // bit5: DSR + bool ri; // bit6: RI + bool cd; // bit7: CD #define MSR_delta_MASK 0xf #define MSR_LINE_MASK 0xf0 @@ -280,20 +322,37 @@ private: // For loopback purposes... - bool loopback_pending; Bit8u loopback_data; - void transmitLoopbackByte(Bit8u val); + void transmitLoopbackByte(Bit8u val, bool value); // 16C550 (FIFO) // TODO + #define FCR_OFFSET 2 + bool fifo_warn; //Bit8u FCR; // FIFO Control Register }; -#define COM1_BASE 0x3f8 -#define COM2_BASE 0x2f8 -#define COM3_BASE 0x3e8 -#define COM4_BASE 0x2e8 +extern CSerial* serialports[]; +const Bit8u serial_defaultirq[4] = { 4, 3, 4, 3 }; +const Bit16u serial_baseaddr[4] = {0x3f8,0x2f8,0x3e8,0x2e8}; +const char* const serial_comname[]={"COM1","COM2","COM3","COM4"}; + +// the COM devices + +class device_COM : public DOS_Device { +public: + // Creates a COM device that communicates with the num-th parallel port, i.e. is LPTnum + device_COM(class CSerial* sc); + ~device_COM(); + bool Read(Bit8u * data,Bit16u * size); + bool Write(Bit8u * data,Bit16u * size); + bool Seek(Bit32u * pos,Bit32u type); + bool Close(); + Bit16u GetInformation(void); +private: + CSerial* sclass; +}; #endif diff --git a/include/setup.h b/include/setup.h index be90b5d..02ebe1f 100644 --- a/include/setup.h +++ b/include/setup.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: setup.h,v 1.22 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: setup.h,v 1.26 2007/01/08 19:45:37 qbix79 Exp $ */ #ifndef DOSBOX_SETUP_H #define DOSBOX_SETUP_H @@ -33,24 +33,25 @@ class CommandLine { public: - CommandLine(int argc,char * argv[]); - CommandLine(char * name,char * cmdline); + CommandLine(int argc,char const * const argv[]); + CommandLine(char const * const name,char const * const cmdline); const char * GetFileName(){ return file_name.c_str();} - bool FindExist(char * name,bool remove=false); - bool FindHex(char * name,int & value,bool remove=false); - bool FindInt(char * name,int & value,bool remove=false); - bool FindString(char * name,std::string & value,bool remove=false); + bool FindExist(char const * const name,bool remove=false); + bool FindHex(char const * const name,int & value,bool remove=false); + bool FindInt(char const * const name,int & value,bool remove=false); + bool FindString(char const * const name,std::string & value,bool remove=false); bool FindCommand(unsigned int which,std::string & value); - bool FindStringBegin(char * begin,std::string & value, bool remove=false); - bool FindStringRemain(char * name,std::string & value); + bool FindStringBegin(char const * const begin,std::string & value, bool remove=false); + bool FindStringRemain(char const * const name,std::string & value); bool GetStringRemain(std::string & value); unsigned int GetCount(void); + void Shift(unsigned int amount=1); private: typedef std::list::iterator cmd_it; std::list cmds; std::string file_name; - bool FindEntry(char * name,cmd_it & it,bool neednext=false); + bool FindEntry(char const * const name,cmd_it & it,bool neednext=false); }; union Value{ @@ -63,10 +64,10 @@ union Value{ class Property { public: - Property(const char* _propname):propname(_propname) { } + Property(char const * const _propname):propname(_propname) { } virtual void SetValue(char* input)=0; - virtual void GetValuestring(char* str)=0; - Value GetValue() { return value;} + virtual void GetValuestring(char* str) const=0; + Value GetValue() const { return value;} virtual ~Property(){ } std::string propname; Value value; @@ -74,52 +75,52 @@ public: class Prop_int:public Property { public: - Prop_int(const char* _propname, int _value):Property(_propname) { + Prop_int(char const * const _propname, int _value):Property(_propname) { value._int=_value; } void SetValue(char* input); - void GetValuestring(char* str); + void GetValuestring(char* str) const; ~Prop_int(){ } }; class Prop_float:public Property { public: - Prop_float(const char* _propname, float _value):Property(_propname){ + Prop_float(char const * const _propname, float _value):Property(_propname){ value._float=_value; } void SetValue(char* input); - void GetValuestring(char* str); + void GetValuestring(char* str) const; ~Prop_float(){ } }; class Prop_bool:public Property { public: - Prop_bool(const char* _propname, bool _value):Property(_propname) { + Prop_bool(char const * const _propname, bool _value):Property(_propname) { value._bool=_value; } void SetValue(char* input); - void GetValuestring(char* str); + void GetValuestring(char* str) const; ~Prop_bool(){ } }; class Prop_string:public Property{ public: - Prop_string(const char* _propname, char* _value):Property(_propname) { + Prop_string(char const * const _propname, char const * const _value):Property(_propname) { value._string=new std::string(_value); } ~Prop_string(){ delete value._string; } void SetValue(char* input); - void GetValuestring(char* str); + void GetValuestring(char* str) const; }; class Prop_hex:public Property { public: - Prop_hex(const char* _propname, int _value):Property(_propname) { + Prop_hex(char const * const _propname, int _value):Property(_propname) { value._hex=_value; } void SetValue(char* input); ~Prop_hex(){ } - void GetValuestring(char* str); + void GetValuestring(char* str) const; }; class Section { @@ -130,7 +131,7 @@ private: struct Function_wrapper { SectionFunction function; bool canchange; - Function_wrapper(SectionFunction _fun,bool _ch){ + Function_wrapper(SectionFunction const _fun,bool _ch){ function=_fun; canchange=_ch; } @@ -139,17 +140,17 @@ private: std::list destroyfunctions; std::string sectionname; public: - Section(const char* _sectionname):sectionname(_sectionname) { } + Section(char const * const _sectionname):sectionname(_sectionname) { } void AddInitFunction(SectionFunction func,bool canchange=false) {initfunctions.push_back(Function_wrapper(func,canchange));} void AddDestroyFunction(SectionFunction func,bool canchange=false) {destroyfunctions.push_front(Function_wrapper(func,canchange));} void ExecuteInit(bool initall=true); void ExecuteDestroy(bool destroyall=true); - const char* GetName() {return sectionname.c_str();} + const char* GetName() const {return sectionname.c_str();} - virtual char* GetPropValue(const char* _property)=0; + virtual char const * GetPropValue(char const * const _property) const =0; virtual void HandleInputline(char * _line)=0; - virtual void PrintData(FILE* outfile)=0; + virtual void PrintData(FILE* outfile) const =0; virtual ~Section() { /*Children must call executedestroy ! */} }; @@ -158,33 +159,34 @@ class Section_prop:public Section { private: std::list properties; typedef std::list::iterator it; + typedef std::list::const_iterator const_it; public: - Section_prop(const char* _sectionname):Section(_sectionname){} - void Add_int(const char* _propname, int _value=0); - void Add_string(const char* _propname, char* _value=NULL); - void Add_bool(const char* _propname, bool _value=false); - void Add_hex(const char* _propname, int _value=0); - void Add_float(const char* _propname, float _value=0.0); + Section_prop(char const * const _sectionname):Section(_sectionname){} + void Add_int(char const * const _propname, int _value=0); + void Add_string(char const * const _propname, char const * const _value=NULL); + void Add_bool(char const * const _propname, bool _value=false); + void Add_hex(char const * const _propname, int _value=0); + void Add_float(char const * const _propname, float _value=0.0); - int Get_int(const char* _propname); - const char* Get_string(const char* _propname); - bool Get_bool(const char* _propname); - int Get_hex(const char* _propname); - float Get_float(const char* _propname); + int Get_int(char const * const _propname) const; + const char* Get_string(char const * const _propname) const; + bool Get_bool(char const * const _propname) const; + int Get_hex(char const * const _propname) const; + float Get_float(char const * const _propname) const; void HandleInputline(char *gegevens); - void PrintData(FILE* outfile); - virtual char* GetPropValue(const char* _property); + void PrintData(FILE* outfile) const; + virtual char const * GetPropValue(char const * const _property) const; //ExecuteDestroy should be here else the destroy functions use destroyed properties virtual ~Section_prop(); }; class Section_line: public Section{ public: - Section_line(const char* _sectionname):Section(_sectionname){} + Section_line(char const * const _sectionname):Section(_sectionname){} ~Section_line(){ExecuteDestroy(true);} void HandleInputline(char* gegevens); - void PrintData(FILE* outfile); - virtual char* GetPropValue(const char* _property); + void PrintData(FILE* outfile) const; + virtual const char* GetPropValue(char const * const _property) const; std::string data; }; @@ -195,23 +197,25 @@ private: std::list sectionlist; typedef std::list::iterator it; typedef std::list::reverse_iterator reverse_it; + typedef std::list::const_iterator const_it; + typedef std::list::const_reverse_iterator const_reverse_it; void (* _start_function)(void); public: - Config(CommandLine * cmd){ cmdline=cmd;} + Config(CommandLine * cmd):cmdline(cmd){} ~Config(); - Section_line * AddSection_line(const char * _name,void (*_initfunction)(Section*)); - Section_prop * AddSection_prop(const char * _name,void (*_initfunction)(Section*),bool canchange=false); + Section_line * AddSection_line(char const * const _name,void (*_initfunction)(Section*)); + Section_prop * AddSection_prop(char const * const _name,void (*_initfunction)(Section*),bool canchange=false); - Section* GetSection(const char* _sectionname); - Section* GetSectionFromProperty(const char* prop); + Section* GetSection(char const* const _sectionname) const; + Section* GetSectionFromProperty(char const * const prop) const; void SetStartUp(void (*_function)(void)); void Init(); void ShutDown(); void StartUp(); - void PrintConfig(const char* configfilename); - bool ParseConfigFile(const char* configfilename); + void PrintConfig(char const * const configfilename) const; + bool ParseConfigFile(char const * const configfilename); void ParseEnv(char ** envp); }; @@ -222,8 +226,8 @@ protected: public: Module_base(Section* configuration){m_configuration=configuration;}; // Module_base(Section* configuration, SaveState* state) {}; - ~Module_base(){/*LOG_MSG("executed")*/;};//Destructors are required + virtual ~Module_base(){/*LOG_MSG("executed")*/;};//Destructors are required /* Returns true if succesful.*/ - virtual bool Change_Config(Section* newconfig) {return false;} ; + virtual bool Change_Config(Section* /*newconfig*/) {return false;} ; }; #endif diff --git a/include/shell.h b/include/shell.h index 3bd8baf..ca95043 100644 --- a/include/shell.h +++ b/include/shell.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell.h,v 1.15 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: shell.h,v 1.20 2007/01/08 19:59:06 qbix79 Exp $ */ #ifndef DOSBOX_SHELL_H #define DOSBOX_SHELL_H @@ -48,6 +48,7 @@ public: ~BatchFile(); bool ReadLine(char * line); bool Goto(char * where); + void Shift(void); Bit16u file_handle; bool echo; DOS_Shell * shell; @@ -104,6 +105,8 @@ public: void CMD_CHOICE(char * args); void CMD_ATTRIB(char * args); void CMD_PATH(char * args); + void CMD_SHIFT(char * args); + void CMD_VER(char * args); /* The shell's variables */ Bit16u input_handle; BatchFile * bf; @@ -113,10 +116,10 @@ public: }; struct SHELL_Cmd { - const char * name; /* Command name*/ + const char * name; /* Command name*/ Bit32u flags; /* Flags about the command */ - void (DOS_Shell::*handler)(char * args); /* Handler for this command */ - const char * help; /* String with command help */ + void (DOS_Shell::*handler)(char * args); /* Handler for this command */ + const char * help; /* String with command help */ }; static inline void StripSpaces(char*&args) { @@ -151,11 +154,11 @@ static inline char* ExpandDot(char*args, char* buffer) { class AutoexecObject{ private: bool installed; - char buf[256]; + std::string buf; public: - AutoexecObject():installed(false){}; - void Install(char * line,...); - void InstallBefore(char* line, ...); + AutoexecObject():installed(false){ }; + void Install(std::string const &in); + void InstallBefore(std::string const &in); ~AutoexecObject(); private: void CreateAutoexec(void); diff --git a/include/support.h b/include/support.h index 83ee6ff..2b7e66e 100644 --- a/include/support.h +++ b/include/support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ char *ltrim(char *str); char *rtrim(char *str); char *trim(char * str); -bool ScanCMDBool(char * cmd,char * check); +bool ScanCMDBool(char * cmd,char const * const check); char * ScanCMDRemain(char * cmd); char * StripWord(char *&cmd); bool IsDecWord(char * word); diff --git a/include/timer.h b/include/timer.h index b6ebab9..5ba2696 100644 --- a/include/timer.h +++ b/include/timer.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/vga.h b/include/vga.h index 8c365c9..0773655 100644 --- a/include/vga.h +++ b/include/vga.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,8 +23,18 @@ #include "dosbox.h" #endif +//Don't enable keeping changes and mapping lfb probably... +#define VGA_LFB_MAPPED +//#define VGA_KEEP_CHANGES +#define VGA_MEMORY (2*1024*1024) +#define VGA_CHANGE_SHIFT 9 + +//Offset inside VGA_MEMORY that will be used for certain types of caching +#define VGA_CACHE_OFFSET (512*1024) + class PageHandler; + enum VGAModes { M_CGA2, M_CGA4, M_EGA, M_VGA, @@ -70,6 +80,7 @@ typedef struct { Bit8u pel_panning; /* Amount of pixels to skip when starting horizontal line */ Bit8u hlines_skip; Bit8u bytes_skip; + Bit8u addr_shift; /* Specific stuff memory write/read handling */ @@ -95,9 +106,11 @@ typedef struct { Bitu width; Bitu height; Bitu blocks; - Bitu panning; Bitu address; + Bit8u *linear_base; + Bitu linear_mask; Bitu address_add; + Bitu line_length; Bitu address_line_total; Bitu address_line; Bitu lines_total; @@ -108,13 +121,14 @@ typedef struct { Bitu parts_lines; Bitu parts_left; struct { - float vtotal; - float vstart; - float vend; - float htotal; - float hstart; - float hend; - float parts; + double framestart; + double vrstart, vrend; // V-retrace + double hrstart, hrend; // H-retrace + double hblkstart, hblkend; // H-blanking + double vblkstart, vblkend; // V-Blanking + double vdend, vtotal; + double hdend, htotal; + double parts; } delay; bool double_scan; bool doublewidth,doubleheight; @@ -140,8 +154,23 @@ typedef struct { Bit8u mc[64][64]; } VGA_HWCURSOR; +typedef union { + Bit32u fullbank; +#ifndef WORDS_BIGENDIAN + struct { + Bit16u lowerbank; + Bit16u bank; + } b; +#else + struct { + Bit16u bank; + Bit16u lowerbank; + } b; +#endif +} VGA_S3_BANK; + typedef struct { - Bit8u bank; + VGA_S3_BANK svga_bank; Bit8u reg_lock1; Bit8u reg_lock2; Bit8u reg_31; @@ -179,31 +208,36 @@ typedef struct { Bit8u htotal; Bit8u hdend; Bit8u hsyncp; - Bit8u hsyncw; + Bit8u syncw; Bit8u vtotal; Bit8u vdend; Bit8u vadjust; Bit8u vsyncp; Bit8u vsyncw; Bit8u max_scanline; + Bit8u lpen_low, lpen_high; + Bit8u cursor_start; + Bit8u cursor_end; } VGA_OTHER; typedef struct { + Bit8u pcjr_flipflop; Bit8u mode_control; Bit8u color_select; - Bit8u mem_bank; Bit8u disp_bank; Bit8u reg_index; Bit8u gfx_control; Bit8u palette_mask; + Bit8u extended_ram; Bit8u border_color; - bool is_32k_mode; - bool pcjr_flipflop; + Bit8u line_mask, line_shift; + Bit8u draw_bank, mem_bank; + Bit8u *draw_base, *mem_base; + Bitu addr_mask; } VGA_TANDY; typedef struct { Bit8u index; - Bit8u reset; Bit8u clocking_mode; Bit8u map_mask; @@ -266,11 +300,11 @@ typedef struct { Bit8u bit_mask; } VGA_Gfx; -struct RGBEntry { +typedef struct { Bit8u red; Bit8u green; Bit8u blue; -}; +} RGBEntry; typedef struct { Bit8u bits; /* DAC bits, usually 6 or 8 */ @@ -280,19 +314,33 @@ typedef struct { Bit8u write_index; Bit8u read_index; Bitu first_changed; + Bit8u combine[16]; RGBEntry rgb[0x100]; } VGA_Dac; -union VGA_Latch { +typedef struct { + Bitu readStart, writeStart; + Bitu bankMask; +} VGA_SVGA; + +typedef union { Bit32u d; Bit8u b[4]; -}; +} VGA_Latch; -union VGA_Memory { - Bit8u linear[512*1024*4]; - Bit8u paged[512*1024][4]; - VGA_Latch latched[512*1024]; -}; +typedef struct { + Bit8u linear[VGA_MEMORY]; +} VGA_Memory; + +typedef struct { + //Add a few more just to be safe + Bit8u map[(VGA_MEMORY >> VGA_CHANGE_SHIFT) + 32]; + Bit8u checkMask, frame, writeMask; + bool active; + Bit32u clearMask; + Bit32u start, last; + Bit32u lastAddress; +} VGA_Changes; typedef struct { Bit32u page; @@ -301,8 +349,6 @@ typedef struct { PageHandler *handler; } VGA_LFB; -#define VGA_CHANGE_SHIFT 9 -typedef Bit8u VGA_Changed[(2*1024*1024) >> VGA_CHANGE_SHIFT]; typedef struct { VGAModes mode; /* The mode the vga system is in */ VGAModes lastmode; @@ -318,13 +364,15 @@ typedef struct { VGA_Dac dac; VGA_Latch latch; VGA_S3 s3; + VGA_SVGA svga; VGA_HERC herc; VGA_TANDY tandy; VGA_OTHER other; VGA_Memory mem; +#ifdef VGA_KEEP_CHANGES + VGA_Changes changes; +#endif VGA_LFB lfb; - VGA_Changed changed; - Bit8u * gfxmem_start; } VGA_Type; @@ -336,6 +384,7 @@ void VGA_SetupHandlers(void); void VGA_StartResize(void); void VGA_SetupDrawing(Bitu val); void VGA_CheckScanLength(void); +void VGA_ChangedBank(void); /* Some DAC/Attribute functions */ void VGA_DAC_CombineColor(Bit8u attr,Bit8u pal); diff --git a/include/video.h b/include/video.h index e439369..fab6cfd 100644 --- a/include/video.h +++ b/include/video.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ #ifndef DOSBOX_VIDEO_H #define DOSBOX_VIDEO_H +#define REDUCE_JOYSTICK_POLLING + typedef enum { GFX_CallBackReset, GFX_CallBackStop, @@ -64,6 +66,14 @@ void GFX_SwitchFullScreen(void); bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch); void GFX_EndUpdate( const Bit16u *changedLines ); +#if defined (WIN32) +bool GFX_SDLUsingWinDIB(void); +#endif + +#if defined (REDUCE_JOYSTICK_POLLING) +void MAPPER_UpdateJoysticks(void); +#endif + /* Mouse related */ void GFX_CaptureMouse(void); extern bool mouselocked; //true if mouse is confined to window diff --git a/install-sh b/install-sh index dd97db7..6ce63b9 100644 --- a/install-sh +++ b/install-sh @@ -1,8 +1,7 @@ #!/bin/sh +# # install - install a program, script, or datafile - -scriptversion=2004-09-10.20 - +# # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. @@ -42,11 +41,13 @@ scriptversion=2004-09-10.20 # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. + # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" + # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" @@ -58,265 +59,236 @@ stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" +transformbasename="" +transform_arg="" +instcmd="$mvprog" chmodcmd="$chmodprog 0755" -chowncmd= -chgrpcmd= -stripcmd= +chowncmd="" +chgrpcmd="" +stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" -src= -dst= -dir_arg= -dstarg= -no_target_directory= +src="" +dst="" +dir_arg="" -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... +while [ x"$1" != x ]; do + case $1 in + -c) instcmd=$cpprog + shift + continue;; -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. + -d) dir_arg=true + shift + continue;; -Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG -" + -o) chowncmd="$chownprog $2" + shift + shift + continue;; -while test -n "$1"; do - case $1 in - -c) shift - continue;; + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; - -d) dir_arg=true - shift - continue;; + -s) stripcmd=$stripprog + shift + continue;; - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; - --help) echo "$usage"; exit 0;; + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t) dstarg=$2 - shift - shift - continue;; - - -T) no_target_directory=true - shift - continue;; - - --version) echo "$0 $scriptversion"; exit 0;; - - *) # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - test -n "$dir_arg$dstarg" && break - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done - break;; - esac + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac done -if test -z "$1"; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 +if [ x"$src" = x ] +then + echo "$0: no input file specified" >&2 + exit 1 +else + : fi -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src ;; - esac +if [ x"$dir_arg" != x ]; then + dst=$src + src="" - if test -n "$dir_arg"; then - dst=$src - src= + if [ -d "$dst" ]; then + instcmd=: + chmodcmd="" + else + instcmd=$mkdirprog + fi +else - if test -d "$dst"; then - mkdircmd=: - chmodcmd= - else - mkdircmd=$mkdirprog - fi - else - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. - if test -z "$dstarg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi + if [ -f "$src" ] || [ -d "$src" ] + then + : + else + echo "$0: $src does not exist" >&2 + exit 1 + fi - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac + if [ x"$dst" = x ] + then + echo "$0: no destination specified" >&2 + exit 1 + else + : + fi - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 - exit 1 - fi - dst=$dst/`basename "$src"` - fi - fi +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic - # This sed command emulates the dirname command. - dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + if [ -d "$dst" ] + then + dst=$dst/`basename "$src"` + else + : + fi +fi - # Make sure that the destination directory exists. +## this sed command emulates the dirname command +dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - # Skip lots of stat calls in the usual case. - if test ! -d "$dstdir"; then - defaultIFS=' - ' - IFS="${IFS-$defaultIFS}" +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script - oIFS=$IFS - # Some sh's can't handle IFS=/ for some reason. - IFS='%' - set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` - IFS=$oIFS +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' + ' +IFS="${IFS-$defaultIFS}" - pathcomp= +oIFS=$IFS +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS=$oIFS - while test $# -ne 0 ; do - pathcomp=$pathcomp$1 - shift - if test ! -d "$pathcomp"; then - $mkdirprog "$pathcomp" - # mkdir can fail with a `File exist' error in case several - # install-sh are creating the directory concurrently. This - # is OK. - test -d "$pathcomp" || exit - fi - pathcomp=$pathcomp/ - done - fi +pathcomp='' - if test -n "$dir_arg"; then - $doit $mkdircmd "$dst" \ - && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } +while [ $# -ne 0 ] ; do + pathcomp=$pathcomp$1 + shift - else - dstfile=`basename "$dst"` + if [ ! -d "$pathcomp" ] ; + then + $mkdirprog "$pathcomp" + else + : + fi - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - trap '(exit $?); exit' 1 2 13 15 - - # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dstdir/$dstfile"; then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ - || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ - || { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" - } - } - fi || { (exit 1); exit; } + pathcomp=$pathcomp/ done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd "$dst" && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename "$dst"` + else + : + fi + +# Make a couple of temp file names in the proper directory. + + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + +# Trap to clean up temp files at exit. + + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + +# Move or copy the file name to the temp name + + $doit $instcmd "$src" "$dsttmp" && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && + +# Now remove or move aside any old file at destination location. We try this +# two ways since rm can't unlink itself on some systems and the destination +# file might be busy for other reasons. In this case, the final cleanup +# might fail but the new file should still install successfully. + +{ + if [ -f "$dstdir/$dstfile" ] + then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || + $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || + { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi +} && + +# Now rename the file to the real destination. + + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + +fi && # The final little trick to "correctly" pass the exit status to the exit trap. -{ - (exit 0); exit -} -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: +{ + (exit 0); exit +} diff --git a/missing b/missing index 64b5f90..fc54c64 100644 --- a/missing +++ b/missing @@ -1,10 +1,6 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. - -scriptversion=2004-09-07.08 - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -42,24 +38,18 @@ else configure_ac=configure.in fi -msg="missing on your system" - case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in -h|--h|--he|--hel|--help) echo "\ @@ -84,15 +74,11 @@ Supported PROGRAM values: lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Send bug reports to ." - exit 0 + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit 0 + echo "missing 0.4 - GNU automake" ;; -*) @@ -101,44 +87,14 @@ Send bug reports to ." exit 1 ;; -esac - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). -case "$1" in - lex|yacc) - # Not GNU programs, they don't have --version. - ;; - - tar) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - - *) + aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 fi - ;; -esac -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case "$1" in - aclocal*) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." @@ -146,8 +102,13 @@ WARNING: \`$1' is $msg. You should only need it if ;; autoconf) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." @@ -155,8 +116,13 @@ WARNING: \`$1' is $msg. You should only need it if ;; autoheader) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." @@ -174,8 +140,13 @@ WARNING: \`$1' is $msg. You should only need it if ;; automake*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." @@ -185,9 +156,14 @@ WARNING: \`$1' is $msg. You should only need it if ;; autom4te) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." @@ -209,7 +185,7 @@ WARNING: \`$1' is needed, but is $msg. bison|yacc) echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if +WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." @@ -239,7 +215,7 @@ WARNING: \`$1' $msg. You should only need it if lex|flex) echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." @@ -261,8 +237,13 @@ WARNING: \`$1' is $msg. You should only need it if ;; help2man) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." @@ -281,8 +262,13 @@ WARNING: \`$1' is $msg. You should only need it if ;; makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if +WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, @@ -298,6 +284,10 @@ WARNING: \`$1' is $msg. You should only need it if tar) shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error @@ -333,8 +323,8 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments. *) echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case @@ -344,10 +334,3 @@ WARNING: \`$1' is needed, and is $msg. esac exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100644 index 0000000..d2d5f21 --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,111 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" 1>&2 + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi + ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi + ;; +esac + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# End: +# mkinstalldirs ends here diff --git a/src/Makefile.in b/src/Makefile.in index 471bdbc..a3ba64b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(dosbox_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,51 +35,8 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -bin_PROGRAMS = dosbox$(EXEEXT) @HAVE_WINDRES_TRUE@am__append_1 = dosbox_ico.o -subdir = src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(bin_PROGRAMS) -am_dosbox_OBJECTS = dosbox.$(OBJEXT) -dosbox_OBJECTS = $(am_dosbox_OBJECTS) -@HAVE_WINDRES_TRUE@am__DEPENDENCIES_1 = dosbox_ico.o -dosbox_DEPENDENCIES = cpu/libcpu.a debug/libdebug.a dos/libdos.a \ - fpu/libfpu.a hardware/libhardware.a gui/libgui.a \ - ints/libints.a misc/libmisc.a shell/libshell.a \ - hardware/serialport/libserial.a $(am__DEPENDENCIES_1) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -SOURCES = $(dosbox_SOURCES) -DIST_SOURCES = $(dosbox_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -107,6 +63,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -137,9 +94,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -147,8 +101,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -156,23 +108,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -182,56 +140,81 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + SUBDIRS = cpu debug dos fpu gui hardware libs ints misc shell platform + +bin_PROGRAMS = dosbox + dosbox_SOURCES = dosbox.cpp -dosbox_LDADD = cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a \ - hardware/libhardware.a gui/libgui.a ints/libints.a \ - misc/libmisc.a shell/libshell.a \ - hardware/serialport/libserial.a $(am__append_1) +dosbox_LDADD = cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a hardware/libhardware.a gui/libgui.a \ + ints/libints.a misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a\ +$(am__append_1) + EXTRA_DIST = dosbox.rc dosbox.ico +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = dosbox$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + +am_dosbox_OBJECTS = dosbox.$(OBJEXT) +dosbox_OBJECTS = $(am_dosbox_OBJECTS) +@HAVE_WINDRES_TRUE@dosbox_DEPENDENCIES = cpu/libcpu.a debug/libdebug.a \ +@HAVE_WINDRES_TRUE@ dos/libdos.a fpu/libfpu.a \ +@HAVE_WINDRES_TRUE@ hardware/libhardware.a gui/libgui.a \ +@HAVE_WINDRES_TRUE@ ints/libints.a misc/libmisc.a \ +@HAVE_WINDRES_TRUE@ shell/libshell.a \ +@HAVE_WINDRES_TRUE@ hardware/serialport/libserial.a dosbox_ico.o +@HAVE_WINDRES_FALSE@dosbox_DEPENDENCIES = cpu/libcpu.a debug/libdebug.a \ +@HAVE_WINDRES_FALSE@ dos/libdos.a fpu/libfpu.a \ +@HAVE_WINDRES_FALSE@ hardware/libhardware.a gui/libgui.a \ +@HAVE_WINDRES_FALSE@ ints/libints.a misc/libmisc.a \ +@HAVE_WINDRES_FALSE@ shell/libshell.a \ +@HAVE_WINDRES_FALSE@ hardware/serialport/libserial.a +dosbox_LDFLAGS = + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/dosbox.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +DIST_SOURCES = $(dosbox_SOURCES) + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +DIST_SUBDIRS = $(SUBDIRS) +SOURCES = $(dosbox_SOURCES) + all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done @@ -239,34 +222,18 @@ uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ - rm -f "$(DESTDIR)$(bindir)/$$f"; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -installcheck-binPROGRAMS: $(bin_PROGRAMS) - bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ - case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ - *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ - esac; \ - f=`echo "$$p" | \ - sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - for opt in --help --version; do \ - if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ - 2>c$${pid}_.err &2; bad=1; fi; \ - done; \ - done; rm -f c$${pid}_.???; exit $$bad dosbox$(EXEEXT): $(dosbox_OBJECTS) $(dosbox_DEPENDENCIES) @rm -f dosbox$(EXEEXT) $(CXXLINK) $(dosbox_LDFLAGS) $(dosbox_OBJECTS) $(dosbox_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -274,18 +241,26 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dosbox.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd @@ -295,13 +270,7 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -313,7 +282,7 @@ $(RECURSIVE_TARGETS): local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -321,13 +290,7 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -348,7 +311,7 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -359,6 +322,14 @@ ctags-recursive: test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -367,22 +338,19 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ - empty_fix=.; \ else \ include_option=--include; \ - empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ + test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -392,11 +360,10 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -419,6 +386,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -432,7 +403,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -447,17 +418,15 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ @@ -467,9 +436,8 @@ check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(mkdir_p) "$$dir"; \ - done + $(mkinstalldirs) $(DESTDIR)$(bindir) + install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -489,7 +457,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -508,8 +476,6 @@ dvi: dvi-recursive dvi-am: -html: html-recursive - info: info-recursive info-am: @@ -522,7 +488,7 @@ install-info: install-info-recursive install-man: -installcheck-am: installcheck-binPROGRAMS +installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) @@ -545,19 +511,22 @@ uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-binPROGRAMS clean-generic clean-recursive ctags \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-recursive ctags \ ctags-recursive distclean distclean-compile distclean-generic \ - distclean-recursive distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installcheck-binPROGRAMS \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-binPROGRAMS install-data install-data-am \ + install-data-recursive install-exec install-exec-am \ + install-exec-recursive install-info install-info-am \ + install-info-recursive install-man install-recursive \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am installdirs-recursive maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-recursive \ + pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \ + tags-recursive uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-info-am uninstall-info-recursive uninstall-recursive dosbox_ico.o: dosbox.rc dosbox.ico $(WINDRES) dosbox.rc dosbox_ico.o diff --git a/src/cpu/Makefile.in b/src/cpu/Makefile.in index ffd6634..6382a29 100644 --- a/src/cpu/Makefile.in +++ b/src/cpu/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libcpu_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,53 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/cpu -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libcpu_a_AR = $(AR) $(ARFLAGS) -libcpu_a_LIBADD = -am_libcpu_a_OBJECTS = callback.$(OBJEXT) cpu.$(OBJEXT) flags.$(OBJEXT) \ - modrm.$(OBJEXT) core_full.$(OBJEXT) paging.$(OBJEXT) \ - core_normal.$(OBJEXT) core_simple.$(OBJEXT) \ - core_dyn_x86.$(OBJEXT) -libcpu_a_OBJECTS = $(am_libcpu_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libcpu_a_SOURCES) -DIST_SOURCES = $(libcpu_a_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -109,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -139,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -149,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -158,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -185,44 +140,67 @@ target_os = @target_os@ target_vendor = @target_vendor@ SUBDIRS = core_full core_normal core_dyn_x86 AM_CPPFLAGS = -I$(top_srcdir)/include + noinst_LIBRARIES = libcpu.a libcpu_a_SOURCES = callback.cpp cpu.cpp flags.cpp modrm.cpp modrm.h core_full.cpp instructions.h \ paging.cpp lazyflags.h core_normal.cpp core_simple.cpp \ core_dyn_x86.cpp +subdir = src/cpu +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libcpu_a_AR = $(AR) cru +libcpu_a_LIBADD = +am_libcpu_a_OBJECTS = callback.$(OBJEXT) cpu.$(OBJEXT) flags.$(OBJEXT) \ + modrm.$(OBJEXT) core_full.$(OBJEXT) paging.$(OBJEXT) \ + core_normal.$(OBJEXT) core_simple.$(OBJEXT) \ + core_dyn_x86.$(OBJEXT) +libcpu_a_OBJECTS = $(am_libcpu_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/callback.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/core_dyn_x86.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/core_full.Po ./$(DEPDIR)/core_normal.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/core_simple.Po ./$(DEPDIR)/cpu.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/flags.Po ./$(DEPDIR)/modrm.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/paging.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libcpu_a_SOURCES) + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +DIST_SUBDIRS = $(SUBDIRS) +SOURCES = $(libcpu_a_SOURCES) + all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/cpu/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/cpu/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/cpu/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -232,7 +210,7 @@ libcpu.a: $(libcpu_a_OBJECTS) $(libcpu_a_DEPENDENCIES) $(RANLIB) libcpu.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -248,18 +226,26 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paging.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd @@ -269,13 +255,7 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -287,7 +267,7 @@ $(RECURSIVE_TARGETS): local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -295,13 +275,7 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -322,7 +296,7 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -333,6 +307,14 @@ ctags-recursive: test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -341,22 +323,19 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ - empty_fix=.; \ else \ include_option=--include; \ - empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ + test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -366,11 +345,10 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -393,6 +371,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -406,7 +388,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -421,17 +403,15 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ @@ -441,6 +421,7 @@ check: check-recursive all-am: Makefile $(LIBRARIES) installdirs: installdirs-recursive installdirs-am: + install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -460,7 +441,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -479,8 +460,6 @@ dvi: dvi-recursive dvi-am: -html: html-recursive - info: info-recursive info-am: @@ -516,18 +495,22 @@ uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-noinstLIBRARIES clean-recursive \ - ctags ctags-recursive distclean distclean-compile \ - distclean-generic distclean-recursive distclean-tags distdir \ - dvi dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs installdirs-am \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-noinstLIBRARIES clean-recursive ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am + mostlyclean-generic mostlyclean-recursive pdf pdf-am \ + pdf-recursive ps ps-am ps-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/cpu/callback.cpp b/src/cpu/callback.cpp index e35416f..b92b478 100644 --- a/src/cpu/callback.cpp +++ b/src/cpu/callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: callback.cpp,v 1.31 2006/02/12 23:28:21 harekiet Exp $ */ +/* $Id: callback.cpp,v 1.36 2007/01/08 19:45:38 qbix79 Exp $ */ #include #include @@ -26,7 +26,7 @@ #include "mem.h" #include "cpu.h" -/* CallBack are located at 0xC800:0 +/* CallBack are located at 0xF100:0 (see CB_SEG in callback.h) And they are 16 bytes each and you can define them to behave in certain ways like a far return or and IRET */ @@ -65,12 +65,12 @@ void CALLBACK_Idle(void) { Bit16u oldcs=SegValue(cs); Bit32u oldeip=reg_eip; SegSet16(cs,CB_SEG); - reg_eip=call_idle<<4; + reg_eip=call_idle*CB_SIZE; DOSBOX_RunMachine(); reg_eip=oldeip; SegSet16(cs,oldcs); SETFLAGBIT(IF,oldIF); - if (!CPU_CycleAuto && CPU_Cycles>0) + if (!CPU_CycleAutoAdjust && CPU_Cycles>0) CPU_Cycles=0; } @@ -87,7 +87,7 @@ static Bitu stop_handler(void) { void CALLBACK_RunRealFar(Bit16u seg,Bit16u off) { reg_sp-=4; - mem_writew(SegPhys(ss)+reg_sp,call_stop<<4); + mem_writew(SegPhys(ss)+reg_sp,call_stop*CB_SIZE); mem_writew(SegPhys(ss)+reg_sp+2,CB_SEG); Bit32u oldeip=reg_eip; Bit16u oldcs=SegValue(cs); @@ -101,7 +101,7 @@ void CALLBACK_RunRealFar(Bit16u seg,Bit16u off) { void CALLBACK_RunRealInt(Bit8u intnum) { Bit32u oldeip=reg_eip; Bit16u oldcs=SegValue(cs); - reg_eip=(CB_MAX*16)+(intnum*6); + reg_eip=(CB_MAX*CB_SIZE)+(intnum*6); SegSet16(cs,CB_SEG); DOSBOX_RunMachine(); reg_eip=oldeip; @@ -133,75 +133,282 @@ const char* CALLBACK_GetDescription(Bitu nr) { return CallBack_Description[nr]; }; -bool CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,const char* descr) { - if (callback>=CB_MAX) return false; +Bitu CALLBACK_SetupExtra(Bitu callback, Bitu type, PhysPt physAddress, bool use_cb=true) { + if (callback>=CB_MAX) + return 0; switch (type) { + case CB_RETN: + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02, callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0xC3); //A RETN Instruction + return (use_cb?5:1); case CB_RETF: - phys_writeb(CB_BASE+(callback<<4)+0,(Bit8u)0xFE); //GRP 4 - phys_writeb(CB_BASE+(callback<<4)+1,(Bit8u)0x38); //Extra Callback instruction - phys_writew(CB_BASE+(callback<<4)+2,callback); //The immediate word - phys_writeb(CB_BASE+(callback<<4)+4,(Bit8u)0xCB); //A RETF Instruction - break; + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02, callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0xCB); //A RETF Instruction + return (use_cb?5:1); case CB_IRET: - phys_writeb(CB_BASE+(callback<<4)+0,(Bit8u)0xFE); //GRP 4 - phys_writeb(CB_BASE+(callback<<4)+1,(Bit8u)0x38); //Extra Callback instruction - phys_writew(CB_BASE+(callback<<4)+2,callback); //The immediate word - phys_writeb(CB_BASE+(callback<<4)+4,(Bit8u)0xCF); //An IRET Instruction - break; + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02,callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0xCF); //An IRET Instruction + return (use_cb?5:1); + case CB_IRETD: + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02,callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0x66); //An IRETD Instruction + phys_writeb(physAddress+0x01,(Bit8u)0xCF); + return (use_cb?6:2); case CB_IRET_STI: - phys_writeb(CB_BASE+(callback<<4)+0,(Bit8u)0xFB); //STI - phys_writeb(CB_BASE+(callback<<4)+1,(Bit8u)0xFE); //GRP 4 - phys_writeb(CB_BASE+(callback<<4)+2,(Bit8u)0x38); //Extra Callback instruction - phys_writew(CB_BASE+(callback<<4)+3,callback); //The immediate word - phys_writeb(CB_BASE+(callback<<4)+5,(Bit8u)0xCF); //An IRET Instruction - break; + phys_writeb(physAddress+0x00,(Bit8u)0xFB); //STI + if (use_cb) { + phys_writeb(physAddress+0x01,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x02,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x03, callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x01,(Bit8u)0xCF); //An IRET Instruction + return (use_cb?6:2); + case CB_IRET_EOI_PIC1: + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02,callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0x50); // push ax + phys_writeb(physAddress+0x01,(Bit8u)0xb0); // mov al, 0x20 + phys_writeb(physAddress+0x02,(Bit8u)0x20); + phys_writeb(physAddress+0x03,(Bit8u)0xe6); // out 0x20, al + phys_writeb(physAddress+0x04,(Bit8u)0x20); + phys_writeb(physAddress+0x05,(Bit8u)0x58); // pop ax + phys_writeb(physAddress+0x06,(Bit8u)0xcf); //An IRET Instruction + return (use_cb?0x0b:0x07); + case CB_IRQ0: // timer int8 + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02,callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0x50); // push ax + phys_writeb(physAddress+0x01,(Bit8u)0x52); // push dx + phys_writeb(physAddress+0x02,(Bit8u)0x1e); // push ds + phys_writew(physAddress+0x03,(Bit16u)0x1ccd); // int 1c + phys_writeb(physAddress+0x05,(Bit8u)0xfa); // cli + phys_writeb(physAddress+0x06,(Bit8u)0x1f); // pop ds + phys_writeb(physAddress+0x07,(Bit8u)0x5a); // pop dx + phys_writew(physAddress+0x08,(Bit16u)0x20b0); // mov al, 0x20 + phys_writew(physAddress+0x0a,(Bit16u)0x20e6); // out 0x20, al + phys_writeb(physAddress+0x0c,(Bit8u)0x58); // pop ax + phys_writeb(physAddress+0x0d,(Bit8u)0xcf); //An IRET Instruction + return (use_cb?0x12:0x0e); + case CB_IRQ1: // keyboard int9 + phys_writeb(physAddress+0x00,(Bit8u)0x50); // push ax + phys_writew(physAddress+0x01,(Bit16u)0x60e4); // in al, 0x60 + phys_writew(physAddress+0x03,(Bit16u)0x4fb4); // mov ah, 0x4f + phys_writeb(physAddress+0x05,(Bit8u)0xf9); // stc + phys_writew(physAddress+0x06,(Bit16u)0x15cd); // int 15 + if (use_cb) { + phys_writew(physAddress+0x08,(Bit16u)0x0473); // jc skip + phys_writeb(physAddress+0x0a,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x0b,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x0c,callback); //The immediate word + // jump here to (skip): + physAddress+=6; + } + phys_writeb(physAddress+0x08,(Bit8u)0xfa); // cli + phys_writew(physAddress+0x09,(Bit16u)0x20b0); // mov al, 0x20 + phys_writew(physAddress+0x0b,(Bit16u)0x20e6); // out 0x20, al + phys_writeb(physAddress+0x0d,(Bit8u)0x58); // pop ax + phys_writeb(physAddress+0x0e,(Bit8u)0xcf); //An IRET Instruction + return (use_cb?0x15:0x0f); + case CB_IRQ9: // pic cascade interrupt + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02,callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0x50); // push ax + phys_writew(physAddress+0x01,(Bit16u)0x61b0); // mov al, 0x61 + phys_writew(physAddress+0x03,(Bit16u)0xa0e6); // out 0xa0, al + phys_writew(physAddress+0x05,(Bit16u)0x0acd); // int a + phys_writeb(physAddress+0x07,(Bit8u)0xfa); // cli + phys_writeb(physAddress+0x08,(Bit8u)0x58); // pop ax + phys_writeb(physAddress+0x09,(Bit8u)0xcf); //An IRET Instruction + return (use_cb?0x0e:0x0a); + case CB_IRQ12: // ps2 mouse int74 + if (!use_cb) E_Exit("int74 callback must implement a callback handler!"); + phys_writeb(physAddress+0x00,(Bit8u)0x1e); // push ds + phys_writeb(physAddress+0x01,(Bit8u)0x06); // push es + phys_writew(physAddress+0x02,(Bit16u)0x6066); // pushad + phys_writeb(physAddress+0x04,(Bit8u)0xfb); // sti + phys_writeb(physAddress+0x05,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x06,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x07,callback); //The immediate word + return 0x09; + case CB_IRQ12_RET: // ps2 mouse int74 return + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02,callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0xfa); // cli + phys_writew(physAddress+0x01,(Bit16u)0x20b0); // mov al, 0x20 + phys_writew(physAddress+0x03,(Bit16u)0xa0e6); // out 0xa0, al + phys_writew(physAddress+0x05,(Bit16u)0x20e6); // out 0x20, al + phys_writew(physAddress+0x07,(Bit16u)0x6166); // popad + phys_writeb(physAddress+0x09,(Bit8u)0x07); // pop es + phys_writeb(physAddress+0x0a,(Bit8u)0x1f); // pop ds + phys_writeb(physAddress+0x0b,(Bit8u)0xcf); //An IRET Instruction + return (use_cb?0x10:0x0c); + case CB_IRQ6_PCJR: // pcjr keyboard interrupt + phys_writeb(physAddress+0x00,(Bit8u)0x50); // push ax + phys_writew(physAddress+0x01,(Bit16u)0x60e4); // in al, 0x60 + phys_writew(physAddress+0x03,(Bit16u)0xe03c); // cmp al, 0xe0 + if (use_cb) { + phys_writew(physAddress+0x05,(Bit16u)0x0674); // je skip + phys_writeb(physAddress+0x07,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x08,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x09,callback); //The immediate word + physAddress+=4; + } else { + phys_writew(physAddress+0x05,(Bit16u)0x0274); // je skip + } + phys_writew(physAddress+0x07,(Bit16u)0x09cd); // int 9 + // jump here to (skip): + phys_writeb(physAddress+0x09,(Bit8u)0xfa); // cli + phys_writew(physAddress+0x0a,(Bit16u)0x20b0); // mov al, 0x20 + phys_writew(physAddress+0x0c,(Bit16u)0x20e6); // out 0x20, al + phys_writeb(physAddress+0x0e,(Bit8u)0x58); // pop ax + phys_writeb(physAddress+0x0f,(Bit8u)0xcf); //An IRET Instruction + return (use_cb?0x14:0x10); + case CB_INT16: + phys_writeb(physAddress+0x00,(Bit8u)0xFB); //STI + if (use_cb) { + phys_writeb(physAddress+0x01,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x02,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x03, callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x01,(Bit8u)0xCF); //An IRET Instruction + for (Bitu i=0;i<=0x0b;i++) phys_writeb(physAddress+0x02+i,0x90); + phys_writew(physAddress+0x0e,(Bit16u)0xedeb); //jmp callback + return (use_cb?0x10:0x0c); + case CB_INT29: // fast console output + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02,callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0x50); // push ax + phys_writew(physAddress+0x01,(Bit16u)0x0eb4); // mov ah, 0x0e + phys_writew(physAddress+0x03,(Bit16u)0x10cd); // int 10 + phys_writeb(physAddress+0x05,(Bit8u)0x58); // pop ax + phys_writeb(physAddress+0x06,(Bit8u)0xcf); //An IRET Instruction + return (use_cb?0x0b:0x07); + case CB_HOOKABLE: + phys_writeb(physAddress+0x00,(Bit8u)0xEB); //jump near + phys_writeb(physAddress+0x01,(Bit8u)0x03); //offset + phys_writeb(physAddress+0x02,(Bit8u)0x90); //NOP + phys_writeb(physAddress+0x03,(Bit8u)0x90); //NOP + phys_writeb(physAddress+0x04,(Bit8u)0x90); //NOP + if (use_cb) { + phys_writeb(physAddress+0x05,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x06,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x07,callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x05,(Bit8u)0xCB); //A RETF Instruction + return (use_cb?0x0a:0x06); + case CB_TDE_IRET: // TandyDAC end transfer + if (use_cb) { + phys_writeb(physAddress+0x00,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x01,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x02,callback); //The immediate word + physAddress+=4; + } + phys_writeb(physAddress+0x00,(Bit8u)0x50); // push ax + phys_writeb(physAddress+0x01,(Bit8u)0xb8); // mov ax, 0x91fb + phys_writew(physAddress+0x02,(Bit16u)0x91fb); + phys_writew(physAddress+0x04,(Bit16u)0x15cd); // int 15 + phys_writeb(physAddress+0x06,(Bit8u)0xfa); // cli + phys_writew(physAddress+0x07,(Bit16u)0x20b0); // mov al, 0x20 + phys_writew(physAddress+0x09,(Bit16u)0x20e6); // out 0x20, al + phys_writeb(physAddress+0x0b,(Bit8u)0x58); // pop ax + phys_writeb(physAddress+0x0c,(Bit8u)0xcf); //An IRET Instruction + return (use_cb?0x11:0x0d); +/* case CB_IPXESR: // IPX ESR + if (!use_cb) E_Exit("ipx esr must implement a callback handler!"); + phys_writeb(physAddress+0x00,(Bit8u)0x1e); // push ds + phys_writeb(physAddress+0x01,(Bit8u)0x06); // push es + phys_writew(physAddress+0x02,(Bit16u)0xa00f); // push fs + phys_writew(physAddress+0x04,(Bit16u)0xa80f); // push gs + phys_writeb(physAddress+0x06,(Bit8u)0x60); // pusha + phys_writeb(physAddress+0x07,(Bit8u)0xFE); //GRP 4 + phys_writeb(physAddress+0x08,(Bit8u)0x38); //Extra Callback instruction + phys_writew(physAddress+0x09,callback); //The immediate word + phys_writeb(physAddress+0x0b,(Bit8u)0xCB); //A RETF Instruction + return 0x0c; + case CB_IPXESR_RET: // IPX ESR return + if (use_cb) E_Exit("ipx esr return must not implement a callback handler!"); + phys_writeb(physAddress+0x00,(Bit8u)0xfa); // cli + phys_writew(physAddress+0x01,(Bit16u)0x20b0); // mov al, 0x20 + phys_writew(physAddress+0x03,(Bit16u)0xa0e6); // out 0xa0, al + phys_writew(physAddress+0x05,(Bit16u)0x20e6); // out 0x20, al + phys_writeb(physAddress+0x07,(Bit8u)0x61); // popa + phys_writew(physAddress+0x08,(Bit16u)0xA90F); // pop gs + phys_writew(physAddress+0x0a,(Bit16u)0xA10F); // pop fs + phys_writeb(physAddress+0x0c,(Bit8u)0x07); // pop es + phys_writeb(physAddress+0x0d,(Bit8u)0x1f); // pop ds + phys_writeb(physAddress+0x0e,(Bit8u)0xcf); //An IRET Instruction + return 0x0f; */ default: E_Exit("CALLBACK:Setup:Illegal type %d",type); } + return 0; +} + +bool CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,const char* descr) { + if (callback>=CB_MAX) return false; + CALLBACK_SetupExtra(callback,type,CALLBACK_PhysPointer(callback)+0,(handler!=NULL)); CallBack_Handlers[callback]=handler; CALLBACK_SetDescription(callback,descr); return true; } -void CALLBACK_RemoveSetup(Bitu callback) { - for (Bitu i = 0;i < 16;i++) { - phys_writeb(CB_BASE+(callback<<4)+i ,(Bit8u) 0x00); +Bitu CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,PhysPt addr,const char* descr) { + if (callback>=CB_MAX) return 0; + Bitu csize=CALLBACK_SetupExtra(callback,type,addr,(handler!=NULL)); + if (csize>0) { + CallBack_Handlers[callback]=handler; + CALLBACK_SetDescription(callback,descr); } + return csize; } -Bitu CALLBACK_SetupExtra(Bitu callback, Bitu type, PhysPt physAddress) { - if (callback>=CB_MAX) - return 0; - switch (type) { - case CB_RETN: - phys_writeb(physAddress+0,(Bit8u)0xFE); //GRP 4 - phys_writeb(physAddress+1,(Bit8u)0x38); //Extra Callback instruction - phys_writew(physAddress+2, callback); //The immediate word - phys_writeb(physAddress+4,(Bit8u)0xC3); //A RETN Instruction - return 5; - case CB_RETF: - phys_writeb(physAddress+0,(Bit8u)0xFE); //GRP 4 - phys_writeb(physAddress+1,(Bit8u)0x38); //Extra Callback instruction - phys_writew(physAddress+2, callback); //The immediate word - phys_writeb(physAddress+4,(Bit8u)0xCB); //A RETF Instruction - return 5; - case CB_IRET: - phys_writeb(physAddress+0,(Bit8u)0xFE); //GRP 4 - phys_writeb(physAddress+1,(Bit8u)0x38); //Extra Callback instruction - phys_writew(physAddress+2,callback); //The immediate word - phys_writeb(physAddress+4,(Bit8u)0xCF); //An IRET Instruction - return 5; - case CB_IRET_STI: - phys_writeb(physAddress+0,(Bit8u)0xFB); //STI - phys_writeb(physAddress+1,(Bit8u)0xFE); //GRP 4 - phys_writeb(physAddress+2,(Bit8u)0x38); //Extra Callback instruction - phys_writew(physAddress+3, callback); //The immediate word - phys_writeb(physAddress+5,(Bit8u)0xCF); //An IRET Instruction - return 6; - default: - E_Exit("CALLBACK:Setup:Illegal type %d",type); +void CALLBACK_RemoveSetup(Bitu callback) { + for (Bitu i = 0;i < 16;i++) { + phys_writeb(CALLBACK_PhysPointer(callback)+i ,(Bit8u) 0x00); } - return 0; } CALLBACK_HandlerObject::~CALLBACK_HandlerObject(){ @@ -233,6 +440,15 @@ void CALLBACK_HandlerObject::Install(CallBack_Handler handler,Bitu type,const ch CALLBACK_Setup(m_callback,handler,type,description); } else E_Exit("Allready installed"); } +void CALLBACK_HandlerObject::Install(CallBack_Handler handler,Bitu type,PhysPt addr,const char* description){ + if(!installed) { + installed=true; + m_type=SETUP; + m_callback=CALLBACK_Allocate(); + CALLBACK_Setup(m_callback,handler,type,addr,description); + } else E_Exit("Allready installed"); +} + void CALLBACK_HandlerObject::Allocate(CallBack_Handler handler,const char* description) { if(!installed) { installed=true; @@ -256,21 +472,23 @@ void CALLBACK_Init(Section* sec) { for (i=0;i #include #include @@ -45,14 +43,11 @@ #include "debug.h" #include "paging.h" #include "inout.h" +#include "fpu.h" -#ifdef CHECKED_MEMORY_ACCESS #define CACHE_MAXSIZE (4096*2) -#else -#define CACHE_MAXSIZE (4096) -#endif -#define CACHE_PAGES (128*8) -#define CACHE_TOTAL (CACHE_PAGES*4096) +#define CACHE_TOTAL (1024*1024*8) +#define CACHE_PAGES (512) #define CACHE_BLOCKS (64*1024) #define CACHE_ALIGN (16) #define DYN_HASH_SHIFT (4) @@ -73,7 +68,7 @@ enum { G_EAX,G_ECX,G_EDX,G_EBX, G_ESP,G_EBP,G_ESI,G_EDI, G_ES,G_CS,G_SS,G_DS,G_FS,G_GS, - G_FLAGS,G_SMASK,G_EIP, + G_FLAGS,G_NEWESP,G_EIP, G_EA,G_STACK,G_CYCLES, G_TMPB,G_TMPW,G_SHIFT, G_EXIT, @@ -118,6 +113,7 @@ enum BlockReturn { #if (C_DEBUG) BR_OpcodeFull, #endif + BR_Iret, BR_CallBack, BR_SMCBlock }; @@ -155,7 +151,7 @@ static DynReg DynRegs[G_MAX]; #define DREG(_WHICH_) &DynRegs[G_ ## _WHICH_ ] static struct { - Bitu ea,tmpb,tmpd,stack,shift; + Bitu ea,tmpb,tmpd,stack,shift,newesp; } extra_regs; static void IllegalOption(const char* msg) { @@ -165,9 +161,19 @@ static void IllegalOption(const char* msg) { #include "core_dyn_x86/cache.h" static struct { - Bitu callback,readdata; + Bitu callback; + Bit32u readdata; } core_dyn; +static struct { + Bit32u state[32]; + FPU_P_Reg temp,temp2; + Bit32u dh_fpu_enabled; + Bit32u state_used; + Bit32u cw,host_cw; + Bit8u temp_state[128]; +} dyn_dh_fpu; + #include "core_dyn_x86/risc_x86.h" @@ -224,6 +230,30 @@ static void dyn_restoreregister(DynReg * src_reg, DynReg * dst_reg) { #include "core_dyn_x86/decoder.h" +#if defined (_MSC_VER) +#define DH_FPU_SAVE_REINIT \ +{ \ + __asm { \ + __asm fnsave dyn_dh_fpu.state[0] \ + } \ + dyn_dh_fpu.state_used=false; \ + dyn_dh_fpu.state[0]|=0x3f; \ +} +#else +#define DH_FPU_SAVE_REINIT \ +{ \ + __asm__ volatile ( \ + "fnsave %0 \n" \ + : \ + : "m" (dyn_dh_fpu.state[0]) \ + : "memory" \ + ); \ + dyn_dh_fpu.state_used=false; \ + dyn_dh_fpu.state[0]|=0x3f; \ +} +#endif + + Bits CPU_Core_Dyn_X86_Run(void) { /* Determine the linear address of CS:EIP */ restart_core: @@ -232,17 +262,49 @@ restart_core: #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) return debugCallback; #endif - CodePageHandler * chandler=MakeCodePage(ip_page); - if (!chandler) return CPU_Core_Normal_Run(); + CodePageHandler * chandler=0; + if (GCC_UNLIKELY(MakeCodePage(ip_page,chandler))) { + CPU_Exception(cpu.exception.which,cpu.exception.error); + goto restart_core; + } + if (!chandler) { + if (dyn_dh_fpu.state_used) DH_FPU_SAVE_REINIT + return CPU_Core_Normal_Run(); + } /* Find correct Dynamic Block to run */ CacheBlock * block=chandler->FindCacheBlock(ip_point&4095); if (!block) { - block=CreateCacheBlock(chandler,ip_point,32); + if (!chandler->invalidation_map || (chandler->invalidation_map[ip_point&4095]<4)) { + block=CreateCacheBlock(chandler,ip_point,32); + } else { + Bitu old_cycles=CPU_Cycles; + CPU_Cycles=1; + Bits nc_retcode=CPU_Core_Normal_Run(); + if (dyn_dh_fpu.state_used) DH_FPU_SAVE_REINIT + if (!nc_retcode) { + CPU_Cycles=old_cycles-1; + goto restart_core; + } + CPU_CycleLeft+=old_cycles; + return nc_retcode; + } } run_block: cache.block.running=0; BlockReturn ret=gen_runcode(block->cache.start); switch (ret) { + case BR_Iret: +#if C_HEAVY_DEBUG + if (DEBUG_HeavyIsBreakpoint()) { + if (dyn_dh_fpu.state_used) DH_FPU_SAVE_REINIT + return debugCallback; + } +#endif + if (!GETFLAG(TF)) goto restart_core; + cpudecoder=CPU_Core_Dyn_X86_Trap_Run; + if (!dyn_dh_fpu.state_used) return CBRET_NONE; + DH_FPU_SAVE_REINIT + return CBRET_NONE; case BR_Normal: /* Maybe check if we staying in the same page? */ #if C_HEAVY_DEBUG @@ -253,8 +315,12 @@ run_block: #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) return debugCallback; #endif + if (!dyn_dh_fpu.state_used) return CBRET_NONE; + DH_FPU_SAVE_REINIT return CBRET_NONE; case BR_CallBack: + if (!dyn_dh_fpu.state_used) return core_dyn.callback; + DH_FPU_SAVE_REINIT return core_dyn.callback; case BR_SMCBlock: // LOG_MSG("selfmodification of running block at %x:%x",SegValue(cs),reg_eip); @@ -263,11 +329,13 @@ run_block: case BR_Opcode: CPU_CycleLeft+=CPU_Cycles; CPU_Cycles=1; + if (dyn_dh_fpu.state_used) DH_FPU_SAVE_REINIT return CPU_Core_Normal_Run(); #if (C_DEBUG) case BR_OpcodeFull: CPU_CycleLeft+=CPU_Cycles; CPU_Cycles=1; + if (dyn_dh_fpu.state_used) DH_FPU_SAVE_REINIT return CPU_Core_Full_Run(); #endif case BR_Link1: @@ -285,7 +353,21 @@ run_block: } goto restart_core; } -return 0; + if (dyn_dh_fpu.state_used) DH_FPU_SAVE_REINIT + return CBRET_NONE; +} + +Bits CPU_Core_Dyn_X86_Trap_Run(void) { + Bits oldCycles = CPU_Cycles; + CPU_Cycles = 1; + cpu.trap_skip = false; + + Bits ret=CPU_Core_Normal_Run(); + if (!cpu.trap_skip) CPU_HW_Interrupt(1); + CPU_Cycles = oldCycles-1; + cpudecoder = &CPU_Core_Dyn_X86_Run; + + return ret; } void CPU_Core_Dyn_X86_Init(void) { @@ -326,8 +408,8 @@ void CPU_Core_Dyn_X86_Init(void) { DynRegs[G_FLAGS].data=®_flags; DynRegs[G_FLAGS].flags=DYNFLG_LOAD|DYNFLG_SAVE; - DynRegs[G_SMASK].data=&cpu.stack.mask; - DynRegs[G_SMASK].flags=DYNFLG_LOAD|DYNFLG_SAVE; + DynRegs[G_NEWESP].data=&extra_regs.newesp; + DynRegs[G_NEWESP].flags=0; DynRegs[G_EIP].data=®_eip; DynRegs[G_EIP].flags=DYNFLG_LOAD|DYNFLG_SAVE; @@ -348,6 +430,28 @@ void CPU_Core_Dyn_X86_Init(void) { DynRegs[G_EXIT].flags=DYNFLG_HAS16; /* Init the generator */ gen_init(); + + /* Init the fpu state */ + dyn_dh_fpu.dh_fpu_enabled=true; + dyn_dh_fpu.state_used=false; + dyn_dh_fpu.cw=0x37f; +#if defined (_MSC_VER) + __asm { + __asm finit + __asm fsave dyn_dh_fpu.state[0] + __asm fstcw dyn_dh_fpu.host_cw + } +#else + __asm__ volatile ( + "finit \n" + "fsave %0 \n" + "fstcw %1 \n" + : + : "m" (dyn_dh_fpu.state[0]), "m" (dyn_dh_fpu.host_cw) + : "memory" + ); +#endif + return; } @@ -356,4 +460,12 @@ void CPU_Core_Dyn_X86_Cache_Init(bool enable_cache) { cache_init(enable_cache); } +void CPU_Core_Dyn_X86_Cache_Close(void) { + cache_close(); +} + +void CPU_Core_Dyn_X86_SetFPUMode(bool dh_fpu) { + dyn_dh_fpu.dh_fpu_enabled=dh_fpu; +} + #endif diff --git a/src/cpu/core_dyn_x86/Makefile.am b/src/cpu/core_dyn_x86/Makefile.am index ad1008a..3d9be09 100644 --- a/src/cpu/core_dyn_x86/Makefile.am +++ b/src/cpu/core_dyn_x86/Makefile.am @@ -1 +1,2 @@ -noinst_HEADERS = cache.h helpers.h decoder.h risc_x86.h string.h \ No newline at end of file +noinst_HEADERS = cache.h helpers.h decoder.h risc_x86.h string.h \ + dyn_fpu.h dyn_fpu_dh.h \ No newline at end of file diff --git a/src/cpu/core_dyn_x86/Makefile.in b/src/cpu/core_dyn_x86/Makefile.in index 1cc69a1..60fb727 100644 --- a/src/cpu/core_dyn_x86/Makefile.in +++ b/src/cpu/core_dyn_x86/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -34,26 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/cpu/core_dyn_x86 -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -80,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -110,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -120,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -129,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -154,41 +138,36 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ -noinst_HEADERS = cache.h helpers.h decoder.h risc_x86.h string.h +noinst_HEADERS = cache.h helpers.h decoder.h risc_x86.h string.h \ + dyn_fpu.h dyn_fpu_dh.h + +subdir = src/cpu/core_dyn_x86 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in Makefile.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/cpu/core_dyn_x86/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/cpu/core_dyn_x86/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu src/cpu/core_dyn_x86/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -197,7 +176,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -209,11 +187,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -236,6 +213,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -249,7 +230,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -267,6 +248,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(HEADERS) + installdirs: install: install-am install-exec: install-exec-am @@ -287,7 +269,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -304,8 +286,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -338,14 +318,14 @@ ps-am: uninstall-am: uninstall-info-am -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - ctags distclean distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic ctags \ + distclean distclean-generic distclean-tags distdir dvi dvi-am \ + info info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/cpu/core_dyn_x86/cache.h b/src/cpu/core_dyn_x86/cache.h index 07ff1b9..7fe2965 100644 --- a/src/cpu/core_dyn_x86/cache.h +++ b/src/cpu/core_dyn_x86/cache.h @@ -15,6 +15,9 @@ public: Bit8u * start; //Where in the cache are we Bitu size; CacheBlock * next; + Bit8u * wmapmask; + Bit16u maskstart; + Bit16u masklen; } cache; struct { Bitu index; @@ -28,7 +31,6 @@ public: CacheBlock * crossblock; }; -class CacheBlock; static struct { struct { CacheBlock * first; @@ -42,17 +44,13 @@ static struct { CodePageHandler * last_page; } cache; -#if (C_HAVE_MPROTECT) -static Bit8u cache_code_link_blocks[2][16] GCC_ATTRIBUTE(aligned(PAGESIZE)); -#else -static Bit8u cache_code_link_blocks[2][16]; -#endif - static CacheBlock link_blocks[2]; -class CodePageHandler :public PageHandler { +class CodePageHandler : public PageHandler { public: - CodePageHandler() {} + CodePageHandler() { + invalidation_map=NULL; + } void SetupAt(Bitu _phys_page,PageHandler * _old_pagehandler) { phys_page=_phys_page; old_pagehandler=_old_pagehandler; @@ -62,6 +60,10 @@ public: active_count=16; memset(&hash_map,0,sizeof(hash_map)); memset(&write_map,0,sizeof(write_map)); + if (invalidation_map!=NULL) { + free(invalidation_map); + invalidation_map=NULL; + } } bool InvalidateRange(Bitu start,Bitu end) { Bits index=1+(start>>DYN_HASH_SHIFT); @@ -87,69 +89,114 @@ public: } void writeb(PhysPt addr,Bitu val){ addr&=4095; + if (host_readb(hostmem+addr)==(Bit8u)val) return; host_writeb(hostmem+addr,val); if (!*(Bit8u*)&write_map[addr]) { if (active_blocks) return; active_count--; if (!active_count) Release(); - } else InvalidateRange(addr,addr); + return; + } else if (!invalidation_map) { + invalidation_map=(Bit8u*)malloc(4096); + memset(invalidation_map,0,4096); + } + invalidation_map[addr]++; + InvalidateRange(addr,addr); } void writew(PhysPt addr,Bitu val){ addr&=4095; + if (host_readw(hostmem+addr)==(Bit16u)val) return; host_writew(hostmem+addr,val); if (!*(Bit16u*)&write_map[addr]) { if (active_blocks) return; active_count--; if (!active_count) Release(); - } else InvalidateRange(addr,addr+1); + return; + } else if (!invalidation_map) { + invalidation_map=(Bit8u*)malloc(4096); + memset(invalidation_map,0,4096); + } + (*(Bit16u*)&invalidation_map[addr])+=0x101; + InvalidateRange(addr,addr+1); } void writed(PhysPt addr,Bitu val){ addr&=4095; + if (host_readd(hostmem+addr)==(Bit32u)val) return; host_writed(hostmem+addr,val); if (!*(Bit32u*)&write_map[addr]) { if (active_blocks) return; active_count--; if (!active_count) Release(); - } else InvalidateRange(addr,addr+3); + return; + } else if (!invalidation_map) { + invalidation_map=(Bit8u*)malloc(4096); + memset(invalidation_map,0,4096); + } + (*(Bit32u*)&invalidation_map[addr])+=0x1010101; + InvalidateRange(addr,addr+3); } bool writeb_checked(PhysPt addr,Bitu val) { addr&=4095; + if (host_readb(hostmem+addr)==(Bit8u)val) return false; if (!*(Bit8u*)&write_map[addr]) { if (!active_blocks) { active_count--; if (!active_count) Release(); } - } else if (InvalidateRange(addr,addr)) { - cpu.exception.which=SMC_CURRENT_BLOCK; - return true; + } else { + if (!invalidation_map) { + invalidation_map=(Bit8u*)malloc(4096); + memset(invalidation_map,0,4096); + } + invalidation_map[addr]++; + if (InvalidateRange(addr,addr)) { + cpu.exception.which=SMC_CURRENT_BLOCK; + return true; + } } host_writeb(hostmem+addr,val); return false; } bool writew_checked(PhysPt addr,Bitu val) { addr&=4095; + if (host_readw(hostmem+addr)==(Bit16u)val) return false; if (!*(Bit16u*)&write_map[addr]) { if (!active_blocks) { active_count--; if (!active_count) Release(); } - } else if (InvalidateRange(addr,addr+1)) { - cpu.exception.which=SMC_CURRENT_BLOCK; - return true; + } else { + if (!invalidation_map) { + invalidation_map=(Bit8u*)malloc(4096); + memset(invalidation_map,0,4096); + } + (*(Bit16u*)&invalidation_map[addr])+=0x101; + if (InvalidateRange(addr,addr+1)) { + cpu.exception.which=SMC_CURRENT_BLOCK; + return true; + } } host_writew(hostmem+addr,val); return false; } bool writed_checked(PhysPt addr,Bitu val) { addr&=4095; + if (host_readd(hostmem+addr)==(Bit32u)val) return false; if (!*(Bit32u*)&write_map[addr]) { if (!active_blocks) { active_count--; if (!active_count) Release(); } - } else if (InvalidateRange(addr,addr+3)) { - cpu.exception.which=SMC_CURRENT_BLOCK; - return true; + } else { + if (!invalidation_map) { + invalidation_map=(Bit8u*)malloc(4096); + memset(invalidation_map,0,4096); + } + (*(Bit32u*)&invalidation_map[addr])+=0x1010101; + if (InvalidateRange(addr,addr+3)) { + cpu.exception.which=SMC_CURRENT_BLOCK; + return true; + } } host_writed(hostmem+addr,val); return false; @@ -178,8 +225,22 @@ public: //Will crash if a block isn't found, which should never happen. } *where=block->hash.next; - for (Bitu i=block->page.start;i<=block->page.end;i++) { - if (write_map[i]) write_map[i]--; + if (GCC_UNLIKELY(block->cache.wmapmask!=NULL)) { + for (Bitu i=block->page.start;icache.maskstart;i++) { + if (write_map[i]) write_map[i]--; + } + Bitu maskct=0; + for (Bitu i=block->cache.maskstart;i<=block->page.end;i++,maskct++) { + if (write_map[i]) { + if ((maskct>=block->cache.masklen) || (!block->cache.wmapmask[maskct])) write_map[i]--; + } + } + free(block->cache.wmapmask); + block->cache.wmapmask=NULL; + } else { + for (Bitu i=block->page.start;i<=block->page.end;i++) { + if (write_map[i]) write_map[i]--; + } } } void Release(void) { @@ -222,6 +283,7 @@ public: } public: Bit8u write_map[4096]; + Bit8u * invalidation_map; CodePageHandler * next, * prev; private: PageHandler * old_pagehandler; @@ -233,36 +295,6 @@ private: }; -static CodePageHandler * MakeCodePage(Bitu lin_page) { - mem_readb(lin_page << 12); //Ensure page contains memory - PageHandler * handler=paging.tlb.handler[lin_page]; - if (handler->flags & PFLAG_HASCODE) return ( CodePageHandler *)handler; - if (handler->flags & PFLAG_NOCODE) { - LOG_MSG("DYNX86:Can't run code in this page"); - return 0; - } - Bitu phys_page=lin_page; - if (!PAGING_MakePhysPage(phys_page)) { - LOG_MSG("DYNX86:Can't find physpage"); - return 0; - } - /* Find a free CodePage */ - if (!cache.free_pages) { - cache.used_pages->ClearRelease(); - } - CodePageHandler * cpagehandler=cache.free_pages; - cache.free_pages=cache.free_pages->next; - cpagehandler->prev=cache.last_page; - cpagehandler->next=0; - if (cache.last_page) cache.last_page->next=cpagehandler; - cache.last_page=cpagehandler; - if (!cache.used_pages) cache.used_pages=cpagehandler; - cpagehandler->SetupAt(phys_page,handler); - MEM_SetPageHandler(phys_page,1,cpagehandler); - PAGING_UnlinkPages(lin_page,1); - return cpagehandler; -} - static INLINE void cache_addunsedblock(CacheBlock * block) { block->cache.next=cache.block.free; cache.block.free=block; @@ -309,6 +341,10 @@ void CacheBlock::Clear(void) { page.handler->DelCacheBlock(this); page.handler=0; } + if (cache.wmapmask){ + free(cache.wmapmask); + cache.wmapmask=NULL; + } } @@ -390,19 +426,21 @@ static INLINE void cache_addd(Bit32u val) { static void gen_return(BlockReturn retcode); +static Bit8u * cache_code_start_ptr=NULL; static Bit8u * cache_code=NULL; +static Bit8u * cache_code_link_blocks=NULL; static CacheBlock * cache_blocks=NULL; /* Define temporary pagesize so the MPROTECT case and the regular case share as much code as possible */ #if (C_HAVE_MPROTECT) #define PAGESIZE_TEMP PAGESIZE #else -#define PAGESIZE_TEMP 1 +#define PAGESIZE_TEMP 4096 #endif +static bool cache_initialized = false; static void cache_init(bool enable) { - static bool cache_initialized = false; Bits i; if (enable) { if (cache_initialized) return; @@ -418,16 +456,17 @@ static void cache_init(bool enable) { cache_blocks[i].cache.next=&cache_blocks[i+1]; } } + if (cache_code_start_ptr==NULL) { + cache_code_start_ptr=(Bit8u*)malloc(CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP-1+PAGESIZE_TEMP); + if(!cache_code_start_ptr) E_Exit("Allocating dynamic cache failed"); + + cache_code=(Bit8u*)(((int)cache_code_start_ptr + PAGESIZE_TEMP-1) & ~(PAGESIZE_TEMP-1)); //MEM LEAK. store old pointer if you want to free it. + + cache_code_link_blocks=cache_code; + cache_code+=PAGESIZE_TEMP; + #if (C_HAVE_MPROTECT) - if(mprotect(cache_code_link_blocks,sizeof(cache_code_link_blocks),PROT_WRITE|PROT_READ|PROT_EXEC)) - LOG_MSG("Setting excute permission on cache code link blocks has failed"); -#endif - if (cache_code==NULL) { - cache_code=(Bit8u*)malloc(CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP-1); - if(!cache_code) E_Exit("Allocating dynamic cache failed"); -#if (C_HAVE_MPROTECT) - cache_code=(Bit8u*)(((int)cache_code + PAGESIZE-1) & ~(PAGESIZE-1)); //MEM LEAK. store old pointer if you want to free it. - if(mprotect(cache_code,CACHE_TOTAL+CACHE_MAXSIZE,PROT_WRITE|PROT_READ|PROT_EXEC)) + if(mprotect(cache_code_link_blocks,CACHE_TOTAL+CACHE_MAXSIZE+PAGESIZE_TEMP,PROT_WRITE|PROT_READ|PROT_EXEC)) LOG_MSG("Setting excute permission on the code cache has failed!"); #endif CacheBlock * block=cache_getblock(); @@ -438,20 +477,43 @@ static void cache_init(bool enable) { block->cache.next=0; //Last block in the list } /* Setup the default blocks for block linkage returns */ - cache.pos=&cache_code_link_blocks[0][0]; + cache.pos=&cache_code_link_blocks[0]; link_blocks[0].cache.start=cache.pos; gen_return(BR_Link1); - cache.pos=&cache_code_link_blocks[1][0]; + cache.pos=&cache_code_link_blocks[32]; link_blocks[1].cache.start=cache.pos; gen_return(BR_Link2); cache.free_pages=0; cache.last_page=0; cache.used_pages=0; /* Setup the code pages */ - for (i=0;inext=cache.free_pages; cache.free_pages=newpage; } } } + +static void cache_close(void) { +/* for (;;) { + if (cache.used_pages) { + CodePageHandler * cpage=cache.used_pages; + CodePageHandler * npage=cache.used_pages->next; + cpage->ClearRelease(); + delete cpage; + cache.used_pages=npage; + } else break; + } + if (cache_blocks != NULL) { + free(cache_blocks); + cache_blocks = NULL; + } + if (cache_code_start_ptr != NULL) { + free(cache_code_start_ptr); + cache_code_start_ptr = NULL; + } + cache_code = NULL; + cache_code_link_blocks = NULL; + cache_initialized = false; */ +} diff --git a/src/cpu/core_dyn_x86/decoder.h b/src/cpu/core_dyn_x86/decoder.h index 19dc1a4..9bdf851 100644 --- a/src/cpu/core_dyn_x86/decoder.h +++ b/src/cpu/core_dyn_x86/decoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,17 +16,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "fpu.h" -#define DYN_FPU_ESC(code) { \ - dyn_get_modrm(); \ - if (decode.modrm.val >= 0xc0) { \ - gen_call_function((void*)&FPU_ESC ## code ## _Normal,"%Id",decode.modrm.val); \ - } else { \ - dyn_fill_ea(); \ - gen_call_function((void*)&FPU_ESC ## code ## _EA,"%Id%Dd",decode.modrm.val,DREG(EA)); \ - gen_releasereg(DREG(EA)); \ - } \ -} +#define X86_DYNFPU_DH_ENABLED +#define X86_INLINED_MEMACCESS + enum REP_Type { REP_NONE=0,REP_NZ,REP_Z @@ -46,6 +38,7 @@ static struct DynDecode { CodePageHandler * code; Bitu index; Bit8u * wmap; + Bit8u * invmap; Bitu first; } page; struct { @@ -57,11 +50,57 @@ static struct DynDecode { DynReg * segprefix; } decode; +static bool MakeCodePage(Bitu lin_page,CodePageHandler * &cph) { + Bit8u rdval; + //Ensure page contains memory: + if (GCC_UNLIKELY(mem_readb_checked_x86(lin_page << 12,&rdval))) return true; + PageHandler * handler=paging.tlb.handler[lin_page]; + if (handler->flags & PFLAG_HASCODE) { + cph=( CodePageHandler *)handler; + return false; + } + if (handler->flags & PFLAG_NOCODE) { + LOG_MSG("DYNX86:Can't run code in this page"); + cph=0; return false; + } + Bitu phys_page=lin_page; + if (!PAGING_MakePhysPage(phys_page)) { + LOG_MSG("DYNX86:Can't find physpage"); + cph=0; return false; + } + /* Find a free CodePage */ + if (!cache.free_pages) { + if (cache.used_pages!=decode.page.code) cache.used_pages->ClearRelease(); + else { + if ((cache.used_pages->next) && (cache.used_pages->next!=decode.page.code)) + cache.used_pages->next->ClearRelease(); + else { + LOG_MSG("DYNX86:Invalid cache links"); + cache.used_pages->ClearRelease(); + } + } + } + CodePageHandler * cpagehandler=cache.free_pages; + cache.free_pages=cache.free_pages->next; + cpagehandler->prev=cache.last_page; + cpagehandler->next=0; + if (cache.last_page) cache.last_page->next=cpagehandler; + cache.last_page=cpagehandler; + if (!cache.used_pages) cache.used_pages=cpagehandler; + cpagehandler->SetupAt(phys_page,handler); + MEM_SetPageHandler(phys_page,1,cpagehandler); + PAGING_UnlinkPages(lin_page,1); + cph=cpagehandler; + return false; +} + static Bit8u decode_fetchb(void) { - if (decode.page.index>=4096) { + if (GCC_UNLIKELY(decode.page.index>=4096)) { /* Advance to the next page */ decode.active_block->page.end=4095; - decode.page.code=MakeCodePage(++decode.page.first); + /* trigger possible page fault here */ + mem_readb((++decode.page.first) << 12); + MakeCodePage(decode.page.first,decode.page.code); CacheBlock * newblock=cache_getblock(); decode.active_block->crossblock=newblock; newblock->crossblock=decode.active_block; @@ -69,6 +108,7 @@ static Bit8u decode_fetchb(void) { decode.active_block->page.start=0; decode.page.code->AddCrossBlock(decode.active_block); decode.page.wmap=decode.page.code->write_map; + decode.page.invmap=decode.page.code->invalidation_map; decode.page.index=0; } decode.page.wmap[decode.page.index]+=0x01; @@ -77,7 +117,7 @@ static Bit8u decode_fetchb(void) { return mem_readb(decode.code-1); } static Bit16u decode_fetchw(void) { - if (decode.page.index>=4095) { + if (GCC_UNLIKELY(decode.page.index>=4095)) { Bit16u val=decode_fetchb(); val|=decode_fetchb() << 8; return val; @@ -87,7 +127,7 @@ static Bit16u decode_fetchw(void) { return mem_readw(decode.code-2); } static Bit32u decode_fetchd(void) { - if (decode.page.index>=4093) { + if (GCC_UNLIKELY(decode.page.index>=4093)) { Bit32u val=decode_fetchb(); val|=decode_fetchb() << 8; val|=decode_fetchb() << 16; @@ -100,6 +140,80 @@ static Bit32u decode_fetchd(void) { return mem_readd(decode.code-4); } +#define START_WMMEM 64 + +static void INLINE decode_increase_wmapmask(Bitu size) { + Bitu mapidx; + CacheBlock* activecb=decode.active_block; + if (GCC_UNLIKELY(!activecb->cache.wmapmask)) { + activecb->cache.wmapmask=(Bit8u*)malloc(START_WMMEM); + memset(activecb->cache.wmapmask,0,START_WMMEM); + activecb->cache.maskstart=decode.page.index; + activecb->cache.masklen=START_WMMEM; + mapidx=0; + } else { + mapidx=decode.page.index-activecb->cache.maskstart; + if (GCC_UNLIKELY(mapidx+size>=activecb->cache.masklen)) { + Bitu newmasklen=activecb->cache.masklen*4; + if (newmasklencache.wmapmask,activecb->cache.masklen); + free(activecb->cache.wmapmask); + activecb->cache.wmapmask=tempmem; + activecb->cache.masklen=newmasklen; + } + } + switch (size) { + case 1 : activecb->cache.wmapmask[mapidx]+=0x01; break; + case 2 : (*(Bit16u*)&activecb->cache.wmapmask[mapidx])+=0x0101; break; + case 4 : (*(Bit32u*)&activecb->cache.wmapmask[mapidx])+=0x01010101; break; + } +} + +static bool decode_fetchb_imm(Bitu & val) { + if (decode.page.index<4096) { + Bitu index=(decode.code>>12); + if (paging.tlb.read[index]) { + val=(Bitu)(paging.tlb.read[index]+decode.code); + decode_increase_wmapmask(1); + decode.code++; + decode.page.index++; + return true; + } + } + val=(Bit32u)decode_fetchb(); + return false; +} +static bool decode_fetchw_imm(Bitu & val) { + if (decode.page.index<4095) { + Bitu index=(decode.code>>12); + if (paging.tlb.read[index]) { + val=(Bitu)(paging.tlb.read[index]+decode.code); + decode_increase_wmapmask(2); + decode.code+=2; + decode.page.index+=2; + return true; + } + } + val=decode_fetchw(); + return false; +} +static bool decode_fetchd_imm(Bitu & val) { + if (decode.page.index<4093) { + Bitu index=(decode.code>>12); + if (paging.tlb.read[index]) { + val=(Bitu)(paging.tlb.read[index]+decode.code); + decode_increase_wmapmask(4); + decode.code+=4; + decode.page.index+=4; + return true; + } + } + val=decode_fetchd(); + return false; +} + static void dyn_reduce_cycles(void) { gen_protectflags(); @@ -148,14 +262,16 @@ static INLINE void dyn_set_eip_last(void) { } -enum save_info_type {exception, cycle_check, normal}; +enum save_info_type {exception, cycle_check, normal, fpu_restore}; -struct { + +static struct { save_info_type type; DynState state; Bit8u * branch_pos; Bit32u eip_change; Bitu cycles; + Bit8u * return_pos; } save_info[512]; Bitu used_save_info=0; @@ -194,6 +310,33 @@ static void dyn_check_bool_exception_al(void) { used_save_info++; } +#include "pic.h" + +static void dyn_check_irqrequest(void) { + gen_load_host(&PIC_IRQCheck,DREG(TMPB),4); + gen_dop_word(DOP_OR,true,DREG(TMPB),DREG(TMPB)); + save_info[used_save_info].branch_pos=gen_create_branch_long(BR_NZ); + gen_releasereg(DREG(TMPB)); + dyn_savestate(&save_info[used_save_info].state); + if (!decode.cycles) decode.cycles++; + save_info[used_save_info].cycles=decode.cycles; + save_info[used_save_info].eip_change=decode.code-decode.code_start; + if (!cpu.code.big) save_info[used_save_info].eip_change&=0xffff; + save_info[used_save_info].type=normal; + used_save_info++; +} + +static void dyn_check_bool_exception_ne(void) { + save_info[used_save_info].branch_pos=gen_create_branch_long(BR_Z); + dyn_savestate(&save_info[used_save_info].state); + if (!decode.cycles) decode.cycles++; + save_info[used_save_info].cycles=decode.cycles; + save_info[used_save_info].eip_change=decode.op_start-decode.code_start; + if (!cpu.code.big) save_info[used_save_info].eip_change&=0xffff; + save_info[used_save_info].type=exception; + used_save_info++; +} + static void dyn_fill_blocks(void) { for (Bitu sct=0; sctindex<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.state_used))); + gen_releasereg(DREG(TMPB)); + dyn_synchstate(&save_info[sct].state); + gen_create_jump(save_info[sct].return_pos); + break; } } used_save_info=0; } -#ifdef CHECKED_MEMORY_ACCESS + +#if !defined(X86_INLINED_MEMACCESS) static void dyn_read_byte(DynReg * addr,DynReg * dst,Bitu high) { gen_protectflags(); gen_call_function((void *)&mem_readb_checked_x86,"%Dd%Id",addr,&core_dyn.readdata); @@ -252,7 +411,7 @@ static void dyn_read_byte_release(DynReg * addr,DynReg * dst,Bitu high) { dyn_check_bool_exception_al(); gen_mov_host(&core_dyn.readdata,dst,1,high); } - static void dyn_write_byte_release(DynReg * addr,DynReg * val,Bitu high) { +static void dyn_write_byte_release(DynReg * addr,DynReg * val,Bitu high) { gen_protectflags(); if (high) gen_call_function((void *)&mem_writeb_checked_x86,"%Ddr%Dh",addr,val); else gen_call_function((void *)&mem_writeb_checked_x86,"%Ddr%Dd",addr,val); @@ -271,50 +430,442 @@ static void dyn_write_word_release(DynReg * addr,DynReg * val,bool dword) { else gen_call_function((void *)&mem_writew_checked_x86,"%Ddr%Dd",addr,val); dyn_check_bool_exception_al(); } + #else + +static void dyn_read_intro(DynReg * addr,bool release_addr=true) { + gen_protectflags(); + + if (addr->genreg) { + // addr already in a register + Bit8u reg_idx=(Bit8u)addr->genreg->index; + x86gen.regs[X86_REG_ECX]->Clear(); + if (reg_idx!=1) { + cache_addw(0xc88b+(reg_idx<<8)); //Mov ecx,reg + } + x86gen.regs[X86_REG_EAX]->Clear(); + if (release_addr) gen_releasereg(addr); + } else { + // addr still in memory, directly move into ecx + x86gen.regs[X86_REG_EAX]->Clear(); + x86gen.regs[X86_REG_ECX]->Clear(); + cache_addw(0x0d8b); //Mov ecx,[data] + cache_addd((Bit32u)addr->data); + } + x86gen.regs[X86_REG_EDX]->Clear(); + + cache_addw(0xc18b); // mov eax,ecx +} + +bool mem_readb_checked_x86x(PhysPt address) { + Bitu index=(address>>12); + Bitu uval; + bool retval; + retval=paging.tlb.handler[index]->readb_checked(address, &uval); + core_dyn.readdata=(Bit8u)uval; + return retval; +} + static void dyn_read_byte(DynReg * addr,DynReg * dst,Bitu high) { - if (high) gen_call_function((void *)&mem_readb,"%Dd%Rh",addr,dst); - else gen_call_function((void *)&mem_readb,"%Dd%Rl",addr,dst); -} -static void dyn_write_byte(DynReg * addr,DynReg * val,Bitu high) { - if (high) gen_call_function((void *)&mem_writeb,"%Dd%Dh",addr,val); - else gen_call_function((void *)&mem_writeb,"%Dd%Dd",addr,val); -} -static void dyn_read_word(DynReg * addr,DynReg * dst,bool dword) { - if (dword) gen_call_function((void *)&mem_readd_dyncorex86,"%Dd%Rd",addr,dst); - else gen_call_function((void *)&mem_readw_dyncorex86,"%Dd%Rw",addr,dst); -} -static void dyn_write_word(DynReg * addr,DynReg * val,bool dword) { - if (dword) gen_call_function((void *)&mem_writed_dyncorex86,"%Dd%Dd",addr,val); - else gen_call_function((void *)&mem_writew_dyncorex86,"%Dd%Dd",addr,val); + dyn_read_intro(addr,false); + + cache_addw(0xe8c1); // shr eax,0x0c + cache_addb(0x0c); + cache_addw(0x048b); // mov eax,paging.tlb.read[eax*TYPE Bit32u] + cache_addb(0x85); + cache_addd((Bit32u)(&paging.tlb.read[0])); + cache_addw(0xc085); // test eax,eax + Bit8u* je_loc=gen_create_branch(BR_Z); + + + cache_addw(0x048a); // mov al,[eax+ecx] + cache_addb(0x08); + + Bit8u* jmp_loc=gen_create_jump(); + gen_fill_branch(je_loc); + cache_addb(0x51); // push ecx + cache_addb(0xe8); + cache_addd(((Bit32u)&mem_readb_checked_x86x) - (Bit32u)cache.pos-4); + cache_addw(0xc483); // add esp,4 + cache_addb(0x04); + cache_addw(0x012c); // sub al,1 + + dyn_check_bool_exception_ne(); + + cache_addw(0x058a); //mov al,[] + cache_addd((Bit32u)(&core_dyn.readdata)); + + gen_fill_jump(jmp_loc); + + x86gen.regs[X86_REG_EAX]->notusable=true; + GenReg * genreg=FindDynReg(dst); + x86gen.regs[X86_REG_EAX]->notusable=false; + cache_addw(0xc08a+(genreg->index<<11)+(high?0x2000:0)); + dst->flags|=DYNFLG_CHANGED; } + static void dyn_read_byte_release(DynReg * addr,DynReg * dst,Bitu high) { - if (high) gen_call_function((void *)&mem_readb,"%Ddr%Rh",addr,dst); - else gen_call_function((void *)&mem_readb,"%Ddr%Rl",addr,dst); + dyn_read_intro(addr); + + cache_addw(0xe8c1); // shr eax,0x0c + cache_addb(0x0c); + cache_addw(0x048b); // mov eax,paging.tlb.read[eax*TYPE Bit32u] + cache_addb(0x85); + cache_addd((Bit32u)(&paging.tlb.read[0])); + cache_addw(0xc085); // test eax,eax + Bit8u* je_loc=gen_create_branch(BR_Z); + + + cache_addw(0x048a); // mov al,[eax+ecx] + cache_addb(0x08); + + Bit8u* jmp_loc=gen_create_jump(); + gen_fill_branch(je_loc); + cache_addb(0x51); // push ecx + cache_addb(0xe8); + cache_addd(((Bit32u)&mem_readb_checked_x86x) - (Bit32u)cache.pos-4); + cache_addw(0xc483); // add esp,4 + cache_addb(0x04); + cache_addw(0x012c); // sub al,1 + + dyn_check_bool_exception_ne(); + + cache_addw(0x058a); //mov al,[] + cache_addd((Bit32u)(&core_dyn.readdata)); + + gen_fill_jump(jmp_loc); + + x86gen.regs[X86_REG_EAX]->notusable=true; + GenReg * genreg=FindDynReg(dst); + x86gen.regs[X86_REG_EAX]->notusable=false; + cache_addw(0xc08a+(genreg->index<<11)+(high?0x2000:0)); + dst->flags|=DYNFLG_CHANGED; } -static void dyn_write_byte_release(DynReg * addr,DynReg * val,Bitu high) { - if (high) gen_call_function((void *)&mem_writeb,"%Ddr%Dh",addr,val); - else gen_call_function((void *)&mem_writeb,"%Ddr%Dd",addr,val); + +bool mem_readd_checked_x86x(PhysPt address) { + if ((address & 0xfff)<0xffd) { + Bitu index=(address>>12); + if (paging.tlb.read[index]) { + core_dyn.readdata=host_readd(paging.tlb.read[index]+address); + return false; + } else { + Bitu uval; + bool retval; + retval=paging.tlb.handler[index]->readd_checked(address, &uval); + core_dyn.readdata=(Bit32u)uval; + return retval; + } + } else return mem_unalignedreadd_checked_x86(address, &core_dyn.readdata); } + +static void dyn_read_word(DynReg * addr,DynReg * dst,bool dword) { + if (dword) { + dyn_read_intro(addr,false); + + cache_addw(0xe8d1); // shr eax,0x1 + Bit8u* jb_loc1=gen_create_branch(BR_B); + cache_addw(0xe8d1); // shr eax,0x1 + Bit8u* jb_loc2=gen_create_branch(BR_B); + cache_addw(0xe8c1); // shr eax,0x0a + cache_addb(0x0a); + cache_addw(0x048b); // mov eax,paging.tlb.read[eax*TYPE Bit32u] + cache_addb(0x85); + cache_addd((Bit32u)(&paging.tlb.read[0])); + cache_addw(0xc085); // test eax,eax + Bit8u* je_loc=gen_create_branch(BR_Z); + + GenReg * genreg=FindDynReg(dst,true); + + cache_addw(0x048b+(genreg->index <<(8+3))); // mov dest,[eax+ecx] + cache_addb(0x08); + + Bit8u* jmp_loc=gen_create_jump(); + gen_fill_branch(jb_loc1); + gen_fill_branch(jb_loc2); + gen_fill_branch(je_loc); + cache_addb(0x51); // push ecx + cache_addb(0xe8); + cache_addd(((Bit32u)&mem_readd_checked_x86x) - (Bit32u)cache.pos-4); + cache_addw(0xc483); // add esp,4 + cache_addb(0x04); + cache_addw(0x012c); // sub al,1 + + dyn_check_bool_exception_ne(); + + gen_mov_host(&core_dyn.readdata,dst,4); + dst->flags|=DYNFLG_CHANGED; + + gen_fill_jump(jmp_loc); + } else { + gen_protectflags(); + gen_call_function((void *)&mem_readw_checked_x86,"%Dd%Id",addr,&core_dyn.readdata); + dyn_check_bool_exception_al(); + gen_mov_host(&core_dyn.readdata,dst,2); + } +} + static void dyn_read_word_release(DynReg * addr,DynReg * dst,bool dword) { - if (dword) gen_call_function((void *)&mem_readd_dyncorex86,"%Ddr%Rd",addr,dst); - else gen_call_function((void *)&mem_readw_dyncorex86,"%Ddr%Rw",addr,dst); + if (dword) { + dyn_read_intro(addr); + + cache_addw(0xe8d1); // shr eax,0x1 + Bit8u* jb_loc1=gen_create_branch(BR_B); + cache_addw(0xe8d1); // shr eax,0x1 + Bit8u* jb_loc2=gen_create_branch(BR_B); + cache_addw(0xe8c1); // shr eax,0x0a + cache_addb(0x0a); + cache_addw(0x048b); // mov eax,paging.tlb.read[eax*TYPE Bit32u] + cache_addb(0x85); + cache_addd((Bit32u)(&paging.tlb.read[0])); + cache_addw(0xc085); // test eax,eax + Bit8u* je_loc=gen_create_branch(BR_Z); + + GenReg * genreg=FindDynReg(dst,true); + + cache_addw(0x048b+(genreg->index <<(8+3))); // mov dest,[eax+ecx] + cache_addb(0x08); + + Bit8u* jmp_loc=gen_create_jump(); + gen_fill_branch(jb_loc1); + gen_fill_branch(jb_loc2); + gen_fill_branch(je_loc); + cache_addb(0x51); // push ecx + cache_addb(0xe8); + cache_addd(((Bit32u)&mem_readd_checked_x86x) - (Bit32u)cache.pos-4); + cache_addw(0xc483); // add esp,4 + cache_addb(0x04); + cache_addw(0x012c); // sub al,1 + + dyn_check_bool_exception_ne(); + + gen_mov_host(&core_dyn.readdata,dst,4); + dst->flags|=DYNFLG_CHANGED; + + gen_fill_jump(jmp_loc); + } else { + gen_protectflags(); + gen_call_function((void *)&mem_readw_checked_x86,"%Ddr%Id",addr,&core_dyn.readdata); + dyn_check_bool_exception_al(); + gen_mov_host(&core_dyn.readdata,dst,2); + } } + +static void dyn_write_intro(DynReg * addr,bool release_addr=true) { + gen_protectflags(); + + if (addr->genreg) { + // addr in a register + Bit8u reg_idx_addr=(Bit8u)addr->genreg->index; + + x86gen.regs[X86_REG_EAX]->Clear(); + x86gen.regs[X86_REG_EAX]->notusable=true; + x86gen.regs[X86_REG_ECX]->Clear(); + x86gen.regs[X86_REG_ECX]->notusable=true; + + if (reg_idx_addr) { + // addr!=eax + cache_addb(0x8b); //Mov eax,reg + cache_addb(0xc0+reg_idx_addr); + } + if (release_addr) gen_releasereg(addr); + } else { + // addr still in memory, directly move into eax + x86gen.regs[X86_REG_EAX]->Clear(); + x86gen.regs[X86_REG_EAX]->notusable=true; + x86gen.regs[X86_REG_ECX]->Clear(); + x86gen.regs[X86_REG_ECX]->notusable=true; + cache_addb(0xa1); //Mov eax,[data] + cache_addd((Bit32u)addr->data); + } + + cache_addw(0xc88b); // mov ecx,eax +} + +static void dyn_write_byte(DynReg * addr,DynReg * val,bool high) { + dyn_write_intro(addr,false); + + GenReg * genreg=FindDynReg(val); + cache_addw(0xe9c1); // shr ecx,0x0c + cache_addb(0x0c); + cache_addw(0x0c8b); // mov ecx,paging.tlb.read[ecx*TYPE Bit32u] + cache_addb(0x8d); + cache_addd((Bit32u)(&paging.tlb.write[0])); + cache_addw(0xc985); // test ecx,ecx + Bit8u* je_loc=gen_create_branch(BR_Z); + + cache_addw(0x0488+(genreg->index<<11)+(high?0x2000:0)); // mov [eax+ecx],reg + cache_addb(0x08); + + Bit8u* jmp_loc=gen_create_jump(); + gen_fill_branch(je_loc); + + if (GCC_UNLIKELY(high)) cache_addw(0xe086+((genreg->index+(genreg->index<<3))<<8)); + cache_addb(0x52); // push edx + cache_addb(0x50+genreg->index); + cache_addb(0x50); // push eax + if (GCC_UNLIKELY(high)) cache_addw(0xe086+((genreg->index+(genreg->index<<3))<<8)); + cache_addb(0xe8); + cache_addd(((Bit32u)&mem_writeb_checked_x86) - (Bit32u)cache.pos-4); + cache_addw(0xc483); // add esp,8 + cache_addb(0x08); + cache_addw(0x012c); // sub al,1 + cache_addb(0x5a); // pop edx + + // Restore registers to be used again + x86gen.regs[X86_REG_EAX]->notusable=false; + x86gen.regs[X86_REG_ECX]->notusable=false; + + dyn_check_bool_exception_ne(); + + gen_fill_jump(jmp_loc); +} + +static void dyn_write_byte_release(DynReg * addr,DynReg * val,bool high) { + dyn_write_intro(addr); + + GenReg * genreg=FindDynReg(val); + cache_addw(0xe9c1); // shr ecx,0x0c + cache_addb(0x0c); + cache_addw(0x0c8b); // mov ecx,paging.tlb.read[ecx*TYPE Bit32u] + cache_addb(0x8d); + cache_addd((Bit32u)(&paging.tlb.write[0])); + cache_addw(0xc985); // test ecx,ecx + Bit8u* je_loc=gen_create_branch(BR_Z); + + cache_addw(0x0488+(genreg->index<<11)+(high?0x2000:0)); // mov [eax+ecx],reg + cache_addb(0x08); + + Bit8u* jmp_loc=gen_create_jump(); + gen_fill_branch(je_loc); + + cache_addb(0x52); // push edx + if (GCC_UNLIKELY(high)) cache_addw(0xe086+((genreg->index+(genreg->index<<3))<<8)); + cache_addb(0x50+genreg->index); + cache_addb(0x50); // push eax + if (GCC_UNLIKELY(high)) cache_addw(0xe086+((genreg->index+(genreg->index<<3))<<8)); + cache_addb(0xe8); + cache_addd(((Bit32u)&mem_writeb_checked_x86) - (Bit32u)cache.pos-4); + cache_addw(0xc483); // add esp,8 + cache_addb(0x08); + cache_addw(0x012c); // sub al,1 + cache_addb(0x5a); // pop edx + + // Restore registers to be used again + x86gen.regs[X86_REG_EAX]->notusable=false; + x86gen.regs[X86_REG_ECX]->notusable=false; + + dyn_check_bool_exception_ne(); + + gen_fill_jump(jmp_loc); +} + +static void dyn_write_word(DynReg * addr,DynReg * val,bool dword) { + if (dword) { + dyn_write_intro(addr,false); + + GenReg * genreg=FindDynReg(val); + cache_addw(0xe9d1); // shr ecx,0x1 + Bit8u* jb_loc1=gen_create_branch(BR_B); + cache_addw(0xe9d1); // shr ecx,0x1 + Bit8u* jb_loc2=gen_create_branch(BR_B); + cache_addw(0xe9c1); // shr ecx,0x0a + cache_addb(0x0a); + cache_addw(0x0c8b); // mov ecx,paging.tlb.read[ecx*TYPE Bit32u] + cache_addb(0x8d); + cache_addd((Bit32u)(&paging.tlb.write[0])); + cache_addw(0xc985); // test ecx,ecx + Bit8u* je_loc=gen_create_branch(BR_Z); + + cache_addw(0x0489+(genreg->index <<(8+3))); // mov [eax+ecx],reg + cache_addb(0x08); + + Bit8u* jmp_loc=gen_create_jump(); + gen_fill_branch(jb_loc1); + gen_fill_branch(jb_loc2); + gen_fill_branch(je_loc); + + cache_addb(0x52); // push edx + cache_addb(0x50+genreg->index); + cache_addb(0x50); // push eax + cache_addb(0xe8); + cache_addd(((Bit32u)&mem_writed_checked_x86) - (Bit32u)cache.pos-4); + cache_addw(0xc483); // add esp,8 + cache_addb(0x08); + cache_addw(0x012c); // sub al,1 + cache_addb(0x5a); // pop edx + + // Restore registers to be used again + x86gen.regs[X86_REG_EAX]->notusable=false; + x86gen.regs[X86_REG_ECX]->notusable=false; + + dyn_check_bool_exception_ne(); + + gen_fill_jump(jmp_loc); + } else { + gen_protectflags(); + gen_call_function((void *)&mem_writew_checked_x86,"%Dd%Dd",addr,val); + dyn_check_bool_exception_al(); + } +} + static void dyn_write_word_release(DynReg * addr,DynReg * val,bool dword) { - if (dword) gen_call_function((void *)&mem_writed_dyncorex86,"%Ddr%Dd",addr,val); - else gen_call_function((void *)&mem_writew_dyncorex86,"%Ddr%Dd",addr,val); + if (dword) { + dyn_write_intro(addr); + + GenReg * genreg=FindDynReg(val); + cache_addw(0xe9d1); // shr ecx,0x1 + Bit8u* jb_loc1=gen_create_branch(BR_B); + cache_addw(0xe9d1); // shr ecx,0x1 + Bit8u* jb_loc2=gen_create_branch(BR_B); + cache_addw(0xe9c1); // shr ecx,0x0a + cache_addb(0x0a); + cache_addw(0x0c8b); // mov ecx,paging.tlb.read[ecx*TYPE Bit32u] + cache_addb(0x8d); + cache_addd((Bit32u)(&paging.tlb.write[0])); + cache_addw(0xc985); // test ecx,ecx + Bit8u* je_loc=gen_create_branch(BR_Z); + + cache_addw(0x0489+(genreg->index <<(8+3))); // mov [eax+ecx],reg + cache_addb(0x08); + + Bit8u* jmp_loc=gen_create_jump(); + gen_fill_branch(jb_loc1); + gen_fill_branch(jb_loc2); + gen_fill_branch(je_loc); + + cache_addb(0x52); // push edx + cache_addb(0x50+genreg->index); + cache_addb(0x50); // push eax + cache_addb(0xe8); + cache_addd(((Bit32u)&mem_writed_checked_x86) - (Bit32u)cache.pos-4); + cache_addw(0xc483); // add esp,8 + cache_addb(0x08); + cache_addw(0x012c); // sub al,1 + cache_addb(0x5a); // pop edx + + // Restore registers to be used again + x86gen.regs[X86_REG_EAX]->notusable=false; + x86gen.regs[X86_REG_ECX]->notusable=false; + + dyn_check_bool_exception_ne(); + + gen_fill_jump(jmp_loc); + } else { + gen_protectflags(); + gen_call_function((void *)&mem_writew_checked_x86,"%Ddr%Dd",addr,val); + dyn_check_bool_exception_al(); + } } + #endif + static void dyn_push_unchecked(DynReg * dynreg) { gen_protectflags(); - if (decode.big_op) { - gen_dop_word_imm(DOP_SUB,true,DREG(ESP),4); - } else { - gen_dop_word_imm(DOP_SUB,true,DREG(ESP),2); - } - gen_dop_word(DOP_AND,true,DREG(ESP),DREG(SMASK)); - gen_dop_word(DOP_MOV,true,DREG(STACK),DREG(ESP)); + gen_lea(DREG(STACK),DREG(ESP),0,0,decode.big_op?(-4):(-2)); + gen_dop_word_var(DOP_AND,true,DREG(STACK),&cpu.stack.mask); + gen_dop_word_var(DOP_AND,true,DREG(ESP),&cpu.stack.notmask); + gen_dop_word(DOP_OR,true,DREG(ESP),DREG(STACK)); gen_dop_word(DOP_ADD,true,DREG(STACK),DREG(SS)); if (decode.big_op) { gen_call_function((void *)&mem_writed,"%Drd%Dd",DREG(STACK),dynreg); @@ -326,13 +877,11 @@ static void dyn_push_unchecked(DynReg * dynreg) { static void dyn_push(DynReg * dynreg) { gen_protectflags(); - gen_dop_word(DOP_MOV,true,DREG(STACK),DREG(ESP)); - if (decode.big_op) { - gen_dop_word_imm(DOP_SUB,true,DREG(STACK),4); - } else { - gen_dop_word_imm(DOP_SUB,true,DREG(STACK),2); - } - gen_dop_word(DOP_AND,true,DREG(STACK),DREG(SMASK)); + gen_lea(DREG(STACK),DREG(ESP),0,0,decode.big_op?(-4):(-2)); + gen_dop_word(DOP_MOV,true,DREG(NEWESP),DREG(ESP)); + gen_dop_word_var(DOP_AND,true,DREG(STACK),&cpu.stack.mask); + gen_dop_word_var(DOP_AND,true,DREG(NEWESP),&cpu.stack.notmask); + gen_dop_word(DOP_OR,true,DREG(NEWESP),DREG(STACK)); gen_dop_word(DOP_ADD,true,DREG(STACK),DREG(SS)); if (decode.big_op) { gen_call_function((void *)&mem_writed_checked_x86,"%Drd%Dd",DREG(STACK),dynreg); @@ -341,54 +890,36 @@ static void dyn_push(DynReg * dynreg) { gen_call_function((void *)&mem_writew_checked_x86,"%Drd%Dd",DREG(STACK),dynreg); } dyn_check_bool_exception_al(); - /* everything was ok, change registers now */ - if (decode.big_op) { - gen_dop_word_imm(DOP_SUB,true,DREG(ESP),4); - } else { - gen_dop_word_imm(DOP_SUB,true,DREG(ESP),2); - } - gen_dop_word(DOP_AND,true,DREG(ESP),DREG(SMASK)); + /* everything was ok, change register now */ + gen_dop_word(DOP_MOV,true,DREG(ESP),DREG(NEWESP)); + gen_releasereg(DREG(NEWESP)); } -static void dyn_pop_unchecked(DynReg * dynreg) { +static void dyn_pop(DynReg * dynreg,bool checked=true) { gen_protectflags(); gen_dop_word(DOP_MOV,true,DREG(STACK),DREG(ESP)); - gen_dop_word(DOP_AND,true,DREG(STACK),DREG(SMASK)); + gen_dop_word_var(DOP_AND,true,DREG(STACK),&cpu.stack.mask); gen_dop_word(DOP_ADD,true,DREG(STACK),DREG(SS)); - if (decode.big_op) { - gen_call_function((void *)&mem_readd,"%Rd%Drd",dynreg,DREG(STACK)); + if (checked) { + if (decode.big_op) { + gen_call_function((void *)&mem_readd_checked_x86,"%Drd%Id",DREG(STACK),&core_dyn.readdata); + } else { + gen_call_function((void *)&mem_readw_checked_x86,"%Drd%Id",DREG(STACK),&core_dyn.readdata); + } + dyn_check_bool_exception_al(); + gen_mov_host(&core_dyn.readdata,dynreg,decode.big_op?4:2); } else { - gen_call_function((void *)&mem_readw,"%Rw%Drd",dynreg,DREG(STACK)); + if (decode.big_op) { + gen_call_function((void *)&mem_readd,"%Rd%Drd",dynreg,DREG(STACK)); + } else { + gen_call_function((void *)&mem_readw,"%Rw%Drd",dynreg,DREG(STACK)); + } } if (dynreg!=DREG(ESP)) { - if (decode.big_op) { - gen_dop_word_imm(DOP_ADD,true,DREG(ESP),4); - } else { - gen_dop_word_imm(DOP_ADD,true,DREG(ESP),2); - } - gen_dop_word(DOP_AND,true,DREG(ESP),DREG(SMASK)); - } -} - -static void dyn_pop(DynReg * dynreg) { - gen_protectflags(); - gen_dop_word(DOP_MOV,true,DREG(STACK),DREG(ESP)); - gen_dop_word(DOP_AND,true,DREG(STACK),DREG(SMASK)); - gen_dop_word(DOP_ADD,true,DREG(STACK),DREG(SS)); - if (decode.big_op) { - gen_call_function((void *)&mem_readd_checked_x86,"%Drd%Id",DREG(STACK),&core_dyn.readdata); - } else { - gen_call_function((void *)&mem_readw_checked_x86,"%Drd%Id",DREG(STACK),&core_dyn.readdata); - } - dyn_check_bool_exception_al(); - gen_mov_host(&core_dyn.readdata,dynreg,decode.big_op?4:2); - if (dynreg!=DREG(ESP)) { - if (decode.big_op) { - gen_dop_word_imm(DOP_ADD,true,DREG(ESP),4); - } else { - gen_dop_word_imm(DOP_ADD,true,DREG(ESP),2); - } - gen_dop_word(DOP_AND,true,DREG(ESP),DREG(SMASK)); + gen_lea(DREG(STACK),DREG(ESP),0,0,decode.big_op?4:2); + gen_dop_word_var(DOP_AND,true,DREG(STACK),&cpu.stack.mask); + gen_dop_word_var(DOP_AND,true,DREG(ESP),&cpu.stack.notmask); + gen_dop_word(DOP_OR,true,DREG(ESP),DREG(STACK)); } } @@ -469,6 +1000,12 @@ skip_extend_word: case 4: /* SIB */ { Bitu sib=decode_fetchb(); + static DynReg * scaledtable[8]={ + DREG(EAX),DREG(ECX),DREG(EDX),DREG(EBX), + 0,DREG(EBP),DREG(ESI),DREG(EDI), + }; + scaled=scaledtable[(sib >> 3) &7]; + scale=(sib >> 6); switch (sib & 7) { case 0:base=DREG(EAX);segbase=DREG(DS);break; case 1:base=DREG(ECX);segbase=DREG(DS);break; @@ -479,18 +1016,25 @@ skip_extend_word: if (decode.modrm.mod) { base=DREG(EBP);segbase=DREG(SS); } else { - imm=(Bit32s)decode_fetchd();segbase=DREG(DS); + segbase=DREG(DS); + Bitu val; + if (decode_fetchd_imm(val)) { + gen_mov_host((void*)val,DREG(EA),4); + if (!addseg) { + gen_lea(reg_ea,DREG(EA),scaled,scale,0); + } else { + DynReg** seg = decode.segprefix ? &decode.segprefix : &segbase; + gen_lea(DREG(EA),DREG(EA),scaled,scale,0); + gen_lea(reg_ea,DREG(EA),*seg,0,0); + } + return; + } + imm=(Bit32s)val; } break; case 6:base=DREG(ESI);segbase=DREG(DS);break; case 7:base=DREG(EDI);segbase=DREG(DS);break; } - static DynReg * scaledtable[8]={ - DREG(EAX),DREG(ECX),DREG(EDX),DREG(EBX), - 0,DREG(EBP),DREG(ESI),DREG(EDI), - }; - scaled=scaledtable[(sib >> 3) &7]; - scale=(sib >> 6); } break; /* SIB Break */ case 5: @@ -505,7 +1049,33 @@ skip_extend_word: } switch (decode.modrm.mod) { case 1:imm=(Bit8s)decode_fetchb();break; - case 2:imm=(Bit32s)decode_fetchd();break; + case 2: { + Bitu val; + if (decode_fetchd_imm(val)) { + gen_mov_host((void*)val,DREG(EA),4); + if (!addseg) { + gen_lea(DREG(EA),DREG(EA),scaled,scale,0); + gen_lea(reg_ea,DREG(EA),base,0,0); + } else { + DynReg** seg = decode.segprefix ? &decode.segprefix : &segbase; + if (!base) { + gen_lea(DREG(EA),DREG(EA),scaled,scale,0); + gen_lea(reg_ea,DREG(EA),*seg,0,0); + } else if (!scaled) { + gen_lea(DREG(EA),DREG(EA),*seg,0,0); + gen_lea(reg_ea,DREG(EA),base,0,0); + } else { + gen_lea(DREG(EA),DREG(EA),scaled,scale,0); + gen_lea(DREG(EA),DREG(EA),base,0,0); + gen_lea(reg_ea,DREG(EA),decode.segprefix ? decode.segprefix : segbase,0,0); + } + } + return; + } + + imm=(Bit32s)val; + break; + } } if (!addseg) { gen_lea(reg_ea,base,scaled,scale,imm); @@ -514,13 +1084,40 @@ skip_extend_word: if (!base) gen_lea(reg_ea,*seg,scaled,scale,imm); else if (!scaled) gen_lea(reg_ea,base,*seg,0,imm); else { - gen_lea(reg_ea,base,scaled,scale,imm); - gen_lea(reg_ea,reg_ea,decode.segprefix ? decode.segprefix : segbase,0,0); + gen_lea(DREG(EA),base,scaled,scale,imm); + gen_lea(reg_ea,DREG(EA),decode.segprefix ? decode.segprefix : segbase,0,0); } } } } + +static void dyn_dop_word_imm(DualOps op,bool dword,DynReg * dr1) { + Bitu val; + if (dword) { + if (decode_fetchd_imm(val)) { + gen_dop_word_imm_mem(op,true,dr1,(void*)val); + return; + } + } else { + if (decode_fetchw_imm(val)) { + gen_dop_word_imm_mem(op,false,dr1,(void*)val); + return; + } + } + gen_dop_word_imm(op,dword,dr1,val); +} + +static void dyn_dop_byte_imm(DualOps op,DynReg * dr1,Bit8u di1) { + Bitu val; + if (decode_fetchb_imm(val)) { + gen_dop_byte_imm_mem(op,dr1,di1,(void*)val); + } else { + gen_dop_byte_imm(op,dr1,di1,(Bit8u)val); + } +} + + #include "helpers.h" #include "string.h" @@ -575,9 +1172,7 @@ static void dyn_mov_ebib(void) { if (decode.modrm.mod<3) { dyn_fill_ea(); gen_call_write(DREG(EA),decode_fetchb(),1); -#ifdef CHECKED_MEMORY_ACCESS dyn_check_bool_exception_al(); -#endif } else { gen_dop_byte_imm(DOP_MOV,&DynRegs[decode.modrm.rm&3],decode.modrm.rm&4,decode_fetchb()); } @@ -696,9 +1291,7 @@ static void dyn_mov_eviv(void) { if (decode.modrm.mod<3) { dyn_fill_ea(); gen_call_write(DREG(EA),decode.big_op ? decode_fetchd() : decode_fetchw(),decode.big_op?4:2); -#ifdef CHECKED_MEMORY_ACCESS dyn_check_bool_exception_al(); -#endif } else { gen_dop_word_imm(DOP_MOV,decode.big_op,&DynRegs[decode.modrm.rm],decode.big_op ? decode_fetchd() : decode_fetchw()); } @@ -771,7 +1364,7 @@ static void dyn_grp1_eb_ib(void) { if (op==DOP_ADC || op==DOP_SBB) gen_needcarry(); else gen_discardflags(); } - gen_dop_byte_imm(op,&DynRegs[decode.modrm.rm&3],decode.modrm.rm&4,decode_fetchb()); + dyn_dop_byte_imm(op,&DynRegs[decode.modrm.rm&3],decode.modrm.rm&4); } } @@ -782,22 +1375,28 @@ static void dyn_grp1_ev_ivx(bool withbyte) { dyn_fill_ea(); if ((op<=DOP_TEST) && (op!=DOP_ADC && op!=DOP_SBB)) set_skipflags(true); dyn_read_word(DREG(EA),DREG(TMPW),decode.big_op); - Bits imm=withbyte ? (Bit8s)decode_fetchb() : (decode.big_op ? decode_fetchd(): decode_fetchw()); if (op<=DOP_TEST) { if (op==DOP_ADC || op==DOP_SBB) gen_needcarry(); else set_skipflags(false); } - gen_dop_word_imm(op,decode.big_op,DREG(TMPW),imm); + if (!withbyte) { + dyn_dop_word_imm(op,decode.big_op,DREG(TMPW)); + } else { + gen_dop_word_imm(op,decode.big_op,DREG(TMPW),(Bit8s)decode_fetchb()); + } if (op!=DOP_CMP) dyn_write_word_release(DREG(EA),DREG(TMPW),decode.big_op); else gen_releasereg(DREG(EA)); gen_releasereg(DREG(TMPW)); } else { - Bits imm=withbyte ? (Bit8s)decode_fetchb() : (decode.big_op ? decode_fetchd(): decode_fetchw()); if (op<=DOP_TEST) { if (op==DOP_ADC || op==DOP_SBB) gen_needcarry(); else gen_discardflags(); } - gen_dop_word_imm(op,decode.big_op,&DynRegs[decode.modrm.rm],imm); + if (!withbyte) { + dyn_dop_word_imm(op,decode.big_op,&DynRegs[decode.modrm.rm]); + } else { + gen_dop_word_imm(op,decode.big_op,&DynRegs[decode.modrm.rm],(Bit8s)decode_fetchb()); + } } } @@ -859,7 +1458,16 @@ static void dyn_grp2_ev(grp2_types type) { gen_shift_word_imm(decode.modrm.reg,decode.big_op,src,1); break; case grp2_imm: { - Bit8u imm=decode_fetchb(); + Bitu val; + if (decode_fetchb_imm(val)) { + if (decode.modrm.reg < 4) gen_needflags(); + else gen_discardflags(); + gen_load_host((void*)val,DREG(TMPB),1); + gen_shift_word_cl(decode.modrm.reg,decode.big_op,src,DREG(TMPB)); + gen_releasereg(DREG(TMPB)); + break; + } + Bit8u imm=(Bit8u)val; if (imm) { /* rotates (first 4 ops) alter cf/of only; shifts (last 4 ops) alter all flags */ if (decode.modrm.reg < 4) gen_needflags(); @@ -985,7 +1593,6 @@ static void dyn_load_seg(SegNames seg,DynReg * src) { gen_releasereg(DREG(TMPB)); } else gen_call_function((void *)CPU_SetSegGeneral,"%Id%Drw",seg,src); gen_releasereg(&DynRegs[G_ES+seg]); - if (seg==ss) gen_releasereg(DREG(SMASK)); } static void dyn_load_seg_off_ea(SegNames seg) { @@ -1034,7 +1641,6 @@ static void dyn_pop_seg(SegNames seg) { gen_releasereg(DREG(TMPB)); gen_releasereg(&DynRegs[G_ES+seg]); gen_releasereg(DREG(ESP)); - if (seg==ss) gen_releasereg(DREG(SMASK)); } } @@ -1062,13 +1668,13 @@ static void dyn_enter(void) { static void dyn_leave(void) { gen_protectflags(); - gen_dop_word(DOP_MOV,true,DREG(TMPW),DREG(SMASK)); + gen_dop_word_var(DOP_MOV,true,DREG(TMPW),&cpu.stack.mask); gen_sop_word(SOP_NOT,true,DREG(TMPW)); gen_dop_word(DOP_AND,true,DREG(ESP),DREG(TMPW)); gen_dop_word(DOP_MOV,true,DREG(TMPW),DREG(EBP)); - gen_dop_word(DOP_AND,true,DREG(TMPW),DREG(SMASK)); + gen_dop_word_var(DOP_AND,true,DREG(TMPW),&cpu.stack.mask); gen_dop_word(DOP_OR,true,DREG(ESP),DREG(TMPW)); - dyn_pop_unchecked(DREG(EBP)); + dyn_pop(DREG(EBP),false); gen_releasereg(DREG(TMPW)); } @@ -1256,7 +1862,7 @@ static void dyn_iret(void) { dyn_set_eip_last_end(DREG(TMPW)); dyn_save_critical_regs(); gen_call_function((void*)&CPU_IRET,"%Id%Drd",decode.big_op,DREG(TMPW)); - gen_return_fast(BR_Normal); + gen_return_fast(BR_Iret); dyn_closeblock(); } @@ -1271,6 +1877,37 @@ static void dyn_interrupt(Bitu num) { dyn_closeblock(); } +static void dyn_add_iocheck(Bitu access_size) { + if (cpu.pmode) { + gen_call_function((void *)&CPU_IO_Exception,"%Dw%Id",DREG(EDX),access_size); + dyn_check_bool_exception_al(); + } +} + +static void dyn_add_iocheck_var(Bit8u accessed_port,Bitu access_size) { + if (cpu.pmode) { + gen_call_function((void *)&CPU_IO_Exception,"%Id%Id",accessed_port,access_size); + dyn_check_bool_exception_al(); + } +} + +#ifdef X86_DYNFPU_DH_ENABLED +#include "dyn_fpu_dh.h" +#define dh_fpu_startup() { \ + fpu_used=true; \ + gen_protectflags(); \ + gen_load_host(&dyn_dh_fpu.state_used,DREG(TMPB),4); \ + gen_dop_word_imm(DOP_CMP,true,DREG(TMPB),0); \ + gen_releasereg(DREG(TMPB)); \ + save_info[used_save_info].branch_pos=gen_create_branch_long(BR_Z); \ + dyn_savestate(&save_info[used_save_info].state); \ + save_info[used_save_info].return_pos=cache.pos; \ + save_info[used_save_info].type=fpu_restore; \ + used_save_info++; \ +} +#endif +#include "dyn_fpu.h" + static CacheBlock * CreateCacheBlock(CodePageHandler * codepage,PhysPt start,Bitu max_opcodes) { Bits i; /* Init a load of variables */ @@ -1280,6 +1917,7 @@ static CacheBlock * CreateCacheBlock(CodePageHandler * codepage,PhysPt start,Bit decode.page.code=codepage; decode.page.index=start&4095; decode.page.wmap=codepage->write_map; + decode.page.invmap=codepage->invalidation_map; decode.page.first=start >> 12; decode.active_block=decode.block=cache_openblock(); decode.block->page.start=decode.page.index; @@ -1299,6 +1937,9 @@ static CacheBlock * CreateCacheBlock(CodePageHandler * codepage,PhysPt start,Bit used_save_info++; gen_releasereg(DREG(CYCLES)); decode.cycles=0; +#ifdef X86_DYNFPU_DH_ENABLED + bool fpu_used=false; +#endif while (max_opcodes--) { /* Init prefixes */ decode.big_addr=cpu.code.big; @@ -1308,7 +1949,18 @@ static CacheBlock * CreateCacheBlock(CodePageHandler * codepage,PhysPt start,Bit decode.cycles++; decode.op_start=decode.code; restart_prefix: - Bitu opcode=decode_fetchb(); + Bitu opcode; + if (!decode.page.invmap) opcode=decode_fetchb(); + else { + if (decode.page.index<4096) { + if (GCC_UNLIKELY(decode.page.invmap[decode.page.index]>=4)) goto illegalopcode; + opcode=decode_fetchb(); + } else { + opcode=decode_fetchb(); + if (GCC_UNLIKELY(decode.page.invmap && + (decode.page.invmap[decode.page.index-1]>=4))) goto illegalopcode; + } + } switch (opcode) { case 0x00:dyn_dop_ebgb(DOP_ADD);break; @@ -1316,7 +1968,7 @@ restart_prefix: case 0x02:dyn_dop_gbeb(DOP_ADD);break; case 0x03:dyn_dop_gvev(DOP_ADD);break; case 0x04:gen_discardflags();gen_dop_byte_imm(DOP_ADD,DREG(EAX),0,decode_fetchb());break; - case 0x05:gen_discardflags();gen_dop_word_imm(DOP_ADD,decode.big_op,DREG(EAX),decode.big_op ? decode_fetchd() : decode_fetchw());break; + case 0x05:gen_discardflags();dyn_dop_word_imm(DOP_ADD,decode.big_op,DREG(EAX));break; case 0x06:dyn_push_seg(es);break; case 0x07:dyn_pop_seg(es);break; @@ -1389,7 +2041,7 @@ restart_prefix: case 0x22:dyn_dop_gbeb(DOP_AND);break; case 0x23:dyn_dop_gvev(DOP_AND);break; case 0x24:gen_discardflags();gen_dop_byte_imm(DOP_AND,DREG(EAX),0,decode_fetchb());break; - case 0x25:gen_discardflags();gen_dop_word_imm(DOP_AND,decode.big_op,DREG(EAX),decode.big_op ? decode_fetchd() : decode_fetchw());break; + case 0x25:gen_discardflags();dyn_dop_word_imm(DOP_AND,decode.big_op,DREG(EAX));break; case 0x26:dyn_segprefix(es);goto restart_prefix; case 0x28:dyn_dop_ebgb(DOP_SUB);break; @@ -1444,7 +2096,7 @@ restart_prefix: break; case 0x61: /* POPA */ for (i=G_EDI;i>=G_EAX;i--) { - dyn_pop_unchecked((i!=G_ESP) ? &DynRegs[i] : DREG(TMPW)); + dyn_pop((i!=G_ESP) ? &DynRegs[i] : DREG(TMPW),false); } gen_releasereg(DREG(TMPW)); break; @@ -1453,7 +2105,7 @@ restart_prefix: case 0x65:dyn_segprefix(gs);goto restart_prefix; //Push immediates //Operand size - case 0x66:decode.big_op=!cpu.code.big;;goto restart_prefix; + case 0x66:decode.big_op=!cpu.code.big;goto restart_prefix; //Address size case 0x67:decode.big_addr=!cpu.code.big;goto restart_prefix; case 0x68: /* PUSH Iv */ @@ -1493,7 +2145,7 @@ restart_prefix: case 0x8b:dyn_mov_gvev();break; /* MOV ev,seg */ case 0x8c:dyn_mov_ev_seg();break; - /* LEA Gv */ + /* LEA Gv */ case 0x8d: dyn_get_modrm(); if (decode.big_op) { @@ -1508,8 +2160,8 @@ restart_prefix: case 0x8e:dyn_mov_seg_ev();break; /* POP Ev */ case 0x8f:dyn_pop_ev();break; - //NOP - case 0x90: + case 0x90: //NOP + case 0x9b: //WAIT/FWAIT break; //XCHG ax,reg case 0x91:case 0x92:case 0x93:case 0x94:case 0x95:case 0x96:case 0x97: @@ -1555,9 +2207,18 @@ restart_prefix: break; /* MOV direct address,AL */ case 0xa2: - gen_lea(DREG(EA),decode.segprefix ? decode.segprefix : DREG(DS),0,0, - decode.big_addr ? decode_fetchd() : decode_fetchw()); - dyn_write_byte_release(DREG(EA),DREG(EAX),false); + if (decode.big_addr) { + Bitu val; + if (decode_fetchd_imm(val)) { + gen_lea_imm_mem(DREG(EA),decode.segprefix ? decode.segprefix : DREG(DS),(void*)val); + } else { + gen_lea(DREG(EA),decode.segprefix ? decode.segprefix : DREG(DS),0,0,(Bits)val); + } + dyn_write_byte_release(DREG(EA),DREG(EAX),false); + } else { + gen_lea(DREG(EA),decode.segprefix ? decode.segprefix : DREG(DS),0,0,decode_fetchw()); + dyn_write_byte_release(DREG(EA),DREG(EAX),false); + } break; /* MOV direct addresses,AX */ case 0xa3: @@ -1583,7 +2244,11 @@ restart_prefix: break; //Mov word reg imm byte,word, case 0xb8:case 0xb9:case 0xba:case 0xbb:case 0xbc:case 0xbd:case 0xbe:case 0xbf: - gen_dop_word_imm(DOP_MOV,decode.big_op,&DynRegs[opcode&7],decode.big_op ? decode_fetchd() : decode_fetchw());break; + if (decode.big_op) { + dyn_dop_word_imm(DOP_MOV,decode.big_op,&DynRegs[opcode&7]);break; + } else { + gen_dop_word_imm(DOP_MOV,decode.big_op,&DynRegs[opcode&7],decode_fetchw());break; + } break; //GRP2 Eb/Ev,Ib case 0xc0:dyn_grp2_eb(grp2_imm);break; @@ -1617,59 +2282,135 @@ restart_prefix: //FPU #ifdef CPU_FPU case 0xd8: - DYN_FPU_ESC(0); +#ifdef X86_DYNFPU_DH_ENABLED + if (dyn_dh_fpu.dh_fpu_enabled) { + if (fpu_used) dh_fpu_esc0(); + else { + dh_fpu_startup(); + dh_fpu_esc0(); + } + } else +#endif + dyn_fpu_esc0(); break; case 0xd9: - DYN_FPU_ESC(1); +#ifdef X86_DYNFPU_DH_ENABLED + if (dyn_dh_fpu.dh_fpu_enabled) { + if (fpu_used) dh_fpu_esc1(); + else { + dh_fpu_startup(); + dh_fpu_esc1(); + } + } else +#endif + dyn_fpu_esc1(); break; case 0xda: - DYN_FPU_ESC(2); +#ifdef X86_DYNFPU_DH_ENABLED + if (dyn_dh_fpu.dh_fpu_enabled) { + if (fpu_used) dh_fpu_esc2(); + else { + dh_fpu_startup(); + dh_fpu_esc2(); + } + } else +#endif + dyn_fpu_esc2(); break; case 0xdb: - DYN_FPU_ESC(3); +#ifdef X86_DYNFPU_DH_ENABLED + if (dyn_dh_fpu.dh_fpu_enabled) { + if (fpu_used) dh_fpu_esc3(); + else { + dh_fpu_startup(); + dh_fpu_esc3(); + } + } else +#endif + dyn_fpu_esc3(); break; case 0xdc: - DYN_FPU_ESC(4); +#ifdef X86_DYNFPU_DH_ENABLED + if (dyn_dh_fpu.dh_fpu_enabled) { + if (fpu_used) dh_fpu_esc4(); + else { + dh_fpu_startup(); + dh_fpu_esc4(); + } + } else +#endif + dyn_fpu_esc4(); break; case 0xdd: - DYN_FPU_ESC(5); +#ifdef X86_DYNFPU_DH_ENABLED + if (dyn_dh_fpu.dh_fpu_enabled) { + if (fpu_used) dh_fpu_esc5(); + else { + dh_fpu_startup(); + dh_fpu_esc5(); + } + } else +#endif + dyn_fpu_esc5(); break; case 0xde: - DYN_FPU_ESC(6); +#ifdef X86_DYNFPU_DH_ENABLED + if (dyn_dh_fpu.dh_fpu_enabled) { + if (fpu_used) dh_fpu_esc6(); + else { + dh_fpu_startup(); + dh_fpu_esc6(); + } + } else +#endif + dyn_fpu_esc6(); break; case 0xdf: - dyn_get_modrm(); - if (decode.modrm.val >= 0xc0) { - if (decode.modrm.val == 0xe0) gen_releasereg(DREG(EAX)); /* FSTSW */ - gen_call_function((void*)&FPU_ESC7_Normal,"%Id",decode.modrm.val); - } else { - dyn_fill_ea(); - gen_call_function((void*)&FPU_ESC7_EA,"%Id%Dd",decode.modrm.val,DREG(EA)); - gen_releasereg(DREG(EA)); - } +#ifdef X86_DYNFPU_DH_ENABLED + if (dyn_dh_fpu.dh_fpu_enabled) { + if (fpu_used) dh_fpu_esc7(); + else { + dh_fpu_startup(); + dh_fpu_esc7(); + } + } else +#endif + dyn_fpu_esc7(); break; #endif - //Loop's + //Loops case 0xe2:dyn_loop(LOOP_NONE);goto finish_block; case 0xe3:dyn_loop(LOOP_JCXZ);goto finish_block; //IN AL/AX,imm - case 0xe4:gen_call_function((void*)&IO_ReadB,"%Id%Rl",decode_fetchb(),DREG(EAX));break; - case 0xe5: + case 0xe4: { + Bitu port=decode_fetchb(); + dyn_add_iocheck_var(port,1); + gen_call_function((void*)&IO_ReadB,"%Id%Rl",port,DREG(EAX)); + } break; + case 0xe5: { + Bitu port=decode_fetchb(); + dyn_add_iocheck_var(port,decode.big_op?4:2); if (decode.big_op) { - gen_call_function((void*)&IO_ReadD,"%Id%Rd",decode_fetchb(),DREG(EAX)); + gen_call_function((void*)&IO_ReadD,"%Id%Rd",port,DREG(EAX)); } else { - gen_call_function((void*)&IO_ReadW,"%Id%Rw",decode_fetchb(),DREG(EAX)); + gen_call_function((void*)&IO_ReadW,"%Id%Rw",port,DREG(EAX)); } - break; + } break; //OUT imm,AL - case 0xe6:gen_call_function((void*)&IO_WriteB,"%Id%Dl",decode_fetchb(),DREG(EAX));break; - case 0xe7: + case 0xe6: { + Bitu port=decode_fetchb(); + dyn_add_iocheck_var(port,1); + gen_call_function((void*)&IO_WriteB,"%Id%Dl",port,DREG(EAX)); + } break; + case 0xe7: { + Bitu port=decode_fetchb(); + dyn_add_iocheck_var(port,decode.big_op?4:2); if (decode.big_op) { - gen_call_function((void*)&IO_WriteD,"%Id%Dd",decode_fetchb(),DREG(EAX)); + gen_call_function((void*)&IO_WriteD,"%Id%Dd",port,DREG(EAX)); } else { - gen_call_function((void*)&IO_WriteW,"%Id%Dw",decode_fetchb(),DREG(EAX)); + gen_call_function((void*)&IO_WriteW,"%Id%Dw",port,DREG(EAX)); } - break; + } break; case 0xe8: /* CALL Ivx */ dyn_call_near_imm(); goto finish_block; @@ -1682,8 +2423,12 @@ restart_prefix: /* Jmp Ibx */ case 0xeb:dyn_exit_link((Bit8s)decode_fetchb());goto finish_block; /* IN AL/AX,DX*/ - case 0xec:gen_call_function((void*)&IO_ReadB,"%Dw%Rl",DREG(EDX),DREG(EAX));break; + case 0xec: + dyn_add_iocheck(1); + gen_call_function((void*)&IO_ReadB,"%Dw%Rl",DREG(EDX),DREG(EAX)); + break; case 0xed: + dyn_add_iocheck(decode.big_op?4:2); if (decode.big_op) { gen_call_function((void*)&IO_ReadD,"%Dw%Rd",DREG(EDX),DREG(EAX)); } else { @@ -1691,14 +2436,20 @@ restart_prefix: } break; /* OUT DX,AL/AX */ - case 0xee:gen_call_function((void*)&IO_WriteB,"%Dw%Dl",DREG(EDX),DREG(EAX));break; + case 0xee: + dyn_add_iocheck(1); + gen_call_function((void*)&IO_WriteB,"%Dw%Dl",DREG(EDX),DREG(EAX)); + break; case 0xef: + dyn_add_iocheck(decode.big_op?4:2); if (decode.big_op) { gen_call_function((void*)&IO_WriteD,"%Dw%Dd",DREG(EDX),DREG(EAX)); } else { gen_call_function((void*)&IO_WriteW,"%Dw%Dw",DREG(EDX),DREG(EAX)); } break; + case 0xf0: //LOCK + break; case 0xf2: //REPNE/NZ decode.rep=REP_NZ; goto restart_prefix; @@ -1716,14 +2467,17 @@ restart_prefix: case 0xf7:dyn_grp3_ev();break; /* Change interrupt flag */ case 0xfa: //CLI + gen_releasereg(DREG(FLAGS)); gen_call_function((void *)&CPU_CLI,"%Rd",DREG(TMPB)); if (cpu.pmode) dyn_check_bool_exception(DREG(TMPB)); gen_releasereg(DREG(TMPB)); break; case 0xfb: //STI + gen_releasereg(DREG(FLAGS)); gen_call_function((void *)&CPU_STI,"%Rd",DREG(TMPB)); if (cpu.pmode) dyn_check_bool_exception(DREG(TMPB)); gen_releasereg(DREG(TMPB)); + dyn_check_irqrequest(); if (max_opcodes<=0) max_opcodes=1; //Allow 1 extra opcode break; case 0xfc: //CLD diff --git a/src/cpu/core_dyn_x86/dyn_fpu.h b/src/cpu/core_dyn_x86/dyn_fpu.h new file mode 100644 index 0000000..e47fc67 --- /dev/null +++ b/src/cpu/core_dyn_x86/dyn_fpu.h @@ -0,0 +1,665 @@ +/* + * Copyright (C) 2002-2005 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* $Id: dyn_fpu.h,v 1.2 2006/09/19 16:27:58 c2woody Exp $ */ + +#include "dosbox.h" +#if C_FPU + +#include +#include +#include "cross.h" +#include "mem.h" +#include "fpu.h" +#include "cpu.h" + + +static void FPU_FDECSTP(){ + TOP = (TOP - 1) & 7; +} + +static void FPU_FINCSTP(){ + TOP = (TOP + 1) & 7; +} + +static void FPU_FNSTCW(PhysPt addr){ + mem_writew(addr,fpu.cw); +} + +static void FPU_FFREE(Bitu st) { + fpu.tags[st]=TAG_Empty; +} + + +#if C_FPU_X86 +#include "../../fpu/fpu_instructions_x86.h" +#else +#include "../../fpu/fpu_instructions.h" +#endif + + +#define dyn_fpu_top() { \ + gen_protectflags(); \ + gen_load_host(&TOP,DREG(EA),4); \ + gen_dop_word_imm(DOP_ADD,true,DREG(EA),decode.modrm.rm); \ + gen_dop_word_imm(DOP_AND,true,DREG(EA),7); \ + gen_load_host(&TOP,DREG(TMPB),4); \ +} + +static void dyn_eatree() { + Bitu group=(decode.modrm.val >> 3) & 7; + switch (group){ + case 0x00: /* FADD ST,STi */ + gen_call_function((void*)&FPU_FADD_EA,"%Ddr",DREG(TMPB)); + break; + case 0x01: /* FMUL ST,STi */ + gen_call_function((void*)&FPU_FMUL_EA,"%Ddr",DREG(TMPB)); + break; + case 0x02: /* FCOM STi */ + gen_call_function((void*)&FPU_FCOM_EA,"%Ddr",DREG(TMPB)); + break; + case 0x03: /* FCOMP STi */ + gen_call_function((void*)&FPU_FCOM_EA,"%Ddr",DREG(TMPB)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x04: /* FSUB ST,STi */ + gen_call_function((void*)&FPU_FSUB_EA,"%Ddr",DREG(TMPB)); + break; + case 0x05: /* FSUBR ST,STi */ + gen_call_function((void*)&FPU_FSUBR_EA,"%Ddr",DREG(TMPB)); + break; + case 0x06: /* FDIV ST,STi */ + gen_call_function((void*)&FPU_FDIV_EA,"%Ddr",DREG(TMPB)); + break; + case 0x07: /* FDIVR ST,STi */ + gen_call_function((void*)&FPU_FDIVR_EA,"%Ddr",DREG(TMPB)); + break; + default: + break; + } +} + +static void dyn_fpu_esc0(){ + dyn_get_modrm(); + if (decode.modrm.val >= 0xc0) { + dyn_fpu_top(); + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + switch (group){ + case 0x00: //FADD ST,STi / + gen_call_function((void*)&FPU_FADD,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x01: // FMUL ST,STi / + gen_call_function((void*)&FPU_FMUL,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x02: // FCOM STi / + gen_call_function((void*)&FPU_FCOM,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x03: // FCOMP STi / + gen_call_function((void*)&FPU_FCOM,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x04: // FSUB ST,STi / + gen_call_function((void*)&FPU_FSUB,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x05: // FSUBR ST,STi / + gen_call_function((void*)&FPU_FSUBR,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x06: // FDIV ST,STi / + gen_call_function((void*)&FPU_FDIV,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x07: // FDIVR ST,STi / + gen_call_function((void*)&FPU_FDIVR,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + default: + break; + } + } else { + dyn_fill_ea(); + gen_call_function((void*)&FPU_FLD_F32_EA,"%Ddr",DREG(EA)); + gen_load_host(&TOP,DREG(TMPB),4); + dyn_eatree(); + } +} + +static void dyn_fpu_esc1(){ + dyn_get_modrm(); + if (decode.modrm.val >= 0xc0) { + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + switch (group){ + case 0x00: /* FLD STi */ + gen_protectflags(); + gen_load_host(&TOP,DREG(EA),4); + gen_dop_word_imm(DOP_ADD,true,DREG(EA),decode.modrm.rm); + gen_dop_word_imm(DOP_AND,true,DREG(EA),7); + gen_call_function((void*)&FPU_PREP_PUSH,""); + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void*)&FPU_FST,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x01: /* FXCH STi */ + dyn_fpu_top(); + gen_call_function((void*)&FPU_FXCH,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x02: /* FNOP */ + gen_call_function((void*)&FPU_FNOP,""); + break; + case 0x03: /* FSTP STi */ + dyn_fpu_top(); + gen_call_function((void*)&FPU_FST,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x04: + switch(sub){ + case 0x00: /* FCHS */ + gen_call_function((void*)&FPU_FCHS,""); + break; + case 0x01: /* FABS */ + gen_call_function((void*)&FPU_FABS,""); + break; + case 0x02: /* UNKNOWN */ + case 0x03: /* ILLEGAL */ + LOG(LOG_FPU,LOG_WARN)("ESC 1:Unhandled group %X subfunction %X",group,sub); + break; + case 0x04: /* FTST */ + gen_call_function((void*)&FPU_FTST,""); + break; + case 0x05: /* FXAM */ + gen_call_function((void*)&FPU_FXAM,""); + break; + case 0x06: /* FTSTP (cyrix)*/ + case 0x07: /* UNKNOWN */ + LOG(LOG_FPU,LOG_WARN)("ESC 1:Unhandled group %X subfunction %X",group,sub); + break; + } + break; + case 0x05: + switch(sub){ + case 0x00: /* FLD1 */ + gen_call_function((void*)&FPU_FLD1,""); + break; + case 0x01: /* FLDL2T */ + gen_call_function((void*)&FPU_FLDL2T,""); + break; + case 0x02: /* FLDL2E */ + gen_call_function((void*)&FPU_FLDL2E,""); + break; + case 0x03: /* FLDPI */ + gen_call_function((void*)&FPU_FLDPI,""); + break; + case 0x04: /* FLDLG2 */ + gen_call_function((void*)&FPU_FLDLG2,""); + break; + case 0x05: /* FLDLN2 */ + gen_call_function((void*)&FPU_FLDLN2,""); + break; + case 0x06: /* FLDZ*/ + gen_call_function((void*)&FPU_FLDZ,""); + break; + case 0x07: /* ILLEGAL */ + LOG(LOG_FPU,LOG_WARN)("ESC 1:Unhandled group %X subfunction %X",group,sub); + break; + } + break; + case 0x06: + switch(sub){ + case 0x00: /* F2XM1 */ + gen_call_function((void*)&FPU_F2XM1,""); + break; + case 0x01: /* FYL2X */ + gen_call_function((void*)&FPU_FYL2X,""); + break; + case 0x02: /* FPTAN */ + gen_call_function((void*)&FPU_FPTAN,""); + break; + case 0x03: /* FPATAN */ + gen_call_function((void*)&FPU_FPATAN,""); + break; + case 0x04: /* FXTRACT */ + gen_call_function((void*)&FPU_FXTRACT,""); + break; + case 0x05: /* FPREM1 */ + gen_call_function((void*)&FPU_FPREM1,""); + break; + case 0x06: /* FDECSTP */ + gen_call_function((void*)&FPU_FDECSTP,""); + break; + case 0x07: /* FINCSTP */ + gen_call_function((void*)&FPU_FINCSTP,""); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 1:Unhandled group %X subfunction %X",group,sub); + break; + } + break; + case 0x07: + switch(sub){ + case 0x00: /* FPREM */ + gen_call_function((void*)&FPU_FPREM,""); + break; + case 0x01: /* FYL2XP1 */ + gen_call_function((void*)&FPU_FYL2XP1,""); + break; + case 0x02: /* FSQRT */ + gen_call_function((void*)&FPU_FSQRT,""); + break; + case 0x03: /* FSINCOS */ + gen_call_function((void*)&FPU_FSINCOS,""); + break; + case 0x04: /* FRNDINT */ + gen_call_function((void*)&FPU_FRNDINT,""); + break; + case 0x05: /* FSCALE */ + gen_call_function((void*)&FPU_FSCALE,""); + break; + case 0x06: /* FSIN */ + gen_call_function((void*)&FPU_FSIN,""); + break; + case 0x07: /* FCOS */ + gen_call_function((void*)&FPU_FCOS,""); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 1:Unhandled group %X subfunction %X",group,sub); + break; + } + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 1:Unhandled group %X subfunction %X",group,sub); + break; + } + } else { + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + dyn_fill_ea(); + switch(group){ + case 0x00: /* FLD float*/ + gen_protectflags(); + gen_call_function((void*)&FPU_PREP_PUSH,""); + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void*)&FPU_FLD_F32,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x01: /* UNKNOWN */ + LOG(LOG_FPU,LOG_WARN)("ESC EA 1:Unhandled group %d subfunction %d",group,sub); + break; + case 0x02: /* FST float*/ + gen_call_function((void*)&FPU_FST_F32,"%Ddr",DREG(EA)); + break; + case 0x03: /* FSTP float*/ + gen_call_function((void*)&FPU_FST_F32,"%Ddr",DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x04: /* FLDENV */ + gen_call_function((void*)&FPU_FLDENV,"%Ddr",DREG(EA)); + break; + case 0x05: /* FLDCW */ + gen_call_function((void *)&FPU_FLDCW,"%Ddr",DREG(EA)); + break; + case 0x06: /* FSTENV */ + gen_call_function((void *)&FPU_FSTENV,"%Ddr",DREG(EA)); + break; + case 0x07: /* FNSTCW*/ + gen_call_function((void *)&FPU_FNSTCW,"%Ddr",DREG(EA)); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC EA 1:Unhandled group %d subfunction %d",group,sub); + break; + } + } +} + +static void dyn_fpu_esc2(){ + dyn_get_modrm(); + if (decode.modrm.val >= 0xc0) { + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + switch(group){ + case 0x05: + switch(sub){ + case 0x01: /* FUCOMPP */ + gen_protectflags(); + gen_load_host(&TOP,DREG(EA),4); + gen_dop_word_imm(DOP_ADD,true,DREG(EA),1); + gen_dop_word_imm(DOP_AND,true,DREG(EA),7); + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void *)&FPU_FUCOM,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + gen_call_function((void *)&FPU_FPOP,""); + gen_call_function((void *)&FPU_FPOP,""); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 2:Unhandled group %d subfunction %d",group,sub); + break; + } + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 2:Unhandled group %d subfunction %d",group,sub); + break; + } + } else { + dyn_fill_ea(); + gen_call_function((void*)&FPU_FLD_I32_EA,"%Ddr",DREG(EA)); + gen_load_host(&TOP,DREG(TMPB),4); + dyn_eatree(); + } +} + +static void dyn_fpu_esc3(){ + dyn_get_modrm(); + if (decode.modrm.val >= 0xc0) { + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + switch (group) { + case 0x04: + switch (sub) { + case 0x00: //FNENI + case 0x01: //FNDIS + LOG(LOG_FPU,LOG_ERROR)("8087 only fpu code used esc 3: group 4: subfuntion :%d",sub); + break; + case 0x02: //FNCLEX FCLEX + gen_call_function((void*)&FPU_FCLEX,""); + break; + case 0x03: //FNINIT FINIT + gen_call_function((void*)&FPU_FINIT,""); + break; + case 0x04: //FNSETPM + case 0x05: //FRSTPM +// LOG(LOG_FPU,LOG_ERROR)("80267 protected mode (un)set. Nothing done"); + break; + default: + E_Exit("ESC 3:ILLEGAL OPCODE group %d subfunction %d",group,sub); + } + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 3:Unhandled group %d subfunction %d",group,sub); + break; + } + } else { + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + dyn_fill_ea(); + switch(group){ + case 0x00: /* FILD */ + gen_call_function((void*)&FPU_PREP_PUSH,""); + gen_protectflags(); + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void*)&FPU_FLD_I32,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x01: /* FISTTP */ + LOG(LOG_FPU,LOG_WARN)("ESC 3 EA:Unhandled group %d subfunction %d",group,sub); + break; + case 0x02: /* FIST */ + gen_call_function((void*)&FPU_FST_I32,"%Ddr",DREG(EA)); + break; + case 0x03: /* FISTP */ + gen_call_function((void*)&FPU_FST_I32,"%Ddr",DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x05: /* FLD 80 Bits Real */ + gen_call_function((void*)&FPU_PREP_PUSH,""); + gen_call_function((void*)&FPU_FLD_F80,"%Ddr",DREG(EA)); + break; + case 0x07: /* FSTP 80 Bits Real */ + gen_call_function((void*)&FPU_FST_F80,"%Ddr",DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 3 EA:Unhandled group %d subfunction %d",group,sub); + } + } +} + +static void dyn_fpu_esc4(){ + dyn_get_modrm(); + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + if (decode.modrm.val >= 0xc0) { + dyn_fpu_top(); + switch(group){ + case 0x00: /* FADD STi,ST*/ + gen_call_function((void*)&FPU_FADD,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x01: /* FMUL STi,ST*/ + gen_call_function((void*)&FPU_FMUL,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x02: /* FCOM*/ + gen_call_function((void*)&FPU_FCOM,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x03: /* FCOMP*/ + gen_call_function((void*)&FPU_FCOM,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x04: /* FSUBR STi,ST*/ + gen_call_function((void*)&FPU_FSUBR,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x05: /* FSUB STi,ST*/ + gen_call_function((void*)&FPU_FSUB,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x06: /* FDIVR STi,ST*/ + gen_call_function((void*)&FPU_FDIVR,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x07: /* FDIV STi,ST*/ + gen_call_function((void*)&FPU_FDIV,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + default: + break; + } + } else { + dyn_fill_ea(); + gen_call_function((void*)&FPU_FLD_F64_EA,"%Ddr",DREG(EA)); + gen_load_host(&TOP,DREG(TMPB),4); + dyn_eatree(); + } +} + +static void dyn_fpu_esc5(){ + dyn_get_modrm(); + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + if (decode.modrm.val >= 0xc0) { + dyn_fpu_top(); + switch(group){ + case 0x00: /* FFREE STi */ + gen_call_function((void*)&FPU_FFREE,"%Ddr",DREG(EA)); + break; + case 0x01: /* FXCH STi*/ + gen_call_function((void*)&FPU_FXCH,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x02: /* FST STi */ + gen_call_function((void*)&FPU_FST,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x03: /* FSTP STi*/ + gen_call_function((void*)&FPU_FST,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x04: /* FUCOM STi */ + gen_call_function((void*)&FPU_FUCOM,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x05: /*FUCOMP STi */ + gen_call_function((void*)&FPU_FUCOM,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 5:Unhandled group %d subfunction %d",group,sub); + break; + } + gen_releasereg(DREG(EA)); + gen_releasereg(DREG(TMPB)); + } else { + dyn_fill_ea(); + switch(group){ + case 0x00: /* FLD double real*/ + gen_call_function((void*)&FPU_PREP_PUSH,""); + gen_protectflags(); + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void*)&FPU_FLD_F64,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x01: /* FISTTP longint*/ + LOG(LOG_FPU,LOG_WARN)("ESC 5 EA:Unhandled group %d subfunction %d",group,sub); + break; + case 0x02: /* FST double real*/ + gen_call_function((void*)&FPU_FST_F64,"%Ddr",DREG(EA)); + break; + case 0x03: /* FSTP double real*/ + gen_call_function((void*)&FPU_FST_F64,"%Ddr",DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x04: /* FRSTOR */ + gen_call_function((void*)&FPU_FRSTOR,"%Ddr",DREG(EA)); + break; + case 0x06: /* FSAVE */ + gen_call_function((void*)&FPU_FSAVE,"%Ddr",DREG(EA)); + break; + case 0x07: /*FNSTSW */ + gen_protectflags(); + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void*)&FPU_SET_TOP,"%Dd",DREG(TMPB)); + gen_load_host(&fpu.sw,DREG(TMPB),4); + gen_call_function((void*)&mem_writew,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 5 EA:Unhandled group %d subfunction %d",group,sub); + } + } +} + +static void dyn_fpu_esc6(){ + dyn_get_modrm(); + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + if (decode.modrm.val >= 0xc0) { + dyn_fpu_top(); + switch(group){ + case 0x00: /*FADDP STi,ST*/ + gen_call_function((void*)&FPU_FADD,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x01: /* FMULP STi,ST*/ + gen_call_function((void*)&FPU_FMUL,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x02: /* FCOMP5*/ + gen_call_function((void*)&FPU_FCOM,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; /* TODO IS THIS ALLRIGHT ????????? */ + case 0x03: /*FCOMPP*/ + if(sub != 1) { + LOG(LOG_FPU,LOG_WARN)("ESC 6:Unhandled group %d subfunction %d",group,sub); + return; + } + gen_load_host(&TOP,DREG(EA),4); + gen_dop_word_imm(DOP_ADD,true,DREG(EA),1); + gen_dop_word_imm(DOP_AND,true,DREG(EA),7); + gen_call_function((void*)&FPU_FCOM,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); /* extra pop at the bottom*/ + break; + case 0x04: /* FSUBRP STi,ST*/ + gen_call_function((void*)&FPU_FSUBR,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x05: /* FSUBP STi,ST*/ + gen_call_function((void*)&FPU_FSUB,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x06: /* FDIVRP STi,ST*/ + gen_call_function((void*)&FPU_FDIVR,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x07: /* FDIVP STi,ST*/ + gen_call_function((void*)&FPU_FDIV,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + default: + break; + } + gen_call_function((void*)&FPU_FPOP,""); + } else { + dyn_fill_ea(); + gen_call_function((void*)&FPU_FLD_I16_EA,"%Ddr",DREG(EA)); + gen_load_host(&TOP,DREG(TMPB),4); + dyn_eatree(); + } +} + +static void dyn_fpu_esc7(){ + dyn_get_modrm(); + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + if (decode.modrm.val >= 0xc0) { + switch (group){ + case 0x01: /* FXCH STi*/ + dyn_fpu_top(); + gen_call_function((void*)&FPU_FXCH,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + break; + case 0x02: /* FSTP STi*/ + case 0x03: /* FSTP STi*/ + dyn_fpu_top(); + gen_call_function((void*)&FPU_FST,"%Ddr%Ddr",DREG(TMPB),DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x04: + switch(sub){ + case 0x00: /* FNSTSW AX*/ + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void*)&FPU_SET_TOP,"%Ddr",DREG(TMPB)); + gen_mov_host(&fpu.sw,DREG(EAX),2); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 7:Unhandled group %d subfunction %d",group,sub); + break; + } + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 7:Unhandled group %d subfunction %d",group,sub); + break; + } + } else { + dyn_fill_ea(); + switch(group){ + case 0x00: /* FILD Bit16s */ + gen_call_function((void*)&FPU_PREP_PUSH,""); + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void*)&FPU_FLD_I16,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x01: + LOG(LOG_FPU,LOG_WARN)("ESC 7 EA:Unhandled group %d subfunction %d",group,sub); + break; + case 0x02: /* FIST Bit16s */ + gen_call_function((void*)&FPU_FST_I16,"%Ddr",DREG(EA)); + break; + case 0x03: /* FISTP Bit16s */ + gen_call_function((void*)&FPU_FST_I16,"%Ddr",DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x04: /* FBLD packed BCD */ + gen_call_function((void*)&FPU_PREP_PUSH,""); + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void*)&FPU_FBLD,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x05: /* FILD Bit64s */ + gen_call_function((void*)&FPU_PREP_PUSH,""); + gen_load_host(&TOP,DREG(TMPB),4); + gen_call_function((void*)&FPU_FLD_I64,"%Ddr%Ddr",DREG(EA),DREG(TMPB)); + break; + case 0x06: /* FBSTP packed BCD */ + gen_call_function((void*)&FPU_FBST,"%Ddr",DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + case 0x07: /* FISTP Bit64s */ + gen_call_function((void*)&FPU_FST_I64,"%Ddr",DREG(EA)); + gen_call_function((void*)&FPU_FPOP,""); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 7 EA:Unhandled group %d subfunction %d",group,sub); + break; + } + } +} + +#endif diff --git a/src/cpu/core_dyn_x86/dyn_fpu_dh.h b/src/cpu/core_dyn_x86/dyn_fpu_dh.h new file mode 100644 index 0000000..e485a2b --- /dev/null +++ b/src/cpu/core_dyn_x86/dyn_fpu_dh.h @@ -0,0 +1,494 @@ +/* + * Copyright (C) 2002-2005 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* $Id: dyn_fpu_dh.h,v 1.2 2006/11/11 14:42:38 c2woody Exp $ */ + +#include "dosbox.h" +#if C_FPU + +static void FPU_FLD_16(PhysPt addr) { + dyn_dh_fpu.temp.m1 = (Bit32u)mem_readw_dyncorex86(addr); +} + +static void FPU_FST_16(PhysPt addr) { + mem_writew_dyncorex86(addr,(Bit16u)dyn_dh_fpu.temp.m1); +} + +static void FPU_FLD_32(PhysPt addr) { + dyn_dh_fpu.temp.m1 = mem_readd_dyncorex86(addr); +} + +static void FPU_FST_32(PhysPt addr) { + mem_writed_dyncorex86(addr,dyn_dh_fpu.temp.m1); +} + +static void FPU_FLD_64(PhysPt addr) { + dyn_dh_fpu.temp.m1 = mem_readd_dyncorex86(addr); + dyn_dh_fpu.temp.m2 = mem_readd_dyncorex86(addr+4); +} + +static void FPU_FST_64(PhysPt addr) { + mem_writed_dyncorex86(addr,dyn_dh_fpu.temp.m1); + mem_writed_dyncorex86(addr+4,dyn_dh_fpu.temp.m2); +} + +static void FPU_FLD_80(PhysPt addr) { + dyn_dh_fpu.temp.m1 = mem_readd_dyncorex86(addr); + dyn_dh_fpu.temp.m2 = mem_readd_dyncorex86(addr+4); + dyn_dh_fpu.temp.m3 = mem_readw_dyncorex86(addr+8); +} + +static void FPU_FST_80(PhysPt addr) { + mem_writed_dyncorex86(addr,dyn_dh_fpu.temp.m1); + mem_writed_dyncorex86(addr+4,dyn_dh_fpu.temp.m2); + mem_writew_dyncorex86(addr+8,dyn_dh_fpu.temp.m3); +} + +static void FPU_FLDCW_DH(PhysPt addr){ + dyn_dh_fpu.cw = mem_readw(addr); + dyn_dh_fpu.temp.m1 = (Bit32u)(dyn_dh_fpu.cw|0x3f); +} + +static void FPU_FNSTCW_DH(PhysPt addr){ + mem_writew(addr,dyn_dh_fpu.cw); +} + +static void FPU_FNINIT_DH(void){ + dyn_dh_fpu.cw = 0x37f; +} + +static void FPU_FSTENV_DH(PhysPt addr){ + if(!cpu.code.big) { + mem_writew_dyncorex86(addr+0,(Bit16u)dyn_dh_fpu.cw); + mem_writew_dyncorex86(addr+2,(Bit16u)dyn_dh_fpu.temp.m2); + mem_writew_dyncorex86(addr+4,dyn_dh_fpu.temp.m3); + } else { + mem_writed_dyncorex86(addr+0,dyn_dh_fpu.temp.m1); + mem_writew_dyncorex86(addr+0,(Bit16u)dyn_dh_fpu.cw); + mem_writed_dyncorex86(addr+4,dyn_dh_fpu.temp.m2); + mem_writed_dyncorex86(addr+8,dyn_dh_fpu.temp.m3); + } +} + +static void FPU_FLDENV_DH(PhysPt addr){ + if(!cpu.code.big) { + dyn_dh_fpu.cw = (Bit32u)mem_readw_dyncorex86(addr); + dyn_dh_fpu.temp.m1 = dyn_dh_fpu.cw|0x3f; + dyn_dh_fpu.temp.m2 = (Bit32u)mem_readw_dyncorex86(addr+2); + dyn_dh_fpu.temp.m3 = mem_readw_dyncorex86(addr+4); + } else { + dyn_dh_fpu.cw = (Bit32u)mem_readw_dyncorex86(addr); + dyn_dh_fpu.temp.m1 = mem_readd_dyncorex86(addr)|0x3f; + dyn_dh_fpu.temp.m2 = mem_readd_dyncorex86(addr+4); + dyn_dh_fpu.temp.m3 = mem_readw_dyncorex86(addr+8); + dyn_dh_fpu.temp.d1 = mem_readw_dyncorex86(addr+10); + } +} + +static void FPU_FSAVE_DH(PhysPt addr){ + if (!cpu.code.big) { + mem_writew_dyncorex86(addr,(Bit16u)dyn_dh_fpu.cw); + addr+=2; + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x04]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x05]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x08]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x09]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x0c]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x0d]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x10]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x11]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x14]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x15]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x18]); + mem_writeb(addr++,dyn_dh_fpu.temp_state[0x19]); + for(Bitu i=28;i<108;i++) mem_writeb(addr++,dyn_dh_fpu.temp_state[i]); + } else { + mem_writew_dyncorex86(addr,(Bit16u)dyn_dh_fpu.cw); + addr+=2; + for(Bitu i=2;i<108;i++) mem_writeb(addr++,dyn_dh_fpu.temp_state[i]); + } +} + +static void FPU_FRSTOR_DH(PhysPt addr){ + if (!cpu.code.big) { + dyn_dh_fpu.cw = (Bit32u)mem_readw_dyncorex86(addr); + dyn_dh_fpu.temp_state[0x00] = mem_readb(addr++)|0x3f; + dyn_dh_fpu.temp_state[0x01] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x04] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x05] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x08] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x09] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x0c] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x0d] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x10] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x11] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x14] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x15] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x18] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0x19] = mem_readb(addr++); + for(Bitu i=28;i<108;i++) dyn_dh_fpu.temp_state[i] = mem_readb(addr++); + } else { + dyn_dh_fpu.cw = (Bit32u)mem_readw_dyncorex86(addr); + for(Bitu i=0;i<108;i++) dyn_dh_fpu.temp_state[i] = mem_readb(addr++); + dyn_dh_fpu.temp_state[0]|=0x3f; + } +} + +static void dh_fpu_esc0(){ + dyn_get_modrm(); + if (decode.modrm.val >= 0xc0) { + cache_addb(0xd8); + cache_addb(decode.modrm.val); + } else { + dyn_fill_ea(); + gen_call_function((void*)&FPU_FLD_32,"%Ddr",DREG(EA)); + cache_addb(0xd8); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + } +} + +static void dh_fpu_esc1(){ + dyn_get_modrm(); + if (decode.modrm.val >= 0xc0) { + cache_addb(0xd9); + cache_addb(decode.modrm.val); + } else { + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + dyn_fill_ea(); + switch(group){ + case 0x00: /* FLD float*/ + gen_call_function((void*)&FPU_FLD_32,"%Ddr",DREG(EA)); + cache_addb(0xd9); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + break; + case 0x01: /* UNKNOWN */ + LOG(LOG_FPU,LOG_WARN)("ESC EA 1:Unhandled group %d subfunction %d",group,sub); + break; + case 0x02: /* FST float*/ + cache_addb(0xd9); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_32,"%Ddr",DREG(EA)); + break; + case 0x03: /* FSTP float*/ + cache_addb(0xd9); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_32,"%Ddr",DREG(EA)); + break; + case 0x04: /* FLDENV */ + gen_call_function((void*)&FPU_FLDENV_DH,"%Ddr",DREG(EA)); + cache_addb(0xd9); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + break; + case 0x05: /* FLDCW */ + gen_call_function((void *)&FPU_FLDCW_DH,"%Ddr",DREG(EA)); + cache_addb(0xd9); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + break; + case 0x06: /* FSTENV */ + cache_addb(0xd9); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FSTENV_DH,"%Ddr",DREG(EA)); + break; + case 0x07: /* FNSTCW*/ + gen_call_function((void*)&FPU_FNSTCW_DH,"%Ddr",DREG(EA)); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC EA 1:Unhandled group %d subfunction %d",group,sub); + break; + } + } +} + +static void dh_fpu_esc2(){ + dyn_get_modrm(); + if (decode.modrm.val >= 0xc0) { + cache_addb(0xda); + cache_addb(decode.modrm.val); + } else { + dyn_fill_ea(); + gen_call_function((void*)&FPU_FLD_32,"%Ddr",DREG(EA)); + cache_addb(0xda); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + } +} + +static void dh_fpu_esc3(){ + dyn_get_modrm(); + if (decode.modrm.val >= 0xc0) { + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + switch (group) { + case 0x04: + switch (sub) { + case 0x00: //FNENI + case 0x01: //FNDIS + LOG(LOG_FPU,LOG_ERROR)("8087 only fpu code used esc 3: group 4: subfuntion :%d",sub); + break; + case 0x02: //FNCLEX FCLEX + cache_addb(0xdb); + cache_addb(decode.modrm.val); + break; + case 0x03: //FNINIT FINIT + gen_call_function((void*)&FPU_FNINIT_DH,""); + cache_addb(0xdb); + cache_addb(decode.modrm.val); + break; + case 0x04: //FNSETPM + case 0x05: //FRSTPM +// LOG(LOG_FPU,LOG_ERROR)("80267 protected mode (un)set. Nothing done"); + break; + default: + E_Exit("ESC 3:ILLEGAL OPCODE group %d subfunction %d",group,sub); + } + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 3:Unhandled group %d subfunction %d",group,sub); + break; + } + } else { + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + dyn_fill_ea(); + switch(group){ + case 0x00: /* FILD */ + gen_call_function((void*)&FPU_FLD_32,"%Ddr",DREG(EA)); + cache_addb(0xdb); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + break; + case 0x01: /* FISTTP */ + LOG(LOG_FPU,LOG_WARN)("ESC 3 EA:Unhandled group %d subfunction %d",group,sub); + break; + case 0x02: /* FIST */ + cache_addb(0xdb); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_32,"%Ddr",DREG(EA)); + break; + case 0x03: /* FISTP */ + cache_addb(0xdb); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_32,"%Ddr",DREG(EA)); + break; + case 0x05: /* FLD 80 Bits Real */ + gen_call_function((void*)&FPU_FLD_80,"%Ddr",DREG(EA)); + cache_addb(0xdb); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + break; + case 0x07: /* FSTP 80 Bits Real */ + cache_addb(0xdb); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_80,"%Ddr",DREG(EA)); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 3 EA:Unhandled group %d subfunction %d",group,sub); + } + } +} + +static void dh_fpu_esc4(){ + dyn_get_modrm(); + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + if (decode.modrm.val >= 0xc0) { + cache_addb(0xdc); + cache_addb(decode.modrm.val); + } else { + dyn_fill_ea(); + gen_call_function((void*)&FPU_FLD_64,"%Ddr",DREG(EA)); + cache_addb(0xdc); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + } +} + +static void dh_fpu_esc5(){ + dyn_get_modrm(); + if (decode.modrm.val >= 0xc0) { + cache_addb(0xdd); + cache_addb(decode.modrm.val); + } else { + dyn_fill_ea(); + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + switch(group){ + case 0x00: /* FLD double real*/ + gen_call_function((void*)&FPU_FLD_64,"%Ddr",DREG(EA)); + cache_addb(0xdd); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + break; + case 0x01: /* FISTTP longint*/ + LOG(LOG_FPU,LOG_WARN)("ESC 5 EA:Unhandled group %d subfunction %d",group,sub); + break; + case 0x02: /* FST double real*/ + cache_addb(0xdd); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_64,"%Ddr",DREG(EA)); + break; + case 0x03: /* FSTP double real*/ + cache_addb(0xdd); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_64,"%Ddr",DREG(EA)); + break; + case 0x04: /* FRSTOR */ + gen_call_function((void*)&FPU_FRSTOR_DH,"%Ddr",DREG(EA)); + cache_addb(0xdd); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp_state[0]))); + break; + case 0x06: /* FSAVE */ + cache_addb(0xdd); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp_state[0]))); + gen_call_function((void*)&FPU_FSAVE_DH,"%Ddr",DREG(EA)); + cache_addb(0xdb); + cache_addb(0xe3); + break; + case 0x07: /* FNSTSW */ + cache_addb(0xdd); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_16,"%Ddr",DREG(EA)); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 5 EA:Unhandled group %d subfunction %d",group,sub); + } + } +} + +static void dh_fpu_esc6(){ + dyn_get_modrm(); + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + if (decode.modrm.val >= 0xc0) { + cache_addb(0xde); + cache_addb(decode.modrm.val); + } else { + dyn_fill_ea(); + gen_call_function((void*)&FPU_FLD_16,"%Ddr",DREG(EA)); + cache_addb(0xde); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + } +} + +static void dh_fpu_esc7(){ + dyn_get_modrm(); + Bitu group=(decode.modrm.val >> 3) & 7; + Bitu sub=(decode.modrm.val & 7); + if (decode.modrm.val >= 0xc0) { + switch (group){ + case 0x01: /* FXCH STi*/ + cache_addb(0xdf); + cache_addb(decode.modrm.val); + break; + case 0x02: /* FSTP STi*/ + case 0x03: /* FSTP STi*/ + cache_addb(0xdf); + cache_addb(decode.modrm.val); + break; + case 0x04: + switch(sub){ + case 0x00: /* FNSTSW AX*/ + cache_addb(0xdd); + cache_addb(0x05|(0x07<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_load_host(&(dyn_dh_fpu.temp.m1),DREG(TMPB),4); + gen_dop_word(DOP_MOV,false,DREG(EAX),DREG(TMPB)); + gen_releasereg(DREG(TMPB)); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 7:Unhandled group %d subfunction %d",group,sub); + break; + } + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 7:Unhandled group %d subfunction %d",group,sub); + break; + } + } else { + dyn_fill_ea(); + switch(group){ + case 0x00: /* FILD Bit16s */ + gen_call_function((void*)&FPU_FLD_16,"%Ddr",DREG(EA)); + cache_addb(0xdf); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + break; + case 0x01: + LOG(LOG_FPU,LOG_WARN)("ESC 7 EA:Unhandled group %d subfunction %d",group,sub); + break; + case 0x02: /* FIST Bit16s */ + cache_addb(0xdf); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_16,"%Ddr",DREG(EA)); + break; + case 0x03: /* FISTP Bit16s */ + cache_addb(0xdf); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_16,"%Ddr",DREG(EA)); + break; + case 0x04: /* FBLD packed BCD */ + gen_call_function((void*)&FPU_FLD_80,"%Ddr",DREG(EA)); + cache_addb(0xdf); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + break; + case 0x05: /* FILD Bit64s */ + gen_call_function((void*)&FPU_FLD_64,"%Ddr",DREG(EA)); + cache_addb(0xdf); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + break; + case 0x06: /* FBSTP packed BCD */ + cache_addb(0xdf); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_80,"%Ddr",DREG(EA)); + break; + case 0x07: /* FISTP Bit64s */ + cache_addb(0xdf); + cache_addb(0x05|(decode.modrm.reg<<3)); + cache_addd((Bit32u)(&(dyn_dh_fpu.temp.m1))); + gen_call_function((void*)&FPU_FST_64,"%Ddr",DREG(EA)); + break; + default: + LOG(LOG_FPU,LOG_WARN)("ESC 7 EA:Unhandled group %d subfunction %d",group,sub); + break; + } + } +} + +#endif diff --git a/src/cpu/core_dyn_x86/risc_x86.h b/src/cpu/core_dyn_x86/risc_x86.h index 7c9b5e3..d5f15bf 100644 --- a/src/cpu/core_dyn_x86/risc_x86.h +++ b/src/cpu/core_dyn_x86/risc_x86.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -110,6 +110,22 @@ return_address: pop ebx mov [retval],eax } +#elif defined (MACOSX) + register Bit32u tempflags=reg_flags & FMASK_TEST; + __asm__ volatile ( + "pushl %%ebx \n" + "pushl %%ebp \n" + "pushl $(run_return_adress) \n" + "pushl %2 \n" + "jmp *%3 \n" + "run_return_adress: \n" + "popl %%ebp \n" + "popl %%ebx \n" + :"=a" (retval), "=c" (tempflags) + :"r" (tempflags),"r" (code) + :"%edx","%edi","%esi","cc","memory" + ); + reg_flags=(reg_flags & ~FMASK_TEST) | (tempflags & FMASK_TEST); #else register Bit32u tempflags=reg_flags & FMASK_TEST; __asm__ volatile ( @@ -267,6 +283,36 @@ static void gen_reinit(void) { } } + +static void gen_load_host(void * data,DynReg * dr1,Bitu size) { + GenReg * gr1=FindDynReg(dr1,true); + switch (size) { + case 1:cache_addw(0xb60f);break; //movzx byte + case 2:cache_addw(0xb70f);break; //movzx word + case 4:cache_addb(0x8b);break; //mov + default: + IllegalOption("gen_load_host"); + } + cache_addb(0x5+(gr1->index<<3)); + cache_addd((Bit32u)data); + dr1->flags|=DYNFLG_CHANGED; +} + +static void gen_mov_host(void * data,DynReg * dr1,Bitu size,Bit8u di1=0) { + GenReg * gr1=FindDynReg(dr1,(size==4)); + switch (size) { + case 1:cache_addb(0x8a);break; //mov byte + case 2:cache_addb(0x66); //mov word + case 4:cache_addb(0x8b);break; //mov + default: + IllegalOption("gen_load_host"); + } + cache_addb(0x5+((gr1->index+(di1?4:0))<<3)); + cache_addd((Bit32u)data); + dr1->flags|=DYNFLG_CHANGED; +} + + static void gen_dop_byte(DualOps op,DynReg * dr1,Bit8u di1,DynReg * dr2,Bit8u di2) { GenReg * gr1=FindDynReg(dr1);GenReg * gr2=FindDynReg(dr2); Bit8u tmp; @@ -316,6 +362,29 @@ finish: cache_addb(imm); } +static void gen_dop_byte_imm_mem(DualOps op,DynReg * dr1,Bit8u di1,void* data) { + GenReg * gr1=FindDynReg(dr1); + Bit16u tmp; + switch (op) { + case DOP_ADD: tmp=0x0502; break; + case DOP_ADC: tmp=0x0512; break; + case DOP_SUB: tmp=0x052a; break; + case DOP_SBB: tmp=0x051a; break; + case DOP_CMP: tmp=0x053a; goto nochange; //Doesn't change + case DOP_XOR: tmp=0x0532; break; + case DOP_AND: tmp=0x0522; break; + case DOP_OR: tmp=0x050a; break; + case DOP_TEST: tmp=0x0584; goto nochange; //Doesn't change + case DOP_MOV: tmp=0x0585; break; + default: + IllegalOption("gen_dop_byte_imm_mem"); + } + dr1->flags|=DYNFLG_CHANGED; +nochange: + cache_addw(tmp+((gr1->index+di1)<<11)); + cache_addd((Bit32u)data); +} + static void gen_sop_byte(SingleOps op,DynReg * dr1,Bit8u di1) { GenReg * gr1=FindDynReg(dr1); Bit16u tmp; @@ -397,6 +466,19 @@ static void gen_lea(DynReg * ddr,DynReg * dsr1,DynReg * dsr2,Bitu scale,Bits imm ddr->flags|=DYNFLG_CHANGED; } +static void gen_lea_imm_mem(DynReg * ddr,DynReg * dsr,void* data) { + GenReg * gdr=FindDynReg(ddr); + Bit8u rm_base=(gdr->index << 3); + cache_addw(0x058b+(rm_base<<8)); + cache_addd((Bit32u)data); + GenReg * gsr=FindDynReg(dsr); + cache_addb(0x8d); //LEA + cache_addb(rm_base+0x44); + cache_addb(rm_base+gsr->index); + cache_addb(0x00); + ddr->flags|=DYNFLG_CHANGED; +} + static void gen_dop_word(DualOps op,bool dword,DynReg * dr1,DynReg * dr2) { GenReg * gr2=FindDynReg(dr2); GenReg * gr1=FindDynReg(dr1,dword && op==DOP_MOV); @@ -457,6 +539,56 @@ finish: else cache_addw(imm); } +static void gen_dop_word_imm_mem(DualOps op,bool dword,DynReg * dr1,void* data) { + GenReg * gr1=FindDynReg(dr1,dword && op==DOP_MOV); + Bit16u tmp; + switch (op) { + case DOP_ADD: tmp=0x0503; break; + case DOP_ADC: tmp=0x0513; break; + case DOP_SUB: tmp=0x052b; break; + case DOP_SBB: tmp=0x051b; break; + case DOP_CMP: tmp=0x053b; goto nochange; //Doesn't change + case DOP_XOR: tmp=0x0533; break; + case DOP_AND: tmp=0x0523; break; + case DOP_OR: tmp=0x050b; break; + case DOP_TEST: tmp=0x0585; goto nochange; //Doesn't change + case DOP_MOV: + gen_mov_host(data,dr1,dword?4:2); + dr1->flags|=DYNFLG_CHANGED; + return; + default: + IllegalOption("gen_dop_word_imm_mem"); + } + dr1->flags|=DYNFLG_CHANGED; +nochange: + if (!dword) cache_addb(0x66); + cache_addw(tmp+(gr1->index<<11)); + cache_addd((Bit32u)data); +} + +static void gen_dop_word_var(DualOps op,bool dword,DynReg * dr1,void* drd) { + GenReg * gr1=FindDynReg(dr1,dword && op==DOP_MOV); + Bit8u tmp; + switch (op) { + case DOP_ADD: tmp=0x03; break; + case DOP_ADC: tmp=0x13; break; + case DOP_SUB: tmp=0x2b; break; + case DOP_SBB: tmp=0x1b; break; + case DOP_CMP: tmp=0x3b; break; + case DOP_XOR: tmp=0x33; break; + case DOP_AND: tmp=0x23; break; + case DOP_OR: tmp=0x0b; break; + case DOP_TEST: tmp=0x85; break; + case DOP_MOV: tmp=0x8b; break; + case DOP_XCHG: tmp=0x87; break; + default: + IllegalOption("gen_dop_word_var"); + } + if (!dword) cache_addb(0x66); + cache_addw(tmp|(0x05+((gr1->index)<<3))<<8); + cache_addd((Bit32u)drd); +} + static void gen_imul_word(bool dword,DynReg * dr1,DynReg * dr2) { GenReg * gr1=FindDynReg(dr1);GenReg * gr2=FindDynReg(dr2); dr1->flags|=DYNFLG_CHANGED; @@ -606,15 +738,42 @@ static void gen_call_function(void * func,char * ops,...) { if (ops) { va_list params; va_start(params,ops); + Bitu stack_used=0; + bool free_flags=false; Bits pindex=0; while (*ops) { if (*ops=='%') { pinfo[pindex].line=ops+1; pinfo[pindex].value=va_arg(params,Bitu); +#if defined (MACOSX) + char * scan=pinfo[pindex].line; + if ((*scan=='I') || (*scan=='D')) stack_used+=4; + else if (*scan=='F') free_flags=true; +#endif pindex++; } ops++; } + +#if defined (MACOSX) + /* align stack */ + stack_used+=4; // saving esp on stack as well + + cache_addw(0xc48b); // mov eax,esp + cache_addb(0x2d); // sub eax,stack_used + cache_addd(stack_used); + cache_addw(0xe083); // and eax,0xfffffff0 + cache_addb(0xf0); + cache_addb(0x05); // sub eax,stack_used + cache_addd(stack_used); + cache_addb(0x94); // xchg eax,esp + if (free_flags) { + cache_addw(0xc083); // add eax,4 + cache_addb(0x04); + } + cache_addb(0x50); // push eax (==old esp) +#endif + paramcount=0; while (pindex) { pindex--; @@ -671,7 +830,24 @@ static void gen_call_function(void * func,char * ops,...) { IllegalOption("gen_call_function unknown param"); } } +#if defined (MACOSX) + if (free_flags) release_flags=false; + } else { + /* align stack */ + Bit32u stack_used=8; // saving esp and return address on the stack + + cache_addw(0xc48b); // mov eax,esp + cache_addb(0x2d); // sub eax,stack_used + cache_addd(stack_used); + cache_addw(0xe083); // and eax,0xfffffff0 + cache_addb(0xf0); + cache_addb(0x05); // sub eax,stack_used + cache_addd(stack_used); + cache_addb(0x94); // xchg eax,esp + cache_addb(0x50); // push esp (==old esp) +#endif } + /* Clear some unprotected registers */ x86gen.regs[X86_REG_ECX]->Clear(); x86gen.regs[X86_REG_EDX]->Clear(); @@ -710,6 +886,11 @@ static void gen_call_function(void * func,char * ops,...) { } /* Restore EAX registers to be used again */ x86gen.regs[X86_REG_EAX]->notusable=false; + +#if defined (MACOSX) + /* restore stack */ + cache_addb(0x5c); // pop esp +#endif } static void gen_call_write(DynReg * dr,Bit32u val,Bitu write_size) { @@ -718,6 +899,21 @@ static void gen_call_write(DynReg * dr,Bit32u val,Bitu write_size) { x86gen.regs[X86_REG_EAX]->notusable=true; gen_protectflags(); +#if defined (MACOSX) + /* align stack */ + Bitu stack_used=12; + + cache_addw(0xc48b); // mov eax,esp + cache_addb(0x2d); // sub eax,stack_used + cache_addd(stack_used); + cache_addw(0xe083); // and eax,0xfffffff0 + cache_addb(0xf0); + cache_addb(0x05); // sub eax,stack_used + cache_addd(stack_used); + cache_addb(0x94); // xchg eax,esp + cache_addb(0x50); // push eax (==old esp) +#endif + cache_addb(0x68); //PUSH val cache_addd(val); GenReg * genreg=FindDynReg(dr); @@ -728,26 +924,22 @@ static void gen_call_write(DynReg * dr,Bit32u val,Bitu write_size) { x86gen.regs[X86_REG_EDX]->Clear(); /* Do the actual call to the procedure */ cache_addb(0xe8); -#ifdef CHECKED_MEMORY_ACCESS switch (write_size) { case 1: cache_addd((Bit32u)mem_writeb_checked_x86 - (Bit32u)cache.pos-4); break; case 2: cache_addd((Bit32u)mem_writew_checked_x86 - (Bit32u)cache.pos-4); break; case 4: cache_addd((Bit32u)mem_writed_checked_x86 - (Bit32u)cache.pos-4); break; default: IllegalOption("gen_call_write"); } -#else - switch (write_size) { - case 1: cache_addd((Bit32u)mem_writeb - (Bit32u)cache.pos-4); break; - case 2: cache_addd((Bit32u)mem_writew_dyncorex86 - (Bit32u)cache.pos-4); break; - case 4: cache_addd((Bit32u)mem_writed_dyncorex86 - (Bit32u)cache.pos-4); break; - default: IllegalOption("gen_call_write"); - } -#endif cache_addw(0xc483); //ADD ESP,8 cache_addb(2*4); x86gen.regs[X86_REG_EAX]->notusable=false; gen_releasereg(dr); + +#if defined (MACOSX) + /* restore stack */ + cache_addb(0x5c); // pop esp +#endif } static Bit8u * gen_create_branch(BranchTypes type) { @@ -760,7 +952,7 @@ static void gen_fill_branch(Bit8u * data,Bit8u * from=cache.pos) { #if C_DEBUG Bits len=from-data; if (len<0) len=-len; - if (len>126) LOG_MSG("BIg jump %d",len); + if (len>126) LOG_MSG("Big jump %d",len); #endif *data=(from-data-1); } @@ -824,34 +1016,6 @@ static void gen_save_host_direct(void * data,Bits imm) { cache_addd(imm); } -static void gen_load_host(void * data,DynReg * dr1,Bitu size) { - GenReg * gr1=FindDynReg(dr1); - switch (size) { - case 1:cache_addw(0xb60f);break; //movzx byte - case 2:cache_addw(0xb70f);break; //movzx word - case 4:cache_addb(0x8b);break; //mov - default: - IllegalOption("gen_load_host"); - } - cache_addb(0x5+(gr1->index<<3)); - cache_addd((Bit32u)data); - dr1->flags|=DYNFLG_CHANGED; -} - -static void gen_mov_host(void * data,DynReg * dr1,Bitu size,Bit8u di1=0) { - GenReg * gr1=FindDynReg(dr1); - switch (size) { - case 1:cache_addb(0x8a);break; //mov byte - case 2:cache_addb(0x66); //mov word - case 4:cache_addb(0x8b);break; //mov - default: - IllegalOption("gen_load_host"); - } - cache_addb(0x5+((gr1->index+(di1?4:0))<<3)); - cache_addd((Bit32u)data); - dr1->flags|=DYNFLG_CHANGED; -} - static void gen_return(BlockReturn retcode) { gen_protectflags(); cache_addb(0x59); //POP ECX, the flags diff --git a/src/cpu/core_dyn_x86/string.h b/src/cpu/core_dyn_x86/string.h index 6138426..f0d2924 100644 --- a/src/cpu/core_dyn_x86/string.h +++ b/src/cpu/core_dyn_x86/string.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cpu/core_full.cpp b/src/cpu/core_full.cpp index 6e372c3..72f8f48 100644 --- a/src/cpu/core_full.cpp +++ b/src/cpu/core_full.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cpu/core_full/Makefile.in b/src/cpu/core_full/Makefile.in index a1c3dcc..d2ab4ff 100644 --- a/src/cpu/core_full/Makefile.in +++ b/src/cpu/core_full/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -34,26 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/cpu/core_full -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -80,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -110,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -120,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -129,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -154,43 +138,37 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ + noinst_HEADERS = ea_lookup.h load.h loadwrite.h op.h optable.h save.h \ string.h support.h +subdir = src/cpu/core_full +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in Makefile.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/cpu/core_full/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/cpu/core_full/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu src/cpu/core_full/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -199,7 +177,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -211,11 +188,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -238,6 +214,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -251,7 +231,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -269,6 +249,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(HEADERS) + installdirs: install: install-am install-exec: install-exec-am @@ -289,7 +270,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -306,8 +287,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -340,14 +319,14 @@ ps-am: uninstall-am: uninstall-info-am -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - ctags distclean distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic ctags \ + distclean distclean-generic distclean-tags distdir dvi dvi-am \ + info info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/cpu/core_full/load.h b/src/cpu/core_full/load.h index 73ced33..1f47b88 100644 --- a/src/cpu/core_full/load.h +++ b/src/cpu/core_full/load.h @@ -447,12 +447,12 @@ l_M_Ed: goto nextopcode; } case D_LEAVEw: - reg_esp&=~cpu.stack.mask; + reg_esp&=cpu.stack.notmask; reg_esp|=(reg_ebp&cpu.stack.mask); reg_bp=Pop_16(); goto nextopcode; case D_LEAVEd: - reg_esp&=~cpu.stack.mask; + reg_esp&=cpu.stack.notmask; reg_esp|=(reg_ebp&cpu.stack.mask); reg_ebp=Pop_32(); goto nextopcode; diff --git a/src/cpu/core_full/op.h b/src/cpu/core_full/op.h index 8f25a72..d7a454f 100644 --- a/src/cpu/core_full/op.h +++ b/src/cpu/core_full/op.h @@ -450,6 +450,11 @@ switch (inst.code.op) { FillFlags(); if (CPU_LMSW(inst_op1_w)) RunException(); goto nextopcode; + case 7: /* INVLPG */ + if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP); + FillFlags(); + PAGING_ClearTLB(); + goto nextopcode; default: LOG(LOG_CPU,LOG_ERROR)("Group 7 Illegal subfunction %X",inst.rm_index); goto illegalopcode; @@ -467,6 +472,12 @@ switch (inst.code.op) { case O_M_Rd_DRx: if (CPU_READ_DRX(inst.rm_index,inst_op1_d)) RunException(); break; + case O_M_TRx_Rd: + if (CPU_WRITE_TRX(inst.rm_index,inst_op1_d)) RunException(); + break; + case O_M_Rd_TRx: + if (CPU_READ_TRX(inst.rm_index,inst_op1_d)) RunException(); + break; case O_LAR: { if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegalopcode; diff --git a/src/cpu/core_full/optable.h b/src/cpu/core_full/optable.h index cf11994..1d21d4b 100644 --- a/src/cpu/core_full/optable.h +++ b/src/cpu/core_full/optable.h @@ -206,8 +206,8 @@ static OpCode OpCodeTable[1024]={ /* 0x120 - 0x127 */ {L_MODRM ,O_M_Rd_CRx ,S_Ed ,0 },{L_MODRM ,O_M_Rd_DRx ,S_Ed ,0 }, {L_MODRM ,O_M_CRx_Rd ,0 ,M_Ed },{L_MODRM ,O_M_DRx_Rd ,0 ,M_Ed }, -{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, -{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, +{L_MODRM ,O_M_Rd_TRx ,S_Ed ,0 },{0 ,0 ,0 ,0 }, +{L_MODRM ,O_M_TRx_Rd ,0 ,M_Ed },{0 ,0 ,0 ,0 }, /* 0x128 - 0x12f */ {0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, @@ -562,8 +562,8 @@ static OpCode OpCodeTable[1024]={ /* 0x320 - 0x327 */ {L_MODRM ,O_M_Rd_CRx ,S_Ed ,0 },{L_MODRM ,O_M_Rd_DRx ,S_Ed ,0 }, {L_MODRM ,O_M_CRx_Rd ,0 ,M_Ed },{L_MODRM ,O_M_DRx_Rd ,0 ,M_Ed }, -{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, -{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, +{L_MODRM ,O_M_Rd_TRx ,S_Ed ,0 },{0 ,0 ,0 ,0 }, +{L_MODRM ,O_M_TRx_Rd ,0 ,M_Ed },{0 ,0 ,0 ,0 }, /* 0x328 - 0x32f */ {0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 }, diff --git a/src/cpu/core_full/support.h b/src/cpu/core_full/support.h index d7f68f7..f7f54b0 100644 --- a/src/cpu/core_full/support.h +++ b/src/cpu/core_full/support.h @@ -86,6 +86,7 @@ enum { O_GRP7w,O_GRP7d, O_M_CRx_Rd,O_M_Rd_CRx, O_M_DRx_Rd,O_M_Rd_DRx, + O_M_TRx_Rd,O_M_Rd_TRx, O_LAR,O_LSL, O_ARPL, diff --git a/src/cpu/core_normal.cpp b/src/cpu/core_normal.cpp index 5ff39ee..d5495b9 100644 --- a/src/cpu/core_normal.cpp +++ b/src/cpu/core_normal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #include "callback.h" #include "pic.h" #include "fpu.h" +#include "paging.h" #if C_DEBUG #include "debug.h" @@ -70,6 +71,7 @@ extern Bitu cycle_count; #define DO_PREFIX_SEG(_SEG) \ BaseDS=SegBase(_SEG); \ BaseSS=SegBase(_SEG); \ + core.base_val_ds=_SEG; \ goto restart_opcode; #define DO_PREFIX_ADDR() \ @@ -91,12 +93,10 @@ static struct { Bitu opcode_index; PhysPt cseip; PhysPt base_ds,base_ss; + SegNames base_val_ds; bool rep_zero; Bitu prefixes; GetEAHandler * ea_table; - struct { - bool skip; - } trap; } core; #define GETIP (core.cseip-SegBase(cs)) @@ -144,6 +144,7 @@ Bits CPU_Core_Normal_Run(void) { core.ea_table=&EATable[cpu.code.big*256]; BaseDS=SegBase(ds); BaseSS=SegBase(ss); + core.base_val_ds=ds; #if C_DEBUG #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) { @@ -190,10 +191,10 @@ decode_end: Bits CPU_Core_Normal_Trap_Run(void) { Bits oldCycles = CPU_Cycles; CPU_Cycles = 1; - core.trap.skip=false; + cpu.trap_skip = false; Bits ret=CPU_Core_Normal_Run(); - if (!core.trap.skip) CPU_HW_Interrupt(1); + if (!cpu.trap_skip) CPU_HW_Interrupt(1); CPU_Cycles = oldCycles-1; cpudecoder = &CPU_Core_Normal_Run; diff --git a/src/cpu/core_normal/Makefile.in b/src/cpu/core_normal/Makefile.in index ce0a632..474d53d 100644 --- a/src/cpu/core_normal/Makefile.in +++ b/src/cpu/core_normal/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -21,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -34,26 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/cpu/core_normal -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -80,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -110,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -120,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -129,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -154,43 +138,37 @@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ + noinst_HEADERS = helpers.h prefix_none.h prefix_66.h prefix_0f.h support.h table_ea.h \ prefix_66_0f.h string.h +subdir = src/cpu/core_normal +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.in Makefile.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/cpu/core_normal/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/cpu/core_normal/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu src/cpu/core_normal/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -199,7 +177,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -211,11 +188,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -238,6 +214,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -251,7 +231,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -269,6 +249,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(HEADERS) + installdirs: install: install-am install-exec: install-exec-am @@ -289,7 +270,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -306,8 +287,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -340,14 +319,14 @@ ps-am: uninstall-am: uninstall-info-am -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - ctags distclean distclean-generic distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic ctags \ + distclean distclean-generic distclean-tags distdir dvi dvi-am \ + info info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/cpu/core_normal/helpers.h b/src/cpu/core_normal/helpers.h index 237144b..f0956f6 100644 --- a/src/cpu/core_normal/helpers.h +++ b/src/cpu/core_normal/helpers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cpu/core_normal/prefix_0f.h b/src/cpu/core_normal/prefix_0f.h index cb24f83..5924437 100644 --- a/src/cpu/core_normal/prefix_0f.h +++ b/src/cpu/core_normal/prefix_0f.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -92,6 +92,10 @@ limit=LoadMw(eaa); if (CPU_LMSW(limit)) RUNEXCEPTION(); break; + case 0x07: /* INVLPG */ + if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP); + PAGING_ClearTLB(); + break; } } else { GetEArw;Bitu limit; @@ -197,6 +201,32 @@ if (CPU_WRITE_DRX(which,*eard)) RUNEXCEPTION(); } break; + CASE_0F_B(0x24) /* MOV Rd,TRx */ + { + GetRM; + Bitu which=(rm >> 3) & 7; + if (rm < 0xc0 ) { + rm |= 0xc0; + LOG(LOG_CPU,LOG_ERROR)("MOV XXX,TR% with non-register",which); + } + GetEArd; + Bit32u trx_value; + if (CPU_READ_TRX(which,trx_value)) RUNEXCEPTION(); + *eard=trx_value; + } + break; + CASE_0F_B(0x26) /* MOV TRx,Rd */ + { + GetRM; + Bitu which=(rm >> 3) & 7; + if (rm < 0xc0 ) { + rm |= 0xc0; + LOG(LOG_CPU,LOG_ERROR)("MOV TR%,XXX with non-register",which); + } + GetEArd; + if (CPU_WRITE_TRX(which,*eard)) RUNEXCEPTION(); + } + break; CASE_0F_W(0x80) /* JO */ JumpCond16_w(TFLG_O);break; CASE_0F_W(0x81) /* JNO */ diff --git a/src/cpu/core_normal/prefix_66.h b/src/cpu/core_normal/prefix_66.h index a839c42..a76e43f 100644 --- a/src/cpu/core_normal/prefix_66.h +++ b/src/cpu/core_normal/prefix_66.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -492,7 +492,7 @@ } break; CASE_D(0xc9) /* LEAVE */ - reg_esp&=~cpu.stack.mask; + reg_esp&=cpu.stack.notmask; reg_esp|=(reg_ebp&cpu.stack.mask); reg_ebp=Pop_32(); break; diff --git a/src/cpu/core_normal/prefix_66_0f.h b/src/cpu/core_normal/prefix_66_0f.h index d9cc990..3022ba5 100644 --- a/src/cpu/core_normal/prefix_66_0f.h +++ b/src/cpu/core_normal/prefix_66_0f.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -94,6 +94,10 @@ limit=LoadMw(eaa); if (CPU_LMSW((Bit16u)limit)) RUNEXCEPTION(); break; + case 0x07: /* INVLPG */ + if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP); + PAGING_ClearTLB(); + break; } } else { GetEArd;Bitu limit; diff --git a/src/cpu/core_normal/prefix_none.h b/src/cpu/core_normal/prefix_none.h index 44a9a94..36739a3 100644 --- a/src/cpu/core_normal/prefix_none.h +++ b/src/cpu/core_normal/prefix_none.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -431,7 +431,19 @@ { GetRMrb; if (rm >= 0xc0 ) {GetEArb;*earb=*rmrb;} - else {GetEAa;SaveMb(eaa,*rmrb);} + else { + if (cpu.pmode) { + if (GCC_UNLIKELY((rm==0x05) && (!cpu.code.big))) { + Descriptor desc; + cpu.gdt.GetDescriptor(SegValue(core.base_val_ds),desc); + if ((desc.Type()==DESC_CODE_R_NC_A) || (desc.Type()==DESC_CODE_R_NC_NA)) { + CPU_Exception(EXCEPTION_GP,SegValue(core.base_val_ds) & 0xfffc); + continue; + } + } + } + GetEAa;SaveMb(eaa,*rmrb); + } break; } CASE_W(0x89) /* MOV Ew,Gw */ @@ -712,7 +724,7 @@ } break; CASE_W(0xc9) /* LEAVE */ - reg_esp&=~cpu.stack.mask; + reg_esp&=cpu.stack.notmask; reg_esp|=(reg_ebp&cpu.stack.mask); reg_bp=Pop_16(); break; @@ -735,7 +747,7 @@ #endif CPU_SW_Interrupt_NoIOPLCheck(3,GETIP); #if CPU_TRAP_CHECK - core.trap.skip=true; + cpu.trap_skip=true; #endif continue; CASE_B(0xcd) /* INT Ib */ @@ -749,7 +761,7 @@ #endif CPU_SW_Interrupt(num,GETIP); #if CPU_TRAP_CHECK - core.trap.skip=true; + cpu.trap_skip=true; #endif continue; } @@ -758,7 +770,7 @@ FillFlags(); CPU_SW_Interrupt(4,GETIP); #if CPU_TRAP_CHECK - core.trap.skip=true; + cpu.trap_skip=true; #endif continue; } @@ -944,7 +956,7 @@ FillFlags(); CPU_SW_Interrupt_NoIOPLCheck(1,GETIP); #if CPU_TRAP_CHECK - core.trap.skip=true; + cpu.trap_skip=true; #endif continue; CASE_B(0xf2) /* REPNZ */ diff --git a/src/cpu/core_normal/support.h b/src/cpu/core_normal/support.h index 2d1aeb1..8a78955 100644 --- a/src/cpu/core_normal/support.h +++ b/src/cpu/core_normal/support.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cpu/core_normal/table_ea.h b/src/cpu/core_normal/table_ea.h index bfe5ed0..d09012e 100644 --- a/src/cpu/core_normal/table_ea.h +++ b/src/cpu/core_normal/table_ea.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cpu/core_simple.cpp b/src/cpu/core_simple.cpp index 72d722e..cfe68d5 100644 --- a/src/cpu/core_simple.cpp +++ b/src/cpu/core_simple.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,6 +63,7 @@ extern Bitu cycle_count; #define DO_PREFIX_SEG(_SEG) \ BaseDS=SegBase(_SEG); \ BaseSS=SegBase(_SEG); \ + core.base_val_ds=_SEG; \ goto restart_opcode; #define DO_PREFIX_ADDR() \ @@ -82,14 +83,16 @@ static const Bit32u AddrMaskTable[2]={0x0000ffff,0xffffffff}; static struct { Bitu opcode_index; +#if defined (_MSC_VER) + volatile HostPt cseip; +#else HostPt cseip; +#endif PhysPt base_ds,base_ss; + SegNames base_val_ds; bool rep_zero; Bitu prefixes; GetEAHandler * ea_table; - struct { - bool skip; - } trap; } core; #define GETIP (core.cseip-SegBase(cs)-MemBase) @@ -137,6 +140,7 @@ Bits CPU_Core_Simple_Run(void) { core.ea_table=&EATable[cpu.code.big*256]; BaseDS=SegBase(ds); BaseSS=SegBase(ss); + core.base_val_ds=ds; #if C_DEBUG #if C_HEAVY_DEBUG if (DEBUG_HeavyIsBreakpoint()) { @@ -181,16 +185,16 @@ decode_end: return CBRET_NONE; } +// not really used Bits CPU_Core_Simple_Trap_Run(void) { - Bits oldCycles = CPU_Cycles; CPU_Cycles = 1; - core.trap.skip=false; + cpu.trap_skip = false; Bits ret=CPU_Core_Normal_Run(); - if (!core.trap.skip) CPU_SW_Interrupt(1,reg_eip); + if (!cpu.trap_skip) CPU_HW_Interrupt(1); CPU_Cycles = oldCycles-1; - cpudecoder = &CPU_Core_Normal_Run; + cpudecoder = &CPU_Core_Simple_Run; return ret; } diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp index 1a58ff5..b38ccb5 100644 --- a/src/cpu/cpu.cpp +++ b/src/cpu/cpu.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cpu.cpp,v 1.79 2006/02/26 16:11:00 qbix79 Exp $ */ +/* $Id: cpu.cpp,v 1.98 2007/02/22 08:35:34 qbix79 Exp $ */ #include +#include #include "dosbox.h" #include "cpu.h" #include "memory.h" @@ -29,29 +30,42 @@ #include "support.h" Bitu DEBUG_EnableDebugger(void); +extern void GFX_SetTitle(Bit32s cycles ,Bits frameskip,bool paused); #if 1 #undef LOG +#if defined (_MSC_VER) #define LOG(X,Y) +#else +#define LOG(X,Y) CPU_LOG +#define CPU_LOG(...) +#endif #endif CPU_Regs cpu_regs; CPUBlock cpu; Segments Segs; -Bits CPU_Cycles = 0; -Bits CPU_CycleLeft = 0; -Bits CPU_CycleMax = 2500; -Bits CPU_CycleUp = 0; -Bits CPU_CycleDown = 0; +Bit32s CPU_Cycles = 0; +Bit32s CPU_CycleLeft = 0; +Bit32s CPU_CycleMax = 3000; +Bit32s CPU_OldCycleMax = 3000; +Bit32s CPU_CyclePercUsed = 100; +Bit32s CPU_CycleLimit = -1; +Bit32s CPU_CycleUp = 0; +Bit32s CPU_CycleDown = 0; +Bit64s CPU_IODelayRemoved = 0; CPU_Decoder * cpudecoder; -bool CPU_CycleAuto; +bool CPU_CycleAutoAdjust; +Bitu CPU_AutoDetermineMode; void CPU_Core_Full_Init(void); void CPU_Core_Normal_Init(void); void CPU_Core_Simple_Init(void); void CPU_Core_Dyn_X86_Init(void); void CPU_Core_Dyn_X86_Cache_Init(bool enable_cache); +void CPU_Core_Dyn_X86_Cache_Close(void); +void CPU_Core_Dyn_X86_SetFPUMode(bool dh_fpu); /* In debug mode exceptions are tested and dosbox exits when * a unhandled exception state is detected. @@ -90,26 +104,26 @@ void CPU_Core_Dyn_X86_Cache_Init(bool enable_cache); void CPU_Push16(Bitu value) { - Bit32u new_esp=(reg_esp&~cpu.stack.mask)|((reg_esp-2)&cpu.stack.mask); + Bit32u new_esp=(reg_esp&cpu.stack.notmask)|((reg_esp-2)&cpu.stack.mask); mem_writew(SegPhys(ss) + (new_esp & cpu.stack.mask) ,value); reg_esp=new_esp; } void CPU_Push32(Bitu value) { - Bit32u new_esp=(reg_esp&~cpu.stack.mask)|((reg_esp-4)&cpu.stack.mask); + Bit32u new_esp=(reg_esp&cpu.stack.notmask)|((reg_esp-4)&cpu.stack.mask); mem_writed(SegPhys(ss) + (new_esp & cpu.stack.mask) ,value); reg_esp=new_esp; } Bitu CPU_Pop16(void) { Bitu val=mem_readw(SegPhys(ss) + (reg_esp & cpu.stack.mask)); - reg_esp=(reg_esp&~cpu.stack.mask)|((reg_esp+2)&cpu.stack.mask); + reg_esp=(reg_esp&cpu.stack.notmask)|((reg_esp+2)&cpu.stack.mask); return val; } Bitu CPU_Pop32(void) { Bitu val=mem_readd(SegPhys(ss) + (reg_esp & cpu.stack.mask)); - reg_esp=(reg_esp&~cpu.stack.mask)|((reg_esp+4)&cpu.stack.mask); + reg_esp=(reg_esp&cpu.stack.notmask)|((reg_esp+4)&cpu.stack.mask); return val; } @@ -401,7 +415,8 @@ doconforming: CPU_SetSegGeneral(fs,new_fs); CPU_SetSegGeneral(gs,new_gs); if (!cpu_tss.SetSelector(new_tss_selector)) LOG(LOG_CPU,LOG_NORMAL)("TaskSwitch: set tss selector %X failed",new_tss_selector); - cpu_tss.desc.SetBusy(true); +// cpu_tss.desc.SetBusy(true); +// cpu_tss.SaveSelector(); // LOG_MSG("Task CPL %X CS:%X IP:%X SS:%X SP:%X eflags %x",cpu.cpl,SegValue(cs),reg_eip,SegValue(ss),reg_esp,reg_flags); return true; } @@ -409,11 +424,11 @@ doconforming: bool CPU_IO_Exception(Bitu port,Bitu size) { if (cpu.pmode && ((GETFLAG_IOPLcpu_tss.limit) goto doexception; - where=cpu_tss.base+ofs+(port/8); - Bitu map=mem_readw(where); + bwhere=cpu_tss.base+ofs+(port/8); + Bitu map=mem_readw(bwhere); Bitu mask=(0xffff>>(16-size)) << (port&7); if (map & mask) goto doexception; } @@ -438,8 +453,9 @@ void CPU_Interrupt(Bitu num,Bitu type,Bitu oldeip) { #if C_HEAVY_DEBUG LOG(LOG_CPU,LOG_ERROR)("Call to interrupt 0xCD this is BAD"); DEBUG_HeavyWriteLogInstruction(); -#endif E_Exit("Call to interrupt 0xCD this is BAD"); +#endif + break; case 0x03: if (DEBUG_Breakpoint()) { CPU_Cycles=0; @@ -552,10 +568,12 @@ void CPU_Interrupt(Bitu num,Bitu type,Bitu oldeip) { if (n_ss_desc.Big()) { cpu.stack.big=true; cpu.stack.mask=0xffffffff; + cpu.stack.notmask=0; reg_esp=n_esp; } else { cpu.stack.big=false; cpu.stack.mask=0xffff; + cpu.stack.notmask=0xffff0000; reg_sp=n_esp & 0xffff; } @@ -814,10 +832,12 @@ void CPU_IRET(bool use32,Bitu oldeip) { if (n_ss_desc.Big()) { cpu.stack.big=true; cpu.stack.mask=0xffffffff; + cpu.stack.notmask=0; reg_esp=n_esp; } else { cpu.stack.big=false; cpu.stack.mask=0xffff; + cpu.stack.notmask=0xffff0000; reg_sp=n_esp & 0xffff; } @@ -1070,10 +1090,12 @@ call_code: if (n_ss_desc.Big()) { cpu.stack.big=true; cpu.stack.mask=0xffffffff; + cpu.stack.notmask=0; reg_esp=n_esp; } else { cpu.stack.big=false; cpu.stack.mask=0xffff; + cpu.stack.notmask=0xffff0000; reg_sp=n_esp & 0xffff; } @@ -1141,9 +1163,12 @@ call_code: LOG(LOG_CPU,LOG_NORMAL)("CALL:TSS to %X",selector); CPU_SwitchTask(selector,TSwitch_CALL_INT,oldeip); break; + case DESC_INVALID: + // used by some installers + CPU_Exception(EXCEPTION_GP,selector & 0xfffc); + return; default: E_Exit("CALL:Descriptor type %x unsupported",call.Type()); - } } assert(1); @@ -1303,10 +1328,12 @@ RET_same_level: if (n_ss_desc.Big()) { cpu.stack.big=true; cpu.stack.mask=0xffffffff; + cpu.stack.notmask=0; reg_esp=n_esp+bytes; } else { cpu.stack.big=false; cpu.stack.mask=0xffff; + cpu.stack.notmask=0xffff0000; reg_sp=(n_esp & 0xffff)+bytes; } @@ -1385,6 +1412,7 @@ bool CPU_LTR(Bitu selector) { } if (!cpu_tss.SetSelector(selector)) E_Exit("LTR failed, selector=%X",selector); cpu_tss.desc.SetBusy(true); + cpu_tss.SaveSelector(); } else { /* Descriptor was no available TSS descriptor */ LOG(LOG_CPU,LOG_NORMAL)("LTR failed, selector=%X (type=%X)",selector,desc.Type()); @@ -1420,13 +1448,32 @@ void CPU_SET_CRX(Bitu cr,Bitu value) { switch (cr) { case 0: { - Bitu changed=cpu.cr0 ^ value; + Bitu changed=cpu.cr0 ^ value; if (!changed) return; cpu.cr0=value; if (value & CR0_PROTECTION) { cpu.pmode=true; LOG(LOG_CPU,LOG_NORMAL)("Protected mode"); PAGING_Enable((value & CR0_PAGING)>0); + + if (!(CPU_AutoDetermineMode&CPU_AUTODETERMINE_MASK)) break; + + if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CYCLES) { + CPU_CycleAutoAdjust=true; + CPU_CycleLeft=0; + CPU_Cycles=0; + CPU_OldCycleMax=CPU_CycleMax; + GFX_SetTitle(CPU_CyclePercUsed,-1,false); + } else { + GFX_SetTitle(-1,-1,false); + } + #if (C_DYNAMIC_X86) + if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CORE) { + CPU_Core_Dyn_X86_Cache_Init(true); + cpudecoder=&CPU_Core_Dyn_X86_Run; + } +#endif + CPU_AutoDetermineMode<<=CPU_AUTODETERMINE_SHIFT; } else { cpu.pmode=false; if (value & CR0_PAGING) LOG_MSG("Paging requested without PE=1"); @@ -1530,6 +1577,38 @@ bool CPU_READ_DRX(Bitu dr,Bit32u & retvalue) { return false; } +bool CPU_WRITE_TRX(Bitu tr,Bitu value) { + /* Check if privileged to access control registers */ + if (cpu.pmode && (cpu.cpl>0)) return CPU_PrepareException(EXCEPTION_GP,0); + switch (tr) { +// case 3: + case 6: + case 7: + cpu.trx[tr]=value; + return false; + default: + LOG(LOG_CPU,LOG_ERROR)("Unhandled MOV TR%d,%X",tr,value); + break; + } + return CPU_PrepareException(EXCEPTION_UD,0); +} + +bool CPU_READ_TRX(Bitu tr,Bit32u & retvalue) { + /* Check if privileged to access control registers */ + if (cpu.pmode && (cpu.cpl>0)) return CPU_PrepareException(EXCEPTION_GP,0); + switch (tr) { +// case 3: + case 6: + case 7: + retvalue=cpu.trx[tr]; + return false; + default: + LOG(LOG_CPU,LOG_ERROR)("Unhandled MOV XXX, TR%d",tr); + break; + } + return CPU_PrepareException(EXCEPTION_UD,0); +} + void CPU_SMSW(Bitu & word) { word=cpu.cr0; @@ -1712,6 +1791,7 @@ bool CPU_SetSegGeneral(SegNames seg,Bitu value) { if (seg==ss) { cpu.stack.big=false; cpu.stack.mask=0xffff; + cpu.stack.notmask=0xffff0000; } return false; } else { @@ -1741,8 +1821,8 @@ bool CPU_SetSegGeneral(SegNames seg,Bitu value) { } if (!desc.saved.seg.p) { - E_Exit("CPU_SetSegGeneral: Stack segment not present"); // or #SS(sel) -// return CPU_PrepareException(EXCEPTION_SS,value & 0xfffc); +// E_Exit("CPU_SetSegGeneral: Stack segment not present"); // or #SS(sel) + return CPU_PrepareException(EXCEPTION_SS,value & 0xfffc); } Segs.val[seg]=value; @@ -1750,9 +1830,11 @@ bool CPU_SetSegGeneral(SegNames seg,Bitu value) { if (desc.Big()) { cpu.stack.big=true; cpu.stack.mask=0xffffffff; + cpu.stack.notmask=0; } else { cpu.stack.big=false; cpu.stack.mask=0xffff; + cpu.stack.notmask=0xffff0000; } } else { if ((value & 0xfffc)==0) { @@ -1799,7 +1881,7 @@ bool CPU_PopSeg(SegNames seg,bool use32) { Bitu val=mem_readw(SegPhys(ss) + (reg_esp & cpu.stack.mask)); if (CPU_SetSegGeneral(seg,val)) return true; Bitu addsp=use32?0x04:0x02; - reg_esp=(reg_esp&~cpu.stack.mask)|((reg_esp+addsp)&cpu.stack.mask); + reg_esp=(reg_esp&cpu.stack.notmask)|((reg_esp+addsp)&cpu.stack.mask); return false; } @@ -1872,38 +1954,49 @@ void CPU_ENTER(bool use32,Bitu bytes,Bitu level) { } } sp_index-=bytes; - reg_esp=(reg_esp&~cpu.stack.mask)|((sp_index)&cpu.stack.mask); + reg_esp=(reg_esp&cpu.stack.notmask)|((sp_index)&cpu.stack.mask); } -extern void GFX_SetTitle(Bits cycles ,Bits frameskip,bool paused); static void CPU_CycleIncrease(bool pressed) { - if (!pressed || CPU_CycleAuto) - return; - Bits old_cycles=CPU_CycleMax; - if(CPU_CycleUp < 100){ - CPU_CycleMax = (Bits)(CPU_CycleMax * (1 + (float)CPU_CycleUp / 100.0)); + if (!pressed) return; + if (CPU_CycleAutoAdjust) { + CPU_CyclePercUsed+=5; + if (CPU_CyclePercUsed>100) CPU_CyclePercUsed=100; + LOG_MSG("CPU:%d percent",CPU_CyclePercUsed); + GFX_SetTitle(CPU_CyclePercUsed,-1,false); } else { - CPU_CycleMax = (Bits)(CPU_CycleMax + CPU_CycleUp); + Bit32s old_cycles=CPU_CycleMax; + if (CPU_CycleUp < 100) { + CPU_CycleMax = (Bit32s)(CPU_CycleMax * (1 + (float)CPU_CycleUp / 100.0)); + } else { + CPU_CycleMax = (Bit32s)(CPU_CycleMax + CPU_CycleUp); + } + + CPU_CycleLeft=0;CPU_Cycles=0; + if (CPU_CycleMax==old_cycles) CPU_CycleMax++; + LOG_MSG("CPU:%d cycles",CPU_CycleMax); + GFX_SetTitle(CPU_CycleMax,-1,false); } - - CPU_CycleLeft=0;CPU_Cycles=0; - if (CPU_CycleMax==old_cycles) CPU_CycleMax++; - LOG_MSG("CPU:%d cycles",CPU_CycleMax); - GFX_SetTitle(CPU_CycleMax,-1,false); } static void CPU_CycleDecrease(bool pressed) { - if (!pressed || CPU_CycleAuto) - return; - if(CPU_CycleDown < 100){ - CPU_CycleMax = (Bits)(CPU_CycleMax / (1 + (float)CPU_CycleDown / 100.0)); + if (!pressed) return; + if (CPU_CycleAutoAdjust) { + CPU_CyclePercUsed-=5; + if (CPU_CyclePercUsed<=0) CPU_CyclePercUsed=1; + LOG_MSG("CPU:%d percent",CPU_CyclePercUsed); + GFX_SetTitle(CPU_CyclePercUsed,-1,false); } else { - CPU_CycleMax = (Bits)(CPU_CycleMax - CPU_CycleDown); + if (CPU_CycleDown < 100) { + CPU_CycleMax = (Bit32s)(CPU_CycleMax / (1 + (float)CPU_CycleDown / 100.0)); + } else { + CPU_CycleMax = (Bit32s)(CPU_CycleMax - CPU_CycleDown); + } + CPU_CycleLeft=0;CPU_Cycles=0; + if (CPU_CycleMax <= 0) CPU_CycleMax=1; + LOG_MSG("CPU:%d cycles",CPU_CycleMax); + GFX_SetTitle(CPU_CycleMax,-1,false); } - CPU_CycleLeft=0;CPU_Cycles=0; - if (CPU_CycleMax <= 0) CPU_CycleMax=1; - LOG_MSG("CPU:%d cycles",CPU_CycleMax); - GFX_SetTitle(CPU_CycleMax,-1,false); } class CPU: public Module_base { @@ -1938,11 +2031,16 @@ public: CPU_SET_CRX(0,0); //Initialize cpu.code.big=false; cpu.stack.mask=0xffff; + cpu.stack.notmask=0xffff0000; cpu.stack.big=false; + cpu.trap_skip=false; cpu.idt.SetBase(0); cpu.idt.SetLimit(1023); - for (Bitu i=0; i<7; i++) cpu.drx[i]=0; + for (Bitu i=0; i<7; i++) { + cpu.drx[i]=0; + cpu.trx[i]=0; + } cpu.drx[6]=0xffff1ff0; cpu.drx[7]=0x00000400; @@ -1960,15 +2058,78 @@ public: } bool Change_Config(Section* newconfig){ Section_prop * section=static_cast(newconfig); + CPU_AutoDetermineMode=CPU_AUTODETERMINE_NONE; CPU_CycleLeft=0;//needed ? CPU_Cycles=0; - const char *cyclesLine = section->Get_string("cycles"); - if (!strcasecmp(cyclesLine,"auto")) { + + std::string str; + CommandLine cmd(0,section->Get_string("cycles")); + cmd.FindCommand(1,str); + + if (str=="max") { CPU_CycleMax=0; - CPU_CycleAuto=true; + CPU_CyclePercUsed=100; + CPU_CycleAutoAdjust=true; + CPU_CycleLimit=-1; + for (Bitu cmdnum=2; cmdnum<=cmd.GetCount(); cmdnum++) { + if (cmd.FindCommand(cmdnum,str)) { + if (str.find('%')==str.length()-1) { + str.erase(str.find('%')); + int percval=0; + std::istringstream stream(str); + stream >> percval; + if ((percval>0) && (percval<=100)) CPU_CyclePercUsed=(Bit32s)percval; + } else if (str=="limit") { + cmdnum++; + if (cmd.FindCommand(cmdnum,str)) { + int cyclimit=0; + std::istringstream stream(str); + stream >> cyclimit; + if (cyclimit>0) CPU_CycleLimit=cyclimit; + } + } + } + } } else { - CPU_CycleMax=atoi(cyclesLine); - CPU_CycleAuto=false; + if (str=="auto") { + CPU_AutoDetermineMode|=CPU_AUTODETERMINE_CYCLES; + CPU_CycleMax=3000; + CPU_OldCycleMax=3000; + CPU_CyclePercUsed=100; + for (Bitu cmdnum=2; cmdnum<=cmd.GetCount(); cmdnum++) { + if (cmd.FindCommand(cmdnum,str)) { + if (str.find('%')==str.length()-1) { + str.erase(str.find('%')); + int percval=0; + std::istringstream stream(str); + stream >> percval; + if ((percval>0) && (percval<=100)) CPU_CyclePercUsed=(Bit32s)percval; + } else if (str=="limit") { + cmdnum++; + if (cmd.FindCommand(cmdnum,str)) { + int cyclimit=0; + std::istringstream stream(str); + stream >> cyclimit; + if (cyclimit>0) CPU_CycleLimit=cyclimit; + } + } else { + int rmdval=0; + std::istringstream stream(str); + stream >> rmdval; + if (rmdval>0) { + CPU_CycleMax=(Bit32s)rmdval; + CPU_OldCycleMax=(Bit32s)rmdval; + } + } + } + } + } else { + int rmdval=0; + std::istringstream stream(str); + stream >> rmdval; + CPU_CycleMax=(Bit32s)rmdval; + } + CPU_CycleAutoAdjust=false; } CPU_CycleUp=section->Get_int("cycleup"); CPU_CycleDown=section->Get_int("cycledown"); @@ -1984,6 +2145,13 @@ public: #if (C_DYNAMIC_X86) else if (!strcasecmp(core,"dynamic")) { cpudecoder=&CPU_Core_Dyn_X86_Run; + CPU_Core_Dyn_X86_SetFPUMode(true); + } else if (!strcasecmp(core,"dynamic_nodhfpu")) { + cpudecoder=&CPU_Core_Dyn_X86_Run; + CPU_Core_Dyn_X86_SetFPUMode(false); + } else if (!strcasecmp(core,"auto")) { + cpudecoder=&CPU_Core_Normal_Run; + CPU_AutoDetermineMode|=CPU_AUTODETERMINE_CORE; } #endif else { @@ -1991,13 +2159,14 @@ public: } #if (C_DYNAMIC_X86) - CPU_Core_Dyn_X86_Cache_Init(!strcasecmp(core,"dynamic")); + CPU_Core_Dyn_X86_Cache_Init(!strcasecmp(core,"dynamic") || !strcasecmp(core,"dynamic_nodhfpu")); #endif - if(CPU_CycleMax <= 0) CPU_CycleMax = 2500; + if(CPU_CycleMax <= 0) CPU_CycleMax = 3000; if(CPU_CycleUp <= 0) CPU_CycleUp = 500; if(CPU_CycleDown <= 0) CPU_CycleDown = 20; - GFX_SetTitle(CPU_CycleMax,-1,false); + if (CPU_CycleAutoAdjust) GFX_SetTitle(CPU_CyclePercUsed,-1,false); + else GFX_SetTitle(CPU_CycleMax,-1,false); return true; } ~CPU(){ /* empty */}; @@ -2006,6 +2175,9 @@ public: static CPU * test; void CPU_ShutDown(Section* sec) { +#if (C_DYNAMIC_X86) + CPU_Core_Dyn_X86_Cache_Close(); +#endif delete test; } diff --git a/src/cpu/flags.cpp b/src/cpu/flags.cpp index 5d87837..b683020 100644 --- a/src/cpu/flags.cpp +++ b/src/cpu/flags.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -597,6 +597,7 @@ Bitu FillFlags(void) { case t_ORb: SET_FLAG(CF,false); + SET_FLAG(AF,false); DOFLAG_ZFb; DOFLAG_SFb; SET_FLAG(OF,false); @@ -604,6 +605,7 @@ Bitu FillFlags(void) { break; case t_ORw: SET_FLAG(CF,false); + SET_FLAG(AF,false); DOFLAG_ZFw; DOFLAG_SFw; SET_FLAG(OF,false); @@ -611,6 +613,7 @@ Bitu FillFlags(void) { break; case t_ORd: SET_FLAG(CF,false); + SET_FLAG(AF,false); DOFLAG_ZFd; DOFLAG_SFd; SET_FLAG(OF,false); @@ -621,6 +624,7 @@ Bitu FillFlags(void) { case t_TESTb: case t_ANDb: SET_FLAG(CF,false); + SET_FLAG(AF,false); DOFLAG_ZFb; DOFLAG_SFb; SET_FLAG(OF,false); @@ -629,6 +633,7 @@ Bitu FillFlags(void) { case t_TESTw: case t_ANDw: SET_FLAG(CF,false); + SET_FLAG(AF,false); DOFLAG_ZFw; DOFLAG_SFw; SET_FLAG(OF,false); @@ -637,6 +642,7 @@ Bitu FillFlags(void) { case t_TESTd: case t_ANDd: SET_FLAG(CF,false); + SET_FLAG(AF,false); DOFLAG_ZFd; DOFLAG_SFd; SET_FLAG(OF,false); @@ -646,6 +652,7 @@ Bitu FillFlags(void) { case t_XORb: SET_FLAG(CF,false); + SET_FLAG(AF,false); DOFLAG_ZFb; DOFLAG_SFb; SET_FLAG(OF,false); @@ -653,6 +660,7 @@ Bitu FillFlags(void) { break; case t_XORw: SET_FLAG(CF,false); + SET_FLAG(AF,false); DOFLAG_ZFw; DOFLAG_SFw; SET_FLAG(OF,false); @@ -660,6 +668,7 @@ Bitu FillFlags(void) { break; case t_XORd: SET_FLAG(CF,false); + SET_FLAG(AF,false); DOFLAG_ZFd; DOFLAG_SFd; SET_FLAG(OF,false); @@ -792,21 +801,21 @@ Bitu FillFlags(void) { break; case t_DECb: - SET_FLAG(AF,(lf_resb & 0x0f) == 0); + SET_FLAG(AF,(lf_resb & 0x0f) == 0x0f); DOFLAG_ZFb; DOFLAG_SFb; SET_FLAG(OF,(lf_resb == 0x7f)); DOFLAG_PF; break; case t_DECw: - SET_FLAG(AF,(lf_resw & 0x0f) == 0); + SET_FLAG(AF,(lf_resw & 0x0f) == 0x0f); DOFLAG_ZFw; DOFLAG_SFw; SET_FLAG(OF,(lf_resw == 0x7fff)); DOFLAG_PF; break; case t_DECd: - SET_FLAG(AF,(lf_resd & 0x0f) == 0); + SET_FLAG(AF,(lf_resd & 0x0f) == 0x0f); DOFLAG_ZFd; DOFLAG_SFd; SET_FLAG(OF,(lf_resd == 0x7fffffff)); @@ -815,7 +824,7 @@ Bitu FillFlags(void) { case t_NEGb: SET_FLAG(CF,(lf_var1b!=0)); - SET_FLAG(AF,(lf_resb & 0x0f) == 0); + SET_FLAG(AF,(lf_resb & 0x0f) != 0); DOFLAG_ZFb; DOFLAG_SFb; SET_FLAG(OF,(lf_var1b == 0x80)); @@ -823,7 +832,7 @@ Bitu FillFlags(void) { break; case t_NEGw: SET_FLAG(CF,(lf_var1w!=0)); - SET_FLAG(AF,(lf_resw & 0x0f) == 0); + SET_FLAG(AF,(lf_resw & 0x0f) != 0); DOFLAG_ZFw; DOFLAG_SFw; SET_FLAG(OF,(lf_var1w == 0x8000)); @@ -831,7 +840,7 @@ Bitu FillFlags(void) { break; case t_NEGd: SET_FLAG(CF,(lf_var1d!=0)); - SET_FLAG(AF,(lf_resd & 0x0f) == 0); + SET_FLAG(AF,(lf_resd & 0x0f) != 0); DOFLAG_ZFd; DOFLAG_SFd; SET_FLAG(OF,(lf_var1d == 0x80000000)); diff --git a/src/cpu/instructions.h b/src/cpu/instructions.h index bd5981c..5f3505b 100644 --- a/src/cpu/instructions.h +++ b/src/cpu/instructions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,7 @@ /* Jumps */ -/* All Byte genereal instructions */ +/* All Byte general instructions */ #define ADDB(op1,op2,load,save) \ lf_var1b=load(op1);lf_var2b=op2; \ lf_resb=lf_var1b+lf_var2b; \ @@ -228,7 +228,14 @@ #define ROLB(op1,op2,load,save) \ - if (!(op2&0x7)) break; \ + if (!(op2&0x7)) { \ + if (op2&0x18) { \ + FillFlags(); \ + SETFLAGBIT(CF,op1 & 1); \ + SETFLAGBIT(OF,(op1 & 1) ^ (op1 >> 7)); \ + } \ + break; \ + } \ FillFlags(); \ lf_var1b=load(op1); \ lf_var2b=op2&0x07; \ @@ -239,7 +246,13 @@ SETFLAGBIT(OF,(lf_resb & 1) ^ (lf_resb >> 7)); #define ROLW(op1,op2,load,save) \ - if (!(op2&0xf)) break; \ + if (!(op2&0xf)) { \ + if (op2&0x10) { \ + FillFlags(); \ + SETFLAGBIT(CF,op1 & 1); \ + } \ + break; \ + } \ FillFlags(); \ lf_var1w=load(op1); \ lf_var2b=op2&0xf; \ @@ -262,7 +275,14 @@ #define RORB(op1,op2,load,save) \ - if (!(op2&0x7)) break; \ + if (!(op2&0x7)) { \ + if (op2&0x10) { \ + FillFlags(); \ + SETFLAGBIT(CF,op1>>7); \ + SETFLAGBIT(OF,(op1>>7) ^ ((op1>>6) & 1)); \ + } \ + break; \ + } \ FillFlags(); \ lf_var1b=load(op1); \ lf_var2b=op2&0x07; \ @@ -273,7 +293,13 @@ if (lf_var2b == 1) SETFLAGBIT(OF,(lf_resb ^ lf_var1b) & 0x80); #define RORW(op1,op2,load,save) \ - if (!(op2&0xf)) break; \ + if (!(op2&0xf)) { \ + if (op2&0x10) { \ + FillFlags(); \ + SETFLAGBIT(CF,op1>>15); \ + } \ + break; \ + } \ FillFlags(); \ lf_var1w=load(op1); \ lf_var2b=op2&0xf; \ @@ -470,43 +496,58 @@ #define DAA() \ if (((reg_al & 0x0F)>0x09) || get_AF()) { \ + if ((reg_al > 0x99) || get_CF()) { \ + reg_al+=0x60; \ + SETFLAGBIT(CF,true); \ + } else { \ + SETFLAGBIT(CF,false); \ + } \ reg_al+=0x06; \ SETFLAGBIT(AF,true); \ } else { \ + if ((reg_al > 0x99) || get_CF()) { \ + reg_al+=0x60; \ + SETFLAGBIT(CF,true); \ + } else { \ + SETFLAGBIT(CF,false); \ + } \ SETFLAGBIT(AF,false); \ } \ - if ((reg_al > 0x9F) || get_CF()) { \ - reg_al+=0x60; \ - SETFLAGBIT(CF,true); \ - } else { \ - SETFLAGBIT(CF,false); \ - } \ SETFLAGBIT(SF,(reg_al&0x80)); \ SETFLAGBIT(ZF,(reg_al==0)); \ + SETFLAGBIT(PF,parity_lookup[reg_al]); \ lflags.type=t_UNKNOWN; #define DAS() \ if (((reg_al & 0x0f) > 9) || get_AF()) { \ + if ((reg_al>0x99) || get_CF()) { \ + reg_al-=0x60; \ + SETFLAGBIT(CF,true); \ + } else { \ + SETFLAGBIT(CF,false); \ + } \ reg_al-=6; \ SETFLAGBIT(AF,true); \ } else { \ + if ((reg_al>0x99) || get_CF()) { \ + reg_al-=0x60; \ + SETFLAGBIT(CF,true); \ + } else { \ + SETFLAGBIT(CF,false); \ + } \ SETFLAGBIT(AF,false); \ } \ - if ((reg_al>0x9f) || get_CF()) { \ - reg_al-=0x60; \ - SETFLAGBIT(CF,true); \ - } else { \ - SETFLAGBIT(CF,false); \ - } \ + SETFLAGBIT(SF,(reg_al&0x80)); \ + SETFLAGBIT(ZF,(reg_al==0)); \ + SETFLAGBIT(PF,parity_lookup[reg_al]); \ lflags.type=t_UNKNOWN; #define AAA() \ if (get_AF() || ((reg_al & 0xf) > 9)) \ { \ - reg_al += 6; \ - reg_ah += 1; \ + reg_ax += 0x106; \ SETFLAGBIT(AF,true); \ SETFLAGBIT(CF,true); \ } else { \ @@ -514,13 +555,15 @@ SETFLAGBIT(CF,false); \ } \ reg_al &= 0x0F; \ - lflags.type=t_UNKNOWN; + lflags.type=t_UNKNOWN; \ + SETFLAGBIT(SF,0); \ + SETFLAGBIT(OF,0); \ + SETFLAGBIT(ZF,(reg_al == 0)); \ + SETFLAGBIT(PF,parity_lookup[reg_al]); #define AAS() \ if (((reg_al & 0x0f)>9) || get_AF()) { \ - reg_ah--; \ - if (reg_al < 6) reg_ah--; \ - reg_al=(reg_al-6) & 0xF; \ + reg_ax -= 0x106; \ SETFLAGBIT(AF,true); \ SETFLAGBIT(CF,true); \ } else { \ @@ -528,18 +571,27 @@ SETFLAGBIT(CF,false); \ } \ reg_al &= 0x0F; \ - lflags.type=t_UNKNOWN; + lflags.type=t_UNKNOWN; \ + SETFLAGBIT(SF,0); \ + SETFLAGBIT(OF,0); \ + SETFLAGBIT(ZF,(reg_al == 0)); \ + SETFLAGBIT(PF,parity_lookup[reg_al]); #define AAM(op1) \ - { \ - Bit8u BLAH=op1; \ - reg_ah=reg_al / BLAH; \ - reg_al=reg_al % BLAH; \ - lflags.type=t_UNKNOWN; \ +{ \ + Bit8u dv=op1; \ + if (dv!=0) { \ + reg_ah=reg_al / dv; \ + reg_al=reg_al % dv; \ SETFLAGBIT(SF,(reg_al & 0x80)); \ SETFLAGBIT(ZF,(reg_al == 0)); \ SETFLAGBIT(PF,parity_lookup[reg_al]); \ - } + SETFLAGBIT(CF,0); \ + SETFLAGBIT(OF,0); \ + SETFLAGBIT(AF,0); \ + lflags.type=t_UNKNOWN; \ + } else EXCEPTION(0); \ +} //Took this from bochs, i seriously hate these weird bcd opcodes @@ -547,12 +599,11 @@ { \ Bit16u ax1 = reg_ah * op1; \ Bit16u ax2 = ax1 + reg_al; \ - Bit8u old_al = reg_al; \ reg_al = (Bit8u) ax2; \ reg_ah = 0; \ - SETFLAGBIT(AF,(ax1 & 0x08) != (ax2 & 0x08)); \ - SETFLAGBIT(CF,ax2 > 0xff); \ - SETFLAGBIT(OF,(reg_al & 0x80) != (old_al & 0x80)); \ + SETFLAGBIT(CF,0); \ + SETFLAGBIT(OF,0); \ + SETFLAGBIT(AF,0); \ SETFLAGBIT(SF,reg_al >= 0x80); \ SETFLAGBIT(ZF,reg_al == 0); \ SETFLAGBIT(PF,parity_lookup[reg_al]); \ @@ -562,6 +613,7 @@ #define MULB(op1,load,save) \ FillFlags(); \ reg_ax=reg_al*load(op1); \ + SETFLAGBIT(ZF,reg_al == 0); \ if (reg_ax & 0xff00) { \ SETFLAGBIT(CF,true);SETFLAGBIT(OF,true); \ } else { \ @@ -574,6 +626,7 @@ Bitu tempu=(Bitu)reg_ax*(Bitu)(load(op1)); \ reg_ax=(Bit16u)(tempu); \ reg_dx=(Bit16u)(tempu >> 16); \ + SETFLAGBIT(ZF,reg_ax == 0); \ if (reg_dx) { \ SETFLAGBIT(CF,true);SETFLAGBIT(OF,true); \ } else { \ @@ -587,6 +640,7 @@ Bit64u tempu=(Bit64u)reg_eax*(Bit64u)(load(op1)); \ reg_eax=(Bit32u)(tempu); \ reg_edx=(Bit32u)(tempu >> 32); \ + SETFLAGBIT(ZF,reg_eax == 0); \ if (reg_edx) { \ SETFLAGBIT(CF,true);SETFLAGBIT(OF,true); \ } else { \ @@ -611,7 +665,7 @@ { \ Bitu val=load(op1); \ if (val==0) EXCEPTION(0); \ - Bitu num=(reg_dx<<16)|reg_ax; \ + Bitu num=((Bit32u)reg_dx<<16)|reg_ax; \ Bitu quo=num/val; \ Bit16u rem=(Bit16u)(num % val); \ Bit16u quo16=(Bit16u)(quo&0xffff); \ @@ -623,7 +677,7 @@ #define DIVD(op1,load,save) \ { \ Bitu val=load(op1); \ - if (!val) EXCEPTION(0); \ + if (val==0) EXCEPTION(0); \ Bit64u num=(((Bit64u)reg_edx)<<32)|reg_eax; \ Bit64u quo=num/val; \ Bit32u rem=(Bit32u)(num % val); \ @@ -650,7 +704,7 @@ #define IDIVW(op1,load,save) \ { \ Bits val=(Bit16s)(load(op1)); \ - if (!val) EXCEPTION(0); \ + if (val==0) EXCEPTION(0); \ Bits num=(Bit32s)((reg_dx<<16)|reg_ax); \ Bits quo=num/val; \ Bit16s rem=(Bit16s)(num % val); \ @@ -663,7 +717,7 @@ #define IDIVD(op1,load,save) \ { \ Bits val=(Bit32s)(load(op1)); \ - if (!val) EXCEPTION(0); \ + if (val==0) EXCEPTION(0); \ Bit64s num=(((Bit64u)reg_edx)<<32)|reg_eax; \ Bit64s quo=num/val; \ Bit32s rem=(Bit32s)(num % val); \ diff --git a/src/cpu/lazyflags.h b/src/cpu/lazyflags.h index 227d5f2..0d93650 100644 --- a/src/cpu/lazyflags.h +++ b/src/cpu/lazyflags.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cpu/modrm.cpp b/src/cpu/modrm.cpp index 15e4cd0..830daf0 100644 --- a/src/cpu/modrm.cpp +++ b/src/cpu/modrm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cpu/modrm.h b/src/cpu/modrm.h index e98f139..7fb3059 100644 --- a/src/cpu/modrm.h +++ b/src/cpu/modrm.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cpu/paging.cpp b/src/cpu/paging.cpp index 7c804cf..9a0462c 100644 --- a/src/cpu/paging.cpp +++ b/src/cpu/paging.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,7 +52,7 @@ Bitu PageHandler::readd(PhysPt addr) { (readb(addr+3) << 24); } -void PageHandler::writeb(PhysPt addr,Bitu val) { +void PageHandler::writeb(PhysPt addr,Bitu /*val*/) { E_Exit("No byte handler for write to %d",addr); }; @@ -67,11 +67,11 @@ void PageHandler::writed(PhysPt addr,Bitu val) { writeb(addr+3,(Bit8u) (val >> 24)); }; -HostPt PageHandler::GetHostReadPt(Bitu phys_page) { +HostPt PageHandler::GetHostReadPt(Bitu /*phys_page*/) { return 0; } -HostPt PageHandler::GetHostWritePt(Bitu phys_page) { +HostPt PageHandler::GetHostWritePt(Bitu /*phys_page*/) { return 0; } @@ -111,7 +111,7 @@ static struct { static Bits PageFaultCore(void) { CPU_CycleLeft+=CPU_Cycles; CPU_Cycles=1; - Bitu ret=CPU_Core_Full_Run(); + Bits ret=CPU_Core_Full_Run(); CPU_CycleLeft+=CPU_Cycles; if (ret<0) E_Exit("Got a dosbox close machine in pagefault core?"); if (ret) @@ -395,7 +395,7 @@ void PAGING_Enable(bool enabled) { // LOG(LOG_PAGING,LOG_NORMAL)("Disabled"); } else { if (cpudecoder==CPU_Core_Simple_Run) { - LOG_MSG("CPU core simple won't run this game,switching to normal"); +// LOG_MSG("CPU core simple won't run this game,switching to normal"); cpudecoder=CPU_Core_Normal_Run; CPU_CycleLeft+=CPU_Cycles; CPU_Cycles=0; diff --git a/src/debug/Makefile.in b/src/debug/Makefile.in index b2e0960..cc062a4 100644 --- a/src/debug/Makefile.in +++ b/src/debug/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libdebug_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,44 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/debug -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libdebug_a_AR = $(AR) $(ARFLAGS) -libdebug_a_LIBADD = -am_libdebug_a_OBJECTS = debug.$(OBJEXT) debug_gui.$(OBJEXT) \ - debug_disasm.$(OBJEXT) debug_win32.$(OBJEXT) -libdebug_a_OBJECTS = $(am_libdebug_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libdebug_a_SOURCES) -DIST_SOURCES = $(libdebug_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -100,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -130,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -140,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -149,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -175,41 +139,51 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + noinst_LIBRARIES = libdebug.a libdebug_a_SOURCES = debug.cpp debug_gui.cpp debug_disasm.cpp debug_inc.h disasm_tables.h debug_win32.cpp +subdir = src/debug +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libdebug_a_AR = $(AR) cru +libdebug_a_LIBADD = +am_libdebug_a_OBJECTS = debug.$(OBJEXT) debug_gui.$(OBJEXT) \ + debug_disasm.$(OBJEXT) debug_win32.$(OBJEXT) +libdebug_a_OBJECTS = $(am_libdebug_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/debug.Po ./$(DEPDIR)/debug_disasm.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/debug_gui.Po ./$(DEPDIR)/debug_win32.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libdebug_a_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libdebug_a_SOURCES) + all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/debug/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/debug/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/debug/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -219,7 +193,7 @@ libdebug.a: $(libdebug_a_OBJECTS) $(libdebug_a_DEPENDENCIES) $(RANLIB) libdebug.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -230,20 +204,36 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug_win32.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -252,7 +242,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -264,11 +253,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -291,6 +279,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -304,7 +296,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -322,6 +314,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) + installdirs: install: install-am install-exec: install-exec-am @@ -342,7 +335,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -361,8 +354,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -398,14 +389,13 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/debug/debug.cpp b/src/debug/debug.cpp index 3bcff3a..2f3f28e 100644 --- a/src/debug/debug.cpp +++ b/src/debug/debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,14 +16,20 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: debug.cpp,v 1.76 2006/03/26 11:11:56 qbix79 Exp $ */ +/* $Id: debug.cpp,v 1.85 2007/02/25 18:38:00 c2woody Exp $ */ + +#include "dosbox.h" +#if C_DEBUG #include #include #include +#include +#include +#include +#include +using namespace std; -#include "dosbox.h" -#if C_DEBUG #include "debug.h" #include "cross.h" //snprintf #include "cpu.h" @@ -54,7 +60,6 @@ int old_cursor_state; // Forwards static void DrawCode(void); -static bool DEBUG_Log_Loop(int count); static void DEBUG_RaiseTimerIrq(void); static void SaveMemory(Bitu seg, Bitu ofs1, Bit32u num); static void SaveMemoryBin(Bitu seg, Bitu ofs1, Bit32u num); @@ -93,15 +98,16 @@ class DEBUG; DEBUG* pDebugcom = 0; bool exitLoop = false; -bool logHeavy = false; // Heavy Debugging Vars for logging #if C_HEAVY_DEBUG -static FILE* cpuLogFile = 0; +static ofstream cpuLogFile; static bool cpuLog = false; static int cpuLogCounter = 0; static int cpuLogType = 1; // log detail +static bool zeroProtect = false; +bool logHeavy = false; #endif @@ -261,8 +267,8 @@ enum EBreakpoint { BKPNT_UNKNOWN, BKPNT_PHYSICAL, BKPNT_INTERRUPT, BKPNT_MEMORY, class CBreakpoint { public: - CBreakpoint (void) { location = 0; active = once = false; segment = 0; offset = 0; intNr = 0; ahValue = 0; type = BKPNT_UNKNOWN; }; + CBreakpoint(void); void SetAddress (Bit16u seg, Bit32u off) { location = GetAddress(seg,off); type = BKPNT_PHYSICAL; segment = seg; offset = off; }; void SetAddress (PhysPt adr) { location = adr; type = BKPNT_PHYSICAL; }; void SetInt (Bit8u _intNr, Bit16u ah) { intNr = _intNr, ahValue = ah; type = BKPNT_INTERRUPT; }; @@ -316,10 +322,16 @@ public: static CBreakpoint* ignoreOnce; }; +CBreakpoint::CBreakpoint(void): +location(0), +active(false),once(false), +segment(0),offset(0),intNr(0),ahValue(0), +type(BKPNT_UNKNOWN) { }; + void CBreakpoint::Activate(bool _active) { - if (GetType()==BKPNT_PHYSICAL) { #if !C_HEAVY_DEBUG + if (GetType()==BKPNT_PHYSICAL) { if (_active) { // Set 0xCC and save old value Bit8u data = mem_readb(location); @@ -333,8 +345,8 @@ void CBreakpoint::Activate(bool _active) mem_writeb(location,oldData); }; } -#endif } +#endif active = _active; }; @@ -377,7 +389,7 @@ void CBreakpoint::ActivateBreakpoints(PhysPt adr, bool activate) std::list::iterator i; CBreakpoint* bp; for(i=BPoints.begin(); i != BPoints.end(); i++) { - bp = static_cast(*i); + bp = (*i); // Do not activate, when bp is an actual adress if (activate && (bp->GetType()==BKPNT_PHYSICAL) && (bp->GetLocation()==adr)) { // Do not activate :) @@ -400,7 +412,7 @@ bool CBreakpoint::CheckBreakpoint(Bitu seg, Bitu off) std::list::iterator i; CBreakpoint* bp; for(i=BPoints.begin(); i != BPoints.end(); i++) { - bp = static_cast(*i); + bp = (*i); if ((bp->GetType()==BKPNT_PHYSICAL) && bp->IsActive() && (bp->GetSegment()==seg) && (bp->GetOffset()==off)) { // Ignore Once ? if (ignoreOnce==bp) { @@ -463,7 +475,7 @@ bool CBreakpoint::CheckIntBreakpoint(PhysPt adr, Bit8u intNr, Bit16u ahValue) std::list::iterator i; CBreakpoint* bp; for(i=BPoints.begin(); i != BPoints.end(); i++) { - bp = static_cast(*i); + bp = (*i); if ((bp->GetType()==BKPNT_INTERRUPT) && bp->IsActive() && (bp->GetIntNr()==intNr)) { if ((bp->GetValue()==BPINT_ALL) || (bp->GetValue()==ahValue)) { // Ignoie it once ? @@ -493,7 +505,7 @@ void CBreakpoint::DeleteAll() std::list::iterator i; CBreakpoint* bp; for(i=BPoints.begin(); i != BPoints.end(); i++) { - bp = static_cast(*i); + bp = (*i); bp->Activate(false); delete bp; }; @@ -509,7 +521,7 @@ bool CBreakpoint::DeleteByIndex(Bit16u index) CBreakpoint* bp; for(i=BPoints.begin(); i != BPoints.end(); i++) { if (nr==index) { - bp = static_cast(*i); + bp = (*i); (BPoints.erase)(i); bp->Activate(false); delete bp; @@ -526,7 +538,7 @@ bool CBreakpoint::DeleteBreakpoint(PhysPt where) std::list::iterator i; CBreakpoint* bp; for(i=BPoints.begin(); i != BPoints.end(); i++) { - bp = static_cast(*i); + bp = (*i); if ((bp->GetType()==BKPNT_PHYSICAL) && (bp->GetLocation()==where)) { (BPoints.erase)(i); bp->Activate(false); @@ -544,7 +556,7 @@ bool CBreakpoint::IsBreakpoint(PhysPt adr) std::list::iterator i; CBreakpoint* bp; for(i=BPoints.begin(); i != BPoints.end(); i++) { - bp = static_cast(*i); + bp = (*i); if ((bp->GetType()==BKPNT_PHYSICAL) && (bp->GetSegment()==adr)) { return true; }; @@ -562,7 +574,7 @@ bool CBreakpoint::IsBreakpointDrawn(PhysPt adr) std::list::iterator i; CBreakpoint* bp; for(i=BPoints.begin(); i != BPoints.end(); i++) { - bp = static_cast(*i); + bp = (*i); if ((bp->GetType()==BKPNT_PHYSICAL) && (bp->GetLocation()==adr)) { // Only draw, if breakpoint is not only once, return !bp->GetOnce(); @@ -577,7 +589,7 @@ void CBreakpoint::ShowList(void) int nr = 0; std::list::iterator i; for(i=BPoints.begin(); i != BPoints.end(); i++) { - CBreakpoint* bp = static_cast(*i); + CBreakpoint* bp = (*i); if (bp->GetType()==BKPNT_PHYSICAL) { DEBUG_ShowMsg("%02X. BP %04X:%04X\n",nr,bp->GetSegment(),bp->GetOffset()); nr++; @@ -598,9 +610,9 @@ void CBreakpoint::ShowList(void) bool DEBUG_Breakpoint(void) { /* First get the phyiscal address and check for a set Breakpoint */ - PhysPt where=GetAddress(SegValue(cs),reg_eip); if (!CBreakpoint::CheckBreakpoint(SegValue(cs),reg_eip)) return false; // Found. Breakpoint is valid + PhysPt where=GetAddress(SegValue(cs),reg_eip); CBreakpoint::ActivateBreakpoints(where,false); // Deactivate all breakpoints return true; }; @@ -695,31 +707,33 @@ static void DrawRegisters(void) { SetColor(SegValue(cs)!=oldsegs[cs].val);oldsegs[cs].val=SegValue(cs);mvwprintw (dbg.win_reg,1,31,"%04X",SegValue(cs)); /*Individual flags*/ + Bitu changed_flags = reg_flags ^ oldflags; + oldflags = reg_flags; - SetColor((reg_flags ^ oldflags)&FLAG_CF); + SetColor(changed_flags&FLAG_CF); mvwprintw (dbg.win_reg,1,53,"%01X",GETFLAG(CF) ? 1:0); - SetColor((reg_flags ^ oldflags)&FLAG_ZF); + SetColor(changed_flags&FLAG_ZF); mvwprintw (dbg.win_reg,1,56,"%01X",GETFLAG(ZF) ? 1:0); - SetColor((reg_flags ^ oldflags)&FLAG_SF); + SetColor(changed_flags&FLAG_SF); mvwprintw (dbg.win_reg,1,59,"%01X",GETFLAG(SF) ? 1:0); - SetColor((reg_flags ^ oldflags)&FLAG_OF); + SetColor(changed_flags&FLAG_OF); mvwprintw (dbg.win_reg,1,62,"%01X",GETFLAG(OF) ? 1:0); - SetColor((reg_flags ^ oldflags)&FLAG_AF); + SetColor(changed_flags&FLAG_AF); mvwprintw (dbg.win_reg,1,65,"%01X",GETFLAG(AF) ? 1:0); - SetColor((reg_flags ^ oldflags)&FLAG_PF); + SetColor(changed_flags&FLAG_PF); mvwprintw (dbg.win_reg,1,68,"%01X",GETFLAG(PF) ? 1:0); - SetColor((reg_flags ^ oldflags)&FLAG_DF); + SetColor(changed_flags&FLAG_DF); mvwprintw (dbg.win_reg,1,71,"%01X",GETFLAG(DF) ? 1:0); - SetColor((reg_flags ^ oldflags)&FLAG_IF); + SetColor(changed_flags&FLAG_IF); mvwprintw (dbg.win_reg,1,74,"%01X",GETFLAG(IF) ? 1:0); - SetColor((reg_flags ^ oldflags)&FLAG_TF); + SetColor(changed_flags&FLAG_TF); mvwprintw (dbg.win_reg,1,77,"%01X",GETFLAG(TF) ? 1:0); - SetColor((reg_flags ^ oldflags)&FLAG_IOPL); + SetColor(changed_flags&FLAG_IOPL); mvwprintw (dbg.win_reg,2,72,"%01X",GETFLAG(IOPL)>>12); - oldflags=reg_flags; + SetColor(cpu.cpl ^ oldcpucpl); mvwprintw (dbg.win_reg,2,78,"%01X",cpu.cpl); @@ -733,7 +747,7 @@ static void DrawRegisters(void) { mvwprintw(dbg.win_reg,0,76,"Real"); // Selector info, if available - if ((cpu.pmode) && curSelectorName[0]) { + if ((cpu.pmode) && curSelectorName[0]) { char out1[200], out2[200]; GetDescriptorInfo(curSelectorName,out1,out2); mvwprintw(dbg.win_reg,2,28,out1); @@ -751,6 +765,7 @@ static void DrawCode(void) Bit32u disEIP = codeViewData.useEIP; PhysPt start = GetAddress(codeViewData.useCS,codeViewData.useEIP); char dline[200];Bitu size;Bitu c; + static char line20[21] = " "; for (int i=0;i<10;i++) { saveSel = false; @@ -782,19 +797,29 @@ static void DrawCode(void) if (drawsize>10) { toolarge = true; drawsize = 9; }; for (c=0;c=drawsize*2;c--) waddch(dbg.win_code,' '); - + if (toolarge) { waddstr(dbg.win_code,".."); drawsize++; }; + // Spacepad up to 20 characters + if(drawsize && (drawsize < 10)) { + line20[20 - drawsize*2] = 0; + waddstr(dbg.win_code,line20); + line20[20 - drawsize*2] = ' '; + } else waddstr(dbg.win_code,line20); + char* res = 0; if (showExtend) res = AnalyzeInstruction(dline, saveSel); + // Spacepad it up to 28 characters + size_t dline_len = strlen(dline); + if(dline_len < 28) for (c = dline_len; c < 28;c++) dline[c] = ' '; dline[28] = 0; waddstr(dbg.win_code,dline); - if (strlen(dline)<28) for (c=28-strlen(dline);c>0;c--) waddch(dbg.win_code,' '); - if (showExtend) { + // Spacepad it up to 20 characters + size_t res_len = strlen(res); + if(res_len && (res_len < 21)) { waddstr(dbg.win_code,res); - for (c=strlen(res);c<20;c++) waddch(dbg.win_code,' '); - } else { - for (c=0;c<20;c++) waddch(dbg.win_code,' '); - } + line20[20-res_len] = 0; + waddstr(dbg.win_code,line20); + line20[20-res_len] = ' '; + } else waddstr(dbg.win_code,line20); + start+=size; disEIP+=size; @@ -806,14 +831,14 @@ static void DrawCode(void) wattrset(dbg.win_code,0); if (!debugging) { - mvwprintw(dbg.win_code,10,0,"(Running)",codeViewData.inputStr); - } else if (codeViewData.inputMode) { - mvwprintw(dbg.win_code,10,0,"-> %s_ ",codeViewData.inputStr); - } else { - mvwprintw(dbg.win_code,10,0," "); - for (c=0;c<50;c++) waddch(dbg.win_code,' '); - }; - + mvwprintw(dbg.win_code,10,0,"(Running)",codeViewData.inputStr); + } else { + if(!*codeViewData.inputStr) { //Clear old commands + mvwprintw(dbg.win_code,10,0," "); + } + mvwprintw(dbg.win_code,10,0,"-> %s_ ",codeViewData.inputStr); + } + wrefresh(dbg.win_code); } @@ -838,41 +863,45 @@ static void SetCodeWinStart() Bit32u GetHexValue(char* str, char*& hex) { Bit32u value = 0; - + Bit32u regval = 0; hex = str; while (*hex==' ') hex++; - if (strstr(hex,"EAX")==hex) { hex+=3; return reg_eax; }; - if (strstr(hex,"EBX")==hex) { hex+=3; return reg_ebx; }; - if (strstr(hex,"ECX")==hex) { hex+=3; return reg_ecx; }; - if (strstr(hex,"EDX")==hex) { hex+=3; return reg_edx; }; - if (strstr(hex,"ESI")==hex) { hex+=3; return reg_esi; }; - if (strstr(hex,"EDI")==hex) { hex+=3; return reg_edi; }; - if (strstr(hex,"EBP")==hex) { hex+=3; return reg_ebp; }; - if (strstr(hex,"ESP")==hex) { hex+=3; return reg_esp; }; - if (strstr(hex,"EIP")==hex) { hex+=3; return reg_eip; }; - if (strstr(hex,"AX")==hex) { hex+=2; return reg_ax; }; - if (strstr(hex,"BX")==hex) { hex+=2; return reg_bx; }; - if (strstr(hex,"CX")==hex) { hex+=2; return reg_cx; }; - if (strstr(hex,"DX")==hex) { hex+=2; return reg_dx; }; - if (strstr(hex,"SI")==hex) { hex+=2; return reg_si; }; - if (strstr(hex,"DI")==hex) { hex+=2; return reg_di; }; - if (strstr(hex,"BP")==hex) { hex+=2; return reg_bp; }; - if (strstr(hex,"SP")==hex) { hex+=2; return reg_sp; }; - if (strstr(hex,"IP")==hex) { hex+=2; return reg_ip; }; - if (strstr(hex,"CS")==hex) { hex+=2; return SegValue(cs); }; - if (strstr(hex,"DS")==hex) { hex+=2; return SegValue(ds); }; - if (strstr(hex,"ES")==hex) { hex+=2; return SegValue(es); }; - if (strstr(hex,"FS")==hex) { hex+=2; return SegValue(fs); }; - if (strstr(hex,"GS")==hex) { hex+=2; return SegValue(gs); }; - if (strstr(hex,"SS")==hex) { hex+=2; return SegValue(ss); }; + if (strstr(hex,"EAX")==hex) { hex+=3; regval = reg_eax; }; + if (strstr(hex,"EBX")==hex) { hex+=3; regval = reg_ebx; }; + if (strstr(hex,"ECX")==hex) { hex+=3; regval = reg_ecx; }; + if (strstr(hex,"EDX")==hex) { hex+=3; regval = reg_edx; }; + if (strstr(hex,"ESI")==hex) { hex+=3; regval = reg_esi; }; + if (strstr(hex,"EDI")==hex) { hex+=3; regval = reg_edi; }; + if (strstr(hex,"EBP")==hex) { hex+=3; regval = reg_ebp; }; + if (strstr(hex,"ESP")==hex) { hex+=3; regval = reg_esp; }; + if (strstr(hex,"EIP")==hex) { hex+=3; regval = reg_eip; }; + if (strstr(hex,"AX")==hex) { hex+=2; regval = reg_ax; }; + if (strstr(hex,"BX")==hex) { hex+=2; regval = reg_bx; }; + if (strstr(hex,"CX")==hex) { hex+=2; regval = reg_cx; }; + if (strstr(hex,"DX")==hex) { hex+=2; regval = reg_dx; }; + if (strstr(hex,"SI")==hex) { hex+=2; regval = reg_si; }; + if (strstr(hex,"DI")==hex) { hex+=2; regval = reg_di; }; + if (strstr(hex,"BP")==hex) { hex+=2; regval = reg_bp; }; + if (strstr(hex,"SP")==hex) { hex+=2; regval = reg_sp; }; + if (strstr(hex,"IP")==hex) { hex+=2; regval = reg_ip; }; + if (strstr(hex,"CS")==hex) { hex+=2; regval = SegValue(cs); }; + if (strstr(hex,"DS")==hex) { hex+=2; regval = SegValue(ds); }; + if (strstr(hex,"ES")==hex) { hex+=2; regval = SegValue(es); }; + if (strstr(hex,"FS")==hex) { hex+=2; regval = SegValue(fs); }; + if (strstr(hex,"GS")==hex) { hex+=2; regval = SegValue(gs); }; + if (strstr(hex,"SS")==hex) { hex+=2; regval = SegValue(ss); }; while (*hex) { - if ((*hex>='0') && (*hex<='9')) value = (value<<4)+*hex-'0'; else - if ((*hex>='A') && (*hex<='F')) value = (value<<4)+*hex-'A'+10; - else break; // No valid char + if ((*hex>='0') && (*hex<='9')) value = (value<<4)+*hex-'0'; + else if ((*hex>='A') && (*hex<='F')) value = (value<<4)+*hex-'A'+10; + else { + if(*hex == '+') {hex++;return regval + value + GetHexValue(hex,hex); }; + if(*hex == '-') {hex++;return regval + value - GetHexValue(hex,hex); }; + break; // No valid char + } hex++; }; - return value; + return regval + value; }; bool ChangeRegister(char* str) @@ -907,34 +936,38 @@ bool ChangeRegister(char* str) if (strstr(hex,"CF")==hex) { hex+=2; SETFLAGBIT(CF,GetHexValue(hex,hex)); } else if (strstr(hex,"DF")==hex) { hex+=2; SETFLAGBIT(DF,GetHexValue(hex,hex)); } else if (strstr(hex,"IF")==hex) { hex+=2; SETFLAGBIT(IF,GetHexValue(hex,hex)); } else - if (strstr(hex,"OF")==hex) { hex+=3; SETFLAGBIT(OF,GetHexValue(hex,hex)); } else - if (strstr(hex,"ZF")==hex) { hex+=3; SETFLAGBIT(ZF,GetHexValue(hex,hex)); } else - if (strstr(hex,"PF")==hex) { hex+=3; SETFLAGBIT(PF,GetHexValue(hex,hex)); } else - if (strstr(hex,"SF")==hex) { hex+=3; SETFLAGBIT(SF,GetHexValue(hex,hex)); } else + if (strstr(hex,"OF")==hex) { hex+=2; SETFLAGBIT(OF,GetHexValue(hex,hex)); } else + if (strstr(hex,"ZF")==hex) { hex+=2; SETFLAGBIT(ZF,GetHexValue(hex,hex)); } else + if (strstr(hex,"PF")==hex) { hex+=2; SETFLAGBIT(PF,GetHexValue(hex,hex)); } else + if (strstr(hex,"SF")==hex) { hex+=2; SETFLAGBIT(SF,GetHexValue(hex,hex)); } else { return false; }; return true; }; -bool ParseCommand(char* str) -{ +bool ParseCommand(char* str) { char* found = str; for(char* idx = found;*idx != 0; idx++) *idx = toupper(*idx); found = trim(found); + string s_found(found); + istringstream stream(s_found); + string command; + stream >> command; + string::size_type next = s_found.find_first_not_of(' ',command.size()); + if(next == string::npos) next = command.size(); + (s_found.erase)(0,next); + found = const_cast(s_found.c_str()); - found = strstr(str,"MEMDUMP "); - if (found) { // Insert variable - found+=8; + if (command == "MEMDUMP") { // Dump memory to file Bit16u seg = (Bit16u)GetHexValue(found,found); found++; Bit32u ofs = GetHexValue(found,found); found++; Bit32u num = GetHexValue(found,found); found++; SaveMemory(seg,ofs,num); return true; }; - found = strstr(str,"MEMDUMPBIN "); - if (found) { // Insert variable - found+=11; + + if (command == "MEMDUMPBIN") { // Dump memory to file bineary Bit16u seg = (Bit16u)GetHexValue(found,found); found++; Bit32u ofs = GetHexValue(found,found); found++; Bit32u num = GetHexValue(found,found); found++; @@ -942,123 +975,112 @@ bool ParseCommand(char* str) return true; }; - found = strstr(str,"IV "); - if (found) { // Insert variable - found+=3; + if (command == "IV") { // Insert variable Bit16u seg = (Bit16u)GetHexValue(found,found); found++; Bit32u ofs = (Bit16u)GetHexValue(found,found); found++; char name[16]; for (int i=0; i<16; i++) { - if ((found[i]!=' ') && (found[i]!=0)) name[i] = found[i]; + if (found[i] && (found[i]!=' ')) name[i] = found[i]; else { name[i] = 0; break; }; }; name[15] = 0; - + + if(!name[0]) return false; DEBUG_ShowMsg("DEBUG: Created debug var %s at %04X:%04X\n",name,seg,ofs); CDebugVar::InsertVariable(name,GetAddress(seg,ofs)); return true; - } - - found = strstr(str,"SV "); - if (found) { // Save variables - found+=3; - char name[13]; - for (int i=0; i<12; i++) { - if ((found[i]!=' ') && (found[i]!=0)) name[i] = found[i]; - else { name[i] = 0; break; }; - }; - name[12] = 0; - if (CDebugVar::SaveVars(name)) DEBUG_ShowMsg("DEBUG: Variable list save (%s) : ok.\n",name); - else DEBUG_ShowMsg("DEBUG: Variable list save (%s) : failure\n",name); - return true; - } + }; - found = strstr(str,"LV "); - if (found) { // load variables - found+=3; + if (command == "SV") { // Save variables char name[13]; for (int i=0; i<12; i++) { - if ((found[i]!=' ') && (found[i]!=0)) name[i] = found[i]; + if (found[i] && (found[i]!=' ')) name[i] = found[i]; else { name[i] = 0; break; }; }; - name[12] = 0; - if (CDebugVar::LoadVars(name)) DEBUG_ShowMsg("DEBUG: Variable list load (%s) : ok.\n",name); - else DEBUG_ShowMsg("DEBUG: Variable list load (%s) : failure\n",name); + name[12] = 0; + if(!name[0]) return false; + DEBUG_ShowMsg("DEBUG: Variable list save (%s) : %s.\n",name,(CDebugVar::SaveVars(name)?"ok":"failure")); return true; - } - found = strstr(str,"SR "); - if (found) { // Set register value - found+=2; - if (ChangeRegister(found)) DEBUG_ShowMsg("DEBUG: Set Register success.\n"); - else DEBUG_ShowMsg("DEBUG: Set Register failure.\n"); + }; + + if (command == "LV") { // load variables + char name[13]; + for (int i=0; i<12; i++) { + if (found[i] && (found[i]!=' ')) name[i] = found[i]; + else { name[i] = 0; break; }; + }; + name[12] = 0; + if(!name[0]) return false; + DEBUG_ShowMsg("DEBUG: Variable list load (%s) : %s.\n",name,(CDebugVar::SaveVars(name)?"ok":"failure")); return true; - } - found = strstr(str,"SM "); - if (found) { // Set memory with following values - found+=3; + }; + + if (command == "SR") { // Set register value + DEBUG_ShowMsg("DEBUG: Set Register success.\n",(ChangeRegister(found)?"success":"failure")); + return true; + }; + + if (command == "SM") { // Set memory with following values Bit16u seg = (Bit16u)GetHexValue(found,found); found++; Bit32u ofs = GetHexValue(found,found); found++; Bit16u count = 0; while (*found) { while (*found==' ') found++; if (*found) { - Bit8u value = (Bit8u)GetHexValue(found,found); found++; + Bit8u value = (Bit8u)GetHexValue(found,found); + if(*found) found++; mem_writeb(GetAddress(seg,ofs+count),value); count++; } }; DEBUG_ShowMsg("DEBUG: Memory changed.\n"); return true; - } + }; - found = strstr(str,"BP "); - if (found) { // Add new breakpoint - found+=3; + if (command == "BP") { // Add new breakpoint Bit16u seg = (Bit16u)GetHexValue(found,found);found++; // skip ":" Bit32u ofs = GetHexValue(found,found); CBreakpoint::AddBreakpoint(seg,ofs,false); DEBUG_ShowMsg("DEBUG: Set breakpoint at %04X:%04X\n",seg,ofs); return true; - } + }; + #if C_HEAVY_DEBUG - found = strstr(str,"BPM "); - if (found) { // Add new breakpoint - found+=3; + + if (command == "BPM") { // Add new breakpoint Bit16u seg = (Bit16u)GetHexValue(found,found);found++; // skip ":" Bit32u ofs = GetHexValue(found,found); CBreakpoint::AddMemBreakpoint(seg,ofs); DEBUG_ShowMsg("DEBUG: Set memory breakpoint at %04X:%04X\n",seg,ofs); return true; - } - found = strstr(str,"BPPM "); - if (found) { // Add new breakpoint - found+=4; + }; + + if (command == "BPPM") { // Add new breakpoint Bit16u seg = (Bit16u)GetHexValue(found,found);found++; // skip ":" Bit32u ofs = GetHexValue(found,found); CBreakpoint* bp = CBreakpoint::AddMemBreakpoint(seg,ofs); - if (bp) - { + if (bp) { bp->SetType(BKPNT_MEMORY_PROT); DEBUG_ShowMsg("DEBUG: Set prot-mode memory breakpoint at %04X:%08X\n",seg,ofs); } return true; - } - found = strstr(str,"BPLM "); - if (found) { // Add new breakpoint - found+=4; - Bitu ofs = GetHexValue(found,found); + }; + + if (command == "BPLM") { // Add new breakpoint + Bit32u ofs = GetHexValue(found,found); CBreakpoint* bp = CBreakpoint::AddMemBreakpoint(0,ofs); if (bp) bp->SetType(BKPNT_MEMORY_LINEAR); DEBUG_ShowMsg("DEBUG: Set linear memory breakpoint at %08X\n",ofs); return true; - } + }; + #endif - found = strstr(str,"BPINT"); - if (found) { // Add Interrupt Breakpoint - found+=5; - Bit8u intNr = (Bit8u)GetHexValue(found,found); found++; + + if (command == "BPINT") { // Add Interrupt Breakpoint + Bit8u intNr = (Bit8u)GetHexValue(found,found); + bool all = !(*found);found++; Bit8u valAH = (Bit8u)GetHexValue(found,found); - if ((valAH==0x00) && (*found=='*')) { + if ((valAH==0x00) && (*found=='*' || all)) { CBreakpoint::AddIntBreakpoint(intNr,BPINT_ALL,false); DEBUG_ShowMsg("DEBUG: Set interrupt breakpoint at INT %02X\n",intNr); } else { @@ -1066,18 +1088,16 @@ bool ParseCommand(char* str) DEBUG_ShowMsg("DEBUG: Set interrupt breakpoint at INT %02X AH=%02X\n",intNr,valAH); } return true; - } - found = strstr(str,"BPLIST"); - if (found) { + }; + + if (command == "BPLIST") { DEBUG_ShowMsg("Breakpoint list:\n"); DEBUG_ShowMsg("-------------------------------------------------------------------------\n"); CBreakpoint::ShowList(); return true; }; - found = strstr(str,"BPDEL"); - if (found) { // Delete Breakpoints - found+=5; + if (command == "BPDEL") { // Delete Breakpoints Bit8u bpNr = (Bit8u)GetHexValue(found,found); if ((bpNr==0x00) && (*found=='*')) { // Delete all CBreakpoint::DeleteAll(); @@ -1087,193 +1107,152 @@ bool ParseCommand(char* str) CBreakpoint::DeleteByIndex(bpNr); } return true; - } - found = strstr(str,"C "); - if (found==(char*)str) { // Set code overview - found++; + }; + + if (command == "C") { // Set code overview Bit16u codeSeg = (Bit16u)GetHexValue(found,found); found++; Bit32u codeOfs = GetHexValue(found,found); DEBUG_ShowMsg("DEBUG: Set code overview to %04X:%04X\n",codeSeg,codeOfs); codeViewData.useCS = codeSeg; codeViewData.useEIP = codeOfs; return true; - } - found = strstr(str,"D "); - if (found==(char*)str) { // Set data overview - found++; + }; + + if (command == "D") { // Set data overview dataSeg = (Bit16u)GetHexValue(found,found); found++; dataOfs = GetHexValue(found,found); DEBUG_ShowMsg("DEBUG: Set data overview to %04X:%04X\n",dataSeg,dataOfs); return true; - } + }; + #if C_HEAVY_DEBUG - found = strstr(str,"LOG "); - if (found) { // Create Cpu log file - found+=4; - DEBUG_ShowMsg("DEBUG: Starting log\n"); -// DEBUG_Log_Loop(GetHexValue(found,found)); - cpuLogFile = fopen("LOGCPU.TXT","wt"); - if (!cpuLogFile) { - DEBUG_ShowMsg("DEBUG: Logfile couldn't be created.\n"); - return false; - } - cpuLog = true; + + if (command == "LOG") { // Create Cpu normal log file cpuLogType = 1; - cpuLogCounter = GetHexValue(found,found); - - debugging=false; - CBreakpoint::ActivateBreakpoints(SegPhys(cs)+reg_eip,true); - ignoreAddressOnce = SegPhys(cs)+reg_eip; - DOSBOX_SetNormalLoop(); - return true; + command = "logcode"; } - found = strstr(str,"LOGS "); - if (found) { // Create Cpu log file - found+=4; - DEBUG_ShowMsg("DEBUG: Starting log\n"); - cpuLogFile = fopen("LOGCPU.TXT","wt"); - if (!cpuLogFile) { - DEBUG_ShowMsg("DEBUG: Logfile couldn't be created.\n"); - return false; - } - cpuLog = true; + if (command == "LOGS") { // Create Cpu short log file cpuLogType = 0; - cpuLogCounter = GetHexValue(found,found); - - debugging=false; - CBreakpoint::ActivateBreakpoints(SegPhys(cs)+reg_eip,true); - ignoreAddressOnce = SegPhys(cs)+reg_eip; - DOSBOX_SetNormalLoop(); - return true; + command = "logcode"; } - found = strstr(str,"LOGL "); - if (found) { // Create Cpu log file - found+=4; + if (command == "LOGL") { // Create Cpu long log file + cpuLogType = 2; + command = "logcode"; + } + + if (command == "logcode") { //Shared code between all logs DEBUG_ShowMsg("DEBUG: Starting log\n"); - cpuLogFile = fopen("LOGCPU.TXT","wt"); - if (!cpuLogFile) { + cpuLogFile.open("LOGCPU.TXT"); + if (!cpuLogFile.is_open()) { DEBUG_ShowMsg("DEBUG: Logfile couldn't be created.\n"); return false; } + //Initialize log object + cpuLogFile << hex << noshowbase << setfill('0') << uppercase; cpuLog = true; - cpuLogType = 2; cpuLogCounter = GetHexValue(found,found); - debugging=false; + debugging = false; CBreakpoint::ActivateBreakpoints(SegPhys(cs)+reg_eip,true); ignoreAddressOnce = SegPhys(cs)+reg_eip; DOSBOX_SetNormalLoop(); return true; - } + }; + #endif - found = strstr(str,"INTT "); - if (found) { // Create Cpu log file - found+=4; + + if (command == "INTT") { //trace int. Bit8u intNr = (Bit8u)GetHexValue(found,found); DEBUG_ShowMsg("DEBUG: Tracing INT %02X\n",intNr); CPU_HW_Interrupt(intNr); SetCodeWinStart(); return true; - } - found = strstr(str,"INT "); - if (found) { // Create Cpu log file - found+=4; + }; + + if (command == "INT") { // start int. Bit8u intNr = (Bit8u)GetHexValue(found,found); DEBUG_ShowMsg("DEBUG: Starting INT %02X\n",intNr); - CBreakpoint::AddBreakpoint (SegValue(cs),reg_eip, true); + CBreakpoint::AddBreakpoint(SegValue(cs),reg_eip, true); CBreakpoint::ActivateBreakpoints(SegPhys(cs)+reg_eip-1,true); - debugging=false; + debugging = false; DrawCode(); DOSBOX_SetNormalLoop(); CPU_HW_Interrupt(intNr); return true; - } - found = strstr(str,"SELINFO "); - if (found) { - found += 8; - while (found[0]==' ') found++; + }; + + if (command == "SELINFO") { + while (found[0] == ' ') found++; char out1[200],out2[200]; GetDescriptorInfo(found,out1,out2); - DEBUG_ShowMsg("SelectorInfo %s:\n",found); - DEBUG_ShowMsg("%s\n",out1); - DEBUG_ShowMsg("%s\n",out2); + DEBUG_ShowMsg("SelectorInfo %s:\n%s\n%s\n",found,out1,out2); }; - found = strstr(str,"GDT"); - if (found) { - LogGDT(); - } + if (command == "GDT") {LogGDT(); return true;} + + if (command == "LDT") {LogLDT(); return true;} + + if (command == "IDT") {LogIDT(); return true;} + + if (command == "PAGING") {LogPages(found); return true;} - found = strstr(str,"LDT"); - if (found) { - LogLDT(); - } + if (command == "CPU") {LogCPUInfo(); return true;} - found = strstr(str,"IDT"); - if (found) { - LogIDT(); - } - - found = strstr(str,"PAGING"); - if (found) { - found += 6; - while (found[0]==' ') found++; - LogPages(found); - } - - found = strstr(str,"CPU"); - if (found) { - LogCPUInfo(); - } - - found = strstr(str,"INTVEC "); - if (found) - { - found += 7; - while (found[0]==' ') found++; - if (found[0] != 0) + if (command == "INTVEC") { + if (found[0] != 0) { OutputVecTable(found); - } + return true; + } + }; - found = strstr(str,"INTHAND "); - if (found) - { - found += 8; - while (found[0]==' ') found++; - if (found[0] != 0) - { + if (command == "INTHAND") { + if (found[0] != 0) { Bit8u intNr = (Bit8u)GetHexValue(found,found); DEBUG_ShowMsg("DEBUG: Set code overview to interrupt handler %X\n",intNr); codeViewData.useCS = mem_readw(intNr*4+2); codeViewData.useEIP = mem_readw(intNr*4); return true; } - } + }; + + if(command == "EXTEND") { //Toggle additional data. + showExtend = !showExtend; + return true; + }; + + if(command == "TIMERIRQ") { //Start a timer irq + DEBUG_RaiseTimerIrq(); + DEBUG_ShowMsg("Debug: Timer Int started.\n"); + return true; + }; + #if C_HEAVY_DEBUG - found = strstr(str,"HEAVYLOG"); - if (found) { // Create Cpu log file + if (command == "HEAVYLOG") { // Create Cpu log file logHeavy = !logHeavy; - if (logHeavy) DEBUG_ShowMsg("DEBUG: Heavy cpu logging on.\n"); - else DEBUG_ShowMsg("DEBUG: Heavy cpu logging off.\n"); + DEBUG_ShowMsg("DEBUG: Heavy cpu logging %s.\n",logHeavy?"on":"off"); return true; - } + }; + + if (command == "ZEROPROTECT") { //toggle zero protection + zeroProtect = !zeroProtect; + DEBUG_ShowMsg("DEBUG: Zero code execution protection %s.\n",zeroProtect?"on":"off"); + return true; + }; + #endif - if ((*str=='H') || (*str=='?')) { - DEBUG_ShowMsg("Debugger keys:\n"); + if (command == "HELP" || command == "?") { + DEBUG_ShowMsg("Debugger commands (enter all values in hex or as register):\n"); DEBUG_ShowMsg("--------------------------------------------------------------------------\n"); DEBUG_ShowMsg("F5 - Run.\n"); DEBUG_ShowMsg("F9 - Set/Remove breakpoint.\n"); DEBUG_ShowMsg("F10/F11 - Step over / trace into instruction.\n"); + DEBUG_ShowMsg("ALT + D/E/S/X/B - Set data view to DS:SI/ES:DI/SS:SP/DS:DX/ES:BX.\n"); + DEBUG_ShowMsg("Escape - clear input line."); DEBUG_ShowMsg("Up/Down - Move code view cursor.\n"); - DEBUG_ShowMsg("Return - Enable command line input.\n"); - DEBUG_ShowMsg("D/E/S/X/B - Set data view to DS:SI/ES:DI/SS:SP/DS:DX/ES:BX.\n"); - DEBUG_ShowMsg("R/F - Scroll data view.\n"); - DEBUG_ShowMsg("V - Toggle additional info.\n"); - DEBUG_ShowMsg("Debugger commands (enter all values in hex or as register):\n"); - DEBUG_ShowMsg("--------------------------------------------------------------------------\n"); + DEBUG_ShowMsg("Page Up/Down - Scroll data view.\n"); DEBUG_ShowMsg("BP [segment]:[offset] - Set breakpoint.\n"); DEBUG_ShowMsg("BPINT [intNr] * - Set interrupt breakpoint.\n"); DEBUG_ShowMsg("BPINT [intNr] [ah] - Set interrupt breakpoint with ah.\n"); @@ -1290,6 +1269,7 @@ bool ParseCommand(char* str) DEBUG_ShowMsg("LOG [num] - Write cpu log file.\n"); DEBUG_ShowMsg("LOGS/LOGL [num] - Write short/long cpu log file.\n"); DEBUG_ShowMsg("HEAVYLOG - Enable/Disable automatic cpu when dosbox exits.\n"); + DEBUG_ShowMsg("ZEROPROTECT - Enable/Disable zero code execution detecion.\n"); #endif DEBUG_ShowMsg("SR [reg] [value] - Set register value.\n"); DEBUG_ShowMsg("SM [seg]:[off] [val] [.]..- Set memory with following values.\n"); @@ -1310,11 +1290,13 @@ bool ParseCommand(char* str) DEBUG_ShowMsg("LDT - Lists descriptors of the LDT.\n"); DEBUG_ShowMsg("IDT - Lists descriptors of the IDT.\n"); DEBUG_ShowMsg("PAGING [page] - Display content of page table.\n"); + DEBUG_ShowMsg("EXTEND - Toggle additional info.\n"); + DEBUG_ShowMsg("TIMERIRQ - Run the system timer.\n"); - DEBUG_ShowMsg("H - Help\n"); + DEBUG_ShowMsg("HELP - Help\n"); - return TRUE; - } + return true; + }; return false; }; @@ -1420,7 +1402,7 @@ char* AnalyzeInstruction(char* inst, bool saveSelector) case 'A' : { jmp = (get_CF()?false:true) && (get_ZF()?false:true); // JA } break; case 'B' : { if (instu[2] == 'E') { - jmp = (get_CF()?true:false) && (get_ZF()?true:false); // JBE + jmp = (get_CF()?true:false) || (get_ZF()?true:false); // JBE } else { jmp = get_CF()?true:false; // JB } @@ -1434,15 +1416,15 @@ char* AnalyzeInstruction(char* inst, bool saveSelector) case 'E' : { jmp = get_ZF()?true:false; // JE } break; case 'G' : { if (instu[2] == 'E') { - jmp = get_SF()?false:true; // JGE + jmp = (get_SF()?true:false)==(get_OF()?true:false); // JGE } else { - jmp = (get_SF()?false:true) && (get_ZF()?false:true); // JG + jmp = (get_ZF()?false:true) && ((get_SF()?true:false)==(get_OF()?true:false)); // JG } } break; case 'L' : { if (instu[2] == 'E') { - jmp = (get_SF()?true:false) || (get_ZF()?true:false) ; // JLE + jmp = (get_ZF()?true:false) || ((get_SF()?true:false)!=(get_OF()?true:false)); // JLE } else { - jmp = get_SF()?true:false; // JL + jmp = (get_SF()?true:false)!=(get_OF()?true:false); // JL } } break; case 'M' : { jmp = true; // JMP @@ -1463,7 +1445,7 @@ char* AnalyzeInstruction(char* inst, bool saveSelector) } break; } } break; - case 'O' : { jmp = get_OF()?true:false; // JMP + case 'O' : { jmp = get_OF()?true:false; // JO } break; case 'P' : { if (instu[2] == 'O') { jmp = get_PF()?false:true; // JPO @@ -1492,143 +1474,148 @@ char* AnalyzeInstruction(char* inst, bool saveSelector) Bit32u DEBUG_CheckKeys(void) { - - if (codeViewData.inputMode) { - int key = getch(); - if (key>0) { - switch (key) { - case 0x0A: codeViewData.inputMode = FALSE; - ParseCommand(codeViewData.inputStr); - break; - case 0x107: //backspace (linux) - case 0x7f: //backspace in some terminal emulators (linux) - case 0x08: // delete - if (strlen(codeViewData.inputStr)>0) codeViewData.inputStr[strlen(codeViewData.inputStr)-1] = 0; - break; - default : if ((key>=32) && (key<=128) && (strlen(codeViewData.inputStr)<253)) { - Bit32u len = strlen(codeViewData.inputStr); - codeViewData.inputStr[len] = char(key); - codeViewData.inputStr[len+1] = 0; - } - break; - } - DEBUG_DrawScreen(); - } - return 0; - }; - - int key=getch(); Bits ret=0; + int key=getch(); if (key>0) { +#if defined(WIN32) && defined(__PDCURSES__) + switch (key) { + case ALT_D: + if (ungetch('D') != ERR) key=27; + break; + case ALT_E: + if (ungetch('E') != ERR) key=27; + break; + case ALT_X: + if (ungetch('X') != ERR) key=27; + break; + case ALT_B: + if (ungetch('B') != ERR) key=27; + break; + case ALT_S: + if (ungetch('S') != ERR) key=27; + break; + } +#endif switch (toupper(key)) { - case '1': - CPU_Cycles = 100; - ret=(*cpudecoder)(); - break; - case '2': - CPU_Cycles = 500; - ret=(*cpudecoder)(); - break; - case '3': - CPU_Cycles = 1000; - ret=(*cpudecoder)(); - break; - case '4': - CPU_Cycles = 5000; - ret=(*cpudecoder)(); - break; - case '5': - CPU_Cycles = 10000; - ret=(*cpudecoder)(); - break; - case 'q': - CPU_Cycles = 5; - ret=(*cpudecoder)(); - break; - case 'D': dataSeg = SegValue(ds); - if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_esi; - else dataOfs = reg_si; - break; - case 'E': dataSeg = SegValue(es); - if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_edi; - else dataOfs = reg_di; - break; - case 'X': dataSeg = SegValue(ds); - if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_edx; - else dataOfs = reg_dx; - break; - case 'B': dataSeg = SegValue(es); - if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_ebx; - else dataOfs = reg_bx; - break; - case 'S': dataSeg = SegValue(ss); - if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_esp; - else dataOfs = reg_sp; - break; + case 27: // escape (a bit slow): Clears line. and processes alt commands. + key=getch(); + if(key < 0) { //Purely escape Clear line + codeViewData.inputStr[0] = 0; + break; + } - case 'R' : dataOfs -= 16; break; - case 'F' : dataOfs += 16; break; - case 'H' : strcpy(codeViewData.inputStr,"H "); - ParseCommand(codeViewData.inputStr); - break; - case 'T' : DEBUG_RaiseTimerIrq(); - DEBUG_ShowMsg("Debug: Timer Int started.\n"); - break; - case 'V' : showExtend = !showExtend; - break; + switch(toupper(key)) { + case 'D' : // ALT - D: DS:SI + dataSeg = SegValue(ds); + if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_esi; + else dataOfs = reg_si; + break; + case 'E' : //ALT - E: es:di + dataSeg = SegValue(es); + if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_edi; + else dataOfs = reg_di; + break; + case 'X': //ALT - X: ds:dx + dataSeg = SegValue(ds); + if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_edx; + else dataOfs = reg_dx; + break; + case 'B' : //ALT -B: es:bx + dataSeg = SegValue(es); + if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_ebx; + else dataOfs = reg_bx; + break; + case 'S': //ALT - S: ss:sp + dataSeg = SegValue(ss); + if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_esp; + else dataOfs = reg_sp; + break; + default: + break; + } + break; + case KEY_PPAGE : dataOfs -= 16; break; + case KEY_NPAGE : dataOfs += 16; break; - case 0x0A : // Return : input - codeViewData.inputMode = true; - codeViewData.inputStr[0] = 0; - break; case KEY_DOWN: // down - if (codeViewData.cursorPos<9) codeViewData.cursorPos++; - else codeViewData.useEIP += codeViewData.firstInstSize; - break; + if (codeViewData.cursorPos<9) codeViewData.cursorPos++; + else codeViewData.useEIP += codeViewData.firstInstSize; + break; case KEY_UP: // up - if (codeViewData.cursorPos>0) codeViewData.cursorPos--; - else codeViewData.useEIP -= 1; - break; - case KEY_HOME: // Home: scroll log page up - DEBUG_RefreshPage(-1); - break; - case KEY_END: // End: scroll log page down - DEBUG_RefreshPage(1); - break; - case KEY_F(5): // Run Programm - debugging=false; - CBreakpoint::ActivateBreakpoints(SegPhys(cs)+reg_eip,true); - ignoreAddressOnce = SegPhys(cs)+reg_eip; - DOSBOX_SetNormalLoop(); - break; - case KEY_F(9): // Set/Remove TBreakpoint - { PhysPt ptr = GetAddress(codeViewData.cursorSeg,codeViewData.cursorOfs); - if (CBreakpoint::IsBreakpoint(ptr)) CBreakpoint::DeleteBreakpoint(ptr); - else CBreakpoint::AddBreakpoint(codeViewData.cursorSeg, codeViewData.cursorOfs, false); + if (codeViewData.cursorPos>0) codeViewData.cursorPos--; + else { + Bitu bytes = 0; + char dline[200]; + Bitu size = 0; + Bit32u newEIP = codeViewData.useEIP - 1; + if(codeViewData.useEIP) { + for (; bytes < 10; bytes++) { + PhysPt start = GetAddress(codeViewData.useCS,newEIP); + size = DasmI386(dline, start, newEIP, cpu.code.big); + if(codeViewData.useEIP == newEIP+size) break; + newEIP--; } + if (bytes>=10) newEIP = codeViewData.useEIP - 1; + } + codeViewData.useEIP = newEIP; + } + break; + case KEY_HOME: // Home: scroll log page up + DEBUG_RefreshPage(-1); + break; + case KEY_END: // End: scroll log page down + DEBUG_RefreshPage(1); + break; + case KEY_F(5): // Run Programm + debugging=false; + CBreakpoint::ActivateBreakpoints(SegPhys(cs)+reg_eip,true); + ignoreAddressOnce = SegPhys(cs)+reg_eip; + DOSBOX_SetNormalLoop(); + break; + case KEY_F(9): // Set/Remove TBreakpoint + { PhysPt ptr = GetAddress(codeViewData.cursorSeg,codeViewData.cursorOfs); + if (CBreakpoint::IsBreakpoint(ptr)) CBreakpoint::DeleteBreakpoint(ptr); + else CBreakpoint::AddBreakpoint(codeViewData.cursorSeg, codeViewData.cursorOfs, false); + } break; case KEY_F(10): // Step over inst - if (StepOver()) return 0; - else { - exitLoop = false; - skipFirstInstruction = true; // for heavy debugger - CPU_Cycles = 1; - Bitu ret=(*cpudecoder)(); - SetCodeWinStart(); - CBreakpoint::ignoreOnce = 0; - } - break; + if (StepOver()) return 0; + else { + exitLoop = false; + skipFirstInstruction = true; // for heavy debugger + CPU_Cycles = 1; + ret=(*cpudecoder)(); + SetCodeWinStart(); + CBreakpoint::ignoreOnce = 0; + } + break; case KEY_F(11): // trace into - exitLoop = false; - skipFirstInstruction = true; // for heavy debugger - CPU_Cycles = 1; - ret = (*cpudecoder)(); - SetCodeWinStart(); - CBreakpoint::ignoreOnce = 0; - break; + exitLoop = false; + skipFirstInstruction = true; // for heavy debugger + CPU_Cycles = 1; + ret = (*cpudecoder)(); + SetCodeWinStart(); + CBreakpoint::ignoreOnce = 0; + break; + case 0x0A: //Parse typed Command + codeViewData.inputMode = true; + if(ParseCommand(codeViewData.inputStr)) codeViewData.inputStr[0] = 0; + break; + case 0x107: //backspace (linux) + case 0x7f: //backspace in some terminal emulators (linux) + case 0x08: // delete + if (strlen(codeViewData.inputStr)>0) codeViewData.inputStr[strlen(codeViewData.inputStr)-1] = 0; + break; + default : if ((key>=32) && (key<=128) && (strlen(codeViewData.inputStr)<253)) { + Bit32u len = strlen(codeViewData.inputStr); + codeViewData.inputStr[len] = char(key); + codeViewData.inputStr[len+1] = 0; + } + break; + } - if (ret<0) return ret; - if (ret>0){ + if (ret<0) return ret; + if (ret>0) { ret=(*CallBack_Handlers[ret])(); if (ret) { exitLoop=true; @@ -1670,7 +1657,7 @@ void DEBUG_Enable(bool pressed) { DOSBOX_SetLoop(&DEBUG_Loop); if(!showhelp) { showhelp=true; - DEBUG_ShowMsg("***| PRESS \"H\" TO SHOW ALL COMMANDS. PRESS \"RETURN\" TO ENTER COMMANDMODE. |***\n"); + DEBUG_ShowMsg("***| TYPE HELP (+ENTER) TO GET AN OVERVIEW OF ALL COMMANDS |***\n"); } KEYBOARD_ClrBuffer(); } @@ -1801,87 +1788,63 @@ static void LogCPUInfo(void) LOG(LOG_MISC,LOG_ERROR)(out1); }; -static void LogInstruction(Bit16u segValue, Bit32u eipValue, char* buffer) -{ - static char empty[15] = { 32,32,32,32,32,32,32,32,32,32,32,32,32,32,0 }; +#if C_HEAVY_DEBUG +static void LogInstruction(Bit16u segValue, Bit32u eipValue, ofstream& out) { + static char empty[23] = { 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0 }; PhysPt start = GetAddress(segValue,eipValue); char dline[200];Bitu size; size = DasmI386(dline, start, reg_eip, cpu.code.big); - Bitu len = strlen(dline); char* res = empty; - if (showExtend) { + if (showExtend && (cpuLogType > 0) ) { res = AnalyzeInstruction(dline,false); - len = strlen(dline); -#if C_HEAVY_DEBUG - if (cpuLogType>=2) { - Bitu reslen=strlen(res); - if (reslen<24) for (Bitu i=0; i<24-reslen; i++) strcat(res," "); - } else -#endif - if (!res || (strlen(res)==0)) res = empty; + if (!res || !(*res)) res = empty; + Bitu reslen = strlen(res); + if (reslen<22) for (Bitu i=0; i<22-reslen; i++) res[reslen+i] = ' '; res[22] = 0; }; + Bitu len = strlen(dline); + if (len<30) for (Bitu i=0; i<30-len; i++) dline[len + i] = ' '; dline[30] = 0; // Get register values -#if C_HEAVY_DEBUG - if (cpuLogType==1) { -#endif - if (len<30) for (Bitu i=0; i<30-len; i++) strcat(dline," "); - sprintf(buffer,"%04X:%08X %s %s EAX:%08X EBX:%08X ECX:%08X EDX:%08X ESI:%08X EDI:%08X EBP:%08X ESP:%08X DS:%04X ES:%04X FS:%04X GS:%04X SS:%04X CF:%01X ZF:%01X SF:%01X OF:%01X AF:%01X PF:%01X IF:%01X\n",segValue,eipValue,dline,res,reg_eax,reg_ebx,reg_ecx,reg_edx,reg_esi,reg_edi,reg_ebp,reg_esp,SegValue(ds),SegValue(es),SegValue(fs),SegValue(gs),SegValue(ss), - get_CF()?1:0,get_ZF()?1:0,get_SF()?1:0,get_OF()?1:0,get_AF()?1:0,get_PF()?1:0,GETFLAGBOOL(IF)); -#if C_HEAVY_DEBUG - } else if (cpuLogType==0) { - if (len<27) for (Bitu i=0; i<27-len; i++) strcat(dline," "); - sprintf(buffer,"%04X:%04X %s EAX:%08X EBX:%08X ECX:%08X EDX:%08X ESI:%08X EDI:%08X EBP:%08X ESP:%08X DS:%04X ES:%04X SS:%04X C%01X Z%01X S%01X O%01X I%01X\n",segValue,eipValue,dline,reg_eax,reg_ebx,reg_ecx,reg_edx,reg_esi,reg_edi,reg_ebp,reg_esp,SegValue(ds),SegValue(es),SegValue(ss), - get_CF()?1:0,get_ZF()?1:0,get_SF()?1:0,get_OF()?1:0,GETFLAGBOOL(IF)); - } else { - if (len<34) for (Bitu i=0; i<34-len; i++) strcat(dline," "); + + if(cpuLogType == 0) { + out << setw(4) << SegValue(cs) << ":" << setw(4) << reg_eip << " " << dline; + } else if (cpuLogType == 1) { + out << setw(4) << SegValue(cs) << ":" << setw(8) << reg_eip << " " << dline << " " << res; + } else if (cpuLogType == 2) { char ibytes[200]=""; char tmpc[200]; for (Bitu i=0; i0) ret=(*CallBack_Handlers[ret])(); - - count--; - if (count==0) break; - - } while (!ret); - if (ret) break; - } while (count>0); - - fclose(f); - return true; -} +#endif // DEBUG.COM stuff @@ -1902,11 +1865,10 @@ public: Bit16u i =2; bool ok = false; args[0] = 0; - do { - ok = cmd->FindCommand(i++,temp_line); + for (;cmd->FindCommand(i++,temp_line)==true;) { strncat(args,temp_line.c_str(),256); strncat(args," ",256); - } while (ok); + } // Start new shell and execute prog active = true; // Save cpu state.... @@ -2170,7 +2132,7 @@ static void DrawVariables(void) } wrefresh(dbg.win_var); -} +}; #undef DEBUG_VAR_BUF_LEN // HEAVY DEBUGGING STUFF @@ -2182,57 +2144,131 @@ static Bit16u logCpuCS [LOGCPUMAX]; static Bit32u logCpuEIP[LOGCPUMAX]; static Bit32u logCount = 0; -typedef struct SLogInst { - char buffer[512]; -} TLogInst; +struct TLogInst { + Bit16u s_cs; + Bit32u eip; + Bit32u eax; + Bit32u ebx; + Bit32u ecx; + Bit32u edx; + Bit32u esi; + Bit32u edi; + Bit32u ebp; + Bit32u esp; + Bit16u s_ds; + Bit16u s_es; + Bit16u s_fs; + Bit16u s_gs; + Bit16u s_ss; + bool c; + bool z; + bool s; + bool o; + bool a; + bool p; + bool i; + char dline[31]; + char res[23]; +}; TLogInst logInst[LOGCPUMAX]; -void DEBUG_HeavyLogInstruction(void) -{ - LogInstruction(SegValue(cs),reg_eip,logInst[logCount++].buffer); - if (logCount>=LOGCPUMAX) { - logCount = 0; +void DEBUG_HeavyLogInstruction(void) { + + static char empty[23] = { 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0 }; + + PhysPt start = GetAddress(SegValue(cs),reg_eip); + char dline[200]; + Bitu size = DasmI386(dline, start, reg_eip, cpu.code.big); + char* res = empty; + if (showExtend) { + res = AnalyzeInstruction(dline,false); + if (!res || !(*res)) res = empty; + Bitu reslen = strlen(res); + if (reslen<22) for (Bitu i=0; i<22-reslen; i++) res[reslen+i] = ' '; res[22] = 0; }; + + Bitu len = strlen(dline); + if (len < 30) for (Bitu i=0; i < 30-len; i++) dline[len+i] = ' '; + dline[30] = 0; + + TLogInst & inst = logInst[logCount]; + strcpy(inst.dline,dline); + inst.s_cs = SegValue(cs); + inst.eip = reg_eip; + strcpy(inst.res,res); + inst.eax = reg_eax; + inst.ebx = reg_ebx; + inst.ecx = reg_ecx; + inst.edx = reg_edx; + inst.esi = reg_esi; + inst.edi = reg_edi; + inst.ebp = reg_ebp; + inst.esp = reg_esp; + inst.s_ds = SegValue(ds); + inst.s_es = SegValue(es); + inst.s_fs = SegValue(fs); + inst.s_gs = SegValue(gs); + inst.s_ss = SegValue(ss); + inst.c = get_CF(); + inst.z = get_ZF(); + inst.s = get_SF(); + inst.o = get_OF(); + inst.a = get_AF(); + inst.p = get_PF(); + inst.i = GETFLAGBOOL(IF); + + if (++logCount >= LOGCPUMAX) logCount = 0; }; -void DEBUG_HeavyWriteLogInstruction(void) -{ +void DEBUG_HeavyWriteLogInstruction(void) { if (!logHeavy) return; - logHeavy = false; DEBUG_ShowMsg("DEBUG: Creating cpu log LOGCPU_INT_CD.TXT\n"); - FILE* f = fopen("LOGCPU_INT_CD.TXT","wt"); - if (!f) { + ofstream out("LOGCPU_INT_CD.TXT"); + if (!out.is_open()) { DEBUG_ShowMsg("DEBUG: Failed.\n"); return; } - + out << hex << noshowbase << setfill('0') << uppercase; Bit32u startLog = logCount; do { // Write Intructions - fprintf(f,"%s",logInst[startLog++].buffer); - if (startLog>=LOGCPUMAX) startLog = 0; - } while (startLog!=logCount); - - fclose(f); + TLogInst & inst = logInst[startLog]; + out << setw(4) << inst.s_cs << ":" << setw(8) << inst.eip << " " + << inst.dline << " " << inst.res << " EAX:" << setw(8)<< inst.eax + << " EBX:" << setw(8) << inst.ebx << " ECX:" << setw(8) << inst.ecx + << " EDX:" << setw(8) << inst.edx << " ESI:" << setw(8) << inst.esi + << " EDI:" << setw(8) << inst.edi << " EBP:" << setw(8) << inst.ebp + << " ESP:" << setw(8) << inst.esp << " DS:" << setw(4) << inst.s_ds + << " ES:" << setw(4) << inst.s_es<< " FS:" << setw(4) << inst.s_fs + << " GS:" << setw(4) << inst.s_gs<< " SS:" << setw(4) << inst.s_ss + << " CF:" << inst.c << " ZF:" << inst.z << " SF:" << inst.s + << " OF:" << inst.o << " AF:" << inst.a << " PF:" << inst.p + << " IF:" << inst.i << endl; +/* fprintf(f,"%04X:%08X %s %s EAX:%08X EBX:%08X ECX:%08X EDX:%08X ESI:%08X EDI:%08X EBP:%08X ESP:%08X DS:%04X ES:%04X FS:%04X GS:%04X SS:%04X CF:%01X ZF:%01X SF:%01X OF:%01X AF:%01X PF:%01X IF:%01X\n", + logInst[startLog].s_cs,logInst[startLog].eip,logInst[startLog].dline,logInst[startLog].res,logInst[startLog].eax,logInst[startLog].ebx,logInst[startLog].ecx,logInst[startLog].edx,logInst[startLog].esi,logInst[startLog].edi,logInst[startLog].ebp,logInst[startLog].esp, + logInst[startLog].s_ds,logInst[startLog].s_es,logInst[startLog].s_fs,logInst[startLog].s_gs,logInst[startLog].s_ss, + logInst[startLog].c,logInst[startLog].z,logInst[startLog].s,logInst[startLog].o,logInst[startLog].a,logInst[startLog].p,logInst[startLog].i);*/ + if (++startLog >= LOGCPUMAX) startLog = 0; + } while (startLog != logCount); + + out.close(); DEBUG_ShowMsg("DEBUG: Done.\n"); }; -bool DEBUG_HeavyIsBreakpoint(void) -{ +bool DEBUG_HeavyIsBreakpoint(void) { + static Bitu zero_count = 0; if (cpuLog) { if (cpuLogCounter>0) { - static char buffer[4096]; - LogInstruction(SegValue(cs),reg_eip,buffer); - fprintf(cpuLogFile,"%s",buffer); + LogInstruction(SegValue(cs),reg_eip,cpuLogFile); cpuLogCounter--; } if (cpuLogCounter<=0) { - fclose(cpuLogFile); + cpuLogFile.close(); DEBUG_ShowMsg("DEBUG: cpu log LOGCPU.TXT created\n"); cpuLog = false; DEBUG_EnableDebugger(); @@ -2241,6 +2277,8 @@ bool DEBUG_HeavyIsBreakpoint(void) } // LogInstruction if (logHeavy) DEBUG_HeavyLogInstruction(); + if(zeroProtect && mem_readd(SegPhys(cs) + reg_eip) == 0) zero_count++; else zero_count = 0; + if(zeroProtect && GCC_UNLIKELY(zero_count == 10)) E_Exit("running zeroed code"); if (skipFirstInstruction) { skipFirstInstruction = false; diff --git a/src/debug/debug_gui.cpp b/src/debug/debug_gui.cpp index 749333d..aa0aeb3 100644 --- a/src/debug/debug_gui.cpp +++ b/src/debug/debug_gui.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: debug_gui.cpp,v 1.28 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: debug_gui.cpp,v 1.31 2007/01/08 19:45:39 qbix79 Exp $ */ #include "dosbox.h" @@ -34,7 +34,7 @@ #include "debug_inc.h" struct _LogGroup { - char * front; + char const* front; bool enabled; }; #include @@ -52,7 +52,7 @@ extern int old_cursor_state; -void DEBUG_ShowMsg(char * format,...) { +void DEBUG_ShowMsg(char const* format,...) { char buf[512]; va_list msg; @@ -97,7 +97,7 @@ void DEBUG_RefreshPage(char scroll) { wrefresh(dbg.win_out); } -void LOG::operator() (char* format, ...){ +void LOG::operator() (char const* format, ...){ char buf[512]; va_list msg; va_start(msg,format); @@ -144,13 +144,13 @@ static void DrawBars(void) { /* Show the Register bar */ mvaddstr(dbg.win_reg->_begy-1,0, "---(Register Overview )---"); /* Show the Data Overview bar perhaps with more special stuff in the end */ - mvaddstr(dbg.win_data->_begy-1,0,"---(Data Overview Scroll: r/f )---"); + mvaddstr(dbg.win_data->_begy-1,0,"---(Data Overview Scroll: page up/down)---"); /* Show the Code Overview perhaps with special stuff in bar too */ - mvaddstr(dbg.win_code->_begy-1,0,"---(Code Overview Scroll: up/down )---"); + mvaddstr(dbg.win_code->_begy-1,0,"---(Code Overview Scroll: up/down )---"); /* Show the Variable Overview bar */ mvaddstr(dbg.win_var->_begy-1,0, "---(Variable Overview )---"); /* Show the Output OverView */ - mvaddstr(dbg.win_out->_begy-1,0, "---(OutPut/Input Scroll: home/end )---"); + mvaddstr(dbg.win_out->_begy-1,0, "---(OutPut/Input Scroll: home/end )---"); attrset(0); } @@ -188,8 +188,7 @@ static void MakePairs(void) { init_pair(PAIR_BLACK_GREY, COLOR_BLACK /*| FOREGROUND_INTENSITY */, COLOR_WHITE); init_pair(PAIR_GREY_RED, COLOR_WHITE/*| FOREGROUND_INTENSITY */, COLOR_RED); } -static void LOG_Destroy(Section* sec) { - +static void LOG_Destroy(Section*) { if(debuglog) fclose(debuglog); } @@ -200,7 +199,7 @@ static void LOG_Init(Section * sec) { }else{ debuglog=0; } - sect->AddDestroyFunction(LOG_Destroy); + sect->AddDestroyFunction(&LOG_Destroy); char buf[1024]; for (Bitu i=1;i #include "mem.h" diff --git a/src/debug/debug_win32.cpp b/src/debug/debug_win32.cpp index c3c48e5..01a229c 100644 --- a/src/debug/debug_win32.cpp +++ b/src/debug/debug_win32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/debug/disasm_tables.h b/src/debug/disasm_tables.h index b0d3c4c..3ce7fb0 100644 --- a/src/debug/disasm_tables.h +++ b/src/debug/disasm_tables.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dos/Makefile.am b/src/dos/Makefile.am index 0beeb4a..3bdfbf5 100644 --- a/src/dos/Makefile.am +++ b/src/dos/Makefile.am @@ -1,10 +1,10 @@ AM_CPPFLAGS = -I$(top_srcdir)/include noinst_LIBRARIES = libdos.a -EXTRA_DIST = scsidefs.h wnaspi32.h +EXTRA_DIST = scsidefs.h wnaspi32.h dos_codepages.h dos_keyboard_layout_data.h libdos_a_SOURCES = dos.cpp dos_devices.cpp dos_execute.cpp dos_files.cpp dos_ioctl.cpp dos_memory.cpp \ dos_misc.cpp dos_classes.cpp dos_programs.cpp dos_tables.cpp \ drives.cpp drives.h drive_virtual.cpp drive_local.cpp drive_cache.cpp drive_fat.cpp \ - drive_iso.cpp dev_con.h dos_mscdex.cpp \ + drive_iso.cpp dev_con.h dos_mscdex.cpp dos_keyboard_layout.cpp \ cdrom.h cdrom.cpp cdrom_ioctl_win32.cpp cdrom_aspi_win32.cpp cdrom_ioctl_linux.cpp cdrom_image.cpp \ cdrom_ioctl_os2.cpp diff --git a/src/dos/Makefile.in b/src/dos/Makefile.in index ff36b98..1758c1e 100644 --- a/src/dos/Makefile.in +++ b/src/dos/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libdos_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,52 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/dos -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libdos_a_AR = $(AR) $(ARFLAGS) -libdos_a_LIBADD = -am_libdos_a_OBJECTS = dos.$(OBJEXT) dos_devices.$(OBJEXT) \ - dos_execute.$(OBJEXT) dos_files.$(OBJEXT) dos_ioctl.$(OBJEXT) \ - dos_memory.$(OBJEXT) dos_misc.$(OBJEXT) dos_classes.$(OBJEXT) \ - dos_programs.$(OBJEXT) dos_tables.$(OBJEXT) drives.$(OBJEXT) \ - drive_virtual.$(OBJEXT) drive_local.$(OBJEXT) \ - drive_cache.$(OBJEXT) drive_fat.$(OBJEXT) drive_iso.$(OBJEXT) \ - dos_mscdex.$(OBJEXT) cdrom.$(OBJEXT) \ - cdrom_ioctl_win32.$(OBJEXT) cdrom_aspi_win32.$(OBJEXT) \ - cdrom_ioctl_linux.$(OBJEXT) cdrom_image.$(OBJEXT) \ - cdrom_ioctl_os2.$(OBJEXT) -libdos_a_OBJECTS = $(am_libdos_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libdos_a_SOURCES) -DIST_SOURCES = $(libdos_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -108,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -138,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -148,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -157,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -183,48 +139,82 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + noinst_LIBRARIES = libdos.a -EXTRA_DIST = scsidefs.h wnaspi32.h +EXTRA_DIST = scsidefs.h wnaspi32.h dos_codepages.h dos_keyboard_layout_data.h libdos_a_SOURCES = dos.cpp dos_devices.cpp dos_execute.cpp dos_files.cpp dos_ioctl.cpp dos_memory.cpp \ dos_misc.cpp dos_classes.cpp dos_programs.cpp dos_tables.cpp \ drives.cpp drives.h drive_virtual.cpp drive_local.cpp drive_cache.cpp drive_fat.cpp \ - drive_iso.cpp dev_con.h dos_mscdex.cpp \ + drive_iso.cpp dev_con.h dos_mscdex.cpp dos_keyboard_layout.cpp \ cdrom.h cdrom.cpp cdrom_ioctl_win32.cpp cdrom_aspi_win32.cpp cdrom_ioctl_linux.cpp cdrom_image.cpp \ cdrom_ioctl_os2.cpp +subdir = src/dos +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libdos_a_AR = $(AR) cru +libdos_a_LIBADD = +am_libdos_a_OBJECTS = dos.$(OBJEXT) dos_devices.$(OBJEXT) \ + dos_execute.$(OBJEXT) dos_files.$(OBJEXT) dos_ioctl.$(OBJEXT) \ + dos_memory.$(OBJEXT) dos_misc.$(OBJEXT) dos_classes.$(OBJEXT) \ + dos_programs.$(OBJEXT) dos_tables.$(OBJEXT) drives.$(OBJEXT) \ + drive_virtual.$(OBJEXT) drive_local.$(OBJEXT) \ + drive_cache.$(OBJEXT) drive_fat.$(OBJEXT) drive_iso.$(OBJEXT) \ + dos_mscdex.$(OBJEXT) dos_keyboard_layout.$(OBJEXT) \ + cdrom.$(OBJEXT) cdrom_ioctl_win32.$(OBJEXT) \ + cdrom_aspi_win32.$(OBJEXT) cdrom_ioctl_linux.$(OBJEXT) \ + cdrom_image.$(OBJEXT) cdrom_ioctl_os2.$(OBJEXT) +libdos_a_OBJECTS = $(am_libdos_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cdrom.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/cdrom_aspi_win32.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/cdrom_image.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/cdrom_ioctl_linux.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/cdrom_ioctl_os2.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/cdrom_ioctl_win32.Po ./$(DEPDIR)/dos.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/dos_classes.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/dos_devices.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/dos_execute.Po ./$(DEPDIR)/dos_files.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/dos_ioctl.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/dos_keyboard_layout.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/dos_memory.Po ./$(DEPDIR)/dos_misc.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/dos_mscdex.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/dos_programs.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/dos_tables.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/drive_cache.Po ./$(DEPDIR)/drive_fat.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/drive_iso.Po ./$(DEPDIR)/drive_local.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/drive_virtual.Po ./$(DEPDIR)/drives.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libdos_a_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libdos_a_SOURCES) + all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/dos/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/dos/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/dos/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -234,7 +224,7 @@ libdos.a: $(libdos_a_OBJECTS) $(libdos_a_DEPENDENCIES) $(RANLIB) libdos.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -251,6 +241,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_execute.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_files.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_ioctl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_keyboard_layout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_memory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_mscdex.Po@am__quote@ @@ -264,20 +255,36 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drives.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -286,7 +293,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -298,11 +304,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -325,6 +330,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -338,7 +347,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -356,6 +365,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) + installdirs: install: install-am install-exec: install-exec-am @@ -376,7 +386,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -395,8 +405,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -432,14 +440,13 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/dos/cdrom.cpp b/src/dos/cdrom.cpp index 96a17ae..ad92fea 100644 --- a/src/dos/cdrom.cpp +++ b/src/dos/cdrom.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -86,7 +86,7 @@ bool CDROM_Interface_SDL::GetAudioTrackInfo (int track, TMSF& start, unsigned ch { if (CD_INDRIVE(SDL_CDStatus(cd))) { FRAMES_TO_MSF(cd->track[track-1].offset+150,&start.min,&start.sec,&start.fr); - attr = cd->track[track-1].type; + attr = cd->track[track-1].type<<4;//sdl uses 0 for audio and 4 for data. instead of 0x00 and 0x40 } return CD_INDRIVE(SDL_CDStatus(cd)); }; @@ -96,7 +96,7 @@ bool CDROM_Interface_SDL::GetAudioSub (unsigned char& attr, unsigned char& track if (CD_INDRIVE(SDL_CDStatus(cd))) { track = cd->cur_track; index = cd->cur_track; - attr = cd->track[track].type; + attr = cd->track[track].type<<4; FRAMES_TO_MSF(cd->cur_frame,&relPos.min,&relPos.sec,&relPos.fr); FRAMES_TO_MSF(cd->cur_frame+cd->track[track].offset,&absPos.min,&absPos.sec,&absPos.fr); } diff --git a/src/dos/cdrom_aspi_win32.cpp b/src/dos/cdrom_aspi_win32.cpp index 3b8b94b..fcc0edb 100644 --- a/src/dos/cdrom_aspi_win32.cpp +++ b/src/dos/cdrom_aspi_win32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cdrom_aspi_win32.cpp,v 1.16 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: cdrom_aspi_win32.cpp,v 1.17 2007/01/08 19:45:39 qbix79 Exp $ */ #if defined (WIN32) diff --git a/src/dos/cdrom_image.cpp b/src/dos/cdrom_image.cpp index 7efcc80..6e80394 100644 --- a/src/dos/cdrom_image.cpp +++ b/src/dos/cdrom_image.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cdrom_image.cpp,v 1.11 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: cdrom_image.cpp,v 1.15 2007/02/22 08:36:25 qbix79 Exp $ */ #include #include @@ -136,9 +136,6 @@ CDROM_Interface_Image::CDROM_Interface_Image(Bit8u subUnit) { images[subUnit] = this; if (refCount == 0) { -#if defined(C_SDL_SOUND) - Sound_Init(); -#endif player.mutex = SDL_CreateMutex(); if (!player.channel) { player.channel = MIXER_AddChannel(&CDAudioCallBack, 44100, "CDAUDIO"); @@ -154,9 +151,6 @@ CDROM_Interface_Image::~CDROM_Interface_Image() if (player.cd == this) player.cd = NULL; ClearTracks(); if (refCount == 0) { -#if defined(C_SDL_SOUND) - Sound_Quit(); -#endif SDL_DestroyMutex(player.mutex); player.channel->Enable(false); } @@ -261,7 +255,7 @@ bool CDROM_Interface_Image::ReadSectors(PhysPt buffer, bool raw, unsigned long s bool success = true; //Gobliiins reads 0 sectors for(int i = 0; i < num; i++) { - success = ReadSector(&buf[i * sectorSize], raw, sector); + success = ReadSector(&buf[i * sectorSize], raw, sector + i); if (!success) break; } @@ -348,7 +342,7 @@ bool CDROM_Interface_Image::LoadIsoFile(char* filename) return false; } track.number = 1; - track.attr = 4; + track.attr = 0x40;//data // try to detect iso type if (CanReadPVD(track.file, COOKED_SECTOR_SIZE, false)) { @@ -452,19 +446,19 @@ bool CDROM_Interface_Image::LoadCueSheet(char *cuefile) track.mode2 = false; } else if (type == "MODE1/2048") { track.sectorSize = COOKED_SECTOR_SIZE; - track.attr = 4; + track.attr = 0x40; track.mode2 = false; } else if (type == "MODE1/2352") { track.sectorSize = RAW_SECTOR_SIZE; - track.attr = 4; + track.attr = 0x40; track.mode2 = false; } else if (type == "MODE2/2336") { track.sectorSize = 2336; - track.attr = 4; + track.attr = 0x40; track.mode2 = true; } else if (type == "MODE2/2352") { track.sectorSize = RAW_SECTOR_SIZE; - track.attr = 4; + track.attr = 0x40; track.mode2 = true; } else success = false; @@ -522,6 +516,7 @@ bool CDROM_Interface_Image::LoadCueSheet(char *cuefile) // add leadout track track.number++; + track.attr = 0;//sync with load iso track.start = 0; track.length = 0; track.file = NULL; @@ -662,3 +657,16 @@ void CDROM_Interface_Image::ClearTracks() } tracks.clear(); } + +void CDROM_Image_Destroy(Section*) { +#if defined(C_SDL_SOUND) + Sound_Quit(); +#endif +} + +void CDROM_Image_Init(Section* section) { +#if defined(C_SDL_SOUND) + Sound_Init(); + section->AddDestroyFunction(CDROM_Image_Destroy, false); +#endif +} diff --git a/src/dos/cdrom_ioctl_linux.cpp b/src/dos/cdrom_ioctl_linux.cpp index a05e0ab..368f931 100644 --- a/src/dos/cdrom_ioctl_linux.cpp +++ b/src/dos/cdrom_ioctl_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dos/cdrom_ioctl_os2.cpp b/src/dos/cdrom_ioctl_os2.cpp index 383ea77..9a9f156 100644 --- a/src/dos/cdrom_ioctl_os2.cpp +++ b/src/dos/cdrom_ioctl_os2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cdrom_ioctl_os2.cpp,v 1.2 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: cdrom_ioctl_os2.cpp,v 1.3 2007/01/08 19:45:39 qbix79 Exp $ */ #include #include "dosbox.h" diff --git a/src/dos/cdrom_ioctl_win32.cpp b/src/dos/cdrom_ioctl_win32.cpp index cfaa5e2..63be508 100644 --- a/src/dos/cdrom_ioctl_win32.cpp +++ b/src/dos/cdrom_ioctl_win32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: cdrom_ioctl_win32.cpp,v 1.13 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: cdrom_ioctl_win32.cpp,v 1.14 2007/01/08 19:45:39 qbix79 Exp $ */ #if defined (WIN32) diff --git a/src/dos/dev_con.h b/src/dos/dev_con.h index 7c7e50e..e5925df 100644 --- a/src/dos/dev_con.h +++ b/src/dos/dev_con.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dev_con.h,v 1.24 2006/02/26 16:05:13 qbix79 Exp $ */ +/* $Id: dev_con.h,v 1.28 2007/01/11 18:08:54 c2woody Exp $ */ #include "dos_inc.h" #include "../ints/int10.h" @@ -33,6 +33,8 @@ public: bool Close(); void ClearAnsi(void); Bit16u GetInformation(void); + bool ReadFromControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode){return false;} + bool WriteToControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode){return false;} private: Bit8u readcache; Bit8u lastwrite; @@ -48,7 +50,6 @@ private: Bit8s savecol; Bit8s saverow; } ansi; - }; bool device_CON::Read(Bit8u * data,Bit16u * size) { @@ -155,6 +156,7 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) { continue; } /*ansi.esc and ansi.sci are true */ + Bit8u page = real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE); switch(data[count]){ case '0': case '1': @@ -265,47 +267,47 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) { case 'H':/* Cursor Pos*/ if(ansi.data[0]==0) ansi.data[0]=1; if(ansi.data[1]==0) ansi.data[1]=1; - INT10_SetCursorPos(--(ansi.data[0]),--(ansi.data[1]),0); /*ansi=1 based, int10 is 0 based */ + INT10_SetCursorPos(--(ansi.data[0]),--(ansi.data[1]),page); /*ansi=1 based, int10 is 0 based */ ClearAnsi(); break; /* cursor up down and forward and backward only change the row or the col not both */ case 'A': /* cursor up*/ - col=CURSOR_POS_COL(0) ; - row=CURSOR_POS_ROW(0) ; + col=CURSOR_POS_COL(page) ; + row=CURSOR_POS_ROW(page) ; tempdata = (ansi.data[0]? ansi.data[0] : 1); if(tempdata > row) { row=0; } else { row-=tempdata;} - INT10_SetCursorPos(row,col,0); + INT10_SetCursorPos(row,col,page); ClearAnsi(); break; case 'B': /*cursor Down */ - col=CURSOR_POS_COL(0) ; - row=CURSOR_POS_ROW(0) ; + col=CURSOR_POS_COL(page) ; + row=CURSOR_POS_ROW(page) ; tempdata = (ansi.data[0]? ansi.data[0] : 1); if(tempdata + static_cast(row) >= ansi.nrows) { row = ansi.nrows - 1;} else { row += tempdata; } - INT10_SetCursorPos(row,col,0); + INT10_SetCursorPos(row,col,page); ClearAnsi(); break; case 'C': /*cursor forward */ - col=CURSOR_POS_COL(0); - row=CURSOR_POS_ROW(0); + col=CURSOR_POS_COL(page); + row=CURSOR_POS_ROW(page); tempdata=(ansi.data[0]? ansi.data[0] : 1); if(tempdata + static_cast(col) >= ansi.ncols) { col = ansi.ncols - 1;} else { col += tempdata;} - INT10_SetCursorPos(row,col,0); + INT10_SetCursorPos(row,col,page); ClearAnsi(); break; case 'D': /*Cursor Backward */ - col=CURSOR_POS_COL(0); - row=CURSOR_POS_ROW(0); + col=CURSOR_POS_COL(page); + row=CURSOR_POS_ROW(page); tempdata=(ansi.data[0]? ansi.data[0] : 1); if(tempdata > col) {col = 0;} else { col -= tempdata;} - INT10_SetCursorPos(row,col,0); + INT10_SetCursorPos(row,col,page); ClearAnsi(); break; case 'J': /*erase screen and move cursor home*/ @@ -313,9 +315,9 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) { if(ansi.data[0]!=2) {/* every version behaves like type 2 */ LOG(LOG_IOCTL,LOG_NORMAL)("ANSI: esc[%dJ called : not supported handling as 2",ansi.data[0]); } - INT10_ScrollWindow(0,0,999,999,0,ansi.attr,0xFF); + INT10_ScrollWindow(0,0,255,255,0,ansi.attr,page); ClearAnsi(); - INT10_SetCursorPos(0,0,0); + INT10_SetCursorPos(0,0,page); break; case 'h': /* SET MODE (if code =7 enable linewrap) */ case 'I': /* RESET MODE */ @@ -323,20 +325,20 @@ bool device_CON::Write(Bit8u * data,Bit16u * size) { ClearAnsi(); break; case 'u': /* Restore Cursor Pos */ - INT10_SetCursorPos(ansi.saverow,ansi.savecol,0); + INT10_SetCursorPos(ansi.saverow,ansi.savecol,page); ClearAnsi(); break; case 's': /* SAVE CURSOR POS */ - ansi.savecol=CURSOR_POS_COL(0); - ansi.saverow=CURSOR_POS_ROW(0); + ansi.savecol=CURSOR_POS_COL(page); + ansi.saverow=CURSOR_POS_ROW(page); ClearAnsi(); break; case 'K':/* erase till end of line (don't touch cursor) */ - col = CURSOR_POS_COL(0); - row = CURSOR_POS_ROW(0); - INT10_WriteChar(' ',ansi.attr,0,ansi.ncols-col,true); //Use this one to prevent scrolling when end of screen is reached + col = CURSOR_POS_COL(page); + row = CURSOR_POS_ROW(page); + INT10_WriteChar(' ',ansi.attr,page,ansi.ncols-col,true); //Use this one to prevent scrolling when end of screen is reached //for(i = col;i<(Bitu) ansi.ncols; i++) INT10_TeletypeOutputAttr(' ',ansi.attr,true); - INT10_SetCursorPos(row,col,0); + INT10_SetCursorPos(row,col,page); ClearAnsi(); break; case 'l':/* (if code =7) disable linewrap */ @@ -367,8 +369,16 @@ Bit16u device_CON::GetInformation(void) { Bit16u head=mem_readw(BIOS_KEYBOARD_BUFFER_HEAD); Bit16u tail=mem_readw(BIOS_KEYBOARD_BUFFER_TAIL); - if ((head==tail) && !readcache) return 0x80D3; /* No Key Available */ - return 0x8093; /* Key Available */ + if ((head==tail) && !readcache) return 0x80D3; /* No Key Available */ + if (real_readw(0x40,head)) return 0x8093; /* Key Available */ + + /* remove the zero from keyboard buffer */ + Bit16u start=mem_readw(BIOS_KEYBOARD_BUFFER_START); + Bit16u end =mem_readw(BIOS_KEYBOARD_BUFFER_END); + head+=2; + if (head>=end) head=start; + mem_writew(BIOS_KEYBOARD_BUFFER_HEAD,head); + return 0x80D3; /* No Key Available */ }; device_CON::device_CON() { diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index cfd2afb..9b40866 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos.cpp,v 1.93 2006/03/08 15:57:23 qbix79 Exp $ */ +/* $Id: dos.cpp,v 1.99 2007/01/13 08:35:49 qbix79 Exp $ */ #include #include @@ -30,6 +30,7 @@ #include "dos_inc.h" #include "setup.h" #include "support.h" +#include "serialport.h" DOS_Block dos; DOS_InfoBlock dos_infoblock; @@ -41,6 +42,18 @@ void DOS_SetError(Bit16u code) { dos.errorcode=code; } +#define DATA_TRANSFERS_TAKE_CYCLES 1 +#ifdef DATA_TRANSFERS_TAKE_CYCLES +#include "cpu.h" +static inline void modify_cycles(Bitu value) { + if((4*value+5) < CPU_Cycles) CPU_Cycles -= 4*value; else CPU_Cycles = 5; +} +#else +static inline void modify_cycles(Bitu /* value */) { + return; +} +#endif + #define DOSNAMEBUF 256 static Bitu DOS_21Handler(void) { if (((reg_ah != 0x50) && (reg_ah != 0x51) && (reg_ah != 0x62) && (reg_ah != 0x64)) && (reg_ah<0x6c)) { @@ -67,7 +80,27 @@ static Bitu DOS_21Handler(void) { } break; case 0x03: /* Read character from STDAUX */ + { + Bit16u port = real_readw(0x40,0); + if(port!=0 && serialports[0]) { + // RTS/DTR on + IO_WriteB(port+4,0x3); + serialports[0]->Getchar(®_al,true, 0xFFFFFFFF); + } + } + break; case 0x04: /* Write Character to STDAUX */ + { + Bit16u port = real_readw(0x40,0); + if(port!=0 && serialports[0]) { + // RTS/DTR on + IO_WriteB(port+4,0x3); + serialports[0]->Putchar(reg_dl,true,true, 0xFFFFFFFF); + // RTS off + IO_WriteB(port+4,0x1); + } + } + break; case 0x05: /* Write Character to PRINTER */ E_Exit("DOS:Unhandled call %02X",reg_ah); break; @@ -499,6 +532,7 @@ static Bitu DOS_21Handler(void) { reg_ax=dos.errorcode; CALLBACK_SCF(true); } + modify_cycles(reg_ax); dos.echo=false; break; } @@ -513,6 +547,7 @@ static Bitu DOS_21Handler(void) { reg_ax=dos.errorcode; CALLBACK_SCF(true); } + modify_cycles(reg_ax); break; }; case 0x41: /* UNLINK Delete file */ @@ -824,8 +859,8 @@ static Bitu DOS_21Handler(void) { break; case 0x63: /* DOUBLE BYTE CHARACTER SET */ if(reg_al == 0) { - SegSet16(ds,RealSeg(dos.tables.dcbs)); - reg_si=RealOff(dos.tables.dcbs); + SegSet16(ds,RealSeg(dos.tables.dbcs)); + reg_si=RealOff(dos.tables.dbcs); reg_al = 0; CALLBACK_SCF(false); //undocumented } else reg_al = 0xff; //Doesn't officially touch carry flag @@ -848,7 +883,7 @@ static Bitu DOS_21Handler(void) { mem_writeb(data + 0x00,reg_al); mem_writew(data + 0x01,0x26); mem_writew(data + 0x03,1); - if(reg_cx > 0x06 ) mem_writew(data+0x05,0x01b5); + if(reg_cx > 0x06 ) mem_writew(data+0x05,dos.loaded_codepage); if(reg_cx > 0x08 ) { Bitu amount = (reg_cx>=0x29)?0x22:(reg_cx-7); MEM_BlockWrite(data + 0x07,dos.tables.country,amount); @@ -856,14 +891,24 @@ static Bitu DOS_21Handler(void) { } CALLBACK_SCF(false); break; + case 0x05: // Get pointer to filename terminator table + mem_writeb(data + 0x00, reg_al); + mem_writed(data + 0x01, dos.tables.filenamechar); + reg_cx = 5; + CALLBACK_SCF(false); + break; + case 0x06: // Get pointer to collating sequence table + mem_writeb(data + 0x00, reg_al); + mem_writed(data + 0x01, dos.tables.collatingseq); + reg_cx = 5; + CALLBACK_SCF(false); + break; case 0x02: // Get pointer to uppercase table case 0x03: // Get pointer to lowercase table case 0x04: // Get pointer to filename uppercase table - case 0x05: // Get pointer to filename terminator table - case 0x06: // Get pointer to collating sequence table case 0x07: // Get pointer to double byte char set table mem_writeb(data + 0x00, reg_al); - mem_writed(data + 0x01, dos.tables.dcbs); //used to be 0 + mem_writed(data + 0x01, dos.tables.dbcs); //used to be 0 reg_cx = 5; CALLBACK_SCF(false); break; @@ -900,7 +945,7 @@ static Bitu DOS_21Handler(void) { case 0x66: /* Get/Set global code page table */ if (reg_al==1) { LOG(LOG_DOSMISC,LOG_ERROR)("Getting global code page table"); - reg_bx=reg_dx=437; + reg_bx=reg_dx=dos.loaded_codepage; CALLBACK_SCF(false); break; } @@ -967,21 +1012,19 @@ static Bitu DOS_21Handler(void) { }; - static Bitu DOS_20Handler(void) { - reg_ax=0x4c00; DOS_21Handler(); return CBRET_NONE; } -static Bitu DOS_27Handler(void) -{ +static Bitu DOS_27Handler(void) { // Terminate & stay resident Bit16u para = (reg_dx/16)+((reg_dx % 16)>0); if (DOS_ResizeMemory(dos.psp(),¶)) DOS_Terminate(true); return CBRET_NONE; } + static Bitu DOS_25Handler(void) { if(Drives[reg_al]==0){ reg_ax=0x8002; @@ -1006,20 +1049,6 @@ static Bitu DOS_26Handler(void) { } return CBRET_NONE; } -static Bitu DOS_28Handler(void) { - return CBRET_NONE; -} - -static Bitu DOS_29Handler(void) { - static bool int29warn=false; - if(!int29warn) { - LOG(LOG_DOSMISC,LOG_WARN)("Int 29 called. Redirecting to int 10:0x0e"); - int29warn=true; - } - reg_ah=0x0e; - CALLBACK_RunRealInt(0x10); - return CBRET_NONE; -} class DOS:public Module_base{ @@ -1042,11 +1071,17 @@ public: callback[4].Install(DOS_27Handler,CB_IRET,"DOS Int 27"); callback[4].Set_RealVec(0x27); - callback[5].Install(DOS_28Handler,CB_IRET,"DOS Int 28"); + callback[5].Install(NULL,CB_IRET,"DOS Int 28"); callback[5].Set_RealVec(0x28); - callback[6].Install(DOS_29Handler,CB_IRET,"CON Output Int 29"); + callback[6].Install(NULL,CB_INT29,"CON Output Int 29"); callback[6].Set_RealVec(0x29); + // pseudocode for CB_INT29: + // push ax + // mov ah, 0x0e + // int 0x10 + // pop ax + // iret DOS_SetupFiles(); /* Setup system File tables */ DOS_SetupDevices(); /* Setup dos devices */ diff --git a/src/dos/dos_classes.cpp b/src/dos/dos_classes.cpp index 8a201f0..1a75e92 100644 --- a/src/dos/dos_classes.cpp +++ b/src/dos/dos_classes.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_classes.cpp,v 1.47 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: dos_classes.cpp,v 1.49 2007/01/08 19:45:39 qbix79 Exp $ */ #include #include @@ -168,13 +168,16 @@ RealPt DOS_InfoBlock::GetPointer(void) { return RealMake(seg,offsetof(sDIB,firstDPB)); } +Bit32u DOS_InfoBlock::GetDeviceChain(void) { + return sGet(sDIB,nulNextDriver); +} + /* program Segment prefix */ Bit16u DOS_PSP::rootpsp = 0; -void DOS_PSP::MakeNew(Bit16u mem_size) -{ +void DOS_PSP::MakeNew(Bit16u mem_size) { /* get previous */ DOS_PSP prevpsp(dos.psp()); /* Clear it first */ diff --git a/src/dos/dos_codepages.h b/src/dos/dos_codepages.h new file mode 100644 index 0000000..9b69f61 --- /dev/null +++ b/src/dos/dos_codepages.h @@ -0,0 +1,1131 @@ +/* + * Copyright (C) Henrique Peron + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +/* This file contains data of .CPI/.CPX-files. They have been + generated by Henrique Peron */ + +/* The font files have been created/edited with CPIadd V1.20 + Copyright (C) 1993-1996 by kostis@acm.org (Kosta Kostis) */ + +/* This file contains data of UPX-compressed CPI files. + UPX, The Ultimate Packer for eXecutables + Copyright (c) 1996-2002 Markus Oberhumer & Laszlo Molnar + http://upx.sourceforge.net */ + + +Bit8u font_ega_cpx[6322] = { +0x81, 0xfc, 0xce, 0xe7, 0x77, 0x02, 0xcd, 0x20, 0xb9, 0xb2, 0x18, 0xbe, 0xb2, 0x19, 0xbf, 0x6e, +0xe7, 0xbb, 0x00, 0x80, 0xfd, 0xf3, 0xa4, 0xfc, 0x87, 0xf7, 0x83, 0xee, 0xc6, 0x19, 0xed, 0x57, +0x57, 0xe9, 0xed, 0xe5, 0x55, 0x50, 0x58, 0x21, 0x0b, 0x01, 0x04, 0x08, 0x6c, 0xfa, 0x36, 0x54, +0x99, 0xe8, 0x0b, 0xa9, 0x00, 0xe6, 0x1a, 0x18, 0x06, 0x74, 0xbb, 0xfc, 0xff, 0x46, 0x4f, 0x4e, +0x54, 0x20, 0x00, 0x00, 0x01, 0x6e, 0x39, 0x01, 0x17, 0x06, 0xfd, 0xfd, 0x06, 0x00, 0x1c, 0x00, +0x4d, 0x26, 0x0e, 0x45, 0x47, 0x41, 0xc9, 0xcd, 0x1e, 0x20, 0xb5, 0x01, 0xfe, 0xd8, 0x35, 0x24, +0x03, 0x00, 0x12, 0x26, 0x10, 0x08, 0x95, 0xc5, 0x0a, 0x00, 0x6d, 0xff, 0x7e, 0x81, 0xa5, 0x81, +0x81, 0xbd, 0x99, 0x03, 0x7e, 0xfe, 0x83, 0x0f, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, +0xe6, 0x77, 0x00, 0x6c, 0xfe, 0x3e, 0xec, 0x7c, 0x38, 0x10, 0x30, 0x10, 0x38, 0x7c, 0xfd, 0xc0, +0x0e, 0x18, 0x3c, 0x3c, 0xe7, 0xb2, 0xb6, 0x00, 0x18, 0x06, 0x0f, 0x65, 0x6e, 0x7e, 0x3b, 0x0f, +0xb3, 0xb3, 0x22, 0x18, 0x09, 0xde, 0xb1, 0xff, 0x00, 0xe7, 0xc3, 0x5f, 0x3f, 0xf6, 0x00, 0x1f, +0x3c, 0x66, 0x42, 0x42, 0x66, 0xff, 0x92, 0x3c, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xfe, 0x21, +0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, 0xde, 0xeb, 0x00, 0x78, 0x20, 0x2d, 0xb9, 0xe6, 0x00, 0x4f, +0x61, 0xbb, 0x9f, 0x0f, 0x3f, 0x33, 0x3f, 0x30, 0x00, 0x70, 0xf0, 0xf9, 0xc8, 0xe0, 0x00, 0x7f, +0x63, 0x7f, 0x63, 0x9e, 0xbd, 0x67, 0xe7, 0xe6, 0xc0, 0x7c, 0x18, 0xdb, 0x87, 0xdd, 0xa0, 0x3c, +0xdb, 0x2e, 0x80, 0xbb, 0xfd, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0x2d, 0xc0, 0x80, 0xbf, 0xfe, +0x1f, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x6b, 0x49, 0x2b, 0x5e, +0x7c, 0x67, 0x3c, 0x00, 0x66, 0x98, 0x9b, 0x07, 0x5f, 0xe7, 0x36, 0xdb, 0x00, 0x7b, 0x1b, 0xff, +0x9b, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0x06, 0xe4, 0xc6, 0x7c, +0x00, 0xfe, 0x43, 0x66, 0x4f, 0x7e, 0x6f, 0x60, 0x0f, 0x00, 0xbd, 0x60, 0x0f, 0x00, 0xfe, 0x96, +0x70, 0x11, 0x0c, 0xfe, 0x0c, 0x77, 0xc9, 0x0c, 0x00, 0x30, 0x60, 0xfe, 0x06, 0xe4, 0x60, 0x30, +0x00, 0xc0, 0x61, 0x56, 0x5c, 0xa1, 0x76, 0x39, 0x28, 0x6c, 0x28, 0x0e, 0x50, 0x58, 0x9f, 0xb2, +0xb7, 0xa0, 0x7c, 0x7d, 0x8a, 0x0e, 0x5b, 0x0e, 0x38, 0xaf, 0xbc, 0xc0, 0x00, 0x18, 0x3c, 0x66, +0xaf, 0x8c, 0x8f, 0x21, 0xeb, 0xe9, 0x24, 0x20, 0x8b, 0xb9, 0x6c, 0x5e, 0x03, 0xad, 0xfe, 0x36, +0xf1, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0x1e, 0xd6, 0xef, 0xc1, 0xc2, 0xc6, 0x26, 0xdf, 0xae, +0x30, 0x60, 0xc6, 0x86, 0x2e, 0x14, 0x0e, 0x0c, 0x76, 0xdc, 0xc1, 0x1a, 0xaf, 0x76, 0xbd, 0x81, +0x6d, 0x00, 0x60, 0x4e, 0x8b, 0xb9, 0x2b, 0x00, 0xe5, 0xb9, 0x59, 0x0f, 0x08, 0x96, 0x8d, 0x00, +0x18, 0xe2, 0x15, 0x16, 0xde, 0xff, 0xe5, 0x84, 0x81, 0xa2, 0xed, 0x06, 0xb6, 0x14, 0x6c, 0xc0, +0x31, 0xfe, 0xd7, 0x96, 0xad, 0x31, 0xf9, 0x15, 0xe2, 0x9f, 0xc0, 0x80, 0xf8, 0x30, 0xae, 0xd6, +0xd6, 0x0e, 0x76, 0xb2, 0x27, 0x38, 0x78, 0x59, 0x10, 0x81, 0x2e, 0xf6, 0xe4, 0x7c, 0xc6, 0xc6, +0xfe, 0x0f, 0xd8, 0x4e, 0x06, 0x3c, 0x02, 0x06, 0xfd, 0x43, 0xdf, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, +0xfe, 0x9c, 0xd0, 0xb0, 0x1e, 0x8d, 0xfe, 0x03, 0xd6, 0xfc, 0x1f, 0x38, 0x90, 0xbb, 0x60, 0x0f, +0xc6, 0xc6, 0xc6, 0x66, 0xee, 0xfe, 0x3f, 0xf3, 0x73, 0xc3, 0x4f, 0x1a, 0x1f, 0x7d, 0x01, 0x0b, +0x7e, 0x0b, 0xdb, 0x3f, 0x0c, 0x78, 0xba, 0x0b, 0x7b, 0x04, 0x0f, 0x62, 0x93, 0x30, 0x9e, 0x92, +0x1a, 0x35, 0x06, 0xc2, 0xc9, 0xde, 0x02, 0x00, 0xf6, 0x62, 0x1b, 0x23, 0x5f, 0x25, 0x4c, 0x0c, +0xdf, 0xb6, 0xb3, 0x10, 0xde, 0x00, 0xdc, 0x61, 0x14, 0xc4, 0x2e, 0x3b, 0xdb, 0x6c, 0x90, 0xfe, +0x0f, 0x6c, 0x3c, 0xfc, 0x66, 0xf1, 0x7c, 0x86, 0xf4, 0xfc, 0x6f, 0xd4, 0x15, 0xef, 0x00, 0xc2, +0xf2, 0xe9, 0xa1, 0x10, 0xf8, 0x6c, 0x3f, 0x7b, 0x6c, 0xf8, 0x0f, 0xfe, 0x66, 0x62, 0x68, 0x84, +0xfc, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0xc0, 0xb6, 0x00, 0xf0, 0x3f, 0x4d, 0x7e, 0xde, 0xc6, +0xc6, 0x66, 0x3a, 0x61, 0xef, 0x69, 0x6e, 0x6f, 0x6b, 0xc2, 0x3c, 0x7d, 0x30, 0x31, 0x26, 0x1e, +0x0d, 0x77, 0x49, 0xef, 0xe6, 0x6a, 0xb3, 0x6e, 0x78, 0x78, 0x74, 0xe6, 0x0f, 0xb3, 0xd8, 0xf0, +0x60, 0x00, 0x6f, 0x92, 0x7f, 0x4f, 0xee, 0xfe, 0xfe, 0xd6, 0xf2, 0xdb, 0x0f, 0xe6, 0xf6, 0xfe, +0xde, 0xce, 0x79, 0x58, 0x6f, 0xc6, 0x9b, 0x2d, 0xdf, 0x41, 0x27, 0xec, 0xf0, 0x1f, 0xd6, 0xde, +0x97, 0xe4, 0x7c, 0x0c, 0x0e, 0xe3, 0x29, 0xd9, 0xe6, 0x1f, 0xe2, 0xb2, 0x42, 0x50, 0x3f, 0x09, +0x7b, 0x7e, 0x7e, 0x5a, 0xaf, 0x16, 0xb2, 0xc6, 0x5f, 0x0f, 0x25, 0x0f, 0x6c, 0x38, 0x10, 0x43, +0xfe, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x6b, 0xa6, 0x6c, 0x8e, 0x61, 0x9f, 0x66, 0x0d, 0xce, +0x0b, 0xcb, 0x4f, 0x1b, 0x86, 0x21, 0x1f, 0x7f, 0xc2, 0x16, 0xec, 0x3c, 0x30, 0x00, 0x1f, 0xfe, +0x0a, 0xc1, 0x70, 0x38, 0x1c, 0x76, 0xb2, 0xaf, 0x3c, 0x0c, 0x00, 0x62, 0x0c, 0x3c, 0xdc, 0x8d, +0x90, 0xe6, 0xec, 0x34, 0x6c, 0xff, 0x18, 0xe9, 0x03, 0x78, 0x0c, 0x7c, 0xaf, 0x16, 0x2e, 0xe0, +0x19, 0x78, 0x66, 0x11, 0xe2, 0xcf, 0x1c, 0x13, 0x02, 0x00, 0xb9, 0xc3, 0xdf, 0x1c, 0x69, 0x2d, +0x2b, 0x00, 0x2f, 0x80, 0x8c, 0x1f, 0xfe, 0xc6, 0xfb, 0x36, 0x32, 0x30, 0x78, 0xaf, 0xcf, 0xf0, +0x5d, 0x76, 0x2e, 0xcc, 0xdf, 0xa1, 0x5f, 0xd2, 0x5f, 0x6c, 0x32, 0x9e, 0x76, 0xe6, 0xdc, 0x03, +0x61, 0x38, 0x4f, 0x6b, 0x4b, 0x09, 0x00, 0xdb, 0x00, 0xcc, 0x10, 0x17, 0x2f, 0x71, 0xc6, 0x00, +0xe6, 0x90, 0x9c, 0x2f, 0x38, 0x35, 0xba, 0x00, 0xec, 0x00, 0x4c, 0xd6, 0x00, 0xc6, 0x0f, 0xdc, +0xcb, 0x66, 0xa1, 0x9f, 0x6c, 0x09, 0x9f, 0x1f, 0xf6, 0xb1, 0x04, 0xf0, 0x9f, 0x90, 0x16, 0xd2, +0x19, 0xed, 0xdc, 0x9f, 0x1f, 0x4c, 0x60, 0xe4, 0x76, 0x09, 0xdf, 0x10, 0xd9, 0xb2, 0xdf, 0xfc, +0xde, 0x36, 0x1c, 0x1f, 0x10, 0x5e, 0x3d, 0x0f, 0x82, 0x31, 0x00, 0x47, 0xc0, 0x0f, 0x00, 0xb7, +0x84, 0x9a, 0x1b, 0x30, 0x53, 0x38, 0x75, 0x2f, 0xd4, 0xb5, 0x04, 0x0c, 0x03, 0x87, 0x52, 0xcc, +0x4f, 0xcd, 0xd9, 0xfe, 0xef, 0x0e, 0x70, 0x64, 0x3d, 0x0e, 0xf7, 0x09, 0x83, 0x3f, 0xda, 0x7b, +0x1b, 0x23, 0x24, 0x40, 0xf8, 0xc9, 0xdc, 0xdf, 0x8b, 0x34, 0xe2, 0x4f, 0x17, 0xd2, 0xcf, 0x18, +0xd8, 0x59, 0x72, 0xcc, 0xbf, 0xe0, 0x4a, 0x39, 0xb8, 0x84, 0xcf, 0x3b, 0x6e, 0x61, 0x1f, 0x2f, +0x7c, 0x60, 0x0f, 0xc0, 0x60, 0x30, 0xb6, 0x84, 0x2e, 0x38, 0x46, 0xc8, 0x2f, 0x3f, 0xde, 0x4b, +0x6f, 0x4f, 0x5c, 0xc2, 0x5f, 0xfd, 0x57, 0xc2, 0x0f, 0xbd, 0x18, 0x32, 0x1f, 0x66, 0x5a, 0xc2, +0x1f, 0x06, 0xde, 0xc2, 0x0f, 0x2f, 0x6b, 0xc0, 0x0f, 0xc6, 0xcf, 0x73, 0x0b, 0x8d, 0x0f, 0x72, +0x09, 0xdc, 0xc7, 0xc8, 0xaf, 0x3f, 0x4e, 0xfe, 0x36, 0x36, 0x7e, 0xd8, 0xd8, 0x6e, 0x3e, 0x1e, +0x3a, 0xdc, 0xfe, 0x0f, 0xce, 0x18, 0xc9, 0xff, 0x3f, 0x84, 0x5d, 0xc6, 0x0f, 0x65, 0xb3, 0xaf, +0x0f, 0x08, 0x8d, 0xf6, 0x4f, 0x71, 0x58, 0x1f, 0xc2, 0x85, 0x1f, 0xc6, 0xef, 0x59, 0x07, 0xc6, +0x9f, 0x65, 0x0d, 0xc6, 0x4f, 0x70, 0x22, 0x71, 0x37, 0xe1, 0x0d, 0xef, 0xd2, 0x70, 0xe0, 0x64, +0x60, 0x03, 0xa1, 0x21, 0x9f, 0x0c, 0xc9, 0x38, 0x7e, 0x0f, 0xdb, 0xb7, 0xf8, 0x69, 0xf8, 0xc4, +0xcc, 0xde, 0x05, 0xc6, 0xe5, 0x19, 0x1f, 0x0e, 0x1b, 0x70, 0x9a, 0x7e, 0xd8, 0x0b, 0xe1, 0x01, +0xaf, 0x42, 0x6a, 0x84, 0x7f, 0xcb, 0xde, 0x0f, 0xcf, 0x21, 0x7b, 0x2f, 0xbf, 0x92, 0x1c, 0x62, +0x5f, 0x04, 0xdc, 0x0c, 0x6f, 0x6e, 0x8d, 0x1c, 0x6c, 0x36, 0x0c, 0x0c, 0x8e, 0xd6, 0x5e, 0x0f, +0x51, 0x0f, 0x98, 0x58, 0x07, 0x48, 0x5d, 0x11, 0xc0, 0x8f, 0x7a, 0x1c, 0xfe, 0x90, 0x34, 0x10, +0x3c, 0xc1, 0xe0, 0xfd, 0xcc, 0xa6, 0x85, 0xe0, 0xa8, 0x6c, 0x0d, 0xac, 0x81, 0xdc, 0x14, 0x3e, +0x0f, 0x60, 0xbf, 0x66, 0xce, 0x9a, 0x3f, 0x22, 0xe8, 0xb9, 0xf7, 0xbc, 0x63, 0xc9, 0x62, 0x85, +0x36, 0xcb, 0xcc, 0x6c, 0xd8, 0x00, 0x6d, 0x76, 0x0d, 0x6c, 0xd8, 0x11, 0x44, 0xe4, 0x85, 0x01, +0x55, 0xaa, 0x21, 0x2f, 0xdd, 0x77, 0x05, 0x76, 0x18, 0x00, 0x0b, 0xd9, 0xf8, 0x0d, 0x0f, 0xcf, +0x26, 0x36, 0x00, 0xf6, 0x36, 0xb0, 0x20, 0xd0, 0x4b, 0xd8, 0x0f, 0x2f, 0xce, 0x23, 0xf6, 0x06, +0x96, 0xc0, 0x00, 0x3d, 0x85, 0x6c, 0x1f, 0x25, 0xa3, 0x2f, 0xba, 0xc9, 0x82, 0x11, 0x0f, 0xac, +0x61, 0x8f, 0x00, 0xc8, 0x86, 0xf8, 0xbf, 0x27, 0x6c, 0x1f, 0x2f, 0x18, 0x18, 0x19, 0x92, 0xff, +0xff, 0x58, 0x23, 0x72, 0x59, 0x5b, 0x1f, 0x3f, 0x21, 0x1b, 0x2d, 0x86, 0x84, 0x1f, 0x0f, 0x37, +0x7b, 0xc2, 0xbf, 0x37, 0x30, 0x3f, 0x6d, 0x52, 0x09, 0xbf, 0xbb, 0xb0, 0x1f, 0xf7, 0x5f, 0x83, +0x2d, 0x6d, 0xf7, 0x2c, 0x64, 0x3f, 0x2f, 0x6c, 0x96, 0x1f, 0x2f, 0x6c, 0xb6, 0x3f, 0x2f, 0x0c, +0xb6, 0xdd, 0xff, 0x2c, 0x24, 0x2f, 0x5f, 0xc8, 0x8e, 0xff, 0xdf, 0x42, 0xc2, 0x86, 0x61, 0xc9, +0xaf, 0xdf, 0x97, 0xb0, 0x3f, 0xef, 0xb9, 0xb0, 0x3f, 0x3f, 0x64, 0x21, 0x4f, 0x10, 0x84, 0x2d, +0x84, 0x91, 0x5f, 0xaf, 0x93, 0x8d, 0x4f, 0xff, 0x2c, 0x64, 0x00, 0x9f, 0x1c, 0x36, 0x00, 0xf0, +0xc9, 0x90, 0x0f, 0x0b, 0x0b, 0x36, 0xf2, 0x61, 0x00, 0x76, 0xdc, 0xd8, 0x08, 0xd2, 0xdc, 0xcf, +0xd3, 0x06, 0x5b, 0xd8, 0xcc, 0xbe, 0x86, 0x45, 0xcc, 0x7f, 0x48, 0x07, 0xad, 0x91, 0x9d, 0x4a, +0xff, 0x35, 0xcc, 0x00, 0x1f, 0xcb, 0xc0, 0xf2, 0x9f, 0x78, 0x7e, 0x00, 0x7e, 0xd8, 0x70, 0x64, +0x92, 0x5f, 0x66, 0x0c, 0x3b, 0xc0, 0x6f, 0x2b, 0x20, 0x1c, 0x8b, 0x20, 0x40, 0xc1, 0x2f, 0xa9, +0x8f, 0xfe, 0xc6, 0x83, 0x25, 0xab, 0xd1, 0x17, 0x6e, 0xee, 0xd6, 0x9c, 0xce, 0x1e, 0x3e, 0x31, +0xb0, 0x2c, 0x6f, 0xb2, 0x0a, 0x82, 0x61, 0x6c, 0xf7, 0x03, 0x06, 0x0f, 0xf3, 0x7e, 0x6c, 0x68, +0x3b, 0x1c, 0x9a, 0x60, 0x09, 0x7d, 0xdf, 0x30, 0x1c, 0xff, 0x25, 0x0b, 0xcd, 0xb2, 0x9a, 0x02, +0x5d, 0x4a, 0x36, 0x50, 0x59, 0x90, 0x3e, 0x10, 0x41, 0x2a, 0x6e, 0x07, 0x66, 0x0f, 0x4f, 0x01, +0xac, 0x1b, 0x11, 0x77, 0x60, 0xff, 0x18, 0x2a, 0x12, 0x42, 0x18, 0x6e, 0x0c, 0x24, 0x97, 0xac, +0x0e, 0x0f, 0xac, 0x61, 0x81, 0x42, 0xf3, 0xb0, 0x00, 0x0f, 0x0c, 0x60, 0xdb, 0xec, 0x34, 0x3c, +0xcf, 0x06, 0xd6, 0x6c, 0x58, 0x5b, 0x24, 0xcf, 0xa0, 0x32, 0xbe, 0x64, 0xbc, 0x00, 0x7e, 0x40, +0x4e, 0x00, 0x2f, 0x18, 0x0e, 0x05, 0x84, 0x05, 0x03, 0x58, 0x70, 0x7e, 0x01, 0x12, 0x1c, 0x7e, +0xff, 0x82, 0x00, 0x12, 0x4c, 0xfd, 0xfb, 0x09, 0x56, 0xf9, 0x04, 0x29, 0x92, 0xe0, 0xf7, 0xf5, +0x49, 0x30, 0xf3, 0x92, 0x60, 0xf1, 0x49, 0x30, 0xef, 0x60, 0x76, 0x78, 0x27, 0xc1, 0x92, 0xec, +0x24, 0x38, 0xeb, 0xea, 0x4e, 0xb0, 0xe9, 0xc1, 0x09, 0xe8, 0x2a, 0x25, 0xe7, 0x4a, 0x60, 0x24, +0xe5, 0x2c, 0x09, 0xe4, 0xa9, 0x12, 0xe3, 0x32, 0x25, 0xc1, 0xe1, 0x90, 0x20, 0xde, 0x48, 0x90, +0xdd, 0x90, 0x60, 0xdb, 0x24, 0xc1, 0xda, 0x82, 0x72, 0x00, 0xde, 0x48, 0xd7, 0x0d, 0xc1, 0x32, +0xe4, 0x20, 0x24, 0xd2, 0x12, 0x9c, 0xd1, 0xcf, 0x82, 0x10, 0x12, 0x4c, 0xcd, 0xcb, 0x09, 0x56, +0xc9, 0x49, 0x30, 0xc7, 0x09, 0x52, 0xc3, 0x02, 0x17, 0x76, 0x12, 0x4c, 0xc1, 0xbe, 0x82, 0x10, +0x12, 0x4c, 0xbd, 0xbc, 0x27, 0x58, 0xbb, 0x20, 0xc1, 0x66, 0xc6, 0xb9, 0x49, 0x70, 0x76, 0x5f, +0x24, 0x48, 0xb5, 0x82, 0xd3, 0x06, 0x64, 0x4b, 0xb3, 0x20, 0x70, 0x82, 0xb0, 0x02, 0x49, 0xae, +0x63, 0xc0, 0x4b, 0xfe, 0xfb, 0x41, 0x08, 0x6b, 0x25, 0xa5, 0x14, 0x49, 0x30, 0xa3, 0x49, 0x70, +0x7e, 0xa1, 0xc1, 0x6b, 0x80, 0x87, 0x25, 0x9f, 0xa3, 0x97, 0x04, 0x9d, 0x1e, 0x80, 0x04, 0x9b, +0x12, 0xbc, 0x1b, 0x99, 0xc1, 0x5b, 0x0d, 0x30, 0x3b, 0x97, 0xd4, 0x1c, 0x48, 0x95, 0x7c, 0x02, +0x12, 0x93, 0x04, 0x8f, 0xaf, 0x82, 0x95, 0x90, 0x58, 0x40, 0x8e, 0xb3, 0x04, 0xaf, 0x1e, 0x82, +0x95, 0x8b, 0x41, 0x42, 0x88, 0xf0, 0x22, 0x87, 0x3c, 0x4a, 0x49, 0x84, 0x41, 0x32, 0xa3, 0x75, +0x20, 0x81, 0xfc, 0x82, 0x25, 0xaf, 0x13, 0x4c, 0x7e, 0x7d, 0x4b, 0x82, 0x7c, 0x68, 0x46, 0xcb, +0x5a, 0xf6, 0xca, 0x0d, 0x12, 0xbc, 0xb8, 0x77, 0x27, 0x58, 0x76, 0x96, 0x04, 0x75, 0x03, 0x09, +0x73, 0x40, 0x82, 0x3c, 0x71, 0x93, 0xe0, 0x78, 0x6f, 0x80, 0x1b, 0x06, 0x78, 0x6c, 0x82, 0x41, +0x6e, 0xf0, 0x04, 0x4b, 0x6c, 0x92, 0xe0, 0x6b, 0x6a, 0x92, 0xd0, 0xf9, 0x26, 0x04, 0x67, 0x7c, +0x03, 0x09, 0x65, 0xc1, 0xb2, 0xf0, 0x1b, 0x24, 0x30, 0x62, 0x61, 0x09, 0x0e, 0xe6, 0x5f, 0x86, +0x2d, 0x37, 0xd9, 0x09, 0x5d, 0x99, 0x42, 0x2a, 0x0a, 0x21, 0xc1, 0x58, 0x91, 0x20, 0x57, 0xb1, +0x19, 0xd7, 0x0d, 0xf0, 0x4a, 0x1c, 0x66, 0x1b, 0x48, 0x53, 0x45, 0xc1, 0x36, 0xf7, 0x8c, 0x82, +0x25, 0x50, 0x82, 0x41, 0x4f, 0x3c, 0xc1, 0x4a, 0x4c, 0xc1, 0x20, 0x4b, 0x3c, 0x0c, 0x24, 0x49, +0xff, 0x01, 0x12, 0x45, 0x18, 0xa9, 0x53, 0x76, 0x0d, 0x24, 0x41, 0xa9, 0x64, 0x35, 0xc0, 0x48, +0x30, 0x3d, 0x97, 0x1d, 0x76, 0x1b, 0xfe, 0x82, 0x24, 0x24, 0x58, 0x39, 0x7c, 0x38, 0x03, 0x06, +0x76, 0x96, 0x48, 0x10, 0x35, 0x12, 0x0c, 0xe6, 0x33, 0x04, 0x07, 0x3c, 0x09, 0x96, 0x31, 0x2f, +0x08, 0x09, 0xbf, 0x5e, 0x6c, 0x26, 0x29, 0x09, 0x09, 0x2b, 0x84, 0x04, 0x09, 0xc3, 0xb2, 0x8b, +0x6b, 0x98, 0xb0, 0x1b, 0x7c, 0x58, 0x76, 0xc1, 0x8b, 0x0e, 0x24, 0x21, 0xf0, 0xc9, 0xcb, 0x37, +0x70, 0x1c, 0x4c, 0x82, 0x1d, 0x58, 0x12, 0x1c, 0x24, 0x24, 0x1a, 0xb3, 0x25, 0xbf, 0x0d, 0x80, +0x04, 0x16, 0x12, 0xb8, 0x19, 0x14, 0x04, 0x58, 0x22, 0x92, 0xe0, 0x7c, 0x11, 0x82, 0x47, 0x83, +0x82, 0x4b, 0x0f, 0x0e, 0x41, 0x42, 0x0d, 0x70, 0x20, 0x0b, 0x70, 0x12, 0x48, 0x09, 0x48, 0x93, +0x66, 0x55, 0xdc, 0x5b, 0x2b, 0xa5, 0x53, 0xc0, 0xa7, 0xb2, 0xb7, 0x04, 0x95, 0x33, 0x0d, 0x84, +0xdb, 0xb4, 0xcc, 0x29, 0x0d, 0xb0, 0xcc, 0xf8, 0x0d, 0x30, 0x19, 0xf9, 0x76, 0xbd, 0x85, 0xf7, +0x61, 0xb7, 0xec, 0x45, 0x53, 0xdd, 0xd7, 0x32, 0x0d, 0x26, 0x98, 0xb0, 0x1b, 0x66, 0x5a, 0x40, +0xdb, 0x05, 0xde, 0xc0, 0x0d, 0x29, 0x01, 0xc9, 0x0d, 0x03, 0x96, 0xe9, 0xe7, 0x5e, 0x09, 0x94, +0x10, 0xb2, 0x19, 0x86, 0x1e, 0xe3, 0xf5, 0xc0, 0x80, 0x6e, 0xe1, 0x30, 0xe0, 0xce, 0xdf, 0x03, +0x36, 0x99, 0xc6, 0x37, 0x90, 0xc6, 0x0d, 0xcb, 0x80, 0xd9, 0x84, 0x65, 0xfb, 0xdb, 0x12, 0x26, +0xc6, 0xb1, 0x09, 0xeb, 0xc6, 0x0b, 0x84, 0xa4, 0xc6, 0xc5, 0x83, 0x07, 0xcf, 0x7f, 0x06, 0x24, +0xcd, 0x30, 0x6b, 0xeb, 0x2b, 0x19, 0xcb, 0x43, 0xde, 0x0e, 0x7c, 0xc1, 0x6f, 0x66, 0xf3, 0x01, +0x03, 0xc7, 0x60, 0x42, 0x66, 0x09, 0x33, 0xc5, 0xb1, 0x2d, 0x61, 0x17, 0xb7, 0xec, 0x0d, 0xb5, +0x29, 0xc0, 0xb2, 0xa7, 0x80, 0x65, 0xbd, 0x40, 0xc2, 0xbb, 0x60, 0x65, 0xb9, 0x90, 0x30, 0xb7, +0xb3, 0x18, 0xb5, 0x53, 0x48, 0x06, 0x5a, 0x24, 0x0c, 0xb1, 0x73, 0x06, 0xaf, 0x63, 0xb0, 0x6d, +0x6e, 0xc3, 0x85, 0x1f, 0x0d, 0x0c, 0xf8, 0x36, 0x6e, 0xda, 0xac, 0x03, 0xdc, 0xd8, 0xaa, 0x01, +0x0b, 0x32, 0xe0, 0xa8, 0xa6, 0x19, 0x10, 0xa3, 0x03, 0x02, 0x9f, 0xe0, 0x2a, 0xf8, 0xb0, 0x32, +0x9b, 0x5b, 0x18, 0x99, 0xb6, 0x03, 0xce, 0x95, 0x01, 0x2b, 0x60, 0x90, 0x93, 0xb0, 0x32, 0x8f, +0x03, 0x1e, 0x8d, 0x8b, 0x01, 0x29, 0x80, 0x95, 0x89, 0x60, 0xc8, 0x87, 0x1f, 0xac, 0x30, 0x83, +0x42, 0x06, 0x51, 0x2b, 0x03, 0x7d, 0x94, 0x01, 0x7b, 0xd9, 0x80, 0x77, 0x1f, 0xc0, 0x08, 0x03, +0x66, 0x75, 0x73, 0x01, 0x2b, 0x30, 0xe0, 0x71, 0x6f, 0x07, 0x8c, 0x6d, 0xca, 0x80, 0x6b, 0x65, +0x40, 0x69, 0xc8, 0x80, 0x67, 0x65, 0xc0, 0x65, 0x01, 0x6e, 0x1b, 0x70, 0x85, 0x61, 0x3f, 0x46, +0x18, 0x5d, 0x18, 0xf0, 0xd1, 0x59, 0x01, 0x53, 0xff, 0x70, 0x85, 0x55, 0xf8, 0x02, 0x18, 0x51, +0x20, 0x03, 0x4d, 0x64, 0x40, 0x49, 0x0c, 0x08, 0x47, 0x30, 0xad, 0x3f, 0x38, 0x0c, 0x44, 0x78, +0xb0, 0x0c, 0x42, 0x60, 0x19, 0x41, 0x90, 0x30, 0x3f, 0x20, 0x19, 0x3d, 0x18, 0x30, 0x3c, 0x7e, +0x0c, 0x0c, 0x3a, 0x60, 0x06, 0x38, 0x30, 0x30, 0x37, 0x6b, 0x19, 0x35, 0x1d, 0x93, 0x91, 0x1d, +0xfe, 0x03, 0x26, 0x31, 0x03, 0x2e, 0xee, 0x2f, 0x80, 0x03, 0x3c, 0x80, 0xc9, 0x2c, 0x7e, 0x96, +0xc0, 0x2a, 0x29, 0x6b, 0xad, 0x78, 0x0b, 0x8f, 0xc2, 0x62, 0x1e, 0xbf, 0x65, 0x40, 0x25, 0x32, +0x60, 0x22, 0x65, 0xc0, 0x20, 0x32, 0x20, 0x1e, 0x60, 0xc0, 0x1c, 0x0c, 0x48, 0x19, 0x01, 0x23, +0x03, 0x96, 0x17, 0x15, 0x64, 0xc0, 0x12, 0x06, 0x0c, 0x18, 0x0f, 0x80, 0x43, 0x3c, 0x1c, 0xc0, +0xca, 0x0d, 0x20, 0x64, 0x0b, 0x2e, 0x30, 0x08, 0x08, 0x2c, 0x03, 0x05, 0x80, 0x03, 0xfc, 0x0c, +0x70, 0xfb, 0xf6, 0xa0, 0x01, 0xf5, 0x6c, 0x00, 0x13, 0xee, 0xda, 0x82, 0xe9, 0x06, 0x38, 0x6b, +0x85, 0x61, 0x0d, 0x0f, 0xd0, 0xda, 0x10, 0x05, 0x20, 0x08, 0xd7, 0x40, 0x10, 0xd1, 0x80, 0x20, +0xcb, 0xf0, 0x41, 0xc5, 0x0f, 0x07, 0x0f, 0x7d, 0x01, 0x0c, 0xbf, 0xba, 0x03, 0x04, 0xb4, 0x50, +0x80, 0xb3, 0xc0, 0x0f, 0xae, 0x67, 0xe6, 0xc0, 0x06, 0x30, 0xa7, 0xa8, 0x75, 0x80, 0x80, 0xa1, +0x03, 0x2c, 0xef, 0x02, 0x9b, 0x38, 0xc0, 0x02, 0x42, 0x00, 0x06, 0x33, 0x06, 0x98, 0x8f, 0x8a, +0xc0, 0x00, 0x89, 0xbb, 0xdb, 0xae, 0x61, 0x49, 0x3c, 0x86, 0x7c, 0xd0, 0xef, 0x05, 0x27, 0x26, +0x4d, 0x80, 0xff, 0x72, 0xc0, 0x3b, 0x35, 0x0f, 0x80, 0x24, 0x65, 0x09, 0x70, 0x5f, 0x59, 0x03, +0x7c, 0x24, 0x66, 0xff, 0x12, 0xf1, 0x80, 0x9f, 0xc0, 0x8b, 0xef, 0x2e, 0x6f, 0x20, 0x3d, 0x46, +0x00, 0x1d, 0x7c, 0x24, 0x8f, 0x86, 0x31, 0x57, 0xdb, 0xea, 0x18, 0x3e, 0x60, 0x58, 0x7c, 0x29, +0x80, 0x86, 0xd7, 0x07, 0x78, 0x23, 0x38, 0x1e, 0x24, 0xab, 0x76, 0xcc, 0xc3, 0x34, 0xf9, 0x30, +0x0f, 0x00, 0xe6, 0x0c, 0x01, 0x92, 0x06, 0x00, 0x83, 0x2d, 0x2b, 0x7e, 0x1a, 0x08, 0xd6, 0xc7, +0xb0, 0xe8, 0xb7, 0xab, 0x47, 0xd6, 0xc3, 0xdd, 0xab, 0x58, 0xc2, 0xc9, 0xf7, 0xe2, 0x1c, 0xe5, +0x07, 0xea, 0x55, 0x3c, 0xb3, 0x0f, 0xce, 0xca, 0x1e, 0x6a, 0x5c, 0xbd, 0xfc, 0x0f, 0xbf, 0xa6, +0xae, 0xbe, 0x7c, 0x43, 0x3d, 0x62, 0x79, 0xb1, 0xab, 0xef, 0x02, 0x07, 0x7e, 0xab, 0xab, 0x17, +0x74, 0x62, 0xbc, 0x37, 0x77, 0x67, 0xb2, 0x7a, 0xaa, 0x94, 0xab, 0x47, 0xa6, 0x8d, 0xcd, 0xea, +0x7c, 0x88, 0xed, 0xca, 0x07, 0x82, 0xc0, 0x78, 0xc4, 0xe2, 0x87, 0x37, 0xaf, 0x4e, 0x6f, 0x75, +0x60, 0x68, 0xc3, 0x38, 0xf5, 0xca, 0xd0, 0x6b, 0x58, 0x7c, 0x69, 0xfe, 0x4a, 0xa1, 0xd9, 0xfe, +0x07, 0xf5, 0x57, 0x9f, 0x1f, 0xce, 0x57, 0x05, 0x2b, 0x52, 0x2d, 0x58, 0x4d, 0x2f, 0x06, 0xab, +0x1e, 0x45, 0xe6, 0x1a, 0x8c, 0x7f, 0xf0, 0x55, 0xb0, 0x39, 0x27, 0x26, 0xa1, 0x6d, 0xa0, 0x13, +0x6c, 0x7a, 0xc3, 0x5e, 0x6f, 0xfc, 0x3d, 0x45, 0x0f, 0xce, 0x7c, 0x0e, 0xda, 0x8b, 0x37, 0x5f, +0x2b, 0xe7, 0xa8, 0x7f, 0x0b, 0x2c, 0xde, 0x57, 0x3d, 0x08, 0x35, 0x56, 0x41, 0x2a, 0xf8, 0x53, +0xbd, 0x00, 0x0c, 0x46, 0x7a, 0x0f, 0x67, 0x27, 0xea, 0x9e, 0xe7, 0x32, 0x6f, 0x3c, 0x40, 0x90, +0xdf, 0x99, 0x3a, 0x97, 0xd9, 0xc5, 0x49, 0xd5, 0x3c, 0x40, 0xe0, 0xe9, 0x91, 0xa9, 0xc3, 0xba, +0xbc, 0xa9, 0x01, 0x76, 0x39, 0x35, 0x80, 0x75, 0xdc, 0x87, 0x09, 0xb8, 0x7f, 0x86, 0x44, 0x26, +0xbb, 0x87, 0x9e, 0x7c, 0x97, 0x60, 0xf8, 0x75, 0x46, 0xf5, 0x76, 0xca, 0x35, 0x09, 0xf8, 0x2f, +0x8b, 0x76, 0x92, 0xaf, 0x7c, 0x15, 0xde, 0x7f, 0x69, 0x70, 0x4f, 0x84, 0x3c, 0x17, 0x24, 0x7a, +0x00, 0xe6, 0x56, 0x22, 0xb5, 0x74, 0x30, 0xa4, 0x52, 0x2c, 0x18, 0x6d, 0x0f, 0x9a, 0x6c, 0x7c, +0x4f, 0x1e, 0x67, 0x91, 0x56, 0x5f, 0x7e, 0xa1, 0x04, 0xa3, 0x87, 0xea, 0x54, 0x4a, 0x58, 0x4c, +0x49, 0xbf, 0x90, 0x62, 0x26, 0x86, 0x54, 0x37, 0x63, 0x11, 0x00, 0x17, 0x7e, 0x83, 0x73, 0x2f, +0x37, 0xdf, 0xf5, 0x54, 0x7e, 0x21, 0x70, 0x90, 0x3a, 0x1f, 0x19, 0xe5, 0xde, 0x0c, 0x12, 0x92, +0x9a, 0x6b, 0x07, 0xa3, 0xc3, 0xc6, 0xff, 0x36, 0x1b, 0xcc, 0x5f, 0x3b, 0x46, 0xb3, 0xe7, 0xf0, +0xb3, 0x6e, 0x6f, 0xcc, 0x07, 0xb6, 0xc9, 0x60, 0x30, 0x17, 0x38, 0x09, 0x4d, 0xbf, 0x82, 0xd1, +0x70, 0xd2, 0x9d, 0x19, 0x97, 0x07, 0x30, 0x8c, 0x82, 0x3f, 0xc0, 0x98, 0x1b, 0x3c, 0x1f, 0x07, +0x8e, 0xb9, 0x17, 0x07, 0xc6, 0x10, 0x73, 0x33, 0x68, 0x47, 0x27, 0x33, 0x81, 0x0d, 0x2c, 0x3a, +0x69, 0xf8, 0xa1, 0xec, 0xa3, 0x85, 0x7f, 0x6e, 0x97, 0xd4, 0xd1, 0x96, 0xce, 0xa3, 0x60, 0x90, +0x47, 0x9b, 0x0d, 0x57, 0x07, 0x82, 0x91, 0x7e, 0x9d, 0xf0, 0x8f, 0x0f, 0xc6, 0x70, 0x9a, 0xf7, +0x98, 0x7a, 0xef, 0x17, 0x0e, 0x27, 0xa6, 0x66, 0x4a, 0x55, 0x80, 0x23, 0x47, 0x5a, 0x59, 0xc8, +0x11, 0x1d, 0x42, 0xc5, 0x53, 0x18, 0x1d, 0xfd, 0xfa, 0xc6, 0xcf, 0xc6, 0xc7, 0x48, 0x3c, 0xa3, +0x47, 0x47, 0x42, 0xb3, 0x37, 0xf7, 0x9f, 0xf6, 0x62, 0xff, 0x3f, 0x5f, 0x30, 0x0a, 0x2a, 0x31, +0xdc, 0x07, 0xb8, 0x4a, 0x46, 0x1f, 0xd1, 0x30, 0x19, 0x93, 0x9b, 0x12, 0x08, 0xa1, 0x0d, 0xa3, +0x06, 0xe6, 0xbf, 0x07, 0x63, 0xe6, 0x6c, 0x7e, 0x33, 0x66, 0xcc, 0x0f, 0xa1, 0xf6, 0x7a, 0x36, +0x6a, 0xdf, 0x11, 0xf4, 0xee, 0x35, 0x10, 0x16, 0xdd, 0xc3, 0x66, 0x33, 0xcf, 0x66, 0x09, 0x22, +0x42, 0xb3, 0x88, 0x01, 0xd9, 0x10, 0x1a, 0xd4, 0x95, 0xd0, 0xca, 0x34, 0xa1, 0x9a, 0xa1, 0x21, +0xbe, 0xb8, 0x08, 0x0d, 0xb2, 0x48, 0x68, 0xac, 0x96, 0xd0, 0xa0, 0xd0, 0x84, 0x9a, 0x84, 0x86, +0x94, 0x8e, 0x84, 0x0e, 0xf8, 0x82, 0x08, 0x05, 0x7c, 0x08, 0x1d, 0xff, 0x70, 0x16, 0x0b, 0x0f, +0x1f, 0x10, 0x1a, 0x5e, 0x3c, 0x14, 0x52, 0x37, 0xa1, 0x84, 0x4c, 0x25, 0x34, 0x46, 0xd0, 0xa1, +0x40, 0x84, 0x96, 0x3a, 0x34, 0x21, 0x34, 0x2e, 0x0d, 0xa1, 0x28, 0x6e, 0x09, 0x22, 0x0f, 0xa1, +0x61, 0x6f, 0x10, 0x42, 0x01, 0x0a, 0x31, 0x5b, 0x77, 0x6f, 0x60, 0xfe, 0x27, 0x06, 0x16, 0xf2, +0x78, 0xc3, 0xd7, 0x27, 0x31, 0xb0, 0xdd, 0x62, 0x60, 0xd7, 0xc4, 0xc0, 0xcb, 0x17, 0x93, 0x81, +0xc8, 0xc1, 0x88, 0x45, 0x78, 0xbc, 0xb3, 0xd8, 0x5d, 0xfe, 0xb6, 0x18, 0x16, 0xb0, 0x16, 0xb1, +0xab, 0xa9, 0x60, 0x71, 0x7e, 0xa3, 0xe2, 0x8b, 0x9c, 0xc0, 0x16, 0xc3, 0x98, 0x92, 0xf1, 0x22, +0x91, 0xc7, 0xe9, 0xd6, 0x97, 0x86, 0xe2, 0x8b, 0x85, 0x0e, 0x2c, 0xc6, 0x80, 0x3c, 0x7a, 0xef, +0xd5, 0x8f, 0x07, 0x0b, 0x17, 0x73, 0x6f, 0xf5, 0xa2, 0x7e, 0x6d, 0xde, 0x9b, 0xff, 0x66, 0x01, +0x36, 0x0c, 0x2e, 0x29, 0x17, 0x81, 0x9e, 0x07, 0x5e, 0x38, 0x05, 0x4f, 0x25, 0x2c, 0x4b, 0xcc, +0xe2, 0x7f, 0x3e, 0x63, 0x59, 0x38, 0x87, 0x90, 0xc5, 0x2c, 0x2c, 0xbe, 0x06, 0x0f, 0x1f, 0x62, +0x31, 0x1b, 0xc2, 0xbd, 0xdd, 0x50, 0x5d, 0x45, 0x3d, 0x79, 0x3c, 0x88, 0x24, 0x20, 0x37, 0x33, +0x81, 0x4c, 0x1c, 0x39, 0x52, 0x03, 0x69, 0x26, 0x11, 0x84, 0x20, 0x90, 0x16, 0x22, 0x00, 0x78, +0xf9, 0x04, 0x7c, 0xce, 0xd6, 0xe6, 0x7c, 0x40, 0x2b, 0x83, 0x33, 0xda, 0x7b, 0x1c, 0x1d, 0x1e, +0x50, 0xc3, 0x1f, 0x10, 0xe7, 0x7c, 0x01, 0x61, 0x33, 0x76, 0x3f, 0x7c, 0x82, 0xb2, 0xaa, 0xaa, +0x02, 0x82, 0x7c, 0xc2, 0x20, 0x33, 0xd4, 0x2a, 0x2c, 0xa2, 0x8d, 0xa3, 0x85, 0x85, 0x0f, 0x2d, +0xe4, 0x60, 0x30, 0xdd, 0xc5, 0xef, 0x9a, 0xa2, 0x00, 0x9a, 0x20, 0x62, 0xef, 0x84, 0xca, 0x33, +0x95, 0x45, 0x53, 0xb2, 0x88, 0x43, 0x06, 0x11, 0x33, 0x1a, 0x44, 0x11, 0xb3, 0xd0, 0xb9, 0x64, +0x93, 0x0c, 0x88, 0x84, 0xff, 0x28, 0x32, 0x33, 0x6a, 0x52, 0x0f, 0x82, 0x31, 0x41, 0xc6, 0xf3, +0xb1, 0x83, 0x34, 0x18, 0x2c, 0x06, 0x92, 0xa0, 0x03, 0x43, 0xe4, 0xf6, 0xbf, 0x30, 0x8a, 0x53, +0x0b, 0xbb, 0xc6, 0x0f, 0x30, 0x8a, 0x30, 0x73, 0x46, 0x0c, 0x1c, 0xe4, 0x48, 0x0f, 0x5a, 0x12, +0x03, 0x61, 0x06, 0xc4, 0x0f, 0x42, 0x72, 0x00, 0xca, 0x20, 0x33, 0x9b, 0x85, 0x40, 0x47, 0xec, +0x05, 0x9f, 0x7f, 0x85, 0x85, 0x36, 0x04, 0xbd, 0x9f, 0x88, 0x91, 0x43, 0xde, 0x32, 0x33, 0xff, +0xec, 0xc2, 0x1f, 0x30, 0x2f, 0x30, 0xac, 0xd2, 0x16, 0xa4, 0xf4, 0x0c, 0x31, 0x5b, 0x0f, 0x56, +0x06, 0x33, 0xfa, 0x00, 0xc3, 0x7c, 0x01, 0x01, 0xa3, 0x14, 0xb3, 0xf0, 0x0e, 0x90, 0xef, 0x2c, +0x8f, 0xc6, 0x49, 0x37, 0x7f, 0xc6, 0x09, 0x0b, 0x0f, 0xe2, 0x55, 0x11, 0xb7, 0xa4, 0x73, 0x0c, +0x90, 0x20, 0x73, 0x85, 0x91, 0x39, 0x81, 0xbd, 0x5f, 0x00, 0x2d, 0x21, 0xbb, 0x42, 0x16, 0x10, +0x09, 0xa1, 0xe7, 0x8a, 0x6f, 0xbd, 0x30, 0x62, 0x36, 0xec, 0xd1, 0x32, 0xa3, 0x56, 0x59, 0x33, +0xc8, 0x20, 0x33, 0x59, 0xd1, 0x0b, 0x59, 0x34, 0x78, 0x1d, 0xcd, 0x18, 0x94, 0xb0, 0x95, 0x2a, +0x0a, 0x1e, 0x11, 0xd0, 0x82, 0xcb, 0x0f, 0x7c, 0x20, 0x9a, 0x21, 0x7c, 0x22, 0xc0, 0x33, 0x45, +0x8a, 0x03, 0x5a, 0x1d, 0xcf, 0x83, 0xb8, 0xe6, 0x7c, 0x80, 0x33, 0x01, 0x23, 0x0c, 0x98, 0xcb, +0xca, 0x02, 0x90, 0x13, 0x0c, 0x62, 0x33, 0x8c, 0x02, 0x00, 0x07, 0xb3, 0x06, 0xf1, 0xb2, 0x33, +0x02, 0x05, 0x01, 0x03, 0x9b, 0x84, 0x01, 0x99, 0xc2, 0x80, 0x97, 0x65, 0x40, 0x95, 0xf1, 0x80, +0x94, 0x44, 0x06, 0x33, 0x2c, 0x22, 0x0f, 0x07, 0x8c, 0x89, 0x41, 0x98, 0x02, 0x90, 0x33, 0x2e, +0x03, 0x79, 0x76, 0x03, 0x03, 0x77, 0x83, 0x70, 0xdf, 0x33, 0xa4, 0x0a, 0x4b, 0x06, 0x67, 0x03, +0x60, 0x40, 0x65, 0x04, 0x68, 0xe9, 0x16, 0x99, 0xf6, 0x95, 0x10, 0x8a, 0xcf, 0x03, 0x3b, 0xc6, +0x0d, 0x12, 0x8a, 0x30, 0xeb, 0x42, 0xb1, 0x0b, 0x32, 0x60, 0x59, 0x90, 0xdf, 0x0d, 0x3c, 0x66, +0x09, 0x39, 0x00, 0x64, 0x10, 0x33, 0xc4, 0x42, 0x38, 0x80, 0x20, 0x57, 0xec, 0xc0, 0x49, 0x3c, +0x22, 0x03, 0xce, 0x45, 0x88, 0x23, 0x7c, 0x10, 0x32, 0x33, 0x60, 0x19, 0x41, 0x64, 0x26, 0x56, +0x29, 0x30, 0x60, 0x30, 0xb7, 0x6c, 0x7c, 0x0a, 0x0d, 0x32, 0x88, 0x33, 0x1e, 0xb0, 0x37, 0xe4, +0x03, 0x35, 0xe0, 0x1e, 0x30, 0x34, 0x2e, 0x03, 0x33, 0x7c, 0x42, 0xc6, 0x6f, 0xc6, 0x60, 0x59, +0x0d, 0xc5, 0x32, 0x2d, 0x03, 0x1c, 0xcb, 0x2b, 0x13, 0x2c, 0x1a, 0xca, 0x80, 0x27, 0x56, 0x34, +0x56, 0x80, 0x14, 0x78, 0xc0, 0x1f, 0x63, 0x36, 0xec, 0x34, 0xa3, 0x15, 0x54, 0x46, 0x73, 0xc0, +0x80, 0x19, 0x06, 0x3c, 0x18, 0x70, 0x15, 0x32, 0x60, 0x13, 0x03, 0x06, 0x18, 0x0f, 0xc0, 0x02, +0x20, 0x62, 0x0d, 0x00, 0xc2, 0x33, 0x47, 0x83, 0x5f, 0xc4, 0xa3, 0x5e, 0x3d, 0x18, 0x33, 0x00, +0x3a, 0x6c, 0x30, 0xda, 0x0f, 0x6c, 0xb8, 0x4e, 0x18, 0xc4, 0x33, 0x28, 0x14, 0x0e, 0xcd, 0x0c, +0x39, 0xc2, 0x20, 0x33, 0x68, 0x09, 0x97, 0x16, 0x89, 0x6b, 0x9c, 0xc9, 0xb3, 0x07, 0x60, 0x30, +0xd0, 0xa1, 0xb2, 0x0c, 0xe2, 0xb1, 0x33, 0x11, 0xa1, 0x88, 0x20, 0x43, 0x44, 0x90, 0x3b, 0x10, +0x19, 0x33, 0x30, 0xa1, 0x5e, 0xc4, 0xec, 0x17, 0x7f, 0x10, 0x19, 0x33, 0xdf, 0xa1, 0x28, 0xcd, +0x76, 0xe2, 0xd0, 0x18, 0x6c, 0x22, 0x95, 0x8f, 0x9b, 0xf6, 0x22, 0x0e, 0x19, 0xb1, 0xd6, 0x44, +0x59, 0x06, 0x45, 0x6c, 0x07, 0x30, 0x10, 0x92, 0x53, 0x9f, 0x22, 0x50, 0xe6, 0x16, 0x2c, 0xfb, +0x06, 0x10, 0x6e, 0x07, 0x0a, 0x65, 0x33, 0x1b, 0x24, 0x20, 0x30, 0x3f, 0x86, 0x05, 0x1b, 0x1c, +0x11, 0x57, 0x12, 0xc1, 0x20, 0x33, 0xf0, 0x0e, 0x5f, 0x0f, 0x16, 0xef, 0x5f, 0x07, 0x9f, 0x8b, +0x0d, 0x7c, 0xef, 0x27, 0x19, 0xc4, 0x33, 0x3c, 0x8a, 0x5a, 0x2f, 0x5e, 0x89, 0x93, 0x45, 0x73, +0x07, 0x47, 0x98, 0x9b, 0x6f, 0xbf, 0x07, 0x23, 0xd8, 0x30, 0x0f, 0x4f, 0x5f, 0x84, 0xd3, 0x0c, +0xf1, 0x0e, 0x79, 0x77, 0x63, 0x65, 0x6b, 0x4d, 0x19, 0xc4, 0x33, 0xc1, 0x22, 0x53, 0x40, 0xff, +0xe1, 0x32, 0xe4, 0x3a, 0xf6, 0x2a, 0x5f, 0x86, 0xa0, 0x20, 0x34, 0x45, 0x12, 0x33, 0x8b, 0x81, +0x3e, 0x35, 0x8b, 0x87, 0x87, 0x2e, 0x8b, 0x21, 0x18, 0x21, 0x20, 0x0e, 0x3c, 0x6c, 0xf1, 0x2b, +0x7a, 0x78, 0x90, 0x41, 0x33, 0x01, 0x39, 0xb5, 0x72, 0xc1, 0x93, 0x54, 0x9d, 0x4c, 0x44, 0x56, +0x67, 0x4a, 0x52, 0x09, 0x80, 0x68, 0x44, 0x35, 0xca, 0x2a, 0xa7, 0x05, 0xe6, 0xc0, 0x5a, 0x59, +0x67, 0x80, 0x1f, 0xff, 0x1a, 0x1e, 0x1c, 0x8b, 0x8d, 0x37, 0x58, 0xd6, 0x56, 0xc1, 0x67, 0xa5, +0x46, 0x49, 0x64, 0x01, 0x83, 0x4c, 0x36, 0x33, 0x12, 0x7c, 0x65, 0x15, 0x67, 0x10, 0x6e, 0x6c, +0x60, 0x49, 0x97, 0x29, 0xab, 0x67, 0x88, 0x70, 0x1f, 0x05, 0x4b, 0x27, 0x4b, 0x59, 0x67, 0x37, +0x16, 0x44, 0xb7, 0xac, 0x12, 0x3f, 0x48, 0x16, 0x5f, 0xca, 0x2a, 0x67, 0x65, 0x9f, 0x00, 0xf6, +0x62, 0x64, 0x3f, 0xc8, 0xbb, 0x00, 0x76, 0x32, 0x34, 0x30, 0x88, 0xd9, 0x78, 0x4f, 0x2c, 0x2c, +0xa7, 0x80, 0x38, 0x1f, 0x05, 0xcb, 0xb7, 0x17, 0x59, 0x67, 0x36, 0x2c, 0x88, 0x1c, 0xd7, 0x88, +0x87, 0x06, 0x12, 0x34, 0x0d, 0x0c, 0xe7, 0x93, 0xbf, 0xbf, 0x64, 0x6c, 0x78, 0x70, 0xe0, 0xe0, +0x65, 0x10, 0x33, 0x09, 0x20, 0xd6, 0x58, 0x82, 0x8f, 0xca, 0x2a, 0x67, 0x25, 0xac, 0x5f, 0x09, +0xd5, 0x18, 0xa1, 0xdc, 0xb0, 0x4f, 0x0f, 0x90, 0xd0, 0x6d, 0x8f, 0x41, 0xbc, 0x7f, 0x21, 0x21, +0x37, 0x7f, 0x92, 0x2d, 0x3f, 0x59, 0x10, 0xff, 0x0f, 0x57, 0x85, 0xaf, 0x29, 0x1e, 0x54, 0xf0, +0xe8, 0x65, 0xc3, 0x8f, 0x3f, 0x21, 0xb8, 0xf4, 0xcf, 0x0b, 0x22, 0x07, 0x1e, 0x03, 0x5f, 0xc8, +0x20, 0x33, 0x25, 0x8b, 0x41, 0x0b, 0xfd, 0x18, 0x59, 0x63, 0x70, 0xcb, 0x0f, 0xaf, 0x2a, 0x83, +0x33, 0xc8, 0x18, 0x18, 0xff, 0x84, 0xd9, 0x12, 0x2f, 0x19, 0xc4, 0x33, 0x6d, 0x15, 0xd4, 0x68, +0x61, 0xff, 0x61, 0x9c, 0x49, 0x1f, 0x30, 0x88, 0x33, 0x9c, 0x00, 0x0c, 0x7e, 0x21, 0x45, 0x27, +0x0c, 0x22, 0x33, 0xe2, 0xb0, 0xaf, 0x0b, 0x81, 0x47, 0x91, 0x90, 0xc6, 0x29, 0xc2, 0x7f, 0x67, +0xe2, 0x2d, 0x2f, 0x2c, 0x09, 0x67, 0x95, 0x41, 0x33, 0x0e, 0x69, 0x8f, 0xfe, 0x06, 0x71, 0x33, +0x62, 0x55, 0x03, 0x2b, 0xf7, 0x06, 0x1c, 0x4f, 0x8d, 0x62, 0x59, 0x3f, 0xaa, 0x0c, 0x33, 0xc2, +0xdc, 0x2f, 0xdf, 0x62, 0x52, 0x8f, 0x2d, 0x29, 0xc7, 0xb7, 0xec, 0xcf, 0x0f, 0x0d, 0x8d, 0x2c, +0xef, 0xcd, 0x9a, 0xef, 0xef, 0x81, 0xe2, 0x4f, 0xc7, 0x20, 0x26, 0xf6, 0xd8, 0xca, 0x33, 0x5f, +0x29, 0x22, 0xe7, 0x78, 0x30, 0x0f, 0x08, 0x83, 0x33, 0x15, 0xb1, 0x86, 0x80, 0x07, 0x0f, 0x65, +0x10, 0x33, 0x98, 0x0b, 0x5f, 0x00, 0x96, 0x56, 0x43, 0x3c, 0x12, 0x00, 0xfc, 0x51, 0x10, 0x88, +0x85, 0x71, 0x28, 0x30, 0x33, 0xa4, 0xec, 0x18, 0x37, 0x04, 0x1e, 0xff, 0x7f, 0x04, 0xb7, 0x3a, +0x3f, 0x96, 0xb0, 0x7f, 0x05, 0x13, 0x2f, 0x45, 0x59, 0x67, 0x68, 0x14, 0x55, 0x60, 0x6d, 0xcc, +0x91, 0x9f, 0xc0, 0xb2, 0x0a, 0x67, 0x18, 0x30, 0xf5, 0xf0, 0x22, 0xa4, 0x84, 0x55, 0x67, 0xcb, +0x80, 0xf1, 0xc0, 0x80, 0x7c, 0xef, 0xab, 0xe0, 0x7c, 0x67, 0x70, 0x21, 0x5e, 0x40, 0x82, 0x31, +0x65, 0x40, 0xe9, 0x41, 0xbc, 0x1b, 0x82, 0x65, 0x8f, 0x2c, 0xac, 0x67, 0x1b, 0x06, 0xe3, 0x0d, +0x19, 0x10, 0xe1, 0x55, 0x70, 0x3c, 0x20, 0x94, 0x67, 0x62, 0x33, 0xdb, 0x37, 0x2e, 0x03, 0xd9, +0x78, 0x2c, 0x03, 0xd7, 0x96, 0x10, 0x9b, 0x30, 0x20, 0x6d, 0x56, 0xc1, 0x67, 0x80, 0x15, 0x80, +0xcb, 0xcf, 0x3c, 0x40, 0xc0, 0xcd, 0x6f, 0x67, 0xcc, 0x78, 0x08, 0x3c, 0x38, 0x70, 0xa2, 0xd0, +0xf2, 0x36, 0x3f, 0x8d, 0x0c, 0x33, 0x87, 0x19, 0x47, 0x4f, 0x59, 0x05, 0x67, 0x84, 0x41, 0x33, +0x00, 0x94, 0xcd, 0x82, 0xb6, 0x45, 0x82, 0xa1, 0x0d, 0xca, 0x5d, 0x0c, 0x58, 0xb7, 0x61, 0xb6, +0xfb, 0x4f, 0x86, 0x2d, 0x37, 0x62, 0x13, 0xbf, 0x0d, 0x3b, 0x03, 0xb1, 0x66, 0x7d, 0x86, 0x25, +0x37, 0x96, 0xe0, 0xd5, 0x95, 0x92, 0x20, 0x93, 0x88, 0xc7, 0x13, 0xaa, 0x30, 0x33, 0x02, 0x49, +0x56, 0xf0, 0xed, 0x9d, 0x12, 0x06, 0xcd, 0x20, 0x5a, 0x99, 0x86, 0xc8, 0x33, 0x18, 0xb6, 0x30, +0x9f, 0x10, 0x31, 0x61, 0x09, 0x15, 0x06, 0x33, 0x0c, 0x58, 0x79, 0x06, 0x04, 0x77, 0x10, 0x07, +0x76, 0x01, 0x65, 0x33, 0xc1, 0x80, 0x65, 0x32, 0x88, 0x76, 0x33, 0x19, 0x10, 0x61, 0x10, 0x2f, +0x0d, 0x20, 0x61, 0x33, 0xe0, 0x32, 0x5d, 0x76, 0x91, 0x30, 0x5b, 0x45, 0x06, 0x33, 0x19, 0xa4, +0x1d, 0xfe, 0x19, 0xc4, 0x33, 0x88, 0x14, 0xb1, 0xa4, 0xe5, 0x32, 0xa0, 0x05, 0x49, 0x0c, 0xe2, +0x7c, 0x33, 0x40, 0x8a, 0x20, 0x60, 0x3f, 0x90, 0x30, 0x3d, 0x4b, 0x18, 0x3b, 0x0b, 0x16, 0xd6, +0x51, 0x66, 0xcd, 0xd1, 0x51, 0x2e, 0x03, 0x35, 0xe6, 0xc8, 0x20, 0x33, 0x65, 0x40, 0x31, 0x78, +0xc0, 0xf0, 0x2f, 0x02, 0x83, 0x33, 0x14, 0x11, 0x88, 0x97, 0x13, 0x0c, 0x38, 0x04, 0x32, 0x33, +0x14, 0x06, 0x23, 0x0c, 0xf8, 0x30, 0x1c, 0x6c, 0x38, 0x1d, 0x10, 0x2b, 0x01, 0x60, 0x33, 0xc0, +0x8c, 0xf5, 0x63, 0x65, 0x0f, 0x21, 0x80, 0x30, 0x17, 0xcb, 0x80, 0x0b, 0xac, 0x82, 0xf0, 0x67, +0x08, 0x02, 0x70, 0x10, 0x09, 0xc9, 0x2a, 0x87, 0xb1, 0x07, 0x61, 0x05, 0x87, 0x5c, 0xb5, 0xac, +0xab, 0xe0, 0x30, 0x70, 0xdc, 0x67, 0x0a, 0x06, 0x63, 0x18, 0x4d, 0x73, 0xc0, 0x55, 0x30, 0x7c, +0xfe, 0x83, 0x67, 0x0c, 0x18, 0xfe, 0x86, 0x1c, 0x70, 0xc2, 0xfe, 0x68, 0x41, 0x0f, 0xc4, 0x2a, +0xe1, 0x60, 0x15, 0x67, 0x67, 0xe8, 0x0c, 0xd8, 0x21, 0x07, 0xc6, 0x68, 0x06, 0x6c, 0xa5, 0x3c, +0xb2, 0x0a, 0x67, 0xef, 0x16, 0x07, 0xc2, 0xc4, 0x1f, 0xa3, 0x02, 0x88, 0x8d, 0x60, 0x17, 0x37, +0x7e, 0xc2, 0x0b, 0xdc, 0x17, 0x86, 0xfc, 0xdb, 0x00, 0x5e, 0x10, 0x08, 0xb2, 0x0a, 0x67, 0x78, +0x14, 0x63, 0xed, 0xb1, 0x2d, 0x23, 0x61, 0xf2, 0x2e, 0x1b, 0x88, 0x68, 0xd9, 0x3c, 0x78, 0xc3, +0xe8, 0xf0, 0x30, 0x3e, 0x4e, 0x31, 0x6b, 0x04, 0xc1, 0x50, 0x06, 0x33, 0x1e, 0xbd, 0xad, 0x27, +0x1e, 0xcd, 0x25, 0x21, 0xe2, 0xcd, 0xc7, 0x5f, 0x99, 0x01, 0xcf, 0xbd, 0x8b, 0xb9, 0x1f, 0xfd, +0x07, 0x7c, 0x74, 0x7c, 0xc2, 0x05, 0xc2, 0xc5, 0x1e, 0x67, 0x1f, 0xd9, 0xac, 0x27, 0xe7, 0xa5, +0x10, 0x86, 0x2f, 0x05, 0x60, 0x33, 0x40, 0xb8, 0xbf, 0x3c, 0xe1, 0x5b, 0x05, 0x30, 0xe0, 0x95, +0x41, 0x33, 0xf2, 0x2c, 0xb7, 0x18, 0x18, 0x0c, 0x62, 0x33, 0x43, 0x88, 0xf9, 0xc9, 0x87, 0x11, +0xc6, 0x7c, 0x32, 0x88, 0x33, 0x12, 0xa1, 0xc8, 0x98, 0xd0, 0x3e, 0x9f, 0x30, 0x83, 0x33, 0xc4, +0x60, 0xcd, 0xfc, 0x3f, 0x18, 0x33, 0x00, 0x3b, 0x19, 0x1a, 0x78, 0xc2, 0xc4, 0xd8, 0xd8, 0x18, +0x11, 0x0b, 0xa0, 0x42, 0x06, 0x33, 0x38, 0x1c, 0xc7, 0x79, 0x28, 0x83, 0x33, 0x4e, 0x6a, 0x7e, +0x0d, 0x38, 0x18, 0x2c, 0xd1, 0x7c, 0x28, 0x83, 0x33, 0xcc, 0x5a, 0x17, 0x6f, 0xbd, 0x5f, 0x56, +0xe6, 0xc6, 0x11, 0x13, 0x86, 0x07, 0x71, 0x11, 0x0c, 0xff, 0xd1, 0x6e, 0x6b, 0x1f, 0xaa, 0xfc, +0x39, 0x32, 0x88, 0x0c, 0x23, 0x63, 0x7b, 0xce, 0xf0, 0xe0, 0xb8, 0x63, 0x88, 0x19, 0xc4, 0x33, +0xf1, 0x5d, 0x18, 0x88, 0x0e, 0x0c, 0xa2, 0x07, 0x33, 0x58, 0x84, 0x5f, 0xf1, 0x58, 0x67, 0x62, +0x61, 0x4d, 0x08, 0x0c, 0x33, 0x6f, 0x42, 0xb1, 0x4f, 0xb9, 0x19, 0xbf, 0x1c, 0xb6, 0xf6, 0xa0, +0xce, 0x07, 0x97, 0xd8, 0x06, 0x61, 0x33, 0xc9, 0x53, 0xe9, 0x74, 0x50, 0x7a, 0x72, 0x55, 0xd1, +0x72, 0xc8, 0x88, 0x9b, 0x49, 0x8a, 0x01, 0x50, 0x85, 0x24, 0x22, 0x06, 0x83, 0x51, 0x0f, 0x33, +0x55, 0x19, 0x9b, 0xf1, 0x68, 0x5f, 0x40, 0x06, 0x33, 0x36, 0xa1, 0x6a, 0xaf, 0x98, 0x5b, 0x0c, +0x2f, 0x88, 0x4a, 0xa1, 0xc0, 0x9b, 0x30, 0x82, 0x18, 0x53, 0x11, 0xb5, 0x2f, 0x95, 0x9b, 0x7f, +0x09, 0x54, 0xdb, 0xab, 0x60, 0x67, 0x7a, 0x0b, 0xdf, 0x4b, 0xa2, 0xfb, 0x65, 0x10, 0x33, 0x57, +0x7c, 0x08, 0x1c, 0x36, 0x88, 0x2c, 0x22, 0x7d, 0x46, 0xd4, 0x9b, 0x0b, 0x15, 0x34, 0x1b, 0x99, +0x8f, 0x12, 0x6e, 0x99, 0xbf, 0xcc, 0x59, 0x54, 0x9b, 0x54, 0x6f, 0xcc, 0x1b, 0x19, 0xab, 0x00, +0x44, 0x2d, 0x6e, 0x65, 0x9b, 0xcc, 0x5e, 0x54, 0xbb, 0x06, 0x71, 0x33, 0x56, 0x05, 0xb3, 0x0a, +0x67, 0x20, 0x22, 0xaa, 0xc8, 0x33, 0x0a, 0xda, 0xeb, 0x52, 0xc8, 0x33, 0x3f, 0xaf, 0x60, 0x33, +0x60, 0x10, 0x33, 0x2c, 0x01, 0x00, 0x28, 0x23, 0xc2, 0x2a, 0x67, 0x59, 0x80, 0xbf, 0x2a, 0x08, +0xa1, 0xc2, 0x67, 0x4a, 0x6a, 0x55, 0xdf, 0x92, 0x5c, 0x12, 0xdf, 0x56, 0xc1, 0x67, 0xd9, 0x52, +0x0c, 0xff, 0x0d, 0x6b, 0x7e, 0x2f, 0x25, 0x3d, 0xd1, 0xf8, 0xef, 0xac, 0x82, 0x67, 0xc4, 0x28, +0x21, 0x73, 0x41, 0xbf, 0xc2, 0x72, 0x74, 0x9f, 0x57, 0x41, 0x67, 0x15, 0xc8, 0x18, 0xa6, 0x8c, +0x02, 0x6c, 0x55, 0x2a, 0x84, 0x37, 0xbb, 0x77, 0xec, 0xb8, 0xae, 0xc4, 0xb1, 0x2c, 0xef, 0x45, +0x06, 0x33, 0x04, 0x4b, 0x00, 0x65, 0x15, 0x67, 0x55, 0x41, 0x31, 0xa3, 0xe9, 0xa8, 0x07, 0x33, +0x8a, 0x8c, 0x9b, 0x08, 0x37, 0x26, 0x8c, 0x30, 0x33, 0x48, 0x06, 0xe3, 0x16, 0x23, 0x51, 0x29, +0x88, 0x5a, 0x21, 0xc0, 0x9b, 0x97, 0x01, 0xd5, 0x3c, 0x64, 0x10, 0x33, 0x35, 0x4b, 0x6f, 0x96, +0x40, 0x73, 0xb2, 0x0a, 0x67, 0x64, 0xc0, 0xcb, 0xc1, 0xa3, 0x5a, 0x56, 0x56, 0x67, 0x12, 0xa8, +0x81, 0x46, 0xd4, 0x9b, 0x4b, 0x05, 0x2d, 0x5b, 0x98, 0x7d, 0x10, 0x6e, 0x98, 0xa7, 0xb2, 0x96, +0x01, 0xb4, 0x2c, 0x03, 0xb3, 0x52, 0x06, 0xb2, 0x30, 0xa2, 0x9b, 0x19, 0x30, 0xad, 0x06, 0x71, +0x78, 0x33, 0x12, 0x01, 0x33, 0x03, 0x97, 0x32, 0x88, 0x33, 0x90, 0x00, 0x63, 0x18, 0x79, 0x67, +0x15, 0x2c, 0x83, 0x98, 0x73, 0x33, 0x0d, 0x28, 0x24, 0x58, 0x5e, 0x9c, 0xc9, 0x60, 0x15, 0x67, +0x60, 0x50, 0x38, 0x33, 0x49, 0xc2, 0x2a, 0x67, 0x59, 0x03, 0x7b, 0xb7, 0xa4, 0x63, 0x10, 0xb0, +0xac, 0x0b, 0x85, 0x55, 0x67, 0xc3, 0x80, 0x37, 0x81, 0x01, 0x35, 0x56, 0xc1, 0xe6, 0x67, 0x20, +0x10, 0xd9, 0x32, 0x2d, 0xa7, 0x01, 0xa6, 0x86, 0xc1, 0x85, 0x2a, 0x18, 0x55, 0x56, 0x67, 0xc0, +0x80, 0x21, 0x1e, 0xb0, 0x20, 0x2c, 0x03, 0x1f, 0x90, 0x41, 0x33, 0x03, 0x12, 0x0d, 0x55, 0x30, +0x54, 0x80, 0x67, 0x20, 0x06, 0x44, 0xcd, 0x33, 0x17, 0x65, 0x9b, 0x7e, 0x30, 0x88, 0xc3, 0x33, +0xcc, 0x95, 0xe1, 0x51, 0x19, 0xc4, 0x4b, 0x8c, 0xa8, 0x9b, 0x51, 0x08, 0x10, 0x83, 0x75, 0x3c, +0x2e, 0x64, 0x33, 0x3f, 0x5e, 0x51, 0x3b, 0xb0, 0x0a, 0x67, 0xcc, 0x5d, 0x4f, 0x7e, 0xc0, 0xce, +0x1e, 0x8c, 0x4e, 0x1e, 0x33, 0x00, 0x82, 0x87, 0x93, 0x78, 0x28, 0xac, 0x67, 0xc5, 0x5c, 0x41, +0x47, 0x51, 0xcc, 0x07, 0x5f, 0xc7, 0xc0, 0xaf, 0xa1, 0x0e, 0xdb, 0xc0, 0x6d, 0xb5, 0xf8, 0x30, +0x15, 0x4c, 0x92, 0xff, 0x64, 0x67, 0x70, 0xd8, 0x07, 0x03, 0x03, 0x73, 0x63, 0x30, 0x88, 0x3e, +0x33, 0x41, 0x28, 0x08, 0x56, 0x67, 0x22, 0x83, 0x33, 0xbe, 0x87, 0x7c, 0x82, 0x7c, 0x71, 0x7c, +0x62, 0x8e, 0xd5, 0xd1, 0xca, 0x20, 0x33, 0x90, 0x8d, 0x00, 0xac, 0x82, 0x67, 0x16, 0x22, 0x5f, +0x2a, 0x18, 0x85, 0xc2, 0x67, 0xc2, 0xd0, 0xf1, 0xc6, 0xef, 0x09, 0x05, 0xe9, 0xef, 0x8c, 0xa8, +0x9b, 0x70, 0x31, 0x99, 0x58, 0xbc, 0x98, 0x93, 0x55, 0x30, 0xe6, 0x23, 0x84, 0x67, 0xc1, 0xe4, +0xc7, 0x4f, 0xcc, 0x78, 0x98, 0xc5, 0x00, 0xca, 0x2a, 0x67, 0x58, 0xc2, 0x00, 0xc5, 0xbf, 0x56, +0xbc, 0xc0, 0x40, 0x80, 0x83, 0x88, 0xea, 0x33, 0x16, 0x22, 0x00, 0x2a, 0x48, 0x3c, 0xca, 0x67, +0x1d, 0xbf, 0xc9, 0x80, 0x59, 0xa2, 0xe0, 0x05, 0x99, 0x8a, 0xc8, 0xcf, 0x50, 0x49, 0x24, 0x41, +0x14, 0x8a, 0xa0, 0x04, 0xbf, 0xc2, 0xa2, 0xcf, 0xc4, 0x0a, 0x54, 0x18, 0x33, 0x8f, 0xa8, 0x9b, +0x02, 0x21, 0x30, 0x0a, 0xc7, 0x54, 0x30, 0x88, 0x85, 0x87, 0xa8, 0x32, 0x33, 0x46, 0xd4, 0x9b, +0x40, 0x56, 0x84, 0xa2, 0x49, 0x15, 0x5f, 0xaa, 0x08, 0x41, 0xcc, 0x71, 0x18, 0x91, 0x33, 0x43, +0x82, 0x17, 0x18, 0x51, 0x9b, 0x16, 0x04, 0xe2, 0xcc, 0x00, 0xad, 0x8c, 0xd3, 0x61, 0x44, 0x9b, +0x20, 0x52, 0xb1, 0x0c, 0xbf, 0x65, 0x00, 0x1f, 0x23, 0x6a, 0x9b, 0x0d, 0x02, 0x23, 0xca, 0x00, +0x9b, 0x80, 0x00, 0x47, 0x89, 0xa1, 0x8b, 0x02, 0xcf, 0x03, 0x02, 0x61, 0x10, 0x33, 0xa2, 0x02, +0x80, 0x38, 0x9b, 0x28, 0x58, 0x05, 0xcb, 0xfb, 0x08, 0x49, 0xa3, 0x22, 0x83, 0x33, 0x44, 0x25, +0x64, 0x64, 0x9b, 0xaa, 0x00, 0x61, 0x40, 0x65, 0x33, 0x20, 0x63, 0x61, 0x10, 0x33, 0x20, 0x46, +0x54, 0x30, 0xc1, 0x54, 0x46, 0x9b, 0x03, 0x02, 0x35, 0x01, 0x2b, 0x23, 0xea, 0x34, 0x9b, 0x31, +0x08, 0x58, 0x52, 0x65, 0x12, 0x80, 0x75, 0x11, 0x15, 0x4b, 0x95, 0x9b, 0x00, 0x46, 0x94, 0x9b, +0x40, 0x10, 0x42, 0x0e, 0x00, 0x00, 0x10, 0x09, 0x0a, 0x61, 0x33, 0xc2, 0x88, 0x9b, 0x02, 0x11, +0x63, 0x81, 0x08, 0xc3, 0x41, 0x04, 0x0a, 0x95, 0x33, 0xc0, 0x88, 0x9b, 0x14, 0xaa, 0x74, 0x22, +0x23, 0x20, 0x26, 0x1d, 0x31, 0xc2, 0x33, 0x82, 0x00, 0xbf, 0x30, 0xa2, 0x9b, 0x11, 0x02, 0x62, +0x64, 0x92, 0x21, 0x0c, 0x33, 0x20, 0x14, 0x2b, 0xa9, 0x82, 0x77, 0x44, 0x05, 0x06, 0x60, 0x9b, +0x11, 0xe5, 0x00, 0x53, 0x90, 0x9b, 0x51, 0x30, 0x88, 0xe5, 0x33, 0x3c, 0x19, 0x5a, 0x39, 0xbf, +0x59, 0x14, 0xcf, 0x59, 0x11, 0xa8, 0x00, 0x25, 0x09, 0x42, 0x05, 0xc0, 0x20, 0x33, 0x10, 0x2a, +0x64, 0x51, 0xcf, 0x50, 0x41, 0x0c, 0x22, 0x33, 0x04, 0xaa, 0x58, 0x14, 0xcf, 0x01, 0x00, 0x83, +0x18, 0x33, 0xa1, 0x00, 0x16, 0x05, 0xcf, 0x43, 0x40, 0x0d, 0xdb, 0xff, 0x0a, 0x54, 0x68, 0x69, +0x73, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x04, 0x69, 0x7f, 0xfb, 0x6c, 0x65, 0x20, 0x68, 0x61, 0x0d, +0x62, 0x65, 0x65, 0x6e, 0x20, 0x63, 0xdb, 0xfe, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x2f, 0x02, +0x69, 0x06, 0xfd, 0x9b, 0x13, 0x79, 0x20, 0x43, 0x50, 0x49, 0x61, 0x64, 0x6f, 0xbf, 0x09, 0x56, +0x31, 0x2e, 0x32, 0x30, 0x37, 0x43, 0x6f, 0x70, 0x7f, 0xf9, 0x79, 0x72, 0x69, 0x67, 0x68, 0x28, +0x43, 0x29, 0x20, 0x31, 0x39, 0xbf, 0xee, 0x39, 0x33, 0x2d, 0x04, 0x36, 0x28, 0x6b, 0x6f, 0xfe, +0xdb, 0x73, 0x74, 0x54, 0x40, 0x61, 0x63, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0xbb, 0xdb, 0x1f, 0x4b, +0x0f, 0x61, 0x20, 0x4b, 0x15, 0x07, 0x1b, 0x29, 0x71, 0x70, 0x72, 0xbb, 0xff, 0x6f, 0x67, 0x72, +0x61, 0x6d, 0x20, 0x6d, 0x61, 0x79, 0x6f, 0x20, 0x75, 0xd6, 0xba, 0x73, 0x63, 0x66, 0x72, 0x09, +0x6b, 0xed, 0x6f, 0x66, 0x7a, 0x84, 0x36, 0xdf, 0x5a, 0x09, 0x7e, 0x20, 0x79, 0x6f, 0x75, 0xd6, +0xb6, 0x72, 0x11, 0x77, 0x8d, 0x69, 0x00, 0xfc, 0x73, 0x6b, 0x2e, 0x0d, 0x0a, 0x00, 0x00, 0x00, +0x00, 0x00, 0x12, 0xff, 0xa4, 0xe8, 0x3a, 0x00, 0x72, 0xfa, 0x41, 0xe8, 0x2f, 0x00, 0xe3, 0x3b, +0x73, 0xf9, 0x83, 0xe9, 0x03, 0x72, 0x06, 0x88, 0xcc, 0xac, 0xf7, 0xd0, 0x95, 0x31, 0xc9, 0xe8, +0x1b, 0x00, 0x11, 0xc9, 0x75, 0x08, 0x41, 0xe8, 0x13, 0x00, 0x73, 0xfb, 0x41, 0x41, 0x81, 0xfd, +0x00, 0xf3, 0x83, 0xd1, 0x01, 0x8d, 0x03, 0x96, 0xf3, 0xa4, 0x96, 0xeb, 0xc8, 0xe8, 0x02, 0x00, +0x11, 0xc9, 0x01, 0xdb, 0x75, 0x04, 0xad, 0x11, 0xc0, 0x93, 0xc3, 0x5e, 0xb9, 0x01, 0x00, 0xac, +0x2c, 0xe8, 0x3c, 0x01, 0x77, 0xf9, 0x8b, 0x1c, 0x86, 0xdf, 0x29, 0xf3, 0x89, 0x1c, 0xad, 0xe2, +0xee, 0xc3 }; + +Bit8u font_ega3_cpx[5455] = { +0x81, 0xfc, 0xce, 0xe7, 0x77, 0x02, 0xcd, 0x20, 0xb9, 0x4f, 0x15, 0xbe, 0x4f, 0x16, 0xbf, 0x6e, +0xe7, 0xbb, 0x00, 0x80, 0xfd, 0xf3, 0xa4, 0xfc, 0x87, 0xf7, 0x83, 0xee, 0xc6, 0x19, 0xed, 0x57, +0x57, 0xe9, 0xed, 0xe5, 0x55, 0x50, 0x58, 0x21, 0x0b, 0x01, 0x04, 0x08, 0x10, 0x40, 0x37, 0xe4, +0x59, 0xc7, 0x7f, 0x53, 0x00, 0xe6, 0xb7, 0x14, 0x06, 0x45, 0xbb, 0xfc, 0xff, 0x46, 0x4f, 0x4e, +0x54, 0x20, 0x00, 0x00, 0x01, 0x6e, 0x39, 0x01, 0x17, 0x06, 0xfd, 0xfd, 0x06, 0x00, 0x1c, 0x00, +0x4d, 0x26, 0x0e, 0x45, 0x47, 0x41, 0xc9, 0xcd, 0x1e, 0x20, 0x03, 0x03, 0xb7, 0xd8, 0x35, 0x24, +0x0c, 0x12, 0x26, 0xb2, 0xd8, 0x10, 0x08, 0x0a, 0x00, 0xed, 0xbf, 0x7e, 0x81, 0xa5, 0x81, 0x81, +0xbd, 0x99, 0x03, 0x7f, 0xb0, 0x7e, 0x0f, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xfc, 0xce, 0xff, +0xff, 0x00, 0x6c, 0xfe, 0x87, 0xdd, 0x7c, 0x38, 0x10, 0x30, 0x10, 0x1f, 0xd8, 0x38, 0x7c, 0x0e, +0x18, 0x3c, 0x3c, 0xd6, 0xb6, 0xe7, 0x00, 0x18, 0x06, 0x0f, 0xcc, 0x4d, 0x7e, 0x3b, 0x0f, 0x76, +0xb6, 0x22, 0x18, 0x09, 0x3b, 0x76, 0xff, 0x00, 0xe7, 0xc3, 0x5f, 0xc7, 0xde, 0x00, 0x1f, 0x3c, +0x66, 0x5f, 0xf2, 0x42, 0x42, 0x66, 0x3c, 0xc3, 0x99, 0xbd, 0x3f, 0xe4, 0xbd, 0x99, 0xc3, 0x1e, +0x0e, 0x1a, 0x32, 0x7b, 0xdd, 0x78, 0xcc, 0x00, 0x78, 0x20, 0x2d, 0xd7, 0xdc, 0x00, 0x4f, 0x61, +0xf7, 0x33, 0x0f, 0x3f, 0x33, 0x3f, 0x30, 0x00, 0x1f, 0x79, 0x70, 0xf0, 0xe0, 0x00, 0x7f, 0x63, +0x7f, 0x63, 0xb3, 0x37, 0x67, 0xe7, 0xe6, 0xc0, 0x7c, 0xb0, 0xdb, 0x18, 0xdb, 0xa0, 0x3c, 0xdb, +0x2e, 0xb7, 0xff, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0x2d, 0xc0, 0x80, 0xff, 0x63, 0xbf, +0x02, 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x2d, 0xc9, 0x06, 0x02, 0x2b, 0xef, 0x6c, +0x5e, 0x3c, 0x00, 0x73, 0x93, 0x66, 0x07, 0x5f, 0xdc, 0x06, 0xdb, 0x00, 0x7b, 0x1b, 0x7f, 0xf3, +0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x80, 0xfc, 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, +0xc8, 0xcc, 0xfe, 0x4f, 0x0d, 0x6c, 0x7e, 0x0f, 0x17, 0xec, 0x00, 0x0f, 0x00, 0xdf, 0xb2, 0x70, +0x11, 0x0c, 0x2e, 0xd9, 0xfe, 0x0c, 0x0c, 0x00, 0x80, 0xfc, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, +0xcc, 0xca, 0xc0, 0x5c, 0x2e, 0x27, 0xa1, 0x28, 0x6c, 0x28, 0x0a, 0xcb, 0x0e, 0x9f, 0xf6, 0x16, +0xa0, 0x7c, 0x7d, 0x8a, 0x61, 0x4b, 0x0e, 0x38, 0xaf, 0x17, 0xd8, 0x00, 0x18, 0xec, 0x95, 0x3c, +0x8c, 0x8f, 0x64, 0xdd, 0xe9, 0x24, 0x20, 0x31, 0x37, 0x6c, 0x5e, 0x03, 0xdf, 0x66, 0xad, 0xf1, +0xc2, 0xc0, 0x7c, 0x06, 0xc3, 0xda, 0x06, 0x86, 0xef, 0xc1, 0xe4, 0xdb, 0xc2, 0xc6, 0xae, 0x30, +0x60, 0xc6, 0x86, 0x85, 0xc2, 0x0e, 0x0c, 0x58, 0xc3, 0x76, 0xdc, 0xaf, 0x76, 0xbd, 0xb0, 0x2d, +0x00, 0x60, 0x4e, 0x31, 0x37, 0x2b, 0x00, 0x37, 0x6b, 0xe5, 0x0f, 0x08, 0xb2, 0x31, 0x00, 0x18, +0xe2, 0xc2, 0xc2, 0xde, 0xff, 0xe5, 0x30, 0xb0, 0xa2, 0xc0, 0x96, 0xed, 0x14, 0x0d, 0xd8, 0x31, +0xfe, 0xb2, 0x95, 0xd7, 0x31, 0xbf, 0xc2, 0xe2, 0x9f, 0xc0, 0x80, 0x1f, 0x26, 0xae, 0xd6, 0xd6, +0xc1, 0x0e, 0xb2, 0x27, 0x0b, 0xc2, 0x38, 0x78, 0x81, 0x2e, 0x9e, 0x3c, 0x7c, 0xc6, 0xc6, 0xfe, +0xdb, 0xc9, 0x0f, 0x06, 0x3c, 0x02, 0x06, 0x7f, 0x08, 0xdf, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0x13, +0xba, 0xfe, 0xb0, 0x1e, 0x8d, 0xc0, 0x9a, 0xfe, 0xfc, 0x1f, 0x72, 0x77, 0x38, 0x60, 0x0f, 0xc6, +0xc6, 0xc6, 0xcc, 0x1d, 0xfe, 0x3f, 0xf3, 0x6e, 0xd8, 0x4f, 0x1a, 0x2f, 0x60, 0x1f, 0x0b, 0x61, +0xbb, 0x7e, 0x3f, 0x0c, 0x78, 0xba, 0x61, 0x6f, 0x04, 0x0f, 0x6c, 0x72, 0x30, 0x9e, 0x52, 0x43, +0x35, 0x06, 0xc2, 0xd9, 0x5b, 0x02, 0x00, 0x5e, 0x2c, 0x1b, 0x23, 0x84, 0xc9, 0x5f, 0x0c, 0xdf, +0x76, 0xb6, 0x10, 0xde, 0x00, 0x8c, 0xc2, 0xdc, 0xc4, 0x2e, 0x67, 0x3b, 0x6c, 0x90, 0xfe, 0x8d, +0x67, 0x0f, 0xfc, 0x66, 0xf1, 0x90, 0x9e, 0x7c, 0xfc, 0x6f, 0xba, 0xc2, 0xef, 0x00, 0xc2, 0x3e, +0x9d, 0xa1, 0x10, 0xf8, 0x6c, 0x67, 0x4f, 0x6c, 0xf8, 0x0f, 0xfe, 0x90, 0xff, 0x66, 0x62, 0x68, +0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0xd8, 0x96, 0x00, 0xf0, 0x3f, 0xc9, 0x0f, 0xde, 0xc6, 0xc6, +0x66, 0x3a, 0xec, 0xbd, 0x69, 0x6e, 0x6f, 0x4d, 0x38, 0x3c, 0x7d, 0xc6, 0x64, 0x30, 0x1e, 0x0d, +0x2e, 0x29, 0xef, 0xe6, 0xd6, 0xed, 0x6a, 0x78, 0x78, 0x74, 0xe6, 0x0f, 0x16, 0x7b, 0xf0, 0x60, +0x00, 0x6f, 0xf2, 0x6f, 0x4f, 0xee, 0xfe, 0xfe, 0xd6, 0x7e, 0x5b, 0x0f, 0xe6, 0xf6, 0xfe, 0xde, +0xce, 0x0f, 0x4b, 0x6f, 0xc6, 0xb3, 0x25, 0xdf, 0x84, 0x7d, 0x41, 0xf0, 0x1f, 0x92, 0xfc, 0xd6, +0xde, 0x7c, 0x0c, 0x0e, 0x25, 0xfb, 0xe3, 0xe6, 0x1f, 0x56, 0x28, 0xe2, 0x50, 0x3f, 0x61, 0x4f, +0x7e, 0x7e, 0x5a, 0xaf, 0x42, 0x36, 0xc6, 0x5f, 0xe4, 0xc1, 0x0f, 0x6c, 0x38, 0x10, 0xc8, 0xbf, +0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0xcd, 0x74, 0x6c, 0x8e, 0x61, 0xac, 0x61, 0x9f, 0xce, 0x61, +0xd9, 0x4f, 0x1b, 0xe4, 0x63, 0x86, 0x7f, 0xc2, 0x82, 0x3d, 0x3c, 0x30, 0x00, 0x5f, 0xc1, 0x1f, +0xc1, 0x70, 0x4e, 0xd6, 0x38, 0x1c, 0xaf, 0x3c, 0x0c, 0x8c, 0xc1, 0x00, 0x3c, 0xdc, 0x11, 0x52, +0xe6, 0x9d, 0xa6, 0x6c, 0xff, 0x7d, 0x80, 0x18, 0x78, 0x0c, 0x7c, 0xc2, 0x25, 0xaf, 0xe0, 0x19, +0x2c, 0xc2, 0x78, 0xe2, 0xcf, 0x63, 0xc2, 0x02, 0x00, 0x77, 0x98, 0xdf, 0x1c, 0x69, 0x65, 0x25, +0x00, 0x2f, 0x90, 0xb1, 0x1f, 0xfe, 0x78, 0x1f, 0x36, 0x32, 0x30, 0x78, 0xaf, 0xbe, 0xcb, 0xcf, +0x76, 0x2e, 0xcc, 0x3b, 0x14, 0x5f, 0xd2, 0x5f, 0xc6, 0xf3, 0x6c, 0x76, 0xe6, 0xdc, 0x20, 0x4c, +0x38, 0x4f, 0x6d, 0x69, 0x09, 0x00, 0xdb, 0x19, 0x62, 0x00, 0x17, 0xce, 0x98, 0x2f, 0x00, 0xe6, +0x92, 0x33, 0x2f, 0x38, 0x46, 0x17, 0x00, 0xec, 0x00, 0xc9, 0xba, 0x00, 0xc6, 0x0f, 0xd9, 0x8c, +0xdc, 0xa1, 0x9f, 0x2d, 0x61, 0x9f, 0x3e, 0x96, 0x1f, 0x04, 0xf0, 0xd2, 0xc2, 0x9f, 0xd2, 0xa3, +0x1d, 0xdc, 0x9f, 0x1f, 0x09, 0x2c, 0xe4, 0x2e, 0x81, 0xdf, 0x10, 0xf6, 0xdb, 0xd9, 0xfc, 0xde, +0x36, 0x1c, 0x1f, 0xc2, 0x4b, 0x3d, 0x0f, 0x30, 0x06, 0x00, 0x08, 0x58, 0x0f, 0x96, 0xf0, 0x00, +0x9a, 0x66, 0xea, 0x1b, 0x38, 0x75, 0x2f, 0xba, 0x16, 0x04, 0x0c, 0xe0, 0x90, 0x52, 0xcc, 0x39, +0x7b, 0x4f, 0xfe, 0xef, 0x0e, 0xac, 0xa7, 0x70, 0x0e, 0xf7, 0x61, 0x90, 0x3f, 0x7b, 0x2f, 0x1b, +0x23, 0x24, 0x08, 0x5f, 0xc9, 0xdc, 0xdf, 0x91, 0x06, 0xe2, 0xf4, 0x61, 0x4f, 0x1e, 0x36, 0x66, +0xf9, 0x84, 0xef, 0xfe, 0x62, 0x60, 0x60, 0x25, 0x2d, 0xff, 0x92, 0x69, 0xcf, 0x71, 0x4b, 0x76, +0xf0, 0x3f, 0x00, 0x2d, 0x31, 0xa7, 0x81, 0x1b, 0x20, 0xff, 0xe9, 0x6b, 0x70, 0x54, 0x54, 0x70, +0x03, 0x04, 0x5a, 0x07, 0x3f, 0x77, 0x0b, 0x78, 0xce, 0xde, 0xf6, 0x73, 0xb3, 0xe6, 0x7f, 0x14, +0x0f, 0x48, 0x09, 0xef, 0x1d, 0xce, 0x6c, 0xef, 0xd2, 0x85, 0x6f, 0xc6, 0xef, 0xac, 0x10, 0x4f, +0x14, 0xd2, 0xef, 0x58, 0xb3, 0x1b, 0xdf, 0x52, 0x5b, 0xe0, 0xff, 0xb1, 0x12, 0xdf, 0x13, 0x49, +0xdf, 0x7e, 0xc7, 0x65, 0xbf, 0x7c, 0x6b, 0xe4, 0xa5, 0xcf, 0x7c, 0x10, 0x38, 0x64, 0x0b, 0x6e, +0xec, 0xd0, 0xff, 0x84, 0x3f, 0xc8, 0xb6, 0x00, 0x00, 0x76, 0xc8, 0xd6, 0xfe, 0x0f, 0xc1, 0x42, +0x2f, 0x6e, 0xe9, 0xf8, 0xb0, 0xb0, 0xea, 0x36, 0x00, 0x0e, 0x58, 0x4f, 0xf6, 0xde, 0xcb, 0xea, +0x00, 0xf6, 0xff, 0x18, 0x08, 0x9f, 0x4b, 0x6e, 0x5f, 0x26, 0x3e, 0x26, 0x7b, 0xba, 0xcc, 0x4f, +0xf6, 0xcc, 0xcf, 0x7a, 0x04, 0xda, 0x40, 0x7a, 0xb0, 0xce, 0xef, 0x18, 0xbc, 0x06, 0x7c, 0xaf, +0x4e, 0x58, 0x22, 0x7c, 0x18, 0xc9, 0x5f, 0x22, 0x12, 0xd2, 0x62, 0x0f, 0x3d, 0x1c, 0x92, 0xff, +0xc3, 0xe4, 0x25, 0x5f, 0xfe, 0xc0, 0xf0, 0xb1, 0x02, 0x7c, 0xcc, 0x92, 0xff, 0xa2, 0x01, 0x6b, +0x01, 0x1f, 0x2c, 0x08, 0xf1, 0x0f, 0x16, 0xf2, 0xc6, 0x7c, 0x26, 0x3d, 0x02, 0xef, 0x59, 0xc8, +0x6f, 0x0f, 0xd2, 0x63, 0x02, 0xef, 0x30, 0x06, 0x01, 0x14, 0x52, 0xef, 0x9e, 0xbd, 0x1c, 0x1f, +0x11, 0x44, 0xf2, 0xc2, 0x01, 0x55, 0xaa, 0x90, 0x17, 0xdd, 0x77, 0x02, 0xbb, 0x18, 0x00, 0x85, +0xec, 0xf8, 0x0d, 0x67, 0x93, 0x0f, 0x36, 0x00, 0xf6, 0x58, 0x90, 0x36, 0x80, 0x25, 0x6c, 0x0f, +0xe7, 0x91, 0x2f, 0xf6, 0x06, 0x4b, 0x60, 0x00, 0x3d, 0x42, 0x36, 0x1f, 0x64, 0xd1, 0x2f, 0xee, +0x59, 0xb0, 0x11, 0x0f, 0x35, 0x2c, 0x8f, 0xd9, 0x90, 0x00, 0xf8, 0xbf, 0x84, 0x0d, 0x1f, 0x2f, +0x43, 0xf2, 0x18, 0x18, 0xff, 0xff, 0x6b, 0x24, 0x72, 0x6b, 0x0b, 0x1f, 0x3f, 0x64, 0x23, 0x2d, +0x90, 0x30, 0x1f, 0x0f, 0x4f, 0xd8, 0x37, 0xbf, 0x37, 0x30, 0x3f, 0x2a, 0x61, 0x6d, 0x17, 0x56, +0xbf, 0x1f, 0xf7, 0xb0, 0x65, 0x5f, 0x6d, 0x85, 0x6c, 0xf7, 0x3f, 0xcd, 0x92, 0x2f, 0x1f, 0xcd, +0x96, 0x2f, 0x3f, 0xc1, 0x96, 0x2f, 0xdd, 0x85, 0x84, 0xff, 0x2f, 0xd9, 0x91, 0x5f, 0xff, 0xdf, +0x48, 0x18, 0x86, 0x2c, 0x59, 0xaf, 0xdf, 0x12, 0x36, 0x3f, 0x17, 0xf6, 0xef, 0x3f, 0x3f, 0x2c, +0x24, 0x4f, 0x82, 0x90, 0x2d, 0x30, 0x12, 0x5f, 0xb2, 0x91, 0xaf, 0x4f, 0x85, 0x6c, 0xff, 0x00, +0x48, 0x08, 0xaf, 0x90, 0x36, 0x24, 0x1e, 0xcf, 0x03, 0x97, 0x0f, 0x94, 0x90, 0x90, 0xaf, 0xc4, +0x8b, 0x87, 0x30, 0x98, 0xbf, 0xff, 0x91, 0xad, 0x1f, 0x38, 0x81, 0x01, 0x3c, 0x90, 0x32, 0x9f, +0x93, 0x27, 0x02, 0x38, 0x10, 0x0c, 0xca, 0x7c, 0x10, 0xcf, 0x59, 0x83, 0xcf, 0x7a, 0xb3, 0x0f, +0x3d, 0xd6, 0x32, 0xaf, 0xff, 0xcb, 0x12, 0x0f, 0x81, 0x64, 0x2f, 0x02, 0xcc, 0x80, 0x01, 0x8f, +0x26, 0xb0, 0x01, 0x09, 0xbc, 0xff, 0x02, 0x09, 0x2b, 0x9f, 0x20, 0x5d, 0x5f, 0x3e, 0x23, 0x70, +0xcc, 0x01, 0xcc, 0x81, 0x65, 0xcf, 0x01, 0x32, 0x1a, 0xce, 0xaf, 0x98, 0x30, 0x3f, 0xdc, 0xb2, +0xbf, 0x0f, 0x65, 0xd0, 0xf5, 0xcf, 0x60, 0x2e, 0x12, 0x1f, 0x23, 0xa3, 0xaf, 0x2c, 0x66, 0x3f, +0xbf, 0x05, 0xb7, 0x0f, 0x08, 0x46, 0x46, 0x2f, 0x16, 0x13, 0x7f, 0x3f, 0x32, 0x58, 0x1f, 0x2c, +0xde, 0x6f, 0x3f, 0xf4, 0x25, 0x0f, 0xfe, 0x6d, 0x64, 0x4f, 0x1f, 0xd8, 0x90, 0xfc, 0x4d, 0x23, +0xa3, 0x1f, 0xb0, 0x78, 0x5f, 0x2f, 0x33, 0x97, 0xee, 0x00, 0x06, 0x90, 0x00, 0x0e, 0xc1, 0x0b, +0x05, 0x1c, 0x61, 0x03, 0x7e, 0x07, 0x16, 0x01, 0x7e, 0x80, 0x04, 0xff, 0x93, 0x20, 0xfd, 0x95, +0x04, 0xfb, 0x4a, 0x82, 0xf9, 0x38, 0x41, 0xf7, 0x8c, 0x24, 0xf5, 0x58, 0x12, 0xf3, 0x8c, 0x24, +0xf1, 0x5d, 0x12, 0xef, 0x78, 0x24, 0x98, 0x27, 0xec, 0x4e, 0xb0, 0xeb, 0x2c, 0x09, 0xea, 0x82, +0x13, 0xe9, 0x49, 0x70, 0xe8, 0xe7, 0x98, 0x4a, 0x24, 0x82, 0x12, 0xe5, 0x04, 0x4b, 0xe4, 0x70, +0xaa, 0xe3, 0x32, 0x48, 0x49, 0xe1, 0x24, 0x24, 0xde, 0x18, 0x12, 0xdd, 0x30, 0x24, 0xdb, 0x1c, +0x49, 0xda, 0x00, 0x92, 0xa0, 0xd7, 0xac, 0x37, 0x0d, 0x01, 0x49, 0xb0, 0xd2, 0x27, 0x08, 0xd1, +0x84, 0x04, 0xcf, 0x93, 0x20, 0xcd, 0x95, 0x04, 0xcb, 0x4c, 0x82, 0xc9, 0x54, 0x12, 0xc7, 0x45, +0x82, 0xc3, 0x93, 0xc0, 0x76, 0xc1, 0x84, 0x04, 0xbe, 0x93, 0x20, 0xbd, 0x96, 0x04, 0xbc, 0xd0, +0x09, 0xbb, 0x92, 0xe0, 0x5a, 0xb9, 0x92, 0xe0, 0x76, 0x5f, 0x48, 0x90, 0xb5, 0x04, 0x2d, 0xc8, +0xb2, 0x80, 0xb3, 0x20, 0x38, 0x41, 0xb0, 0x81, 0x24, 0xae, 0x30, 0x60, 0x4b, 0xfe, 0x16, 0x48, +0xa8, 0x2b, 0x09, 0xa5, 0x60, 0x52, 0x44, 0xe0, 0x92, 0xa3, 0x7e, 0x11, 0x90, 0xa1, 0xcb, 0xe8, +0xf0, 0x5f, 0x09, 0x0e, 0xa3, 0x9d, 0x09, 0x2e, 0x1e, 0x9b, 0x78, 0x01, 0x1b, 0xb7, 0x24, 0x99, +0x0d, 0x76, 0x82, 0x97, 0xd4, 0x90, 0x60, 0x95, 0x24, 0x38, 0x7c, 0x93, 0x49, 0xb0, 0x92, 0x93, +0x20, 0x80, 0x95, 0x04, 0x8e, 0x04, 0xb1, 0xb3, 0x92, 0xc0, 0x71, 0x8b, 0x48, 0xb0, 0x88, 0x24, +0x48, 0x87, 0x09, 0x5e, 0x3c, 0x84, 0x02, 0x29, 0xd3, 0x90, 0x4a, 0x81, 0x24, 0x98, 0xfc, 0x7f, +0x21, 0xb0, 0xce, 0x70, 0x82, 0x7d, 0xb2, 0x4e, 0x7c, 0xcb, 0xb2, 0xd7, 0xaa, 0x0d, 0xe0, 0xc0, +0xd5, 0xf5, 0x92, 0x77, 0x66, 0x3a, 0x6b, 0x21, 0x25, 0xc3, 0x82, 0x09, 0x3c, 0xea, 0x40, 0x71, +0x78, 0x52, 0x4b, 0x7f, 0x7e, 0x12, 0x4c, 0xf0, 0x6c, 0x1d, 0x5a, 0x78, 0x60, 0x49, 0x7a, 0xd9, +0x92, 0x69, 0xd1, 0x26, 0xac, 0xb6, 0xfc, 0x25, 0xa4, 0x64, 0x9c, 0xe0, 0x1b, 0x62, 0x07, 0x12, +0x61, 0xe6, 0x96, 0x04, 0x5f, 0x53, 0xc3, 0x37, 0x7d, 0xc0, 0xb2, 0x99, 0x82, 0x85, 0x0a, 0x41, +0x42, 0x58, 0x33, 0x22, 0x57, 0xd7, 0x95, 0x62, 0x0d, 0x1c, 0x90, 0xe0, 0x66, 0x53, 0x6d, 0x36, +0x45, 0xf7, 0x2c, 0x81, 0x8c, 0x30, 0x1c, 0x12, 0x4f, 0x3c, 0x56, 0x12, 0x4c, 0x06, 0x09, 0x4b, +0x3c, 0x20, 0x09, 0x49, 0x90, 0x60, 0xff, 0x45, 0x48, 0x0c, 0x83, 0x20, 0xc1, 0x76, 0x41, 0x12, +0x6f, 0xb5, 0x5f, 0xc1, 0x4b, 0xc3, 0xd9, 0x25, 0x3d, 0x76, 0x1b, 0x48, 0x72, 0xfe, 0x82, 0x25, +0x39, 0x7c, 0x60, 0x40, 0x38, 0x76, 0x04, 0x31, 0x96, 0xc1, 0x80, 0x35, 0xe6, 0x70, 0x20, 0x33, +0x3c, 0x60, 0x49, 0x31, 0x90, 0x90, 0x2f, 0xc5, 0x86, 0xbf, 0x26, 0x90, 0xe0, 0x29, 0x2b, 0x61, +0x91, 0x09, 0x42, 0x6a, 0x37, 0x26, 0x6c, 0x7c, 0x1b, 0x7c, 0x96, 0x1d, 0xc1, 0x8b, 0x03, 0x09, +0x21, 0xf2, 0xb2, 0xf0, 0x37, 0x70, 0x1c, 0x93, 0x60, 0x1d, 0x96, 0x04, 0x1c, 0x09, 0x09, 0x1a, +0x6c, 0x09, 0xbf, 0x0d, 0x20, 0xc1, 0x16, 0x16, 0x2e, 0x19, 0x44, 0x2c, 0x02, 0x72, 0x24, 0x18, +0x7c, 0x11, 0xe0, 0x91, 0x83, 0xe0, 0x92, 0x0f, 0x0e, 0x90, 0x90, 0x0d, 0x1c, 0x48, 0x0b, 0x70, +0x04, 0x12, 0x09, 0xc1, 0xa4, 0x66, 0x2a, 0x21, 0x05, 0x00, 0xc1, 0xe0, 0x4a, 0x9a, 0x52, 0x7f, +0x61, 0xc0, 0xff, 0xe0, 0xbd, 0xed, 0x37, 0xd2, 0x32, 0xfc, 0x7f, 0xd0, 0x42, 0xcc, 0xac, 0x19, +0xf8, 0x97, 0x06, 0xac, 0xe5, 0x0c, 0x48, 0xf3, 0x25, 0x25, 0x71, 0x98, 0x6c, 0x61, 0xc6, 0x25, +0x0c, 0xed, 0x69, 0x25, 0xc5, 0x71, 0x01, 0x21, 0x90, 0x86, 0xe7, 0x7f, 0x72, 0x2d, 0x43, 0xb0, +0x42, 0x63, 0x28, 0x19, 0xde, 0x80, 0x43, 0xda, 0x38, 0x01, 0xc9, 0xdb, 0x03, 0x86, 0xda, 0xd8, +0x01, 0x09, 0x03, 0x86, 0xd7, 0xd4, 0x24, 0xa4, 0x00, 0x13, 0x06, 0xd2, 0xf0, 0x32, 0xe0, 0xf0, +0xb0, 0xbc, 0xd0, 0x61, 0x40, 0xce, 0x82, 0x2b, 0x5f, 0x79, 0x0c, 0x58, 0xcb, 0x80, 0xd9, 0x8b, +0xa0, 0xf9, 0xc9, 0xf6, 0xcc, 0x3a, 0x30, 0xc7, 0xce, 0x10, 0x40, 0x71, 0x8c, 0x19, 0xc3, 0xbb, +0x0c, 0xb8, 0xfc, 0xc0, 0x07, 0x0c, 0xbf, 0x65, 0xc0, 0xf0, 0x4d, 0xf4, 0x80, 0xbc, 0xb1, 0x94, +0x7f, 0xb8, 0x92, 0x0a, 0xc1, 0x1d, 0x92, 0xdb, 0x1b, 0x1c, 0x06, 0x65, 0xc0, 0xa4, 0x65, 0x87, +0xc2, 0x0d, 0x49, 0x87, 0xc2, 0x71, 0x36, 0x6c, 0x61, 0x0d, 0x60, 0x48, 0xc2, 0x63, 0x19, 0xac, +0x75, 0x25, 0x2d, 0x71, 0xb0, 0x60, 0xc6, 0x64, 0x40, 0xa3, 0x0c, 0x08, 0x9f, 0x80, 0xab, 0xf8, +0xc0, 0xca, 0x9b, 0x6f, 0x61, 0x99, 0x70, 0x0c, 0x38, 0x95, 0x06, 0xac, 0x93, 0x80, 0x41, 0xc0, +0xca, 0x8f, 0x0c, 0x78, 0x8d, 0x8b, 0x06, 0xa4, 0x89, 0x03, 0x56, 0x87, 0x80, 0x21, 0x1f, 0xb0, +0xc2, 0x83, 0x08, 0x19, 0x51, 0xac, 0x0c, 0x7d, 0x52, 0x06, 0x7b, 0x64, 0x03, 0x77, 0x1f, 0x01, +0x23, 0x0c, 0x98, 0x75, 0x73, 0x07, 0xac, 0x71, 0xc2, 0x80, 0x6f, 0x1e, 0x30, 0x6d, 0x29, 0x03, +0x6b, 0x96, 0x01, 0x69, 0x23, 0x03, 0x67, 0x95, 0x01, 0x65, 0x06, 0xb8, 0x1b, 0x61, 0xc0, 0x15, +0x3f, 0x1b, 0x61, 0x5d, 0xd1, 0x61, 0xc0, 0x59, 0x06, 0x4c, 0xff, 0x55, 0xc0, 0x15, 0xf8, 0x08, +0x60, 0x51, 0x29, 0x0c, 0x4d, 0xa4, 0x03, 0x4f, 0x55, 0x81, 0xb6, 0x0d, 0xc1, 0x96, 0x85, 0x79, +0x2c, 0x03, 0x47, 0x46, 0x18, 0x1f, 0xd6, 0xc2, 0x1b, 0x61, 0x24, 0x30, 0x3c, 0xcb, 0x19, 0x30, +0xfc, 0x3d, 0xc0, 0x6b, 0x61, 0x60, 0x84, 0xf5, 0xc0, 0x30, 0x38, 0x2b, 0x61, 0x36, 0x5f, 0x92, +0x2d, 0x0d, 0x58, 0xc9, 0x29, 0x61, 0x40, 0xb2, 0x7d, 0x30, 0x61, 0x2e, 0xf0, 0x1c, 0x18, 0x2c, +0xfc, 0xb3, 0x06, 0x2a, 0x89, 0xae, 0x59, 0x62, 0x61, 0xc0, 0x80, 0xcc, 0x27, 0x42, 0xe8, 0xce, +0x59, 0xac, 0xc3, 0x17, 0x27, 0xa0, 0xbd, 0x30, 0x1c, 0xd6, 0x5c, 0x48, 0xf5, 0x10, 0x08, 0xcd, +0x1b, 0x59, 0xc4, 0x5b, 0x37, 0xd6, 0x96, 0xa7, 0x0d, 0xe6, 0x0b, 0x8b, 0xe9, 0x89, 0x09, 0x4f, +0x37, 0x85, 0xc5, 0xe9, 0x49, 0xbc, 0x37, 0x37, 0xd1, 0x6e, 0x0d, 0xfe, 0x00, 0x2c, 0x64, 0xc0, +0x1b, 0x8b, 0x17, 0x43, 0xdb, 0x78, 0x0b, 0x53, 0xc0, 0x92, 0x29, 0x80, 0x61, 0x09, 0xe4, 0xc8, +0x05, 0x08, 0x0e, 0xb0, 0xfc, 0xc0, 0x01, 0xfb, 0x06, 0x30, 0xf6, 0xf5, 0x4c, 0x80, 0x6c, 0xee, +0x0b, 0x02, 0xe9, 0x06, 0xe6, 0x60, 0x38, 0x83, 0x0d, 0x1c, 0xbe, 0x0f, 0xfe, 0xb7, 0x60, 0x02, +0xd7, 0x40, 0x10, 0xd1, 0x80, 0x20, 0xcb, 0xf0, 0x41, 0xc5, 0x0f, 0x07, 0x0f, 0x7d, 0x01, 0x0c, +0xbf, 0xba, 0x03, 0x04, 0xb4, 0x50, 0x80, 0xb3, 0xc0, 0x0f, 0xae, 0x67, 0xe6, 0xc0, 0x06, 0x30, +0xa7, 0xa8, 0x75, 0x80, 0x80, 0xa1, 0x03, 0x2c, 0xef, 0x02, 0x9b, 0x38, 0xc0, 0x02, 0x42, 0x00, +0x06, 0x33, 0x06, 0x98, 0x8f, 0x8a, 0xdd, 0x00, 0x89, 0x00, 0x3e, 0x61, 0xde, 0xdb, 0x49, 0x3c, +0x86, 0xfd, 0xd0, 0xc0, 0xf7, 0x27, 0x26, 0xff, 0x9d, 0x26, 0x72, 0x35, 0x12, 0xe0, 0x0f, 0x65, +0x38, 0x40, 0x5f, 0xb8, 0x04, 0x59, 0x24, 0x03, 0x14, 0xed, 0x12, 0xf0, 0x80, 0x9f, 0xf0, 0x1e, +0x72, 0x2e, 0x1b, 0x08, 0x3d, 0x46, 0xf0, 0xda, 0x72, 0x25, 0xa3, 0x09, 0x31, 0x57, 0x94, 0xf8, +0x18, 0x3e, 0x60, 0xc0, 0x68, 0x28, 0x90, 0x9c, 0xcc, 0x80, 0x07, 0x23, 0x38, 0xb2, 0x7a, 0x1e, +0x76, 0xcc, 0x8b, 0x55, 0x3e, 0x74, 0x22, 0x40, 0x0d, 0x09, 0xf0, 0x13, 0x06, 0x4b, 0x80, 0x00, +0x84, 0x61, 0x2b, 0x83, 0x2b, 0xb7, 0x18, 0xe8, 0x74, 0x0c, 0xf7, 0xd6, 0xb9, 0x72, 0xfe, 0xdd, +0x3e, 0x88, 0xc2, 0xfd, 0x1c, 0x02, 0x1d, 0xbb, 0x2e, 0xb3, 0x0a, 0xca, 0xef, 0xab, 0x1e, 0xc5, +0xfc, 0x0f, 0x47, 0x57, 0xbf, 0xfc, 0x05, 0x62, 0x85, 0xf3, 0x79, 0xef, 0x3d, 0x4f, 0x02, 0x07, +0x17, 0xab, 0x7e, 0xab, 0x74, 0x37, 0xab, 0x62, 0x77, 0x5e, 0xbd, 0x67, 0x81, 0x95, 0xac, 0x94, +0xbe, 0x7a, 0x8f, 0x8d, 0x7c, 0xdc, 0xac, 0x88, 0x07, 0xde, 0x26, 0x86, 0xc0, 0x78, 0x87, 0x02, +0xbd, 0x01, 0xf6, 0x43, 0x1b, 0xc3, 0x38, 0x57, 0x06, 0xd0, 0x6b, 0xe3, 0xab, 0x69, 0xfe, 0xee, +0x34, 0x1b, 0xfe, 0x07, 0xab, 0xcf, 0xef, 0x1f, 0xce, 0x57, 0x20, 0x90, 0x76, 0xdb, 0x8c, 0xf3, +0x2f, 0x1e, 0x0d, 0x56, 0x45, 0xe6, 0x35, 0x18, 0x7f, 0xf0, 0x2c, 0x66, 0x39, 0xc3, 0x7a, 0x35, +0x2f, 0x02, 0xbd, 0x2e, 0x9e, 0xc4, 0x1b, 0x6f, 0xe4, 0xef, 0x97, 0x0f, 0xce, 0x7c, 0x0e, 0xd7, +0x5e, 0x37, 0x5f, 0xa8, 0xb0, 0x3a, 0x7f, 0x7e, 0x45, 0x1a, 0x46, 0xfd, 0x15, 0x84, 0x56, 0xde, +0x20, 0xf8, 0x00, 0x0c, 0x1e, 0x2f, 0x9b, 0x67, 0xf7, 0xf4, 0x27, 0x0b, 0x32, 0x6f, 0x82, 0x54, +0x3c, 0xdf, 0xd4, 0x01, 0x97, 0x4e, 0xca, 0xd9, 0xd5, 0x3c, 0x18, 0xb8, 0xea, 0x61, 0x71, 0x48, +0xba, 0x86, 0x65, 0x4a, 0xd7, 0x1a, 0x8b, 0xe0, 0x8a, 0xdc, 0x3a, 0xcc, 0xcc, 0x7f, 0x34, 0x24, +0x26, 0x62, 0xf7, 0xe0, 0x7c, 0x97, 0x60, 0xf8, 0xa6, 0xce, 0x47, 0x76, 0x09, 0x4e, 0xb9, 0xf8, +0x2f, 0x92, 0xef, 0xd4, 0xaf, 0xe4, 0x7f, 0xa7, 0x0a, 0x69, 0x84, 0x3d, 0xb8, 0x3c, 0x17, 0x00, +0xe6, 0x5a, 0x46, 0xd6, 0x02, 0x91, 0x74, 0x32, 0x0c, 0x18, 0x6d, 0x36, 0x16, 0x0f, 0x7c, 0x4f, +0x48, 0x4d, 0x1e, 0x56, 0xb5, 0xb3, 0x5f, 0x7e, 0x6d, 0x9d, 0x72, 0xa3, 0x4a, 0xa9, 0x49, 0x49, +0x43, 0x46, 0x0d, 0x56, 0x90, 0x0a, 0x37, 0x2c, 0xc2, 0x00, 0x17, 0x9c, 0x40, 0x5d, 0x7e, 0x4f, +0x35, 0xdf, 0x7e, 0x21, 0x70, 0xa9, 0x53, 0x1f, 0x19, 0xee, 0x0d, 0x0c, 0x12, 0xa9, 0x53, 0x11, +0x07, 0xa9, 0x09, 0x3e, 0x02, 0xc0, 0x35, 0xcf, 0x21, 0x4c, 0x21, 0xff, 0x1e, 0xb9, 0x0f, 0x39, +0x34, 0x3d, 0x7f, 0x0a, 0xc6, 0x81, 0x24, 0xff, 0xb5, 0x71, 0xa8, 0x38, 0x1d, 0x8c, 0x86, 0x9f, +0xc4, 0x30, 0x3b, 0x7c, 0x07, 0x8c, 0x92, 0xf7, 0xc1, 0x2d, 0xe1, 0xc6, 0xf7, 0x4b, 0x88, 0x66, +0xf7, 0xc1, 0x78, 0x0c, 0x6f, 0x2b, 0x62, 0xff, 0x7e, 0x58, 0x31, 0x76, 0xb0, 0x62, 0x6b, 0xcc, +0x60, 0x7c, 0x27, 0xac, 0x24, 0xe7, 0xf6, 0x51, 0x61, 0xfe, 0x65, 0x8c, 0x86, 0x77, 0x71, 0x60, +0x30, 0x0a, 0xc5, 0xa3, 0x67, 0xac, 0x78, 0x36, 0x2e, 0x59, 0x11, 0x26, 0xc3, 0x8a, 0x1e, 0x98, +0x15, 0x16, 0xb0, 0xac, 0x0e, 0x54, 0x9a, 0xf7, 0xe3, 0x33, 0x9a, 0x57, 0x36, 0x1c, 0x0e, 0x47, +0x01, 0x88, 0x3d, 0x87, 0x3c, 0xff, 0xe1, 0x4d, 0xff, 0x1f, 0x00, 0x66, 0x14, 0x18, 0x9a, 0xc5, +0x2f, 0xf8, 0x51, 0x30, 0x0c, 0xfa, 0x82, 0x06, 0x07, 0x3e, 0x41, 0x10, 0xff, 0x10, 0x3a, 0x2f, +0xf4, 0x58, 0xc2, 0xf7, 0x66, 0x4f, 0x01, 0x22, 0x88, 0x01, 0x34, 0x84, 0xd9, 0xa1, 0x21, 0xd4, +0xca, 0x42, 0x2b, 0x9a, 0x43, 0x68, 0xbe, 0x1a, 0x42, 0xb8, 0xd0, 0x10, 0xb2, 0xa1, 0x91, 0xac, +0xa0, 0x09, 0x2d, 0x9a, 0x0d, 0xa1, 0x94, 0x1d, 0x08, 0x8e, 0xf8, 0x0a, 0x08, 0x82, 0x3a, 0x10, +0x7c, 0xff, 0x16, 0x10, 0x70, 0x0f, 0x34, 0x2c, 0x1f, 0x28, 0x20, 0x5e, 0x09, 0x79, 0x52, 0x37, +0x68, 0x42, 0x4c, 0x43, 0x4b, 0x46, 0x40, 0x2d, 0xa1, 0x3a, 0x68, 0x08, 0x34, 0x42, 0x43, 0x2e, +0x28, 0x12, 0x1a, 0x22, 0xc3, 0xdc, 0x0f, 0x6f, 0x02, 0x42, 0x10, 0xb6, 0x84, 0x0a, 0x77, 0xc0, +0x62, 0xfe, 0x2c, 0xde, 0x27, 0xf2, 0x87, 0x0d, 0xd7, 0x1f, 0x02, 0x16, 0xe3, 0x4c, 0xb3, 0xd6, +0x07, 0x17, 0x11, 0xe5, 0xd1, 0x4a, 0xaf, 0xb8, 0x9f, 0x69, 0x24, 0x89, 0xc0, 0x7f, 0x36, 0x19, +0xfc, 0x0f, 0xf4, 0x48, 0x81, 0x33, 0xe0, 0xaf, 0x79, 0x8d, 0x17, 0xaa, 0x80, 0x08, 0x48, 0x67, +0x9b, 0xcd, 0x7f, 0x1f, 0x07, 0x86, 0xc5, 0x91, 0x68, 0x33, 0x7f, 0x00, 0x71, 0xf6, 0x80, 0x3f, +0xf6, 0xce, 0xc2, 0x7f, 0x7a, 0xfc, 0x17, 0x2c, 0x74, 0x07, 0x16, 0x8d, 0x81, 0x6d, 0x78, 0x71, +0x7e, 0x67, 0x39, 0xd8, 0x52, 0xf8, 0x9f, 0x14, 0xc3, 0x9f, 0x5d, 0x19, 0xec, 0xa2, 0x11, 0x18, +0xb0, 0x38, 0x3c, 0x39, 0x8b, 0x57, 0x5e, 0x41, 0x5b, 0x3c, 0x7e, 0xc2, 0x2f, 0x86, 0x06, 0xae, +0xfc, 0x11, 0x98, 0xc9, 0x22, 0x2f, 0x0b, 0x16, 0x29, 0x88, 0x86, 0x40, 0x57, 0xbf, 0xcd, 0x11, +0x2f, 0xfe, 0x86, 0x1c, 0x70, 0xc2, 0x66, 0x99, 0xfe, 0x17, 0xd2, 0x35, 0xce, 0x00, 0x00, 0x83, +0x18, 0x33, 0x03, 0x72, 0x81, 0x4c, 0x04, 0x90, 0x27, 0x69, 0x26, 0x32, 0x82, 0x14, 0x11, 0x0a, +0x06, 0x41, 0x48, 0xc3, 0x48, 0x49, 0xb3, 0x2c, 0x23, 0x83, 0x95, 0x11, 0x93, 0x32, 0x88, 0x33, +0x15, 0xa1, 0x23, 0x98, 0xa5, 0xb3, 0xc4, 0x0a, 0x11, 0x19, 0x33, 0xa4, 0x20, 0x13, 0x14, 0x8c, +0x88, 0x85, 0x03, 0x28, 0x32, 0x33, 0x49, 0x41, 0x63, 0x81, 0x48, 0x63, 0x10, 0x09, 0x48, 0x20, +0x53, 0x24, 0x2b, 0x43, 0x95, 0x15, 0x33, 0xb0, 0x82, 0x23, 0x56, 0x30, 0x13, 0x0a, 0x56, 0x41, +0xc2, 0x03, 0x58, 0x48, 0xf3, 0x21, 0x29, 0xe3, 0x61, 0x10, 0x33, 0xf9, 0x56, 0x00, 0xff, 0x48, +0x0e, 0xf0, 0x85, 0x64, 0x0f, 0x88, 0x84, 0x36, 0x00, 0x30, 0x33, 0x90, 0x06, 0x6c, 0x7f, 0x88, +0xb0, 0x91, 0x96, 0x6c, 0xff, 0xc6, 0xfc, 0x4d, 0x08, 0xe9, 0x1a, 0x02, 0xe7, 0x37, 0x21, 0xa2, +0x0f, 0x90, 0xa2, 0x4b, 0xad, 0xbd, 0x24, 0x48, 0x01, 0x05, 0x25, 0x05, 0xc1, 0x90, 0x2e, 0x2a, +0x18, 0x4a, 0x11, 0xac, 0x24, 0x29, 0xaf, 0xe8, 0x14, 0x99, 0x2b, 0x8c, 0xe0, 0xb0, 0x61, 0x42, +0x00, 0xdb, 0xf3, 0x0f, 0x0c, 0xec, 0x34, 0x3c, 0x46, 0xb0, 0x1c, 0x76, 0xf8, 0x23, 0x58, 0x1b, +0xd8, 0x36, 0xa0, 0x32, 0x9b, 0x30, 0x88, 0x33, 0x08, 0x80, 0x18, 0xb0, 0x9b, 0x2b, 0x08, 0x03, +0x05, 0x29, 0x20, 0x20, 0x15, 0x24, 0xa4, 0x07, 0x91, 0x41, 0x33, 0x0c, 0x08, 0x8b, 0x49, 0xc1, +0x23, 0x83, 0x58, 0x33, 0x04, 0x20, 0x85, 0x14, 0x77, 0x90, 0x82, 0x69, 0x06, 0x31, 0x33, 0x48, +0x15, 0x21, 0x29, 0xbd, 0x20, 0x10, 0x7d, 0x04, 0x22, 0x6f, 0x15, 0xac, 0x0a, 0x86, 0x81, 0xc1, +0xc8, 0x73, 0x60, 0x59, 0x65, 0x8c, 0xac, 0x57, 0x80, 0x15, 0x49, 0xb2, 0x82, 0x3b, 0x59, 0xc1, +0x2d, 0x83, 0x08, 0x33, 0x30, 0x08, 0x60, 0x19, 0x4d, 0x05, 0x32, 0x49, 0x31, 0x99, 0x30, 0x45, +0x06, 0x33, 0x10, 0x57, 0x6c, 0x79, 0x61, 0x17, 0x00, 0x6c, 0x06, 0x24, 0x20, 0x03, 0x42, 0x1e, +0x03, 0xce, 0x1b, 0x40, 0x2a, 0x03, 0x66, 0x19, 0x17, 0x01, 0x2b, 0x30, 0xe0, 0x15, 0x12, 0x03, +0xae, 0x18, 0x0f, 0xc0, 0x21, 0x3c, 0x1c, 0x60, 0x65, 0x0d, 0xc2, 0x3c, 0x0b, 0x2a, 0x0c, 0x33, +0x10, 0x08, 0x60, 0x56, 0xfb, 0x30, 0xac, 0xf3, 0x60, 0x56, 0x59, 0x31, 0xac, 0x63, 0x50, 0x06, +0x33, 0x10, 0xa1, 0x94, 0x58, 0x56, 0x73, 0x22, 0x83, 0x33, 0x26, 0x14, 0x4d, 0xc9, 0x0a, 0x9b, +0x64, 0x10, 0x33, 0x0a, 0x42, 0x10, 0xc1, 0xcb, 0x88, 0x20, 0xcb, 0xc4, 0x10, 0xc3, 0x6c, 0x08, +0x3b, 0x09, 0x02, 0x11, 0x2b, 0x04, 0x62, 0x23, 0x02, 0x11, 0x1b, 0x81, 0x08, 0x13, 0x40, 0x04, +0x20, 0x82, 0x0b, 0x11, 0xc2, 0x33, 0x8b, 0x61, 0xda, 0xd1, 0x61, 0x23, 0x1b, 0x32, 0x88, 0x33, +0x45, 0xa8, 0x50, 0xdc, 0x64, 0x62, 0x78, 0x60, 0x62, 0xb6, 0x8b, 0x6c, 0xef, 0x62, 0xf1, 0x57, +0x55, 0x64, 0xe1, 0x05, 0x4f, 0x16, 0xef, 0xcc, 0x66, 0x01, 0x3e, 0x2c, 0x42, 0x38, 0x78, 0x11, +0x33, 0x17, 0xb2, 0x2c, 0x06, 0x86, 0xc5, 0x0f, 0x1f, 0x51, 0x2c, 0x1b, 0x17, 0xee, 0x88, 0x50, +0xb9, 0x32, 0x88, 0x33, 0x80, 0x3c, 0xb5, 0x72, 0xe0, 0xc9, 0x28, 0x9d, 0x4c, 0x22, 0xab, 0x67, +0x24, 0x29, 0x41, 0x15, 0x0c, 0x62, 0x33, 0xa1, 0x22, 0xbc, 0x05, 0xbf, 0xc8, 0xf8, 0xc8, 0x85, +0x45, 0x43, 0x56, 0x88, 0x9c, 0x0f, 0x44, 0x71, 0x66, 0x82, 0x91, 0x17, 0x88, 0x58, 0xf2, 0x38, +0xc9, 0xc3, 0x97, 0xc6, 0x7c, 0x0d, 0x1b, 0x12, 0xe2, 0x50, 0x3b, 0xaa, 0x0c, 0x33, 0x15, 0xff, +0xcf, 0xcd, 0xef, 0xec, 0xff, 0xdc, 0x8b, 0x0c, 0xc8, 0x27, 0xd1, 0x05, 0x9c, 0xf0, 0x0a, 0x1c, +0x4c, 0x80, 0xb0, 0x67, 0xb2, 0x08, 0x00, 0x01, 0x0c, 0x62, 0x33, 0x01, 0x0a, 0x98, 0x01, 0x21, +0x4b, 0x80, 0x55, 0x34, 0x01, 0xbb, 0x7e, 0x07, 0x06, 0x1d, 0x3c, 0x81, 0x01, 0x1b, 0xc0, 0xb9, +0x0d, 0x2d, 0x96, 0x30, 0x18, 0x10, 0x3c, 0x60, 0x15, 0x91, 0x41, 0x33, 0x0c, 0x58, 0x0d, 0x19, +0x30, 0x0b, 0x34, 0x60, 0x0a, 0x61, 0x15, 0x67, 0x40, 0x50, 0x28, 0x90, 0x41, 0x84, 0x51, 0x84, +0x33, 0xc9, 0xa0, 0x66, 0xc5, 0x17, 0x50, 0x7e, 0x17, 0x83, 0x4c, 0x3c, 0x55, 0xd1, 0x5e, 0x38, +0x07, 0x19, 0xe7, 0x66, 0x2d, 0x21, 0x08, 0x19, 0xc4, 0x7c, 0x33, 0x16, 0x47, 0x8f, 0x1b, 0xd8, +0xc5, 0xfc, 0x19, 0x7c, 0xc2, 0x10, 0xbf, 0x13, 0xc2, 0x7c, 0x3c, 0x65, 0x33, 0xe9, 0x74, 0x50, +0x27, 0x97, 0x57, 0xd1, 0x22, 0x92, 0x72, 0x50, 0x92, 0x5f, 0x50, 0x60, 0x60, 0xf8, 0x18, 0x41, +0x0f, 0x5d, 0xf0, 0xe6, 0x06, 0x06, 0x77, 0xfc, 0xac, 0xa0, 0x60, 0xf6, 0x83, 0xea, 0xec, 0xf9, +0x44, 0x05, 0xa2, 0x78, 0xae, 0xea, 0x45, 0x9c, 0x0c, 0x2c, 0x23, 0x9b, 0x25, 0x10, 0x97, 0x81, +0x20, 0xb7, 0x01, 0x2b, 0x60, 0x20, 0x63, 0x25, 0x27, 0x83, 0x89, 0x20, 0x97, 0x02, 0xd5, 0xfb, +0xa2, 0x56, 0xb0, 0xb2, 0xab, 0x41, 0x12, 0xa3, 0x93, 0x80, 0xc3, 0x59, 0x51, 0xdb, 0xa8, 0x02, +0x17, 0x32, 0xeb, 0xf2, 0xd8, 0xf6, 0x58, 0x5c, 0x5a, 0x00, 0xdc, 0x0c, 0xb2, 0x77, 0x58, 0x0e, +0x0f, 0xe5, 0x5d, 0x00, 0xd8, 0xd8, 0xfc, 0xda, 0xde, 0xb0, 0xdc, 0x0c, 0x0e, 0x09, 0xcb, 0x0f, +0x3e, 0x8c, 0xa0, 0x7c, 0xec, 0x90, 0x3f, 0x0f, 0xea, 0xb0, 0x3f, 0x2d, 0x21, 0x5b, 0x29, 0xea, +0x0c, 0x6b, 0x05, 0x2c, 0x80, 0x91, 0x43, 0xb7, 0xb2, 0x63, 0x00, 0xd9, 0x67, 0xee, 0x6c, 0xfe, +0x10, 0x0c, 0xd4, 0x6c, 0x0f, 0x56, 0x02, 0x7b, 0x32, 0xa2, 0x8b, 0x00, 0x95, 0xa8, 0x84, 0xdb, +0x92, 0x8d, 0xeb, 0xf0, 0x46, 0xd4, 0x9b, 0xa2, 0x56, 0x15, 0xb2, 0xab, 0x90, 0x11, 0xab, 0x44, +0x8d, 0x0c, 0x6a, 0x09, 0xb8, 0x2b, 0x03, 0x7b, 0x49, 0x51, 0x8b, 0x88, 0x0a, 0x54, 0xc8, 0xbb, +0x42, 0x56, 0xcb, 0x32, 0xa2, 0xcb, 0x94, 0x11, 0x3f, 0x0c, 0xa8, 0xfb, 0x45, 0x2d, 0x2a, 0x64, +0x0b, 0x21, 0x29, 0x2b, 0x4a, 0x19, 0x9f, 0xfd, 0xab, 0x05, 0x6c, 0xd8, 0x6c, 0x36, 0xb9, 0x80, +0x0f, 0x0d, 0x23, 0xaa, 0x11, 0x9b, 0xad, 0x02, 0x25, 0x41, 0x9b, 0x2b, 0x6a, 0xab, 0x51, 0x21, +0x1a, 0x49, 0x8b, 0x4b, 0xa0, 0x8b, 0x59, 0x05, 0x67, 0xa8, 0x55, 0xb5, 0xa4, 0xdb, 0x95, 0x40, +0xeb, 0xac, 0x82, 0x67, 0xb5, 0x8a, 0x90, 0x15, 0x5b, 0xb0, 0x8c, 0xff, 0x91, 0x55, 0x67, 0x10, +0x56, 0x21, 0x21, 0x46, 0xce, 0x0f, 0x66, 0x2c, 0x92, 0x32, 0xa8, 0xfb, 0x15, 0xb5, 0xaa, 0x95, +0xfb, 0x8d, 0x24, 0x0b, 0x24, 0x50, 0x0b, 0x8b, 0x28, 0x2f, 0x40, 0x35, 0x6a, 0x84, 0x1b, 0x35, +0x89, 0x2b, 0x95, 0x40, 0x2b, 0xac, 0x82, 0x67, 0xd5, 0xaa, 0x56, 0x12, 0x7b, 0x93, 0x82, 0x63, +0xa7, 0xa0, 0x3c, 0x64, 0x93, 0x60, 0x36, 0x18, 0x54, 0xab, 0xa2, 0x46, 0xd5, 0x32, 0xab, 0x52, +0x12, 0xbb, 0x3c, 0xa2, 0xbb, 0x89, 0xea, 0xcb, 0x51, 0x2b, 0x5a, 0x19, 0xcb, 0x75, 0xa2, 0xdb, +0x85, 0x11, 0xdb, 0x2b, 0x6b, 0xef, 0x19, 0x54, 0xcb, 0x8b, 0x6a, 0xdb, 0x54, 0x2b, 0xaa, 0x49, +0x2b, 0x23, 0x84, 0x3b, 0x19, 0x51, 0xab, 0xa2, 0x0a, 0x44, 0x48, 0xbb, 0x0a, 0x09, 0x63, 0x4a, +0x82, 0x20, 0x06, 0xd0, 0xcc, 0x8b, 0x6a, 0x0b, 0x54, 0x2b, 0x5a, 0x49, 0x5b, 0x4d, 0xa8, 0x6b, +0xaa, 0x85, 0xbf, 0x01, 0x2c, 0x6b, 0xa4, 0xa8, 0xfe, 0x3b, 0x51, 0xad, 0x6a, 0x65, 0x4b, 0x21, +0x29, 0x9b, 0xea, 0x65, 0x3f, 0x07, 0x07, 0x2b, 0x29, 0xdb, 0x58, 0x54, 0xeb, 0x02, 0x58, 0x38, +0x13, 0x1b, 0x28, 0x83, 0x33, 0x04, 0x22, 0x48, 0x12, 0x04, 0x04, 0x27, 0x03, 0x09, 0x96, 0x02, +0x01, 0x03, 0x26, 0xf0, 0xff, 0x82, 0x03, 0xf0, 0x8c, 0x0c, 0x71, 0x64, 0x10, 0x8d, 0x2c, 0x60, +0x3d, 0x16, 0xb0, 0x59, 0x51, 0x67, 0x48, 0x49, 0xc1, 0x4b, 0x28, 0x81, 0x59, 0x51, 0x69, 0x0b, +0x18, 0x75, 0xc0, 0x08, 0xa2, 0x66, 0xeb, 0x85, 0xb0, 0x93, 0x65, 0x50, 0x61, 0xcb, 0x80, 0xe5, +0xc0, 0x80, 0xdc, 0xe3, 0x30, 0xe0, 0xdc, 0xe1, 0x0c, 0x38, 0xdc, 0xdf, 0x12, 0x0e, 0xdc, 0x17, +0x03, 0xce, 0xdb, 0x80, 0x03, 0xe6, 0x53, 0xcb, 0xd9, 0xc8, 0xc3, 0x80, 0xd7, 0x82, 0x53, 0xd6, +0x10, 0x12, 0x01, 0x46, 0x42, 0x1d, 0x30, 0x03, 0xc4, 0xbd, 0x19, 0xc0, 0x0a, 0x80, 0x9a, 0x0d, +0x54, 0xca, 0x1f, 0x5a, 0x46, 0x8d, 0xc8, 0x80, 0x73, 0x46, 0xd4, 0xe1, 0x88, 0x5a, 0xc0, 0xc8, +0x9b, 0x94, 0x79, 0xc3, 0x57, 0x46, 0xa9, 0xfe, 0x90, 0x01, 0xbe, 0xa4, 0xa8, 0x5f, 0x9a, 0x85, +0x0d, 0xc8, 0x88, 0xb7, 0x56, 0xd4, 0x85, 0x88, 0x5a, 0xc2, 0xc8, 0xc5, 0xf7, 0xa0, 0x42, 0x35, +0x90, 0x6f, 0x96, 0x14, 0xdd, 0x92, 0xa2, 0x19, 0x90, 0x31, 0x4b, 0xc8, 0x80, 0xa8, 0x7a, 0xc0, +0xa6, 0xc0, 0x88, 0x9b, 0x50, 0x21, 0x1a, 0x49, 0xfb, 0xcb, 0x8a, 0x69, 0x49, 0x51, 0x6d, 0x0c, +0x48, 0x35, 0x55, 0x10, 0x1a, 0x94, 0x67, 0x4b, 0x8a, 0xb3, 0x89, 0x01, 0x89, 0x55, 0x10, 0x16, +0x90, 0x67, 0xb0, 0xa2, 0x23, 0x96, 0x91, 0x9f, 0xb0, 0x0a, 0x67, 0xd8, 0xaa, 0xfd, 0x30, 0x20, +0x66, 0xea, 0x31, 0x40, 0x2b, 0x83, 0x6f, 0x59, 0x51, 0xaf, 0x0e, 0x08, 0x5f, 0x8a, 0x3a, 0xc0, +0xca, 0xbd, 0xa2, 0x66, 0x5b, 0x0c, 0xb0, 0xcb, 0xa8, 0x07, 0x57, 0xac, 0xac, 0xd9, 0x64, 0x15, +0x67, 0x03, 0x42, 0x4b, 0x51, 0x03, 0x0b, 0x09, 0xad, 0x30, 0x66, 0x0b, 0x18, 0xb0, 0x03, 0x63, +0xcc, 0xce, 0x95, 0x55, 0x75, 0xc1, 0x80, 0x41, 0x84, 0xaa, 0xf0, 0x9b, 0x06, 0xac, 0x3d, 0x11, +0x35, 0xc2, 0xaa, 0x95, 0xc5, 0x85, 0x24, 0x33, 0x2f, 0x59, 0xf7, 0x2b, 0x5a, 0x59, 0x51, 0xcb, +0xa0, 0x45, 0x59, 0x54, 0x13, 0x83, 0x6a, 0x99, 0x72, 0x23, 0x8b, 0x44, 0x4d, 0xfd, 0x6a, 0x65, +0xa9, 0x2c, 0x89, 0x17, 0x91, 0x40, 0x7d, 0xc8, 0x80, 0x24, 0x65, 0xc0, 0x22, 0xc8, 0x80, 0x20, +0x06, 0xd5, 0xc3, 0x0c, 0x58, 0x1d, 0x6a, 0xd9, 0xa7, 0x2b, 0x89, 0xb1, 0xa4, 0xa8, 0xfe, 0x27, +0x51, 0xad, 0xa8, 0x25, 0x95, 0x8d, 0xa4, 0x7b, 0x51, 0xe7, 0x37, 0x58, 0x49, 0xb3, 0x90, 0x0c, +0x0d, 0x26, 0x01, 0x4b, 0x41, 0x4c, 0x10, 0x80, 0x33, 0x05, 0x02, 0x9f, 0xd0, 0x58, 0xfe, 0x0c, +0xa1, 0xcf, 0xe5, 0x07, 0x6c, 0xd3, 0xf6, 0xa2, 0x7e, 0x9c, 0x07, 0x5e, 0x8b, 0xe7, 0x00, 0xb0, +0x08, 0xff, 0x0a, 0x5a, 0x06, 0x04, 0x31, 0xcf, 0xa8, 0x60, 0xcb, 0x51, 0x4b, 0xde, 0xa8, 0x48, +0x43, 0x45, 0x4d, 0xce, 0xa3, 0x21, 0xa3, 0xa5, 0x19, 0xc1, 0xeb, 0x8c, 0x60, 0xfb, 0xa3, 0x36, +0x69, 0xa0, 0xa8, 0x96, 0x9e, 0x34, 0xac, 0xc3, 0x16, 0x7f, 0x97, 0x5e, 0x5b, 0xde, 0x15, 0x9a, +0xd1, 0x58, 0xa9, 0xb9, 0x3f, 0x8b, 0xfe, 0xdb, 0xde, 0x05, 0xb0, 0x19, 0x9d, 0xa0, 0xc6, 0x5a, +0x1f, 0x9f, 0x66, 0x11, 0x65, 0xfc, 0xed, 0xfc, 0x07, 0xc6, 0xcc, 0xf8, 0xf8, 0xcc, 0xc6, 0x82, +0x14, 0x3b, 0x41, 0x0a, 0x4b, 0x0d, 0x12, 0x2e, 0x38, 0xd4, 0x8b, 0x06, 0x07, 0x6a, 0x16, 0x0b, +0xd4, 0x12, 0x2e, 0xa3, 0x17, 0x3b, 0x49, 0xf5, 0x91, 0x48, 0x3c, 0x86, 0x11, 0x9b, 0x90, 0xa2, +0xa3, 0x46, 0x54, 0xa3, 0x29, 0x6a, 0xab, 0xa2, 0x0e, 0x00, 0x7b, 0x91, 0x0b, 0x05, 0x07, 0x46, +0xd4, 0xab, 0x8a, 0x1a, 0x11, 0x75, 0xb3, 0xa2, 0x96, 0xb3, 0x50, 0x93, 0xbb, 0x6a, 0x58, 0xcb, +0x35, 0x29, 0x53, 0x86, 0x11, 0xe3, 0x27, 0xf1, 0x05, 0x0d, 0x33, 0x1b, 0x05, 0x33, 0x33, 0xca, +0x7d, 0x97, 0x66, 0x09, 0x02, 0x23, 0x9b, 0x10, 0x15, 0xa2, 0x86, 0x1b, 0x42, 0x93, 0xa3, 0xb8, +0x24, 0x1a, 0xf6, 0x55, 0x10, 0x28, 0x94, 0x67, 0xb3, 0x49, 0x94, 0x7c, 0x06, 0x59, 0x05, 0x67, +0xa8, 0x10, 0x34, 0xa4, 0x7b, 0x82, 0x49, 0xde, 0x88, 0xac, 0x67, 0x84, 0x5e, 0x91, 0x27, 0x53, +0xd4, 0xc3, 0xac, 0xa8, 0xcb, 0x14, 0x95, 0x10, 0x9a, 0xcb, 0x11, 0x86, 0xd0, 0x0a, 0x2d, 0x89, +0x6e, 0xa2, 0x08, 0x60, 0x16, 0x4b, 0x5e, 0xaf, 0xab, 0x20, 0x67, 0x51, 0x28, 0xa8, 0x25, 0x6e, +0x61, 0x8f, 0x13, 0x1b, 0xac, 0xa8, 0xa3, 0x11, 0xb5, 0xf5, 0xe2, 0xa3, 0x2b, 0x81, 0x11, 0xab, +0xf5, 0xa0, 0xf6, 0x96, 0x11, 0xb3, 0x11, 0xf5, 0x05, 0x8b, 0x80, 0xbb, 0x9d, 0x45, 0x2d, 0xa8, +0x62, 0xb3, 0x66, 0x13, 0xbb, 0x4f, 0x12, 0xa8, 0xeb, 0x46, 0xd4, 0xa3, 0xb3, 0x08, 0x6f, 0x10, +0x88, 0x7c, 0xcb, 0xf2, 0x45, 0x5c, 0x7e, 0x06, 0x5d, 0xf6, 0x86, 0x8a, 0x5a, 0x19, 0xf4, 0xfb, +0x76, 0xcc, 0x62, 0x35, 0x6a, 0x59, 0x3d, 0x1d, 0x23, 0xeb, 0xf8, 0x0c, 0x8b, 0xd7, 0x06, 0x0c, +0xfa, 0x1c, 0x61, 0x11, 0x32, 0x55, 0xb0, 0x9f, 0x1a, 0x02, 0xc3, 0x49, 0xa8, 0xdb, 0x59, 0x05, +0x67, 0x40, 0x0e, 0x1d, 0xbf, 0xf2, 0x64, 0x62, 0x05, 0x99, 0x52, 0x44, 0x0a, 0x4a, 0x21, 0x0b, +0x50, 0x45, 0x00, 0x90, 0x14, 0xa1, 0xc1, 0x39, 0x13, 0x50, 0x56, 0x67, 0x09, 0x44, 0x00, 0x08, +0x94, 0x84, 0x22, 0x11, 0x30, 0x2f, 0xb7, 0xc0, 0x2a, 0x67, 0x01, 0x08, 0x45, 0x21, 0x40, 0x42, +0x11, 0x02, 0x48, 0x12, 0xa3, 0x21, 0x83, 0x33, 0x0c, 0xc8, 0x51, 0xe5, 0x68, 0x0a, 0x9e, 0x39, +0xbf, 0x22, 0xb2, 0x67, 0x50, 0xb2, 0x49, 0x50, 0xa2, 0x02, 0x41, 0x85, 0xc1, 0x39, 0xbb, 0x50, +0x56, 0x67, 0x12, 0x45, 0xbc, 0xa0, 0x17, 0xab, 0xc0, 0x67, 0x02, 0x02, 0x51, 0xa1, 0x20, 0x08, +0x2b, 0x0a, 0xab, 0x67, 0x7f, 0xa8, 0x0d, 0x0a, 0x54, 0x68, 0x69, 0x73, 0x7f, 0xfb, 0x20, 0x66, +0x6f, 0x6e, 0x74, 0x04, 0x69, 0x6c, 0x65, 0x20, 0x68, 0x61, 0xff, 0x6f, 0x0d, 0x62, 0x65, 0x65, +0x6e, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x73, 0xdb, 0x64, 0x2f, 0x02, 0x69, 0x06, 0x13, +0xb7, 0x7f, 0x79, 0x20, 0x43, 0x50, 0x49, 0x61, 0x64, 0x09, 0x56, 0x31, 0xff, 0xed, 0x2e, 0x32, +0x30, 0x37, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0xfd, 0x2f, 0x28, 0x43, 0x29, 0x20, +0x31, 0x39, 0x39, 0x33, 0x2d, 0xfb, 0xd7, 0x04, 0x36, 0x28, 0x6b, 0x6f, 0x73, 0x74, 0x54, 0xdb, +0x7f, 0x40, 0x61, 0x63, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x1f, 0x4b, 0x63, 0x77, 0x0f, 0x61, 0x20, +0x4b, 0x15, 0x29, 0xff, 0x60, 0x71, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x77, 0xf7, 0x20, +0x6d, 0x61, 0x79, 0x6f, 0x20, 0x75, 0x73, 0x63, 0xdd, 0x5a, 0x66, 0x72, 0x09, 0x6f, 0x66, 0x6b, +0xad, 0x7a, 0x84, 0x36, 0x09, 0xf6, 0x5b, 0x7e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x11, 0xdf, 0xda, +0x77, 0x8d, 0x69, 0x73, 0x6b, 0x2e, 0x0d, 0x00, 0x80, 0x0a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x40, +0xff, 0xa4, 0xe8, 0x3a, 0x00, 0x72, 0xfa, 0x41, 0xe8, 0x2f, 0x00, 0xe3, 0x3b, 0x73, 0xf9, 0x83, +0xe9, 0x03, 0x72, 0x06, 0x88, 0xcc, 0xac, 0xf7, 0xd0, 0x95, 0x31, 0xc9, 0xe8, 0x1b, 0x00, 0x11, +0xc9, 0x75, 0x08, 0x41, 0xe8, 0x13, 0x00, 0x73, 0xfb, 0x41, 0x41, 0x81, 0xfd, 0x00, 0xf3, 0x83, +0xd1, 0x01, 0x8d, 0x03, 0x96, 0xf3, 0xa4, 0x96, 0xeb, 0xc8, 0xe8, 0x02, 0x00, 0x11, 0xc9, 0x01, +0xdb, 0x75, 0x04, 0xad, 0x11, 0xc0, 0x93, 0xc3, 0x5e, 0xb9, 0x01, 0x00, 0xac, 0x2c, 0xe8, 0x3c, +0x01, 0x77, 0xf9, 0x8b, 0x1c, 0x86, 0xdf, 0x29, 0xf3, 0x89, 0x1c, 0xad, 0xe2, 0xee, 0xc3 }; + +Bit8u font_ega5_cpx[5720] = { +0x81, 0xfc, 0x9a, 0xc1, 0x77, 0x02, 0xcd, 0x20, 0xb9, 0x58, 0x16, 0xbe, 0x58, 0x17, 0xbf, 0x3a, +0xc1, 0xbb, 0x00, 0x80, 0xfd, 0xf3, 0xa4, 0xfc, 0x87, 0xf7, 0x83, 0xee, 0xc6, 0x19, 0xed, 0x57, +0x57, 0xe9, 0xb9, 0xbf, 0x55, 0x50, 0x58, 0x21, 0x0b, 0x01, 0x04, 0x08, 0xcf, 0xfc, 0xfe, 0x92, +0xf9, 0xe1, 0xc2, 0x32, 0xcc, 0xbf, 0xc0, 0x15, 0x06, 0xcf, 0xbb, 0xfc, 0xff, 0x46, 0x4f, 0x4e, +0x54, 0x20, 0x00, 0x00, 0x01, 0x6e, 0x39, 0x01, 0x17, 0x06, 0xfd, 0xfd, 0x05, 0x00, 0x1c, 0x00, +0x4d, 0x26, 0x0e, 0x45, 0x47, 0x41, 0xc9, 0xcd, 0x1e, 0x20, 0xe1, 0x02, 0xfe, 0xd8, 0x35, 0x24, +0x03, 0x00, 0x12, 0x26, 0x10, 0x08, 0x95, 0xc5, 0x0a, 0x00, 0x6d, 0xff, 0x7e, 0x81, 0xa5, 0x81, +0x81, 0xbd, 0x99, 0x03, 0x7e, 0xfe, 0x83, 0x0f, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, +0xe6, 0x77, 0x00, 0x6c, 0xfe, 0x3e, 0xec, 0x7c, 0x38, 0x10, 0x30, 0x10, 0x38, 0x7c, 0xfd, 0xc0, +0x0e, 0x18, 0x3c, 0x3c, 0xe7, 0xb2, 0xb6, 0x00, 0x18, 0x06, 0x0f, 0x65, 0x6e, 0x7e, 0x3b, 0x0f, +0xb3, 0xb3, 0x22, 0x18, 0x09, 0xde, 0xb1, 0xff, 0x00, 0xe7, 0xc3, 0x5f, 0x3f, 0xf6, 0x00, 0x1f, +0x3c, 0x66, 0x42, 0x42, 0x66, 0xff, 0x92, 0x3c, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xfe, 0x21, +0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, 0xde, 0xeb, 0x00, 0x78, 0x20, 0x2d, 0xb9, 0xe6, 0x00, 0x4f, +0x61, 0xbb, 0x9f, 0x0f, 0x3f, 0x33, 0x3f, 0x30, 0x00, 0x70, 0xf0, 0xf9, 0xc8, 0xe0, 0x00, 0x7f, +0x63, 0x7f, 0x63, 0x9e, 0xbd, 0x67, 0xe7, 0xe6, 0xc0, 0x7c, 0x18, 0xdb, 0x87, 0xdd, 0xa0, 0x3c, +0xdb, 0x2e, 0x80, 0xbb, 0xfd, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0x2d, 0xc0, 0x80, 0xbf, 0xfe, +0x1f, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x6b, 0x49, 0x2b, 0x5e, +0x7c, 0x67, 0x3c, 0x00, 0x66, 0x98, 0x9b, 0x07, 0x5f, 0xe7, 0x36, 0xdb, 0x00, 0x7b, 0x1b, 0xff, +0x9b, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0x06, 0xe4, 0xc6, 0x7c, +0x00, 0xfe, 0x43, 0x66, 0x4f, 0x7e, 0x6f, 0x60, 0x0f, 0x00, 0xbd, 0x60, 0x0f, 0x00, 0xfe, 0x96, +0x70, 0x11, 0x0c, 0xfe, 0x0c, 0x77, 0xc9, 0x0c, 0x00, 0x30, 0x60, 0xfe, 0x06, 0xe4, 0x60, 0x30, +0x00, 0xc0, 0x61, 0x56, 0x5c, 0xa1, 0x76, 0x39, 0x28, 0x6c, 0x28, 0x0e, 0x50, 0x58, 0x9f, 0xb2, +0xb7, 0xa0, 0x7c, 0x7d, 0x8a, 0x0e, 0x5b, 0x0e, 0x38, 0xaf, 0xbc, 0xc0, 0x00, 0x18, 0x3c, 0x66, +0xaf, 0x8c, 0x8f, 0x21, 0xeb, 0xe9, 0x24, 0x20, 0x8b, 0xb9, 0x6c, 0x5e, 0x03, 0xad, 0xfe, 0x36, +0xf1, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0x1e, 0xd6, 0xef, 0xc1, 0xc2, 0xc6, 0x26, 0xdf, 0xae, +0x30, 0x60, 0xc6, 0x86, 0x2e, 0x14, 0x0e, 0x0c, 0x76, 0xdc, 0xc1, 0x1a, 0xaf, 0x76, 0xbd, 0x81, +0x6d, 0x00, 0x60, 0x4e, 0x8b, 0xb9, 0x2b, 0x00, 0xe5, 0xb9, 0x59, 0x0f, 0x08, 0x96, 0x8d, 0x00, +0x18, 0xe2, 0x15, 0x16, 0xde, 0xff, 0xe5, 0x84, 0x81, 0xa2, 0xed, 0x06, 0xb6, 0x14, 0x6c, 0xc0, +0x31, 0xfe, 0xd7, 0x96, 0xad, 0x31, 0xf9, 0x15, 0xe2, 0x9f, 0xc0, 0x80, 0xf8, 0x30, 0xae, 0xd6, +0xd6, 0x0e, 0x76, 0xb2, 0x27, 0x38, 0x78, 0x59, 0x10, 0x81, 0x2e, 0xf6, 0xe4, 0x7c, 0xc6, 0xc6, +0xfe, 0x0f, 0xd8, 0x4e, 0x06, 0x3c, 0x02, 0x06, 0xfd, 0x43, 0xdf, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, +0xfe, 0x9c, 0xd0, 0xb0, 0x1e, 0x8d, 0xfe, 0x03, 0xd6, 0xfc, 0x1f, 0x38, 0x90, 0xbb, 0x60, 0x0f, +0xc6, 0xc6, 0xc6, 0x66, 0xee, 0xfe, 0x3f, 0xf3, 0x73, 0xc3, 0x4f, 0x1a, 0x1f, 0x7d, 0x01, 0x0b, +0x7e, 0x0b, 0xdb, 0x3f, 0x0c, 0x78, 0xba, 0x0b, 0x7b, 0x04, 0x0f, 0x62, 0x93, 0x30, 0x9e, 0x92, +0x1a, 0x35, 0x06, 0xc2, 0xc9, 0xde, 0x02, 0x00, 0xf6, 0x62, 0x1b, 0x23, 0x5f, 0x25, 0x4c, 0x0c, +0xdf, 0xb6, 0xb3, 0x10, 0xde, 0x00, 0xdc, 0x61, 0x14, 0xc4, 0x2e, 0x3b, 0xdb, 0x6c, 0x90, 0xfe, +0x0f, 0x6c, 0x3c, 0xfc, 0x66, 0xf1, 0x7c, 0x86, 0xf4, 0xfc, 0x6f, 0xd4, 0x15, 0xef, 0x00, 0xc2, +0xf2, 0xe9, 0xa1, 0x10, 0xf8, 0x6c, 0x3f, 0x7b, 0x6c, 0xf8, 0x0f, 0xfe, 0x66, 0x62, 0x68, 0x84, +0xfc, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0xc0, 0xb6, 0x00, 0xf0, 0x3f, 0x4d, 0x7e, 0xde, 0xc6, +0xc6, 0x66, 0x3a, 0x61, 0xef, 0x69, 0x6e, 0x6f, 0x6b, 0xc2, 0x3c, 0x7d, 0x30, 0x31, 0x26, 0x1e, +0x0d, 0x77, 0x49, 0xef, 0xe6, 0x6a, 0xb3, 0x6e, 0x78, 0x78, 0x74, 0xe6, 0x0f, 0xb3, 0xd8, 0xf0, +0x60, 0x00, 0x6f, 0x92, 0x7f, 0x4f, 0xee, 0xfe, 0xfe, 0xd6, 0xf2, 0xdb, 0x0f, 0xe6, 0xf6, 0xfe, +0xde, 0xce, 0x79, 0x58, 0x6f, 0xc6, 0x9b, 0x2d, 0xdf, 0x41, 0x27, 0xec, 0xf0, 0x1f, 0xd6, 0xde, +0x97, 0xe4, 0x7c, 0x0c, 0x0e, 0xe3, 0x29, 0xd9, 0xe6, 0x1f, 0xe2, 0xb2, 0x42, 0x50, 0x3f, 0x09, +0x7b, 0x7e, 0x7e, 0x5a, 0xaf, 0x16, 0xb2, 0xc6, 0x5f, 0x0f, 0x25, 0x0f, 0x6c, 0x38, 0x10, 0x43, +0xfe, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x6b, 0xa6, 0x6c, 0x8e, 0x61, 0x9f, 0x66, 0x0d, 0xce, +0x0b, 0xcb, 0x4f, 0x1b, 0x86, 0x21, 0x1f, 0x7f, 0xc2, 0x16, 0xec, 0x3c, 0x30, 0x00, 0x1f, 0xfe, +0x0a, 0xc1, 0x70, 0x38, 0x1c, 0x76, 0xb2, 0xaf, 0x3c, 0x0c, 0x00, 0x62, 0x0c, 0x3c, 0xdc, 0x8d, +0x90, 0xe6, 0xec, 0x34, 0x6c, 0xff, 0x18, 0xe9, 0x03, 0x78, 0x0c, 0x7c, 0xaf, 0x16, 0x2e, 0xe0, +0x19, 0x78, 0x66, 0x11, 0xe2, 0xcf, 0x1c, 0x13, 0x02, 0x00, 0xb9, 0xc3, 0xdf, 0x1c, 0x69, 0x2d, +0x2b, 0x00, 0x2f, 0x80, 0x8c, 0x1f, 0xfe, 0xc6, 0xfb, 0x36, 0x32, 0x30, 0x78, 0xaf, 0xcf, 0xf0, +0x5d, 0x76, 0x2e, 0xcc, 0xdf, 0xa1, 0x5f, 0xd2, 0x5f, 0x6c, 0x32, 0x9e, 0x76, 0xe6, 0xdc, 0x03, +0x61, 0x38, 0x4f, 0x6b, 0x4b, 0x09, 0x00, 0xdb, 0x00, 0xcc, 0x10, 0x17, 0x2f, 0x71, 0xc6, 0x00, +0xe6, 0x90, 0x9c, 0x2f, 0x38, 0x35, 0xba, 0x00, 0xec, 0x00, 0x4c, 0xd6, 0x00, 0xc6, 0x0f, 0xdc, +0xcb, 0x66, 0xa1, 0x9f, 0x6c, 0x09, 0x9f, 0x1f, 0xf6, 0xb1, 0x04, 0xf0, 0x9f, 0x90, 0x16, 0xd2, +0x19, 0xed, 0xdc, 0x9f, 0x1f, 0x4c, 0x60, 0xe4, 0x76, 0x09, 0xdf, 0x10, 0xd9, 0xb2, 0xdf, 0xfc, +0xde, 0x36, 0x1c, 0x1f, 0x10, 0x5e, 0x3d, 0x0f, 0x82, 0x31, 0x00, 0x47, 0xc0, 0x0f, 0x00, 0xb7, +0x84, 0x9a, 0x1b, 0x30, 0x53, 0x38, 0x75, 0x2f, 0xd4, 0xb5, 0x04, 0x0c, 0x03, 0x87, 0x52, 0xcc, +0x4f, 0xcd, 0xd9, 0xfe, 0xef, 0x0e, 0x70, 0x64, 0x3d, 0x0e, 0xf7, 0x09, 0x83, 0x3f, 0xda, 0x7b, +0x1b, 0x23, 0x24, 0x40, 0xf8, 0xc9, 0xdc, 0xdf, 0x8b, 0x34, 0xe2, 0x4f, 0x95, 0x34, 0xef, 0x76, +0x7a, 0xfe, 0x62, 0x1c, 0xff, 0xe6, 0x5e, 0x10, 0x10, 0xab, 0x3f, 0x2b, 0x69, 0xef, 0x5a, 0x19, +0xaf, 0x69, 0x4a, 0xdf, 0x7c, 0xef, 0x40, 0x0e, 0x7c, 0x91, 0xb4, 0xdf, 0x69, 0xb2, 0x6f, 0xc6, +0xdf, 0x52, 0x08, 0xe0, 0x30, 0x48, 0xde, 0x6d, 0xed, 0x82, 0x63, 0x5b, 0x82, 0x02, 0xa9, 0x07, +0xef, 0x0e, 0xe9, 0xfe, 0xff, 0xc6, 0xb6, 0x40, 0x1f, 0x6b, 0xe0, 0x62, 0x30, 0x5b, 0x62, 0xbf, +0x56, 0xd2, 0xdf, 0xb4, 0x92, 0x9f, 0xf6, 0xb1, 0xd7, 0x7c, 0x6d, 0x7c, 0xa6, 0x0b, 0xa4, 0xcf, +0xd8, 0x7b, 0x1c, 0x1e, 0x1f, 0x17, 0x61, 0x7b, 0x24, 0x2f, 0x69, 0x28, 0xee, 0x0f, 0xdc, 0xd8, +0x60, 0x6c, 0x00, 0xdc, 0x2f, 0xe0, 0x8b, 0xdb, 0xd8, 0x3c, 0xf8, 0x30, 0xfc, 0xa1, 0xbe, 0x64, +0x1f, 0x35, 0x7c, 0xda, 0x04, 0x3f, 0x9e, 0x21, 0xc5, 0xd3, 0x8f, 0x24, 0x3b, 0x78, 0xc0, 0xdf, +0x61, 0x3a, 0x7d, 0x9f, 0x61, 0x34, 0x94, 0x3c, 0xff, 0x90, 0x69, 0x49, 0x6b, 0x9d, 0x2f, 0x3e, +0xbd, 0xc4, 0x2b, 0xd9, 0x3f, 0x4f, 0x97, 0x31, 0xbf, 0xc6, 0x6f, 0xf6, 0xcc, 0xf8, 0xf8, 0xcc, +0xbf, 0x8f, 0x78, 0x5f, 0x4b, 0x6c, 0x0f, 0xee, 0xc2, 0xdf, 0xf6, 0x63, 0x21, 0x09, 0xb2, 0xb3, +0x06, 0xa1, 0x30, 0x4f, 0x38, 0x63, 0x17, 0x4a, 0x3c, 0x60, 0x7f, 0x1c, 0x42, 0x48, 0x6f, 0x72, +0x2f, 0x3f, 0x00, 0x6c, 0x48, 0x8f, 0xfc, 0x4f, 0xe3, 0x9d, 0x7e, 0xd8, 0x00, 0xbf, 0x86, 0xc1, +0x32, 0xb2, 0xe6, 0x1a, 0x54, 0x4f, 0x21, 0x69, 0xfe, 0x6f, 0x03, 0x7b, 0x7f, 0xcf, 0x3a, 0x84, +0x5c, 0x72, 0x10, 0x9d, 0x40, 0x5f, 0x10, 0xd6, 0xb0, 0x93, 0x1f, 0x11, 0x44, 0x01, 0x85, 0xbc, +0x55, 0xaa, 0x2e, 0xe4, 0xdd, 0x77, 0x18, 0xbb, 0xc0, 0x00, 0xf8, 0x0d, 0x64, 0x21, 0x0f, 0xe4, +0xd9, 0x36, 0x00, 0xf6, 0x36, 0x1b, 0x16, 0xc0, 0x0f, 0x64, 0x09, 0x2f, 0xd8, 0x79, 0xf6, 0x06, +0x00, 0xcd, 0x12, 0x3d, 0xb4, 0x90, 0x1f, 0x2f, 0x2c, 0x59, 0xee, 0x11, 0x4b, 0x16, 0x0f, 0x8f, +0x64, 0x0d, 0x00, 0x43, 0x36, 0xf8, 0xbf, 0x1f, 0x3c, 0x61, 0x2f, 0x18, 0x18, 0xff, 0xc9, 0x90, +0xff, 0xc2, 0x1a, 0x72, 0xc8, 0xda, 0x1f, 0x3f, 0x0c, 0xd9, 0x2d, 0x1f, 0x36, 0x24, 0x0f, 0x37, +0xbf, 0xd8, 0x13, 0x37, 0x30, 0x3f, 0x6d, 0x95, 0x4a, 0xbf, 0xd9, 0x85, 0x1f, 0xf7, 0x5f, 0x1b, +0x6c, 0x6d, 0xf7, 0x3f, 0x64, 0x21, 0x2f, 0x65, 0xb3, 0x1f, 0x2f, 0x65, 0xb3, 0x3f, 0x2f, 0x61, +0xb0, 0xdd, 0xff, 0x2f, 0x64, 0x21, 0x5f, 0x46, 0x76, 0xff, 0xdf, 0x16, 0x12, 0x86, 0xaf, 0x0d, +0x4b, 0xdf, 0xbd, 0x84, 0x3f, 0xef, 0xc9, 0x85, 0x3f, 0x3f, 0x24, 0x0b, 0x4f, 0x84, 0x20, 0x2d, +0x5f, 0x24, 0x8c, 0xaf, 0x9b, 0x6c, 0x4f, 0xff, 0x00, 0x61, 0x21, 0x9f, 0xe4, 0xb0, 0x00, 0xf0, +0x48, 0x86, 0x0f, 0x58, 0x58, 0x36, 0xe4, 0x30, 0x8f, 0x44, 0x58, 0x0f, 0x08, 0x10, 0x8f, 0x96, +0x5b, 0x0f, 0x5f, 0xe5, 0x12, 0x0f, 0x1e, 0x96, 0x4f, 0xf5, 0x66, 0xb2, 0x41, 0x0e, 0x1f, 0x12, +0x56, 0x4f, 0x81, 0xf4, 0x3f, 0xff, 0x21, 0xe9, 0x04, 0x08, 0xaf, 0xb7, 0xb0, 0x66, 0x0f, 0x2f, +0x1c, 0x30, 0x8f, 0x40, 0x80, 0x5b, 0x18, 0x9f, 0x0f, 0x68, 0x60, 0x7e, 0xaa, 0x78, 0xcd, 0x1e, +0xaf, 0x7e, 0x0f, 0x2c, 0xf6, 0x3a, 0x7e, 0x40, 0x0f, 0x85, 0xc1, 0x4f, 0x08, 0xb4, 0x0f, 0xff, +0x3b, 0x5b, 0x2f, 0x3c, 0x1f, 0x02, 0x01, 0x8f, 0xac, 0x52, 0x5d, 0x96, 0xd4, 0x41, 0x16, 0xa4, +0x3e, 0x10, 0x90, 0x4a, 0x6e, 0xf6, 0x5e, 0x0f, 0xbc, 0x6f, 0x06, 0x17, 0x66, 0x1f, 0xe7, 0x52, +0x50, 0x2a, 0x02, 0x0f, 0x09, 0xee, 0x90, 0x58, 0x97, 0x0c, 0x30, 0x1f, 0x81, 0xac, 0xac, 0xb0, +0x61, 0x42, 0x00, 0xdb, 0xf3, 0x0f, 0x0c, 0xec, 0x34, 0x3c, 0x35, 0x08, 0x5f, 0x6c, 0x81, 0x81, +0x58, 0x2c, 0xd9, 0x16, 0xa0, 0x32, 0xbc, 0x93, 0x2f, 0x00, 0x7e, 0x06, 0x90, 0x00, 0x0e, 0xc1, +0x0b, 0x05, 0x1c, 0x61, 0x03, 0x7e, 0x07, 0x16, 0x01, 0x7e, 0x80, 0x04, 0xff, 0x93, 0x20, 0xfd, +0x95, 0x04, 0xfb, 0x4a, 0x82, 0xf9, 0x38, 0x41, 0xf7, 0x8c, 0x24, 0xf5, 0x58, 0x12, 0xf3, 0x8c, +0x24, 0xf1, 0x5d, 0x12, 0xef, 0x78, 0x24, 0x98, 0x27, 0xec, 0x4e, 0xb0, 0xeb, 0x2c, 0x09, 0xea, +0x82, 0x13, 0xe9, 0x49, 0x70, 0xe8, 0xe7, 0x98, 0x4a, 0x24, 0x82, 0x12, 0xe5, 0x04, 0x4b, 0xe4, +0x70, 0xaa, 0xe3, 0x32, 0x48, 0x49, 0xe1, 0x24, 0x24, 0xde, 0x18, 0x12, 0xdd, 0x30, 0x24, 0xdb, +0x1c, 0x49, 0xda, 0x00, 0x92, 0xa0, 0xd7, 0xac, 0x37, 0x0d, 0x01, 0x49, 0xb0, 0xd2, 0x27, 0x08, +0xd1, 0x84, 0x04, 0xcf, 0x93, 0x20, 0xcd, 0x95, 0x04, 0xcb, 0x4c, 0x82, 0xc9, 0x54, 0x12, 0xc7, +0x45, 0x82, 0xc3, 0x93, 0xc0, 0x76, 0xc1, 0x84, 0x04, 0xbe, 0x93, 0x20, 0xbd, 0x96, 0x04, 0xbc, +0xf0, 0x09, 0xbb, 0x66, 0xc6, 0x1c, 0x48, 0xb9, 0x76, 0x52, 0x12, 0x5f, 0x34, 0x09, 0xb5, 0x92, +0xe0, 0x06, 0xb3, 0x20, 0xd9, 0x20, 0x12, 0x9c, 0xb0, 0xae, 0xb0, 0x40, 0x4b, 0xc2, 0x18, 0xfe, +0xfb, 0x49, 0x10, 0xa5, 0x93, 0x5a, 0x44, 0x97, 0x04, 0xa3, 0x7e, 0x96, 0x04, 0xa1, 0x04, 0xa7, +0x20, 0x1c, 0x96, 0x9f, 0xa3, 0x5c, 0x12, 0x9d, 0x1e, 0x02, 0x12, 0x9b, 0x49, 0xf0, 0x1b, 0x99, +0x04, 0x6f, 0x0d, 0xc1, 0xec, 0x97, 0xd4, 0x70, 0x20, 0x95, 0x7c, 0x60, 0x49, 0x93, 0x41, 0x92, +0x92, 0x09, 0x26, 0x80, 0x8e, 0x62, 0x2b, 0xb3, 0x12, 0xbc, 0x1e, 0x8b, 0x09, 0x56, 0x88, 0x04, +0x09, 0xc1, 0x8b, 0x87, 0x3c, 0x2b, 0x25, 0x84, 0xf3, 0x48, 0x25, 0x91, 0x12, 0x4c, 0xfc, 0x7f, +0x24, 0x58, 0x7e, 0x4e, 0x10, 0x7d, 0xd4, 0x09, 0x7c, 0xa7, 0x96, 0x8b, 0x8a, 0xa3, 0x65, 0x0d, +0xd8, 0x25, 0xc1, 0x77, 0x42, 0xea, 0x66, 0x3a, 0x95, 0x84, 0xd4, 0x83, 0x20, 0xc1, 0x3c, 0x71, +0xea, 0x6c, 0xed, 0xe6, 0x64, 0x59, 0x8e, 0x6c, 0x6c, 0x24, 0x18, 0xf0, 0x6c, 0x3a, 0xb5, 0x8b, +0x35, 0x90, 0x8a, 0x75, 0x21, 0x88, 0x7c, 0xc8, 0x20, 0x65, 0x7c, 0x96, 0x4d, 0xf0, 0x1b, 0x81, +0x09, 0x62, 0x70, 0x20, 0x61, 0xe6, 0x6c, 0x49, 0x5f, 0x37, 0x3b, 0x35, 0x7d, 0x99, 0x48, 0x2d, +0xca, 0x24, 0x58, 0x58, 0x12, 0x24, 0x57, 0x36, 0x23, 0xd7, 0x0d, 0x5e, 0x29, 0x1c, 0x66, 0x25, +0xa4, 0xb3, 0x6a, 0x9b, 0x45, 0xf7, 0x8c, 0x04, 0xcb, 0xa0, 0x04, 0x87, 0x4f, 0x3c, 0x82, 0x95, +0x4c, 0x82, 0x41, 0x4b, 0x3c, 0x18, 0x48, 0x49, 0xff, 0x03, 0x24, 0x45, 0xf0, 0x04, 0x43, 0x76, +0x1c, 0x48, 0x41, 0x7c, 0x02, 0x12, 0x3f, 0x49, 0xf0, 0xc3, 0x3d, 0x5c, 0x76, 0x76, 0x1b, 0xfe, +0x09, 0x92, 0x39, 0x90, 0x60, 0x7c, 0x38, 0x0c, 0x18, 0x76, 0x96, 0x20, 0x41, 0x35, 0x48, 0x30, +0xe6, 0x33, 0x12, 0x1c, 0x3c, 0x31, 0x24, 0x58, 0x2f, 0x21, 0x24, 0xbf, 0x78, 0xb1, 0x26, 0x29, +0x24, 0x24, 0x2b, 0x12, 0x12, 0x09, 0x26, 0xa4, 0x97, 0x7c, 0x61, 0xc2, 0x1b, 0x7c, 0xc1, 0x60, +0xd9, 0x8b, 0x3b, 0x90, 0x21, 0xf0, 0x37, 0x26, 0x2f, 0x70, 0x1c, 0xd4, 0x09, 0x1d, 0x82, 0x84, +0xac, 0x42, 0x42, 0x1a, 0xbf, 0x31, 0x5b, 0x0d, 0xab, 0x65, 0x86, 0xf5, 0x80, 0x0d, 0x29, 0x82, +0xa7, 0x83, 0x7c, 0x1e, 0x49, 0x11, 0x83, 0x2e, 0x09, 0x0f, 0x0e, 0x09, 0x09, 0x0d, 0x81, 0x04, +0x0b, 0x20, 0xc1, 0x70, 0x09, 0x4d, 0x4a, 0x66, 0x1b, 0x20, 0x71, 0x08, 0xac, 0x98, 0x03, 0x35, +0x20, 0x96, 0x00, 0x3b, 0x30, 0x8f, 0xfe, 0x1b, 0x04, 0x26, 0xf0, 0xb1, 0xcd, 0x9a, 0xfe, 0xb3, +0x29, 0xe9, 0x0d, 0x63, 0x83, 0x01, 0xf7, 0x7c, 0x60, 0x65, 0xa7, 0x0d, 0x16, 0x70, 0xd8, 0xc3, +0x18, 0xf0, 0xf0, 0xd8, 0xcc, 0xc6, 0xf1, 0x4a, 0x4a, 0x63, 0xbe, 0x97, 0x67, 0x4f, 0xfe, 0xb0, +0x92, 0x71, 0x2c, 0x19, 0xe7, 0xd1, 0x48, 0xb6, 0xc3, 0x01, 0x0f, 0xe3, 0x61, 0x87, 0xe2, 0x7e, +0x8b, 0xc9, 0x22, 0xbf, 0x96, 0x01, 0xdd, 0x04, 0x03, 0xdc, 0x76, 0x38, 0xad, 0x94, 0x53, 0x10, +0x60, 0x65, 0xa1, 0x97, 0x16, 0x46, 0x0c, 0x03, 0x71, 0x91, 0x8c, 0x44, 0x03, 0x3e, 0xbf, 0xf8, +0xcc, 0xd2, 0xc0, 0x2d, 0x47, 0x06, 0x3c, 0xd0, 0xcf, 0x40, 0x5a, 0x1d, 0xc0, 0x64, 0x70, 0xc7, +0x64, 0xcb, 0x78, 0xf3, 0xb1, 0x8c, 0x9f, 0x32, 0xc0, 0xe0, 0xc7, 0x4a, 0x46, 0xc9, 0xc0, 0x32, +0x74, 0xb0, 0x64, 0xc3, 0x7d, 0x61, 0x40, 0xc0, 0x30, 0x60, 0xbe, 0x65, 0x41, 0x70, 0x20, 0xd8, +0x30, 0x6f, 0x80, 0xd6, 0x13, 0x01, 0x25, 0xcd, 0xba, 0x01, 0x31, 0x60, 0xb7, 0x4c, 0x48, 0x1d, +0xfc, 0x07, 0x06, 0xb3, 0x70, 0x96, 0x01, 0xb1, 0x2e, 0x09, 0x80, 0xfe, 0x97, 0x90, 0x01, 0x6f, +0x18, 0x30, 0xb5, 0x5c, 0x18, 0x41, 0x44, 0xf3, 0x08, 0x03, 0x10, 0x60, 0x32, 0x60, 0xa3, 0x06, +0x04, 0x9f, 0xc0, 0x55, 0xf8, 0x60, 0x65, 0x9b, 0xc0, 0x32, 0x99, 0x20, 0x65, 0x97, 0xc0, 0x32, +0x95, 0x58, 0x64, 0x93, 0xac, 0x0c, 0x8f, 0x80, 0x07, 0x8d, 0x40, 0xca, 0x8b, 0x60, 0x65, 0x89, +0x18, 0x32, 0x87, 0x1f, 0x2b, 0x0c, 0x83, 0x90, 0x01, 0x51, 0xca, 0x80, 0x7d, 0x65, 0xc0, 0x7b, +0x36, 0x20, 0x77, 0x1f, 0x30, 0x42, 0x80, 0x19, 0x75, 0xc0, 0xca, 0x73, 0x0c, 0x78, 0x71, 0x6f, +0x01, 0x23, 0x32, 0xe0, 0x6d, 0x6b, 0x19, 0x90, 0x69, 0x32, 0x60, 0x67, 0x19, 0x30, 0x65, 0x80, +0x5b, 0x1b, 0x5c, 0x61, 0x61, 0x3f, 0x11, 0x06, 0x5d, 0x06, 0xbc, 0xd1, 0x59, 0xc0, 0x14, 0xff, +0x5c, 0x61, 0x55, 0xf8, 0x00, 0x06, 0x51, 0xc2, 0x80, 0x4d, 0x18, 0xb0, 0x4b, 0x0c, 0x58, 0x47, +0x81, 0xa9, 0x44, 0xbd, 0x49, 0x2f, 0x08, 0x10, 0xfd, 0x49, 0x6f, 0x0d, 0xd3, 0x49, 0x6f, 0x0d, +0xc5, 0x32, 0x60, 0x3d, 0x30, 0x60, 0x0e, 0x3b, 0x2d, 0x3b, 0x1c, 0x37, 0x03, 0x26, 0x7f, 0x37, +0x52, 0x2c, 0x86, 0x2d, 0x0b, 0x0d, 0xb0, 0xec, 0x29, 0x7d, 0x60, 0x19, 0x31, 0x38, 0x30, 0x2f, +0x7e, 0x25, 0x0c, 0x2d, 0x49, 0x88, 0x0d, 0x1c, 0x81, 0x01, 0x29, 0x61, 0xc0, 0x7c, 0x27, 0x56, +0x2c, 0x0d, 0xdd, 0x0c, 0x58, 0x22, 0x06, 0xa4, 0x20, 0x0c, 0x58, 0x1e, 0xe0, 0x2d, 0xdc, 0x92, +0x4b, 0x5b, 0x66, 0x19, 0x10, 0x19, 0x0c, 0x08, 0x17, 0x1e, 0xb0, 0x15, 0x20, 0x03, 0x12, 0x32, +0x60, 0x18, 0x0f, 0x06, 0x1c, 0x3c, 0x1c, 0x0d, 0x03, 0x56, 0x0b, 0x01, 0x21, 0x70, 0x81, 0x08, +0x08, 0x60, 0x19, 0x05, 0x03, 0x1c, 0xfc, 0xfb, 0x60, 0x80, 0xf6, 0x00, 0x0d, 0xf5, 0x6c, 0x04, +0x98, 0xee, 0xe9, 0xd0, 0x16, 0x06, 0x38, 0x5f, 0x2b, 0x81, 0x0d, 0x0f, 0xfe, 0x80, 0x07, 0x19, +0x02, 0x4c, 0xd7, 0xd1, 0x04, 0x08, 0xcb, 0x08, 0x10, 0xc5, 0x01, 0x3e, 0x0f, 0x07, 0x0f, 0x7d, +0xbf, 0x20, 0x80, 0xba, 0x70, 0x80, 0xb4, 0x01, 0x0a, 0xb3, 0xae, 0x06, 0xf8, 0x67, 0xe6, 0xc0, +0xa7, 0xd0, 0x00, 0xa8, 0x80, 0x0d, 0x0e, 0xa1, 0x20, 0x78, 0x80, 0x02, 0x9b, 0x02, 0x00, 0x07, +0x42, 0x13, 0xc0, 0x33, 0x8f, 0xc0, 0x00, 0x8a, 0xbb, 0x1b, 0x89, 0x00, 0x3e, 0x61, 0x49, 0x3c, +0x86, 0x5e, 0xb0, 0x7c, 0xd0, 0x27, 0x04, 0xf8, 0x26, 0xff, 0x72, 0xbc, 0xc3, 0x72, 0x0f, 0x48, +0x02, 0x65, 0x00, 0x07, 0x5f, 0xc0, 0x97, 0x59, 0x24, 0x66, 0xff, 0x0f, 0x38, 0x12, 0x9f, 0xbc, +0x18, 0xef, 0x2e, 0x06, 0x02, 0x3d, 0xd0, 0xf0, 0x46, 0xad, 0x24, 0x68, 0x08, 0x31, 0x56, 0xfc, +0x57, 0x18, 0x3e, 0x83, 0xf0, 0xe0, 0x7c, 0x18, 0x5b, 0x00, 0x0f, 0x23, 0x38, 0x64, 0xf5, 0x1e, +0x76, 0xcc, 0x98, 0x86, 0xf9, 0x30, 0xc0, 0x7c, 0x0f, 0x0c, 0x40, 0x12, 0x06, 0xb0, 0x25, 0x00, +0x2b, 0x03, 0x61, 0x7e, 0xd6, 0x18, 0x56, 0xe8, 0xbd, 0xea, 0x63, 0xd6, 0xe1, 0xc5, 0x5a, 0xdd, +0xc2, 0x17, 0x5f, 0xc9, 0x1c, 0xe5, 0xaf, 0xba, 0x07, 0x3c, 0xb3, 0x71, 0x56, 0xca, 0x1e, 0xe0, +0x7d, 0x73, 0xfc, 0x0f, 0xf1, 0xe8, 0xa9, 0xfc, 0xad, 0x53, 0xac, 0xea, 0x79, 0x2c, 0xf5, 0xbd, +0x02, 0x07, 0x7e, 0xf5, 0x62, 0xab, 0x74, 0xf7, 0x66, 0x62, 0x77, 0x67, 0x56, 0x8f, 0xaa, 0x94, +0xf5, 0x48, 0xa6, 0x59, 0x7d, 0x8d, 0x7c, 0x88, 0x5c, 0xb9, 0x07, 0x82, 0x7a, 0x25, 0x6b, 0x87, +0xac, 0x46, 0x3d, 0xfc, 0x76, 0xcc, 0x60, 0xfc, 0xcc, 0xbd, 0x32, 0xd0, 0x6b, 0x56, 0x5f, 0x69, +0xfe, 0x64, 0x68, 0x36, 0xfe, 0x07, 0xd5, 0x67, 0xf5, 0x1f, 0xce, 0xc1, 0xc2, 0x57, 0xe0, 0x0b, +0x56, 0x4d, 0x2f, 0xc1, 0x6a, 0x1e, 0x45, 0x06, 0xa3, 0xe6, 0x7f, 0xf0, 0x14, 0xac, 0x39, 0x8b, +0x49, 0xc1, 0xcb, 0xe2, 0xc5, 0xca, 0xde, 0x30, 0x1e, 0x6f, 0x7f, 0x8f, 0x45, 0x0f, 0xce, 0x7c, +0x0e, 0xf1, 0x22, 0x37, 0xca, 0x7d, 0x21, 0x0c, 0x7f, 0xa4, 0xf7, 0x0b, 0x57, 0xa5, 0x08, 0x35, +0x56, 0x41, 0x2a, 0xf8, 0x22, 0x16, 0x9d, 0x9d, 0xf4, 0x9b, 0x64, 0x3c, 0xdd, 0x48, 0xe7, 0x32, +0x6f, 0x3c, 0x08, 0x52, 0xdf, 0x53, 0x07, 0x97, 0xd9, 0x3a, 0x29, 0xd5, 0x3c, 0x61, 0xe0, 0x26, +0x61, 0xd4, 0x21, 0xba, 0xd4, 0x80, 0xbc, 0x76, 0x1a, 0xc0, 0x39, 0x75, 0xdc, 0xc3, 0xa4, 0xb0, +0x7f, 0x43, 0xaa, 0x16, 0xdd, 0x53, 0xa4, 0x7c, 0x97, 0x60, 0x3a, 0xa3, 0xf8, 0xf5, 0x76, 0xe5, +0x9a, 0x09, 0xf8, 0x2f, 0x54, 0x3b, 0x92, 0xaf, 0x0a, 0xef, 0x8c, 0x7f, 0x69, 0xb8, 0xa7, 0x84, +0x3c, 0x17, 0x46, 0x3d, 0x00, 0xe6, 0xd6, 0x91, 0x5a, 0x74, 0x18, 0x16, 0xce, 0x16, 0x0c, 0x6d, +0x0f, 0x4d, 0x36, 0x7c, 0x4f, 0x1e, 0xb3, 0x48, 0x56, 0x5f, 0x82, 0x8b, 0x7e, 0x4b, 0x87, 0xc5, +0xa9, 0x4a, 0x90, 0x9a, 0x47, 0x43, 0x60, 0xd4, 0x56, 0x30, 0xac, 0xfb, 0x1b, 0x8b, 0x00, 0x17, +0x7e, 0x2f, 0x1a, 0x9c, 0x37, 0xdf, 0x7e, 0x81, 0xa7, 0x21, 0x70, 0x61, 0x1b, 0xd6, 0x89, 0x0c, +0xb3, 0xdc, 0x12, 0x6b, 0x58, 0x46, 0xfc, 0x54, 0x4a, 0xf7, 0x91, 0x3b, 0xf9, 0x7f, 0x25, 0x9c, +0x8e, 0xfe, 0xf7, 0xc2, 0x84, 0x57, 0xef, 0x23, 0x4c, 0x7c, 0xf7, 0x7c, 0x84, 0x24, 0xef, 0x60, +0x34, 0xc6, 0xa5, 0x84, 0xef, 0xd4, 0x42, 0xa0, 0x38, 0x49, 0x28, 0x9f, 0xf7, 0x08, 0x46, 0xa9, +0x6c, 0x49, 0xff, 0x0f, 0x60, 0x84, 0x13, 0xcd, 0xef, 0x86, 0x30, 0xcf, 0x10, 0x8c, 0x8a, 0xa1, +0x92, 0xe7, 0x76, 0xe0, 0x05, 0x0c, 0xa0, 0x4d, 0x99, 0xd2, 0xd1, 0xf6, 0x73, 0x57, 0xfc, 0x37, +0x8b, 0x69, 0x26, 0x97, 0x53, 0x21, 0xd3, 0x17, 0x37, 0xa3, 0x5a, 0x6f, 0x42, 0xa6, 0x38, 0xe1, +0xe8, 0x61, 0x7f, 0x06, 0x0c, 0xe8, 0x1f, 0x7e, 0xed, 0x87, 0xc1, 0x7b, 0xc6, 0xa3, 0x47, 0xad, +0x37, 0xcd, 0xe8, 0x3c, 0xeb, 0xa3, 0x18, 0x2e, 0x2a, 0x47, 0x07, 0x38, 0x7e, 0x23, 0x12, 0x5e, +0xe0, 0x3f, 0xb7, 0x8b, 0xd1, 0x18, 0x0f, 0x66, 0x14, 0x0f, 0xbd, 0x8f, 0x0c, 0x70, 0x07, 0x08, +0x83, 0x67, 0xfe, 0xb7, 0x60, 0x30, 0xe6, 0xb1, 0x12, 0xde, 0x5c, 0xb8, 0xaf, 0x76, 0xec, 0x10, +0xc8, 0x22, 0x88, 0x01, 0x43, 0x68, 0xd9, 0x1a, 0x42, 0xd4, 0xb4, 0x12, 0xca, 0x84, 0x26, 0x9a, +0xbe, 0x21, 0x34, 0xb8, 0x0d, 0xa1, 0xb2, 0x1a, 0x09, 0xac, 0xd0, 0x12, 0xa0, 0x10, 0x9a, 0x9a, +0x94, 0x81, 0xd0, 0x8e, 0x80, 0xd0, 0xf8, 0x82, 0x03, 0xa1, 0x7c, 0x01, 0xa1, 0xff, 0x70, 0xc3, +0x62, 0x0f, 0x1f, 0x02, 0x42, 0x5e, 0x90, 0x87, 0x52, 0x37, 0x26, 0x94, 0x4c, 0xb4, 0x84, 0x46, +0x12, 0x3a, 0x40, 0x3a, 0x86, 0xd0, 0x34, 0x34, 0x84, 0x2e, 0xa1, 0x21, 0x28, 0x22, 0xcc, 0x2d, +0x0f, 0x6f, 0x20, 0x34, 0x10, 0x4b, 0x28, 0x0a, 0x2c, 0x66, 0x77, 0xfe, 0xe2, 0x0d, 0x27, 0xd8, +0xc0, 0xf2, 0xd7, 0x16, 0x6f, 0x27, 0xdd, 0x2c, 0x06, 0xd7, 0x58, 0x0c, 0xcb, 0xb0, 0x18, 0xc2, +0x8b, 0xd3, 0x47, 0xbc, 0xb8, 0xc7, 0x47, 0x07, 0xe1, 0x62, 0x2f, 0x07, 0x93, 0x98, 0x27, 0xcd, +0x06, 0x8b, 0x0e, 0xa4, 0x1c, 0x44, 0xc6, 0x1f, 0xc6, 0x66, 0x27, 0xd7, 0x66, 0x07, 0x3a, 0xe6, +0x0f, 0x47, 0x40, 0xb8, 0x5c, 0x4f, 0x4f, 0x40, 0xbe, 0x7c, 0xd9, 0xde, 0x02, 0x3e, 0x40, 0xb6, +0xa7, 0x3e, 0x9b, 0xb4, 0x40, 0xbc, 0x27, 0x07, 0x62, 0x50, 0xf6, 0xef, 0xf6, 0x17, 0x4c, 0x08, +0x1c, 0x2f, 0x83, 0x18, 0xc7, 0x2e, 0x3c, 0x38, 0x7e, 0x47, 0xb8, 0x58, 0x55, 0x05, 0x83, 0x5e, +0x4f, 0x6a, 0x72, 0x30, 0x51, 0x59, 0x4c, 0x0f, 0x3e, 0xcc, 0x62, 0x38, 0x18, 0x58, 0x33, 0x45, +0x32, 0x6e, 0x2f, 0x82, 0x21, 0x1f, 0x6b, 0x16, 0x1b, 0xdd, 0xab, 0xdc, 0x50, 0x4a, 0x48, 0x17, +0x00, 0x00, 0x0d, 0x62, 0x33, 0x0e, 0xc8, 0x81, 0x4c, 0x52, 0x03, 0x21, 0x47, 0x69, 0x26, 0x64, +0x04, 0x82, 0xa2, 0x46, 0x11, 0x03, 0x02, 0x4d, 0x18, 0x99, 0x06, 0x31, 0xcc, 0xf3, 0x03, 0x06, +0x68, 0x58, 0x44, 0x03, 0x06, 0x18, 0x69, 0x65, 0x11, 0x53, 0x84, 0xbd, 0x2f, 0x0f, 0x56, 0x80, +0x98, 0x0f, 0x09, 0x12, 0x58, 0x08, 0x59, 0x2f, 0x0d, 0x8b, 0x73, 0x61, 0xef, 0x6f, 0x4f, 0x5f, +0x66, 0x2a, 0x48, 0x0f, 0x01, 0x12, 0xe7, 0x0c, 0x59, 0x1f, 0x66, 0x81, 0x45, 0x53, 0x85, 0xb5, +0x06, 0x0f, 0x80, 0xbd, 0x2f, 0x0f, 0x48, 0xc4, 0xc6, 0x13, 0x98, 0x4b, 0x8d, 0x0f, 0x84, 0x4b, +0xdc, 0x08, 0x19, 0xf3, 0x42, 0x06, 0xd2, 0x5a, 0xac, 0xa9, 0xf5, 0x6e, 0x0c, 0x16, 0xea, 0x3e, +0xd2, 0xfe, 0xc9, 0x1e, 0x0f, 0xce, 0xff, 0x21, 0x10, 0x03, 0x32, 0x20, 0xf4, 0x6c, 0x59, 0xaf, +0x0f, 0x21, 0xbc, 0x30, 0x78, 0x4f, 0xd9, 0x61, 0x1f, 0x0f, 0x2e, 0x62, 0x23, 0xd9, 0x92, 0xc6, +0x4c, 0xd9, 0x2c, 0x3f, 0x1c, 0x30, 0x68, 0xba, 0xae, 0x1e, 0x04, 0x7c, 0xce, 0x64, 0x07, 0xe1, +0xe6, 0x7c, 0x40, 0x60, 0x64, 0x60, 0xca, 0x04, 0x8d, 0x73, 0xb3, 0x52, 0x1c, 0x1d, 0xcd, 0xda, +0x1e, 0x1f, 0x53, 0x42, 0x7c, 0x0e, 0x1a, 0xa3, 0x1b, 0x93, 0x18, 0x0e, 0xb1, 0xd4, 0x01, 0xb0, +0x10, 0xaf, 0x03, 0xe1, 0xef, 0x4f, 0x2d, 0x7b, 0x0f, 0xcf, 0x85, 0xec, 0x2f, 0xbf, 0x28, 0x1c, +0xad, 0x70, 0x49, 0x93, 0x0c, 0x21, 0xa9, 0xa3, 0x62, 0xa3, 0x3c, 0xc9, 0x36, 0xd1, 0x12, 0x23, +0x24, 0x9b, 0xd9, 0xcb, 0x3b, 0x03, 0xa7, 0x02, 0x60, 0xc0, 0x24, 0x40, 0x33, 0xa2, 0xfb, 0x82, +0xb2, 0xaa, 0xaa, 0x02, 0x82, 0xb5, 0x0c, 0x63, 0x00, 0x4c, 0x01, 0x16, 0x4e, 0x77, 0xe0, 0xa8, +0x6c, 0x62, 0x0b, 0xe8, 0xdc, 0xb2, 0x2d, 0x98, 0x3e, 0x0f, 0x9a, 0xfd, 0x66, 0xce, 0x9a, 0x3f, +0x22, 0xe8, 0x9d, 0x2e, 0xbc, 0x36, 0x2c, 0x96, 0x85, 0xcc, 0x3c, 0x36, 0x6c, 0xd8, 0x00, 0x66, +0xb7, 0x0d, 0x6c, 0xd8, 0x60, 0x10, 0x33, 0xb4, 0x50, 0x94, 0x6c, 0x64, 0x6f, 0x0f, 0x21, 0x2f, +0x60, 0x30, 0x77, 0x6c, 0xef, 0x9a, 0xa2, 0x00, 0x88, 0x58, 0x9a, 0xef, 0xa1, 0x32, 0x33, 0x9d, +0x62, 0xff, 0x5e, 0x92, 0x04, 0xc1, 0x10, 0x29, 0xa8, 0x0c, 0xe2, 0xf1, 0x33, 0xb1, 0x8a, 0xcb, +0x98, 0x12, 0x5f, 0x09, 0x73, 0x0c, 0xff, 0x64, 0x10, 0x33, 0xa4, 0x50, 0x0f, 0x62, 0xd0, 0x89, +0x7e, 0x10, 0x7f, 0x34, 0x18, 0x2c, 0x06, 0x3e, 0x04, 0x3d, 0xbe, 0x22, 0x97, 0x03, 0xf6, 0x64, +0x1d, 0xbf, 0x1f, 0x17, 0x36, 0xc6, 0x0f, 0x30, 0x12, 0x58, 0x3f, 0xc7, 0x92, 0x3f, 0x0f, 0xb0, +0x02, 0x53, 0xcc, 0x35, 0xac, 0x0f, 0x48, 0x26, 0x00, 0x19, 0x44, 0x33, 0xb3, 0x50, 0x40, 0xbd, +0x60, 0x47, 0x9f, 0xb0, 0x90, 0x7f, 0x36, 0xac, 0xb7, 0x9f, 0x6f, 0x51, 0x84, 0xb6, 0x9c, 0xb3, +0xcc, 0xcc, 0xff, 0x26, 0x6c, 0x1f, 0x30, 0xc3, 0xca, 0x2f, 0xd2, 0xb6, 0x2c, 0x1f, 0x0c, 0x01, +0x4a, 0x93, 0x90, 0x03, 0x66, 0x0c, 0x60, 0xc0, 0xc3, 0x04, 0x68, 0x7c, 0xa3, 0xcc, 0x06, 0xf0, +0x0e, 0xbe, 0x53, 0x2c, 0x8f, 0xc6, 0xdd, 0x40, 0x7f, 0xc6, 0x32, 0x24, 0xc6, 0xbc, 0x16, 0x9f, +0x6e, 0x09, 0x3f, 0x0c, 0x21, 0x10, 0xb3, 0x0b, 0x23, 0x39, 0x02, 0x7b, 0x5f, 0x00, 0x5a, 0x42, +0xbb, 0x85, 0x2c, 0x10, 0x12, 0x42, 0xe7, 0x58, 0xdf, 0xbd, 0x30, 0x62, 0x36, 0xec, 0x6f, 0x2b, +0x4a, 0x33, 0x51, 0x2a, 0xca, 0x66, 0x19, 0x00, 0xe8, 0x41, 0xff, 0x11, 0xb2, 0x1d, 0x2b, 0x9b, +0x94, 0x2a, 0x22, 0x60, 0x0a, 0x12, 0xb1, 0x90, 0x4c, 0x29, 0x58, 0x21, 0x0c, 0xa2, 0x7c, 0x33, +0xaa, 0xa0, 0x42, 0x11, 0x89, 0x09, 0x1e, 0x18, 0x70, 0x03, 0x09, 0x2e, 0x76, 0x01, 0x13, 0x01, +0xd0, 0xcb, 0x80, 0xff, 0xd9, 0x7b, 0x1b, 0x29, 0x0d, 0x32, 0x60, 0xfb, 0x30, 0x60, 0x76, 0xf9, +0x8b, 0x38, 0x76, 0x2b, 0x7b, 0x09, 0x61, 0x45, 0x62, 0xd9, 0x53, 0x5b, 0x76, 0xf6, 0x0d, 0x44, +0x60, 0x59, 0x6f, 0xe0, 0x32, 0xef, 0x3c, 0x37, 0x30, 0xed, 0x0d, 0x96, 0xbd, 0x29, 0x0d, 0x2c, +0x03, 0xe9, 0x12, 0x06, 0xe7, 0x2d, 0x03, 0xe5, 0x60, 0x19, 0xa4, 0x42, 0x35, 0xe3, 0x18, 0x60, +0xc0, 0x6e, 0xe1, 0x18, 0x70, 0xce, 0xdf, 0x01, 0x1b, 0x99, 0x1b, 0xc8, 0xc6, 0xc6, 0x0d, 0x65, +0xc0, 0xd9, 0xd9, 0xb2, 0xfb, 0x0d, 0x11, 0x6f, 0x37, 0xb3, 0x24, 0xe5, 0x42, 0xf4, 0x66, 0x37, +0x18, 0x70, 0x64, 0x20, 0x02, 0xc0, 0x1d, 0xcf, 0xe6, 0x7c, 0x80, 0x80, 0x65, 0xcd, 0x19, 0xf0, +0xcc, 0xcb, 0xcb, 0x80, 0xca, 0xe0, 0x54, 0x63, 0x9c, 0x30, 0xc7, 0xd8, 0x70, 0x58, 0x06, 0xc5, +0x09, 0x4b, 0xb1, 0x17, 0x65, 0x6f, 0x0d, 0xb5, 0x96, 0xbd, 0x29, 0xa7, 0x2c, 0x03, 0xbd, 0x12, +0x06, 0xbb, 0x2b, 0x03, 0xb9, 0x84, 0x01, 0xb7, 0xc5, 0x80, 0xb5, 0x0f, 0x98, 0x53, 0xb3, 0x84, +0x01, 0xb2, 0xe0, 0x80, 0xb1, 0xcd, 0x19, 0xaf, 0x63, 0x6e, 0xc3, 0xb6, 0xc3, 0x85, 0x1f, 0x0d, +0xcc, 0xe8, 0x36, 0x6e, 0xda, 0x3c, 0x80, 0x07, 0xab, 0x18, 0xf0, 0xaa, 0xa8, 0x03, 0x16, 0xa6, +0x06, 0x31, 0x33, 0x60, 0x55, 0xb0, 0x30, 0x9b, 0x48, 0x18, 0x99, 0x24, 0x0c, 0x97, 0x58, 0x06, +0x95, 0x10, 0x0f, 0x94, 0x42, 0x64, 0x33, 0x30, 0x03, 0x8b, 0x03, 0x1e, 0x8a, 0x89, 0x10, 0x09, +0x00, 0x64, 0x33, 0xcb, 0x80, 0x79, 0xc0, 0x80, 0x76, 0x77, 0x20, 0xdc, 0xdf, 0xa9, 0xc2, 0x33, +0x92, 0x01, 0x67, 0x18, 0xd0, 0x03, 0x65, 0x01, 0x1a, 0xe9, 0x45, 0x26, 0xf6, 0x09, 0xa9, 0x95, +0x9b, 0x3a, 0xb0, 0xc6, 0x0d, 0x30, 0xc6, 0x4a, 0xb7, 0xd7, 0x0c, 0x48, 0x59, 0x64, 0xb7, 0x0d, +0x3c, 0x66, 0x42, 0x0e, 0x00, 0x19, 0x44, 0x33, 0xb1, 0x10, 0x38, 0x3b, 0x73, 0x0e, 0x06, 0x30, +0x6f, 0x61, 0x09, 0x30, 0xd2, 0x69, 0x60, 0xd3, 0x01, 0x13, 0x78, 0xbd, 0x92, 0x42, 0x4e, 0x64, +0x97, 0x1b, 0x30, 0x29, 0x30, 0x60, 0x30, 0xc0, 0x6c, 0x7c, 0x0a, 0x20, 0x64, 0x3a, 0x01, 0x33, +0x28, 0x03, 0x96, 0x37, 0x35, 0x30, 0x64, 0xe0, 0x03, 0x1e, 0x34, 0x33, 0xc6, 0x2e, 0x7c, 0x6f, +0xc6, 0x59, 0x42, 0x0d, 0x35, 0x6b, 0x0b, 0x03, 0x92, 0x97, 0x2b, 0x13, 0x2c, 0x1a, 0xca, 0x80, +0x27, 0x0c, 0x38, 0xfe, 0x22, 0x01, 0x8b, 0xa9, 0x8c, 0x1f, 0x63, 0xe1, 0x46, 0x34, 0x73, 0x80, +0x54, 0x30, 0xc0, 0x19, 0xbc, 0x62, 0x81, 0x6d, 0x40, 0x06, 0x13, 0x60, 0xc0, 0x18, 0x0f, 0x0c, +0x58, 0x0d, 0x18, 0x44, 0x33, 0x40, 0x01, 0x26, 0x62, 0xfa, 0x28, 0x46, 0xff, 0x8c, 0x4e, 0xd6, +0x76, 0xf6, 0x30, 0x1a, 0x7c, 0xf0, 0x63, 0x6e, 0x76, 0x17, 0x07, 0x60, 0x6c, 0x93, 0x30, 0x17, +0x38, 0x93, 0x98, 0xe3, 0x05, 0xa3, 0x70, 0xd2, 0xba, 0x09, 0xef, 0x07, 0x30, 0x46, 0xc1, 0x3f, +0xc0, 0xcc, 0x0d, 0x3c, 0x1f, 0x07, 0xc7, 0x5c, 0x17, 0x07, 0xc6, 0x10, 0x62, 0x10, 0xa4, 0x28, +0xe7, 0x47, 0x27, 0xb1, 0x19, 0x41, 0x2c, 0xf8, 0x35, 0x42, 0xd5, 0xec, 0x47, 0x0b, 0x7f, 0x6e, +0x97, 0xa0, 0xa3, 0x96, 0xce, 0x46, 0xc1, 0x41, 0x47, 0x37, 0x1b, 0x57, 0x07, 0x37, 0x23, 0x7e, +0x8f, 0x70, 0xb3, 0x07, 0x1f, 0xda, 0x89, 0x2b, 0x06, 0x17, 0x29, 0x81, 0x0e, 0x1e, 0xbd, 0x27, +0x5f, 0x47, 0x8f, 0x5e, 0x5a, 0x3d, 0x23, 0x59, 0x3a, 0x6c, 0x30, 0xda, 0x0f, 0x6c, 0xb8, 0x4e, +0xd4, 0xd1, 0x48, 0x3c, 0x33, 0x7a, 0x47, 0x42, 0x30, 0x7b, 0xf7, 0x9f, 0xe6, 0x66, 0xd5, 0xd9, +0x5f, 0x30, 0x0a, 0x2a, 0x20, 0xdc, 0x07, 0x64, 0xf4, 0xfc, 0x1f, 0x0d, 0xa3, 0x19, 0xd1, 0x19, +0x12, 0x7c, 0x31, 0x9a, 0x0c, 0x0b, 0xed, 0x83, 0xfe, 0x04, 0x63, 0x6b, 0xbd, 0xfb, 0x7e, 0x33, +0x66, 0xcc, 0x0f, 0x07, 0x7a, 0x36, 0x6a, 0xdf, 0x4c, 0xa8, 0x11, 0xf4, 0xed, 0x0e, 0xc1, 0x16, +0x66, 0x33, 0x70, 0x5f, 0x44, 0x66, 0x09, 0x02, 0x83, 0x33, 0x84, 0x16, 0x97, 0x37, 0xcf, 0xda, +0x9c, 0x07, 0x60, 0x30, 0x87, 0x26, 0xb2, 0x88, 0x43, 0xb1, 0x84, 0x32, 0x33, 0x14, 0x1c, 0xbc, +0x65, 0x0e, 0x1c, 0xbf, 0xfa, 0x62, 0x42, 0x8d, 0x82, 0x0c, 0x33, 0x98, 0xd0, 0x5e, 0x62, 0x76, +0x17, 0x7f, 0x88, 0x0c, 0x33, 0xef, 0x50, 0x28, 0xcd, 0x71, 0xe8, 0x76, 0x18, 0x6c, 0x22, 0xca, +0x47, 0x9b, 0xf6, 0x7b, 0x18, 0xf7, 0x10, 0x59, 0x38, 0x63, 0x00, 0x17, 0x30, 0x08, 0xcb, 0x1f, +0x9f, 0x11, 0x28, 0xe6, 0x0b, 0x16, 0xfb, 0x06, 0x08, 0x37, 0x07, 0x85, 0x32, 0x33, 0x0d, 0x12, +0x20, 0x30, 0xc3, 0x82, 0x3f, 0x1b, 0x3d, 0x0e, 0x57, 0x37, 0xc6, 0xa2, 0xd5, 0xbc, 0xcc, 0xe1, +0x1d, 0x5f, 0x0f, 0x5f, 0x2c, 0xde, 0x07, 0x9f, 0xc5, 0x1b, 0x7c, 0xef, 0x8b, 0x09, 0xab, 0x82, +0x8f, 0xe2, 0xc0, 0x5a, 0x8b, 0x17, 0x89, 0x93, 0xd1, 0xdc, 0x07, 0x47, 0xb3, 0x98, 0x77, 0x89, +0xcd, 0x1e, 0xaf, 0x0f, 0x38, 0xa3, 0x17, 0x9f, 0x0c, 0x8b, 0x77, 0x79, 0x77, 0x6b, 0x62, 0x00, +0x7e, 0x62, 0xcb, 0x5d, 0x0a, 0xfd, 0x1f, 0x2a, 0xe1, 0x32, 0xe4, 0x3a, 0xf6, 0x2a, 0x5f, 0x86, +0x82, 0x00, 0x34, 0x49, 0x80, 0x33, 0x06, 0x16, 0x3e, 0x78, 0x98, 0xb7, 0x87, 0x18, 0xb2, 0x2e, +0x18, 0xe2, 0xb0, 0x21, 0x3c, 0x16, 0x0f, 0x2b, 0x7a, 0x19, 0xc4, 0x78, 0x33, 0x90, 0x03, 0xb5, +0x72, 0x3c, 0x19, 0x53, 0x9d, 0x4c, 0x14, 0x91, 0x82, 0x92, 0xc8, 0x82, 0x20, 0x51, 0x21, 0x83, +0x27, 0x61, 0x10, 0x33, 0x82, 0x50, 0x84, 0x0c, 0x87, 0x85, 0x41, 0x33, 0x0c, 0x82, 0x97, 0x64, +0xa3, 0x00, 0x83, 0x60, 0xa7, 0x10, 0x21, 0x08, 0x65, 0x33, 0xc8, 0x20, 0xc7, 0x19, 0x44, 0x33, +0x08, 0x42, 0x11, 0x32, 0xe7, 0x54, 0x06, 0x33, 0x2c, 0x82, 0x07, 0x41, 0x84, 0x08, 0x96, 0x33, +0xac, 0xb2, 0x17, 0x65, 0x11, 0x07, 0x8b, 0x20, 0x27, 0xd9, 0x09, 0x04, 0x08, 0x0f, 0x11, 0x9c, +0x58, 0x65, 0x27, 0xc8, 0x80, 0xa7, 0x10, 0xa3, 0x22, 0x64, 0x33, 0x2a, 0x03, 0xb7, 0x19, 0x44, +0x33, 0x62, 0x10, 0x2a, 0x09, 0x27, 0x06, 0x11, 0x33, 0x62, 0x55, 0x28, 0x09, 0x67, 0x19, 0x44, +0x33, 0x22, 0x14, 0x20, 0x09, 0xd7, 0x19, 0xc4, 0x33, 0x22, 0x14, 0x02, 0x0b, 0x47, 0x10, 0xa1, +0x46, 0x65, 0x33, 0xb6, 0x20, 0x87, 0x60, 0xb6, 0x42, 0x36, 0x31, 0x09, 0x95, 0x05, 0x97, 0xae, +0x04, 0xcf, 0x61, 0x10, 0x33, 0x20, 0x42, 0x2b, 0xb0, 0xc7, 0x60, 0x10, 0x33, 0x82, 0x08, 0x10, +0xcb, 0xd7, 0x1c, 0x65, 0x33, 0x66, 0x88, 0x94, 0xb1, 0x0c, 0x07, 0x95, 0x00, 0x97, 0x20, 0xb6, +0xce, 0xc6, 0x84, 0x10, 0xa7, 0x94, 0x41, 0x33, 0x02, 0x11, 0xa9, 0x40, 0x96, 0x01, 0xf9, 0xc2, +0x20, 0x33, 0x04, 0x0b, 0x48, 0x48, 0x43, 0xb0, 0x0c, 0xe9, 0x91, 0x44, 0x51, 0x30, 0x60, 0xe1, +0x20, 0x86, 0x7c, 0xb0, 0xc8, 0x33, 0x62, 0x19, 0xdb, 0x8b, 0x0c, 0x33, 0x48, 0x04, 0x97, 0x83, +0x48, 0x33, 0x41, 0x22, 0x12, 0x16, 0x93, 0xcb, 0x20, 0x33, 0x59, 0x04, 0xa1, 0x08, 0x16, 0xc1, +0xb2, 0x93, 0x42, 0x16, 0xaf, 0x04, 0x87, 0x13, 0x56, 0x59, 0xaf, 0x32, 0x20, 0x5f, 0x44, 0x00, +0x48, 0x18, 0x33, 0xc8, 0x80, 0x6d, 0x06, 0x91, 0x33, 0x58, 0x14, 0xc8, 0x80, 0xcf, 0x41, 0x84, +0x58, 0x91, 0x33, 0x48, 0x82, 0x07, 0x06, 0x11, 0x33, 0x48, 0x15, 0x42, 0x82, 0x69, 0x06, 0x31, +0x33, 0x48, 0x15, 0x40, 0x82, 0xcb, 0x44, 0x20, 0x11, 0x19, 0x33, 0x2c, 0x88, 0x03, 0x66, 0x2b, +0x30, 0x41, 0x4c, 0x41, 0x64, 0x11, 0x83, 0x78, 0x08, 0x10, 0x33, 0xb1, 0x02, 0x95, 0x05, 0x3b, +0x0c, 0x62, 0x33, 0x41, 0xac, 0x88, 0x64, 0x49, 0x0c, 0x32, 0x33, 0x56, 0x06, 0x13, 0x12, 0x20, +0xd3, 0x02, 0xc4, 0x71, 0xf1, 0x5a, 0xdb, 0x81, 0x00, 0x7f, 0x0c, 0x22, 0x33, 0x80, 0x00, 0x14, +0x12, 0xa1, 0x20, 0x47, 0x41, 0x04, 0x08, 0x85, 0x33, 0x41, 0x28, 0x77, 0x60, 0x10, 0x33, 0x84, +0x82, 0x7f, 0x19, 0x85, 0x98, 0xa1, 0x20, 0x87, 0x06, 0x31, 0x33, 0x0a, 0x42, 0x44, 0x10, 0x97, +0x08, 0x19, 0x33, 0x41, 0x28, 0xa7, 0x64, 0x10, 0x33, 0xa3, 0x20, 0x37, 0x41, 0x04, 0x0a, 0x82, +0x33, 0x10, 0x32, 0x3f, 0x82, 0x51, 0x37, 0x30, 0x0a, 0x47, 0xc1, 0xec, 0xd3, 0x07, 0x46, 0x46, +0x47, 0x12, 0x20, 0x87, 0x10, 0x0b, 0x88, 0x60, 0x33, 0x8c, 0x04, 0x8f, 0x90, 0x41, 0x33, 0x80, +0x58, 0x11, 0x4a, 0xc7, 0x50, 0x06, 0x33, 0x04, 0x88, 0xe7, 0x41, 0x8c, 0x58, 0x90, 0x33, 0xc8, +0x80, 0x1f, 0x19, 0x44, 0x33, 0x88, 0x11, 0x08, 0x0c, 0x57, 0x06, 0xb1, 0x33, 0x88, 0x50, 0x85, +0x0c, 0x77, 0x20, 0x86, 0x1b, 0x88, 0x32, 0x7f, 0x98, 0x45, 0x68, 0x2b, 0x83, 0x33, 0x18, 0x10, +0x97, 0x20, 0x16, 0x10, 0xc9, 0x33, 0x88, 0x18, 0x9f, 0x10, 0x32, 0x33, 0x20, 0x0e, 0xf1, 0xc1, +0x12, 0x37, 0x1c, 0x56, 0xff, 0xd3, 0x21, 0x40, 0x07, 0x0c, 0x22, 0x33, 0x92, 0xa7, 0xe9, 0x74, +0x50, 0xf0, 0xe4, 0x5a, 0xd1, 0x72, 0x91, 0x55, 0x67, 0x92, 0x14, 0x80, 0xa0, 0x15, 0xc8, 0x22, +0x15, 0xa3, 0x16, 0x7a, 0xf8, 0x4e, 0xab, 0xa0, 0x66, 0x67, 0x20, 0x28, 0x01, 0xab, 0x15, 0x9c, +0x5b, 0x66, 0x15, 0x60, 0x67, 0x7a, 0x50, 0x7c, 0xc2, 0x05, 0x1f, 0x03, 0xc2, 0x7c, 0x41, 0x58, +0x67, 0x90, 0x53, 0x1d, 0xbf, 0x3c, 0x19, 0x65, 0x05, 0x99, 0x91, 0x41, 0x33, 0x92, 0x14, 0x82, +0x82, 0x42, 0xde, 0x00, 0x05, 0x2b, 0x48, 0x59, 0x67, 0x2d, 0x21, 0x53, 0x25, 0x00, 0x6a, 0x0b, +0x6a, 0x8b, 0x54, 0x21, 0xb2, 0x60, 0x34, 0x07, 0x5b, 0xf6, 0x10, 0x08, 0x28, 0x0f, 0x49, 0xd0, +0xa6, 0xab, 0x60, 0x67, 0x54, 0x2b, 0x20, 0x61, 0xad, 0x2a, 0xab, 0x67, 0x45, 0x70, 0x66, 0x00, +0x4b, 0x24, 0x0f, 0xef, 0xc0, 0x2a, 0x82, 0x03, 0x8b, 0x0a, 0x23, 0xdf, 0xde, 0xff, 0x3c, 0x42, +0x99, 0xa5, 0xa1, 0xa5, 0x99, 0x42, 0x0e, 0xb2, 0x0a, 0x67, 0x05, 0x90, 0x28, 0x65, 0x83, 0x32, +0x03, 0x6d, 0xac, 0x82, 0x67, 0x00, 0x2a, 0x01, 0x10, 0xb0, 0xec, 0x09, 0x00, 0x95, 0x55, 0x67, +0x46, 0x00, 0x0a, 0x03, 0xf9, 0x10, 0x0c, 0x70, 0x92, 0xef, 0x07, 0x18, 0xf4, 0xfe, 0x84, 0x01, +0xf2, 0x60, 0xc0, 0x00, 0xef, 0x0c, 0x18, 0xed, 0x55, 0xb0, 0x80, 0x91, 0x67, 0x05, 0xcb, 0xe9, +0x17, 0x59, 0x67, 0x66, 0x29, 0x82, 0x00, 0xc7, 0x40, 0x0a, 0x16, 0x60, 0xdb, 0xa4, 0x08, 0x9d, +0x50, 0xaf, 0x38, 0x44, 0xb1, 0x5f, 0xcd, 0x44, 0x38, 0x2a, 0xac, 0x82, 0xb8, 0x67, 0x19, 0xb0, +0xd3, 0x0f, 0x08, 0xd1, 0x2a, 0x30, 0x00, 0xc2, 0x67, 0x01, 0x2b, 0x82, 0x81, 0x17, 0x02, 0xac, +0x67, 0x94, 0xa0, 0x52, 0x61, 0xe0, 0xb3, 0x0a, 0x67, 0x20, 0x05, 0xc3, 0x01, 0xa3, 0xd2, 0x0e, +0x51, 0x93, 0x14, 0x8c, 0xbf, 0xa3, 0x64, 0xc1, 0xbb, 0x15, 0x0c, 0xa3, 0x60, 0x67, 0xb0, 0x15, +0x0c, 0x2a, 0x64, 0x67, 0x14, 0x1c, 0x82, 0x6c, 0x09, 0xef, 0x77, 0x15, 0xa4, 0x0a, 0x66, 0x67, +0x15, 0x04, 0xd7, 0x82, 0x10, 0x93, 0x0c, 0x0a, 0x0f, 0x04, 0x35, 0xd0, 0x9b, 0x7b, 0x07, 0x02, +0x13, 0xc9, 0x28, 0xac, 0x67, 0x74, 0xa8, 0x08, 0xd3, 0x2a, 0x98, 0x18, 0x87, 0xca, 0x67, 0x0d, +0x0a, 0xb7, 0xff, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x04, 0x69, 0x6c, 0xff, +0xf6, 0x65, 0x20, 0x68, 0x61, 0x0d, 0x62, 0x65, 0x65, 0x6e, 0x20, 0x63, 0x72, 0xb7, 0xfd, 0x65, +0x61, 0x74, 0x65, 0x64, 0x2f, 0x02, 0x69, 0x06, 0xfb, 0x37, 0x13, 0x79, 0x20, 0x43, 0x50, 0x49, +0x61, 0x64, 0x09, 0xdf, 0x7e, 0x56, 0x31, 0x2e, 0x32, 0x30, 0x37, 0x43, 0x6f, 0x70, 0x79, 0xff, +0xf2, 0x72, 0x69, 0x67, 0x68, 0x28, 0x43, 0x29, 0x20, 0x31, 0x39, 0x39, 0x7f, 0xdd, 0x33, 0x2d, +0x04, 0x36, 0x28, 0x6b, 0x6f, 0x73, 0xfd, 0xb7, 0x74, 0x54, 0x40, 0x61, 0x63, 0x6d, 0x2e, 0x6f, +0x72, 0x67, 0x76, 0xb7, 0x1f, 0x4b, 0x0f, 0x61, 0x20, 0x4b, 0x15, 0x0f, 0x36, 0x29, 0x71, 0x70, +0x72, 0x6f, 0x77, 0xff, 0x67, 0x72, 0x61, 0x6d, 0x20, 0x6d, 0x61, 0x79, 0x6f, 0x20, 0x75, 0x73, +0xad, 0x75, 0x63, 0x66, 0x72, 0x09, 0xd6, 0xda, 0x6f, 0x66, 0x7a, 0x84, 0x36, 0xbf, 0xb5, 0x09, +0x7e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0xad, 0x6d, 0x11, 0x77, 0x8d, 0x69, 0x00, 0xf8, 0x73, 0x6b, +0x2e, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0xff, 0xa4, 0xe8, 0x3a, 0x00, 0x72, 0xfa, +0x41, 0xe8, 0x2f, 0x00, 0xe3, 0x3b, 0x73, 0xf9, 0x83, 0xe9, 0x03, 0x72, 0x06, 0x88, 0xcc, 0xac, +0xf7, 0xd0, 0x95, 0x31, 0xc9, 0xe8, 0x1b, 0x00, 0x11, 0xc9, 0x75, 0x08, 0x41, 0xe8, 0x13, 0x00, +0x73, 0xfb, 0x41, 0x41, 0x81, 0xfd, 0x00, 0xf3, 0x83, 0xd1, 0x01, 0x8d, 0x03, 0x96, 0xf3, 0xa4, +0x96, 0xeb, 0xc8, 0xe8, 0x02, 0x00, 0x11, 0xc9, 0x01, 0xdb, 0x75, 0x04, 0xad, 0x11, 0xc0, 0x93, +0xc3, 0x5e, 0xb9, 0x01, 0x00, 0xac, 0x2c, 0xe8, 0x3c, 0x01, 0x77, 0xf9, 0x8b, 0x1c, 0x86, 0xdf, +0x29, 0xf3, 0x89, 0x1c, 0xad, 0xe2, 0xee, 0xc3 }; diff --git a/src/dos/dos_devices.cpp b/src/dos/dos_devices.cpp index aded20f..c12bf09 100644 --- a/src/dos/dos_devices.cpp +++ b/src/dos/dos_devices.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_devices.cpp,v 1.11 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: dos_devices.cpp,v 1.16 2007/01/13 08:35:49 qbix79 Exp $ */ #include #include "dosbox.h" @@ -37,22 +37,30 @@ DOS_Device * Devices[DOS_DEVICES]; class device_NUL : public DOS_Device { public: device_NUL() { SetName("NUL"); }; - bool Read(Bit8u * data,Bit16u * size) { + virtual bool Read(Bit8u * data,Bit16u * size) { for(Bitu i = 0; i < *size;i++) data[i]=0; - LOG(LOG_IOCTL,LOG_NORMAL)("NUL:READ"); + LOG(LOG_IOCTL,LOG_NORMAL)("%s:READ",GetName()); return true; } - bool Write(Bit8u * data,Bit16u * size) { - LOG(LOG_IOCTL,LOG_NORMAL)("NUL:WRITE"); + virtual bool Write(Bit8u * data,Bit16u * size) { + LOG(LOG_IOCTL,LOG_NORMAL)("%s:WRITE",GetName()); return true; } - bool Seek(Bit32u * pos,Bit32u type) { - LOG(LOG_IOCTL,LOG_NORMAL)("NUL:SEEK"); + virtual bool Seek(Bit32u * pos,Bit32u type) { + LOG(LOG_IOCTL,LOG_NORMAL)("%s:SEEK",GetName()); return true; } - bool Close() { return true; } - Bit16u GetInformation(void) { return 0x8084; } + virtual bool Close() { return true; } + virtual Bit16u GetInformation(void) { return 0x8084; } + virtual bool ReadFromControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode){return false;} + virtual bool WriteToControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode){return false;} +}; + +class device_LPT1 : public device_NUL { +public: + device_LPT1() { SetName("LPT1");} + Bit16u GetInformation(void) { return 0x80A0; } }; bool DOS_Device::Read(Bit8u * data,Bit16u * size) { @@ -75,6 +83,14 @@ Bit16u DOS_Device::GetInformation(void) { return Devices[devnum]->GetInformation(); } +bool DOS_Device::ReadFromControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode) { + return Devices[devnum]->ReadFromControlChannel(bufptr,size,retcode); +} + +bool DOS_Device::WriteToControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode) { + return Devices[devnum]->WriteToControlChannel(bufptr,size,retcode); +} + DOS_File::DOS_File(const DOS_File& orig) { type=orig.type; flags=orig.flags; @@ -110,12 +126,25 @@ DOS_File & DOS_File::operator= (const DOS_File & orig) { Bit8u DOS_FindDevice(char * name) { /* should only check for the names before the dot and spacepadded */ + // STDAUX is alias for COM1 + // A bit of a hack, but no application will probably use stdaux to determine wether a directory exists + if (strcasecmp(name, "STDAUX") == 0) name = "COM1"; + char temp[CROSS_LEN];//TODO if(!name || !(*name)) return DOS_DEVICES; strcpy(temp,name); char* dot= strrchr(temp,'.'); if(dot && *dot) *dot=0; //no ext checking + char* leading = strrchr(temp,'\\'); + if(leading) { + *leading = 0; + Bit8u drive;char fulldir[DOS_PATHLENGTH]; + if (!DOS_MakeName(temp,fulldir,&drive)) return DOS_DEVICES; + if(!Drives[drive]->TestDir(fulldir)) return DOS_DEVICES; + *leading='\\'; + } + /* loop through devices */ for(Bit8u index = 0;index < DOS_DEVICES;index++) { if (Devices[index]) { @@ -158,4 +187,7 @@ void DOS_SetupDevices(void) { DOS_Device * newdev2; newdev2=new device_NUL(); DOS_AddDevice(newdev2); + DOS_Device * newdev3; + newdev3=new device_LPT1(); + DOS_AddDevice(newdev3); } diff --git a/src/dos/dos_execute.cpp b/src/dos/dos_execute.cpp index 2841f86..ccff05e 100644 --- a/src/dos/dos_execute.cpp +++ b/src/dos/dos_execute.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_execute.cpp,v 1.54 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: dos_execute.cpp,v 1.60 2007/01/11 16:31:10 c2woody Exp $ */ #include #include @@ -26,8 +26,9 @@ #include "regs.h" #include "callback.h" #include "debug.h" +#include "cpu.h" -char * RunningProgram="DOSBOX"; +const char * RunningProgram="DOSBOX"; #ifdef _MSC_VER #pragma pack(1) @@ -93,7 +94,7 @@ static void RestoreRegisters(void) { reg_sp+=18; } -extern void GFX_SetTitle(Bits cycles,Bits frameskip,bool paused); +extern void GFX_SetTitle(Bit32s cycles,Bits frameskip,bool paused); void DOS_UpdatePSPName(void) { DOS_MCB mcb(dos.psp()-1); static char name[9]; @@ -137,6 +138,27 @@ bool DOS_Terminate(bool tsr) { // Free memory owned by process if (!tsr) DOS_FreeProcessMemory(mempsp); DOS_UpdatePSPName(); + + if ((!(CPU_AutoDetermineMode>>CPU_AUTODETERMINE_SHIFT)) || (cpu.pmode)) return true; + + CPU_AutoDetermineMode>>=CPU_AUTODETERMINE_SHIFT; + if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CYCLES) { + CPU_CycleAutoAdjust=false; + CPU_CycleLeft=0; + CPU_Cycles=0; + CPU_CycleMax=CPU_OldCycleMax; + GFX_SetTitle(CPU_OldCycleMax,-1,false); + } else { + GFX_SetTitle(-1,-1,false); + } +#if (C_DYNAMIC_X86) + if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CORE) { + cpudecoder=&CPU_Core_Normal_Run; + CPU_CycleLeft=0; + CPU_Cycles=0; + } +#endif + return true; } @@ -233,16 +255,24 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) { Bit16u fhandle;Bit16u len;Bit32u pos; Bit16u pspseg,envseg,loadseg,memsize,readsize; PhysPt loadaddress;RealPt relocpt; - Bitu headersize,imagesize; + Bitu headersize=0,imagesize=0; DOS_ParamBlock block(block_pt); block.LoadData(); + //Remove the loadhigh flag for the moment! + if(flags&0x80) LOG(LOG_EXEC,LOG_ERROR)("using loadhigh flag!!!!!. dropping it"); + flags &= 0x7f; if (flags!=LOADNGO && flags!=OVERLAY && flags!=LOAD) { - E_Exit("DOS:Not supported execute mode %d for file %s",flags,name); + DOS_SetError(DOSERR_FORMAT_INVALID); + return false; +// E_Exit("DOS:Not supported execute mode %d for file %s",flags,name); } /* Check for EXE or COM File */ bool iscom=false; - if (!DOS_OpenFile(name,OPEN_READ,&fhandle)) return false; + if (!DOS_OpenFile(name,OPEN_READ,&fhandle)) { + DOS_SetError(DOSERR_FILE_NOT_FOUND); + return false; + } len=sizeof(EXE_Header); if (!DOS_ReadFile(fhandle,(Bit8u *)&head,&len)) { DOS_CloseFile(fhandle); @@ -433,7 +463,7 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) { DEBUG_CheckExecuteBreakpoint(RealSeg(csip),RealOff(csip)); #endif /* Add the filename to PSP and environment MCB's */ - char stripname[8];Bitu index=0; + char stripname[8]= { 0 };Bitu index=0; while (char chr=*name++) { switch (chr) { case ':':case '\\':case '/':index=0;break; diff --git a/src/dos/dos_files.cpp b/src/dos/dos_files.cpp index 7c098b0..6bc05e8 100644 --- a/src/dos/dos_files.cpp +++ b/src/dos/dos_files.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_files.cpp,v 1.72 2006/03/10 09:38:24 qbix79 Exp $ */ +/* $Id: dos_files.cpp,v 1.81 2007/01/08 21:20:23 qbix79 Exp $ */ #include #include @@ -49,7 +49,7 @@ Bit8u DOS_GetDefaultDrive(void) { } void DOS_SetDefaultDrive(Bit8u drive) { - if (drive<=DOS_DRIVES) dos.current_drive=drive; + if (drive<=DOS_DRIVES && ((drive<2) || Drives[drive])) dos.current_drive = drive; } bool DOS_MakeName(char * name,char * fullname,Bit8u * drive) { @@ -122,7 +122,7 @@ bool DOS_MakeName(char * name,char * fullname,Bit8u * drive) { continue; } - Bit32u iDown, cDots; + Bit32s iDown, cDots; bool dots = true; Bit32u templen =strlen(tempdir); for(iDown=0;(iDown < templen) && dots;iDown++) @@ -307,7 +307,7 @@ bool DOS_ReadFile(Bit16u entry,Bit8u * data,Bit16u * amount) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; - if (!Files[handle]) { + if (!Files[handle] || !Files[handle]->IsOpen()) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; @@ -330,7 +330,7 @@ bool DOS_WriteFile(Bit16u entry,Bit8u * data,Bit16u * amount) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; - if (!Files[handle]) { + if (!Files[handle] || !Files[handle]->IsOpen()) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; @@ -353,7 +353,7 @@ bool DOS_SeekFile(Bit16u entry,Bit32u * pos,Bit32u type) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; - if (!Files[handle]) { + if (!Files[handle] || !Files[handle]->IsOpen()) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; @@ -370,7 +370,9 @@ bool DOS_CloseFile(Bit16u entry) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; - Files[handle]->Close(); + if (Files[handle]->IsOpen()) { + Files[handle]->Close(); + } DOS_PSP psp(dos.psp()); psp.SetFileHandle(entry,0xff); if (Files[handle]->RemoveRef()<=0) { @@ -380,6 +382,20 @@ bool DOS_CloseFile(Bit16u entry) { return true; } +static bool PathExists(char* name) { + char* leading = strrchr(name,'\\'); + if(!leading) return true; + char temp[CROSS_LEN]; + strcpy(temp,name); + leading = strrchr(temp,'\\'); + *leading = 0; + Bit8u drive;char fulldir[DOS_PATHLENGTH]; + if (!DOS_MakeName(temp,fulldir,&drive)) return false; + if(!Drives[drive]->TestDir(fulldir)) return false; + return true; +} + + bool DOS_CreateFile(char * name,Bit16u attributes,Bit16u * entry) { // Creation of a device is the same as opening it // Tc201 installer @@ -410,10 +426,13 @@ bool DOS_CreateFile(char * name,Bit16u attributes,Bit16u * entry) { } bool foundit=Drives[drive]->FileCreate(&Files[handle],fullname,attributes); if (foundit) { + Files[handle]->SetDrive(drive); Files[handle]->AddRef(); psp.SetFileHandle(*entry,handle); return true; } else { + if(!PathExists(name)) DOS_SetError(DOSERR_PATH_NOT_FOUND); + else DOS_SetError(DOSERR_FILE_NOT_FOUND); return false; } } @@ -462,6 +481,7 @@ bool DOS_OpenFile(char * name,Bit8u flags,Bit16u * entry) { Files[handle]=new DOS_Device(*Devices[devnum]); } else { exists=Drives[drive]->FileOpen(&Files[handle],fullname,flags); + if (exists) Files[handle]->SetDrive(drive); } if (exists || device ) { Files[handle]->AddRef(); @@ -471,8 +491,10 @@ bool DOS_OpenFile(char * name,Bit8u flags,Bit16u * entry) { //Test if file exists, but opened in read-write mode (and writeprotected) if(((flags&3) != OPEN_READ) && Drives[drive]->FileExists(fullname)) DOS_SetError(DOSERR_ACCESS_DENIED); - else - DOS_SetError(DOSERR_FILE_NOT_FOUND); + else { + if(!PathExists(name)) DOS_SetError(DOSERR_PATH_NOT_FOUND); + else DOS_SetError(DOSERR_FILE_NOT_FOUND); + } return false; } } @@ -533,7 +555,7 @@ bool DOS_SetFileAttr(char * name,Bit16u attr) Bit16u attrTemp; char fullname[DOS_PATHLENGTH];Bit8u drive; if (!DOS_MakeName(name,fullname,&drive)) return false; - if (strcmp(Drives[drive]->GetInfo(),"CDRom.")==0 || strcmp(Drives[drive]->GetInfo(),"isoDrive")==0) { + if (strncmp(Drives[drive]->GetInfo(),"CDRom ",6)==0 || strncmp(Drives[drive]->GetInfo(),"isoDrive ",9)==0) { DOS_SetError(DOSERR_ACCESS_DENIED); return false; } @@ -574,7 +596,7 @@ bool DOS_DuplicateEntry(Bit16u entry,Bit16u * newentry) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; - if (!Files[handle]) { + if (!Files[handle] || !Files[handle]->IsOpen()) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; @@ -599,7 +621,7 @@ bool DOS_ForceDuplicateEntry(Bit16u entry,Bit16u newentry) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; - if (!Files[orig]) { + if (!Files[orig] || !Files[orig]->IsOpen()) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; @@ -653,10 +675,10 @@ static bool isvalid(const char in){ Bit8u FCB_Parsename(Bit16u seg,Bit16u offset,Bit8u parser ,char *string, Bit8u *change) { char * string_begin=string;Bit8u ret=0; - DOS_FCB fcb(seg,offset); - bool hasdrive,hasname,hasext; - hasdrive=hasname=hasext=false; - Bitu index;bool finished;Bit8u fill; + DOS_FCB fcb(seg,offset); + bool hasdrive,hasname,hasext,finished; + hasdrive=hasname=hasext=finished=false; + Bitu index=0;Bit8u fill=' '; /* First get the old data from the fcb */ #ifdef _MSC_VER #pragma pack (1) @@ -1035,7 +1057,7 @@ bool DOS_GetFileDate(Bit16u entry, Bit16u* otime, Bit16u* odate) DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; - if (!Files[handle]) { + if (!Files[handle] || !Files[handle]->IsOpen()) { DOS_SetError(DOSERR_INVALID_HANDLE); return false; }; diff --git a/src/dos/dos_ioctl.cpp b/src/dos/dos_ioctl.cpp index a627c2c..fe31cf5 100644 --- a/src/dos/dos_ioctl.cpp +++ b/src/dos/dos_ioctl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_ioctl.cpp,v 1.26 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: dos_ioctl.cpp,v 1.29 2007/01/08 19:45:39 qbix79 Exp $ */ #include #include "dosbox.h" @@ -46,9 +46,43 @@ bool DOS_IOCTL(void) { } switch(reg_al) { case 0x00: /* Get Device Information */ - reg_dx=Files[handle]->GetInformation(); + if (Files[handle]->GetInformation() & 0x8000) { //Check for device + reg_dx=Files[handle]->GetInformation(); + } else { + Bit8u hdrive=Files[handle]->GetDrive(); + if (hdrive==0xff) { + LOG(LOG_IOCTL,LOG_NORMAL)("00:No drive set"); + hdrive=2; // defaulting to C: + } + /* return drive number in lower 5 bits for block devices */ + reg_dx=(Files[handle]->GetInformation()&0xffe0)|hdrive; + } reg_ax=reg_dx; //Destroyed officially return true; + case 0x02: /* Read from Device Control Channel */ + if (Files[handle]->GetInformation() & 0xc000) { + /* is character device with IOCTL support */ + PhysPt bufptr=PhysMake(SegValue(ds),reg_dx); + Bit16u retcode=0; + if (((DOS_Device*)(Files[handle]))->ReadFromControlChannel(bufptr,reg_cx,&retcode)) { + reg_ax=retcode; + return true; + } + } + DOS_SetError(0x0001); // invalid function + return false; + case 0x03: /* Write to Device Control Channel */ + if (Files[handle]->GetInformation() & 0xc000) { + /* is character device with IOCTL support */ + PhysPt bufptr=PhysMake(SegValue(ds),reg_dx); + Bit16u retcode=0; + if (((DOS_Device*)(Files[handle]))->WriteToControlChannel(bufptr,reg_cx,&retcode)) { + reg_ax=retcode; + return true; + } + } + DOS_SetError(0x0001); // invalid function + return false; case 0x06: /* Get Input Status */ if (Files[handle]->GetInformation() & 0x8000) { //Check for device reg_al=(Files[handle]->GetInformation() & 0x40) ? 0x0 : 0xff; @@ -59,12 +93,11 @@ bool DOS_IOCTL(void) { Files[handle]->Seek(&endlocation, DOS_SEEK_END); if(oldlocation < endlocation){//Still data available reg_al=0xff; - } else - { + } else { reg_al=0x0; //EOF or beyond } Files[handle]->Seek(&oldlocation, DOS_SEEK_SET); //restore filelocation - LOG(LOG_IOCTL,LOG_NORMAL)("06:Used Get Input Status on regualar file with handle %d",handle); + LOG(LOG_IOCTL,LOG_NORMAL)("06:Used Get Input Status on regular file with handle %d",handle); } return true; case 0x07: /* Get Output Status */ diff --git a/src/dos/dos_keyboard_layout.cpp b/src/dos/dos_keyboard_layout.cpp new file mode 100644 index 0000000..79e8af3 --- /dev/null +++ b/src/dos/dos_keyboard_layout.cpp @@ -0,0 +1,1058 @@ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "dosbox.h" +#include "bios.h" +#include "setup.h" +#include "support.h" +#include "../ints/int10.h" +#include "regs.h" +#include "callback.h" +#include "mapper.h" +#include "drives.h" +#include "dos_inc.h" + +#include "dos_codepages.h" +#include "dos_keyboard_layout_data.h" + + +static FILE* OpenDosboxFile(const char* name) { + Bit8u drive; + char fullname[DOS_PATHLENGTH]; + + localDrive* ldp=0; + // try to build dos name + if (DOS_MakeName((char*)name,fullname,&drive)) { + try { + // try to open file on mounted drive first + ldp=dynamic_cast(Drives[drive]); + if (ldp) { + FILE *tmpfile=ldp->GetSystemFilePtr(fullname, "rb"); + if (tmpfile != NULL) return tmpfile; + } + } + catch(...) {} + } + FILE *tmpfile=fopen(name, "rb"); + return tmpfile; +} + + +class keyboard_layout { +public: + keyboard_layout() { + this->reset(); + language_codes=NULL; + use_foreign_layout=false; + sprintf(current_keyboard_file_name, "none"); + }; + + ~keyboard_layout(); + + // read in a codepage from a .cpi-file + Bitu read_codepage_file(const char* codepage_file_name, Bit32s codepage_id); + Bit16u extract_codepage(const char* keyboard_file_name); + // read in a keyboard layout from a .kl-file + Bitu read_keyboard_file(const char* keyboard_file_name, Bit32s req_cp); + + // call layout_key to apply the current language layout + bool layout_key(Bitu key, Bit8u flags1, Bit8u flags2, Bit8u flags3); + + Bitu switch_keyboard_layout(const char* new_layout, keyboard_layout* &created_layout); + void switch_foreign_layout(); + + +private: + static const Bit8u layout_pages=12; + Bit16u current_layout[(MAX_SCAN_CODE+1)*layout_pages]; + struct { + Bit16u required_flags,forbidden_flags; + Bit16u required_userflags,forbidden_userflags; + } current_layout_planes[layout_pages-4]; + Bit8u additional_planes,used_lock_modifiers; + + // diacritics table + Bit8u diacritics[2048]; + Bit16u diacritics_entries; + Bit16u diacritics_character; + Bit16u user_keys; + + char current_keyboard_file_name[256]; + bool use_foreign_layout; + + // language code storage used when switching layouts + char** language_codes; + Bitu language_code_count; + + void reset(); + void read_keyboard_file(Bit32s specific_layout); + Bitu read_keyboard_file(const char* keyboard_file_name, Bit32s specific_layout, Bit32s requested_codepage); + bool map_key(Bitu key, Bit16u layouted_key, bool is_command, bool is_keypair); +}; + + +keyboard_layout::~keyboard_layout() { + if (language_codes) { + for (Bitu i=0; iread_keyboard_file(keyboard_file_name, -1, req_cp); +} + +// switch to a different layout +void keyboard_layout::read_keyboard_file(Bit32s specific_layout) { + if (strcmp(current_keyboard_file_name,"none")) + this->read_keyboard_file(current_keyboard_file_name, specific_layout, dos.loaded_codepage); +} + +static Bit32u read_kcl_file(const char* kcl_file_name, const char* layout_id) { + FILE* tempfile = OpenDosboxFile(kcl_file_name); + if (tempfile==0) return 0; + + static Bit8u rbuf[8192]; + + // check ID-bytes of file + Bit32u dr=(Bit32u)fread(rbuf, sizeof(Bit8u), 7, tempfile); + if ((dr<7) || (rbuf[0]!=0x4b) || (rbuf[1]!=0x43) || (rbuf[2]!=0x46)) { + fclose(tempfile); + return 0; + } + + fseek(tempfile, 7+rbuf[6], SEEK_SET); + + for (;;) { + Bit32u cur_pos=(Bit32u)(ftell(tempfile)); + dr=(Bit32u)fread(rbuf, sizeof(Bit8u), 5, tempfile); + if (dr<5) break; + Bit16u len=host_readw(&rbuf[0]); + + Bit8u data_len=rbuf[2]; + + char lng_codes[256]; + // get all language codes for this layout + for (Bitu i=0; ireset(); + + if (specific_layout==-1) strcpy(current_keyboard_file_name, keyboard_file_name); + if (!strcmp(keyboard_file_name,"none")) return KEYB_NOERROR; + + static Bit8u read_buf[65535]; + Bit32u read_buf_size, read_buf_pos, bytes_read; + Bit32u start_pos=5; + + char nbuf[512]; + sprintf(nbuf, "%s.kl", keyboard_file_name); + FILE* tempfile = OpenDosboxFile(nbuf); + if (tempfile==NULL) { + // see if build-in keyboard layout is available, then copy it + if (!strncasecmp(keyboard_file_name,"BG",2)) { + read_buf_size=687; + for (Bitu i=0; i(layout_pages-4)) additional_planes=(layout_pages-4); + + // seek to plane descriptor + read_buf_pos=start_pos+0x14+submappings*8; + for (Bit16u cplane=0; cplane0)) { + // add all available mappings + for (Bit16u addmap=0; addmapadditional_planes+2) break; + Bitu charptr=read_buf_pos+addmap*((read_buf[read_buf_pos-2]&0x80)?2:1); + Bit16u kchar=read_buf[charptr]; + if (read_buf[read_buf_pos-2]&0x80) kchar|=read_buf[charptr+1]<<8; // scancode/char pair + + if (kchar!=0) { // key remapped + // overwrite mapping + current_layout[scan*layout_pages+addmap]=kchar; + // clear command bit + current_layout[scan*layout_pages+layout_pages-2]&=~(1<use_foreign_layout=true; + return KEYB_NOERROR; + } + + LOG(LOG_BIOS,LOG_ERROR)("No matching keyboard layout found in %s",keyboard_file_name); + + // reset layout data (might have been changed by general layout) + this->reset(); + + return KEYB_LAYOUTNOTFOUND; +} + +bool keyboard_layout::layout_key(Bitu key, Bit8u flags1, Bit8u flags2, Bit8u flags3) { + if (key>MAX_SCAN_CODE) return false; + if (!this->use_foreign_layout) return false; + + bool is_special_pair=(current_layout[key*layout_pages+layout_pages-1] & 0x80)==0x80; + + if ((((flags1&used_lock_modifiers)&0x7c)==0) && ((flags3&2)==0)) { + // check if shift/caps is active: + // (left_shift OR right_shift) XOR (key_affected_by_caps AND caps_locked) + if ((((flags1&2)>>1) | (flags1&1)) ^ (((current_layout[key*layout_pages+layout_pages-1] & 0x40) & (flags1 & 0x40))>>6)) { + // shift plane + if (current_layout[key*layout_pages+1]!=0) { + // check if command-bit is set for shift plane + bool is_command=(current_layout[key*layout_pages+layout_pages-2]&2)!=0; + if (this->map_key(key, current_layout[key*layout_pages+1], + is_command, is_special_pair)) return true; + } + } else { + // normal plane + if (current_layout[key*layout_pages]!=0) { + // check if command-bit is set for normal plane + bool is_command=(current_layout[key*layout_pages+layout_pages-2]&1)!=0; + if (this->map_key(key, current_layout[key*layout_pages], + is_command, is_special_pair)) return true; + } + } + } + + // calculate current flags + Bit16u current_flags=(flags1&0x7f) | (((flags2&3) | (flags3&0xc))<<8); + if (flags1&3) current_flags|=0x4000; // either shift key active + if (flags3&2) current_flags|=0x1000; // e0 prefixed + + // check all planes if flags fit + for (Bit16u cplane=0; cplane>(cplane+2))&1)!=0; + if (this->map_key(key, current_layout[key*layout_pages+2+cplane], + is_command, is_special_pair)) return true; + } else break; // abort plane checking + } + } + + if (diacritics_character>0) { + // ignore state-changing keys + switch(key) { + case 0x1d: /* Ctrl Pressed */ + case 0x2a: /* Left Shift Pressed */ + case 0x36: /* Right Shift Pressed */ + case 0x38: /* Alt Pressed */ + case 0x3a: /* Caps Lock */ + case 0x45: /* Num Lock */ + case 0x46: /* Scroll Lock */ + break; + default: + if (diacritics_character-200>=diacritics_entries) { + diacritics_character=0; + return true; + } + Bit16u diacritics_start=0; + // search start of subtable + for (Bit16u i=0; i=200) && (key_command<235)) { + // diacritics command + diacritics_character=key_command; + if (diacritics_character-200>=diacritics_entries) diacritics_character=0; + return true; + } else if ((key_command>=120) && (key_command<129)) { + // switch layout command + this->read_keyboard_file(key_command-119); + return true; + } else if ((key_command>=180) && (key_command<188)) { + // switch user key off + user_keys&=~(1<<(key_command-180)); + return true; + } else if ((key_command>=188) && (key_command<196)) { + // switch user key on + user_keys|=(1<<(key_command-188)); + return true; + } else if (key_command==160) return true; // nop command + } else { + // non-command + if (diacritics_character>0) { + if (diacritics_character-200>=diacritics_entries) diacritics_character = 0; + else { + Bit16u diacritics_start=0; + // search start of subtable + for (Bit16u i=0; i(&nbuf[strsz-1])); + if (plc=='I') { + // try CPX-extension as well + nbuf[strsz-1]='X'; + tempfile=OpenDosboxFile(nbuf); + } else if (plc=='X') { + // try CPI-extension as well + nbuf[strsz-1]='I'; + tempfile=OpenDosboxFile(nbuf); + } + } + } + + static Bit8u cpi_buf[65536]; + Bit32u cpi_buf_size=0,size_of_cpxdata=0;; + bool upxfound=false; + Bit16u found_at_pos=5; + if (tempfile==NULL) { + // check if build-in codepage is available + switch (codepage_id) { + case 437: case 850: case 852: case 853: case 857: case 858: + for (Bitu bct=0; bct<6322; bct++) cpi_buf[bct]=font_ega_cpx[bct]; + cpi_buf_size=6322; + break; + case 771: case 772: case 808: case 855: case 866: case 872: + for (Bitu bct=0; bct<5455; bct++) cpi_buf[bct]=font_ega3_cpx[bct]; + cpi_buf_size=5455; + break; + case 737: case 851: case 869: + for (Bitu bct=0; bct<5720; bct++) cpi_buf[bct]=font_ega5_cpx[bct]; + cpi_buf_size=5720; + break; + default: + return KEYB_INVALIDCPFILE; + break; + } + upxfound=true; + found_at_pos=0x29; + size_of_cpxdata=cpi_buf_size; + } else { + Bit32u dr=(Bit32u)fread(cpi_buf, sizeof(Bit8u), 5, tempfile); + // check if file is valid + if (dr<5) { + LOG(LOG_BIOS,LOG_ERROR)("Codepage file %s invalid",cp_filename); + return KEYB_INVALIDCPFILE; + } + // check if non-compressed cpi file + if ((cpi_buf[0]!=0xff) || (cpi_buf[1]!=0x46) || (cpi_buf[2]!=0x4f) || + (cpi_buf[3]!=0x4e) || (cpi_buf[4]!=0x54)) { + // check if dr-dos custom cpi file + if ((cpi_buf[0]==0x7f) && (cpi_buf[1]!=0x44) && (cpi_buf[2]!=0x52) && + (cpi_buf[3]!=0x46) && (cpi_buf[4]!=0x5f)) { + LOG(LOG_BIOS,LOG_ERROR)("Codepage file %s has unsupported DR-DOS format",cp_filename); + return KEYB_INVALIDCPFILE; + } + // check if compressed cpi file + Bit8u next_byte=0; + for (Bitu i=0; i<100; i++) { + fread(&next_byte, sizeof(Bit8u), 1, tempfile); found_at_pos++; + while (next_byte==0x55) { + fread(&next_byte, sizeof(Bit8u), 1, tempfile); found_at_pos++; + if (next_byte==0x50) { + fread(&next_byte, sizeof(Bit8u), 1, tempfile); found_at_pos++; + if (next_byte==0x58) { + fread(&next_byte, sizeof(Bit8u), 1, tempfile); found_at_pos++; + if (next_byte==0x21) { + // read version ID + fread(&next_byte, sizeof(Bit8u), 1, tempfile); + found_at_pos++; + upxfound=true; + break; + } + } + } + } + if (upxfound) break; + } + if (!upxfound) { + LOG(LOG_BIOS,LOG_ERROR)("Codepage file %s invalid: %x",cp_filename,cpi_buf[0]); + return KEYB_INVALIDCPFILE; + } else { + if (next_byte<10) E_Exit("UPX-compressed cpi file, but upx-version too old"); + + // read in compressed CPX-file + fseek(tempfile, 0, SEEK_SET); + size_of_cpxdata=(Bitu)fread(cpi_buf, sizeof(Bit8u), 65536, tempfile); + } + } else { + // standard uncompressed cpi-file + fseek(tempfile, 0, SEEK_SET); + cpi_buf_size=(Bit32u)fread(cpi_buf, sizeof(Bit8u), 65536, tempfile); + } + } + + if (upxfound) { + if (size_of_cpxdata>0xfe00) E_Exit("Size of cpx-compressed data too big"); + + found_at_pos+=19; + // prepare for direct decompression + cpi_buf[found_at_pos]=0xcb; + + Bit16u seg=0; + Bit16u size=0x1500; + if (!DOS_AllocateMemory(&seg,&size)) E_Exit("Not enough free low memory to unpack data"); + MEM_BlockWrite((seg<<4)+0x100,cpi_buf,size_of_cpxdata); + + // setup segments + Bit16u save_ds=SegValue(ds); + Bit16u save_es=SegValue(es); + Bit16u save_ss=SegValue(ss); + Bit32u save_esp=reg_esp; + SegSet16(ds,seg); + SegSet16(es,seg); + SegSet16(ss,seg+0x1000); + reg_esp=0xfffe; + + // let UPX unpack the file + CALLBACK_RunRealFar(seg,0x100); + + SegSet16(ds,save_ds); + SegSet16(es,save_es); + SegSet16(ss,save_ss); + reg_esp=save_esp; + + // get unpacked content + MEM_BlockRead((seg<<4)+0x100,cpi_buf,65536); + cpi_buf_size=65536; + + DOS_FreeMemory(seg); + } + + + start_pos=host_readd(&cpi_buf[0x13]); + number_of_codepages=host_readw(&cpi_buf[start_pos]); + start_pos+=4; + + // search if codepage is provided by file + for (Bit16u test_codepage=0; test_codepagetype==M_TEXT) && (machine==MCH_VGA)) { + INT10_LoadFont(Real2Phys(int10.rom.font_16),true,256,0,0,16); + } + INT10_SetupRomMemoryChecksum(); + + return KEYB_NOERROR; + } + + start_pos=host_readd(&cpi_buf[start_pos]); + start_pos+=2; + } + + LOG(LOG_BIOS,LOG_ERROR)("Codepage %i not found",codepage_id); + + return KEYB_INVALIDCPFILE; +} + +Bitu keyboard_layout::switch_keyboard_layout(const char* new_layout, keyboard_layout*& created_layout) { + if (strncasecmp(new_layout,"US",2)) { + // switch to a foreign layout + char tbuf[256]; + strcpy(tbuf, new_layout); + size_t newlen=strlen(tbuf); + + bool language_code_found=false; + // check if language code is present in loaded foreign layout + for (Bitu i=0; iuse_foreign_layout) { + // switch to foreign layout + this->use_foreign_layout=true; + diacritics_character=0; + LOG(LOG_BIOS,LOG_NORMAL)("Switched to layout %s",tbuf); + } + } else { + keyboard_layout * temp_layout=new keyboard_layout(); + Bitu req_codepage=temp_layout->extract_codepage(new_layout); + Bitu kerrcode=temp_layout->read_keyboard_file(new_layout, req_codepage); + if (kerrcode) { + delete temp_layout; + return kerrcode; + } + // ...else keyboard layout loaded successfully, change codepage accordingly + kerrcode=temp_layout->read_codepage_file("auto", req_codepage); + if (kerrcode) { + delete temp_layout; + return kerrcode; + } + // Everything went fine, switch to new layout + created_layout=temp_layout; + } + } else if (this->use_foreign_layout) { + // switch to the US layout + this->use_foreign_layout=false; + diacritics_character=0; + LOG(LOG_BIOS,LOG_NORMAL)("Switched to US layout"); + } + return KEYB_NOERROR; +} + +void keyboard_layout::switch_foreign_layout() { + this->use_foreign_layout=!this->use_foreign_layout; + diacritics_character=0; + if (this->use_foreign_layout) LOG(LOG_BIOS,LOG_NORMAL)("Switched to foreign layout"); + else LOG(LOG_BIOS,LOG_NORMAL)("Switched to US layout"); +} + + +static keyboard_layout* loaded_layout=NULL; + +// CTRL-ALT-F2 switches between foreign and US-layout using this function +static void switch_keyboard_layout(bool pressed) { + if (!pressed) + return; + if (loaded_layout) loaded_layout->switch_foreign_layout(); +} + +// called by int9-handler +bool DOS_LayoutKey(Bitu key, Bit8u flags1, Bit8u flags2, Bit8u flags3) { + if (loaded_layout) return loaded_layout->layout_key(key, flags1, flags2, flags3); + else return false; +} + +Bitu DOS_LoadKeyboardLayout(const char * layoutname, Bit32s codepage, const char * codepagefile) { + keyboard_layout * temp_layout=new keyboard_layout(); + // try to read the layout for the specified codepage + Bitu kerrcode=temp_layout->read_keyboard_file(layoutname, codepage); + if (kerrcode) { + delete temp_layout; + return kerrcode; + } + // ...else keyboard layout loaded successfully, change codepage accordingly + kerrcode=temp_layout->read_codepage_file(codepagefile, codepage); + if (kerrcode) { + delete temp_layout; + return kerrcode; + } + // Everything went fine, switch to new layout + loaded_layout=temp_layout; + return KEYB_NOERROR; +} + +Bitu DOS_SwitchKeyboardLayout(const char* new_layout) { + if (loaded_layout) { + keyboard_layout* changed_layout=NULL; + Bitu ret_code=loaded_layout->switch_keyboard_layout(new_layout, changed_layout); + if (changed_layout) { + // Remove old layout, activate new layout + delete loaded_layout; + loaded_layout=changed_layout; + } + return ret_code; + } else return 0xff; +} + + +class DOS_KeyboardLayout: public Module_base { +public: + DOS_KeyboardLayout(Section* configuration):Module_base(configuration){ + Section_prop * section=static_cast(configuration); + dos.loaded_codepage=437; // US codepage already initialized + loaded_layout=new keyboard_layout(); + + const char * layoutname=section->Get_string("keyboardlayout"); + // try to find a good codepage for the requested layout + Bitu req_codepage=loaded_layout->extract_codepage(layoutname); + + loaded_layout->read_codepage_file("auto", req_codepage); + if (loaded_layout->read_keyboard_file(layoutname, dos.loaded_codepage)) + LOG_MSG("Error loading keyboard layout %s",layoutname); + } + + ~DOS_KeyboardLayout(){ + if ((dos.loaded_codepage!=437) && (CurMode->type==M_TEXT)) { + INT10_ReloadRomFonts(); + dos.loaded_codepage=437; // US codepage + } + if (loaded_layout) { + delete loaded_layout; + loaded_layout=NULL; + } + } +}; + +static DOS_KeyboardLayout* test; + +void DOS_KeyboardLayout_ShutDown(Section* /*sec*/) { + delete test; +} + +void DOS_KeyboardLayout_Init(Section* sec) { + test = new DOS_KeyboardLayout(sec); + sec->AddDestroyFunction(&DOS_KeyboardLayout_ShutDown,true); +// MAPPER_AddHandler(switch_keyboard_layout,MK_f2,MMOD1|MMOD2,"sw_layout","Switch Layout"); +} diff --git a/src/dos/dos_keyboard_layout_data.h b/src/dos/dos_keyboard_layout_data.h new file mode 100644 index 0000000..4b200b5 --- /dev/null +++ b/src/dos/dos_keyboard_layout_data.h @@ -0,0 +1,796 @@ +/* + * Copyright (C) Henrique Peron + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + + +/* This file contains data of .KL-files. They have been generated + by Henrique Peron using FreeDOS KC */ + +/* KC: compiles keyboard descriptors in KEY language to a KeybCB, + wrapped in a KL file (for use of FD-KEYB 2.X) + Copyright (C) 2004 by Aitor SANTAMARIA_MERINO */ + + +// Bulgaria (101-key) +Bit8u layout_BG[687] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x09, 0x00, 0x00, 0x42, 0x47, 0x2c, 0xba, 0x01, 0x42, 0x47, 0x07, +0x03, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x03, 0x99, 0x01, 0x00, +0x00, 0x00, 0x00, 0x68, 0x03, 0xae, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x03, 0x97, 0x02, 0x00, +0x00, 0x00, 0x00, 0x57, 0x03, 0xae, 0x01, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x03, 0xa7, 0x00, 0x00, +0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x02, 0x03, 0x00, 0x00, 0x40, 0x04, 0x02, 0x03, 0x00, 0x00, 0x23, 0x05, +0x02, 0x03, 0x00, 0x00, 0xcf, 0x07, 0x02, 0x03, 0x00, 0x00, 0x5e, 0x08, 0x02, 0x03, 0x00, 0x00, +0x26, 0x09, 0x02, 0x03, 0x00, 0x00, 0x24, 0x1a, 0x02, 0x03, 0x00, 0x00, 0x5b, 0x1b, 0x02, 0x03, +0x00, 0x00, 0x5d, 0x2b, 0x02, 0x03, 0x00, 0x00, 0x7c, 0x33, 0x02, 0x03, 0x00, 0x00, 0x3c, 0x34, +0x02, 0x03, 0x00, 0x00, 0x3e, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x03, 0x01, 0x01, +0x00, 0x3f, 0x04, 0x01, 0x01, 0x00, 0x2b, 0x05, 0x02, 0x05, 0x00, 0x22, 0xa0, 0x07, 0x01, 0x01, +0x00, 0x3d, 0x08, 0x01, 0x01, 0x00, 0x3a, 0x09, 0x01, 0x01, 0x00, 0x2f, 0x0a, 0x03, 0x05, 0x00, +0x5f, 0x00, 0x1f, 0x0b, 0x01, 0x01, 0x00, 0xef, 0x0c, 0x01, 0x01, 0x00, 0x49, 0x0d, 0x01, 0x00, +0x2e, 0x56, 0x10, 0x01, 0x00, 0x2c, 0xf2, 0x11, 0x41, 0x00, 0xe7, 0xe8, 0x12, 0x42, 0x00, 0xa8, +0xa9, 0xcf, 0x13, 0x41, 0x00, 0xb7, 0xb8, 0x14, 0x41, 0x00, 0xf5, 0xf6, 0x15, 0x41, 0x00, 0xf9, +0xfa, 0x16, 0x41, 0x00, 0xc6, 0xc7, 0x17, 0x41, 0x00, 0xe3, 0xe4, 0x18, 0x41, 0x00, 0xa6, 0xa7, +0x19, 0x41, 0x00, 0xf3, 0xf4, 0x1a, 0x41, 0x00, 0xa4, 0xa5, 0x1b, 0x01, 0x00, 0x3b, 0xfd, 0x1e, +0x41, 0x00, 0xed, 0xee, 0x1f, 0xc1, 0x00, 0xde, 0x1f, 0xe0, 0x00, 0x20, 0x41, 0x00, 0xa0, 0xa1, +0x21, 0x41, 0x00, 0xd6, 0xd7, 0x22, 0x41, 0x00, 0xe9, 0xea, 0x23, 0x41, 0x00, 0xac, 0xad, 0x24, +0x41, 0x00, 0xe5, 0xe6, 0x25, 0x41, 0x00, 0xd4, 0xd5, 0x26, 0x41, 0x00, 0xeb, 0xec, 0x27, 0x41, +0x00, 0xd2, 0xd3, 0x28, 0x41, 0x00, 0xfb, 0xfc, 0x2a, 0x04, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x78, +0x2b, 0x01, 0x00, 0x29, 0x28, 0x2c, 0x41, 0x00, 0x9c, 0x9d, 0x2d, 0x41, 0x00, 0xbd, 0xbe, 0x2e, +0x41, 0x00, 0x9e, 0x9f, 0x2f, 0x41, 0x00, 0xf7, 0xf8, 0x30, 0x41, 0x00, 0xaa, 0xab, 0x31, 0x41, +0x00, 0xb5, 0xb6, 0x32, 0x41, 0x00, 0xd8, 0xdd, 0x33, 0x41, 0x00, 0xe1, 0xe2, 0x34, 0x41, 0x00, +0xd0, 0xd1, 0x35, 0x41, 0x00, 0xa2, 0xa3, 0x00, 0x05, 0x02, 0x07, 0x00, 0x00, 0xa0, 0x12, 0x42, +0x03, 0x00, 0x00, 0xcf, 0x36, 0x04, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x79, 0x00, 0x03, 0x01, 0x01, +0x00, 0x3f, 0x04, 0x01, 0x01, 0x00, 0x2b, 0x05, 0x01, 0x01, 0x00, 0x22, 0x07, 0x01, 0x01, 0x00, +0x3d, 0x08, 0x01, 0x01, 0x00, 0x3a, 0x09, 0x01, 0x01, 0x00, 0x2f, 0x0a, 0x03, 0x05, 0x00, 0x5f, +0x00, 0x1f, 0x0b, 0x01, 0x01, 0x00, 0xef, 0x0c, 0x01, 0x01, 0x00, 0x49, 0x0d, 0x01, 0x00, 0x2e, +0x56, 0x10, 0x01, 0x00, 0x2c, 0xf2, 0x11, 0x41, 0x00, 0xe7, 0xe8, 0x12, 0x41, 0x00, 0xa8, 0xa9, +0x13, 0x41, 0x00, 0xb7, 0xb8, 0x14, 0x41, 0x00, 0xf5, 0xf6, 0x15, 0x41, 0x00, 0xf9, 0xfa, 0x16, +0x41, 0x00, 0xc6, 0xc7, 0x17, 0x41, 0x00, 0xe3, 0xe4, 0x18, 0x41, 0x00, 0xa6, 0xa7, 0x19, 0x41, +0x00, 0xf3, 0xf4, 0x1a, 0x41, 0x00, 0xa4, 0xa5, 0x1b, 0x01, 0x00, 0x3b, 0xfd, 0x1e, 0x41, 0x00, +0xed, 0xee, 0x1f, 0xc1, 0x00, 0xde, 0x1f, 0xe0, 0x00, 0x20, 0x41, 0x00, 0xa0, 0xa1, 0x21, 0x41, +0x00, 0xd6, 0xd7, 0x22, 0x41, 0x00, 0xe9, 0xea, 0x23, 0x41, 0x00, 0xac, 0xad, 0x24, 0x41, 0x00, +0xe5, 0xe6, 0x25, 0x41, 0x00, 0xd4, 0xd5, 0x26, 0x41, 0x00, 0xeb, 0xec, 0x27, 0x41, 0x00, 0xd2, +0xd3, 0x28, 0x41, 0x00, 0xfb, 0xfc, 0x2a, 0x04, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x2b, 0x01, +0x00, 0x29, 0x28, 0x2c, 0x41, 0x00, 0x9c, 0x9d, 0x2d, 0x41, 0x00, 0xbd, 0xbe, 0x2e, 0x41, 0x00, +0x9e, 0x9f, 0x2f, 0x41, 0x00, 0xf7, 0xf8, 0x30, 0x41, 0x00, 0xaa, 0xab, 0x31, 0x41, 0x00, 0xb5, +0xb6, 0x32, 0x41, 0x00, 0xd8, 0xdd, 0x33, 0x41, 0x00, 0xe1, 0xe2, 0x34, 0x41, 0x00, 0xd0, 0xd1, +0x35, 0x41, 0x00, 0xa2, 0xa3, 0x00, 0x36, 0x04, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x00 }; + +// Czech Republic (Standard) +Bit8u layout_CZ243[1003] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x04, 0xf3, 0x00, 0x43, 0x5a, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, +0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x03, 0x36, 0x01, 0xb8, 0x01, 0x00, 0x00, 0x5a, 0x03, +0x79, 0x02, 0x80, 0x02, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0x63, 0x03, +0x07, 0x03, 0x74, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x2b, 0x31, 0xc8, 0x03, 0x01, 0x01, 0xa0, +0x32, 0x04, 0x03, 0x05, 0xa0, 0x33, 0xc9, 0x1e, 0x05, 0x01, 0x01, 0xa0, 0x34, 0x06, 0x02, 0x05, +0xa0, 0x35, 0xca, 0x07, 0x01, 0x01, 0xa0, 0x36, 0x08, 0x02, 0x04, 0xec, 0x37, 0xcb, 0x09, 0x02, +0x00, 0xa0, 0x38, 0xfa, 0x0a, 0x02, 0x04, 0xa1, 0x39, 0xcc, 0x0b, 0x01, 0x00, 0x82, 0x30, 0x0c, +0x02, 0x04, 0x3d, 0x25, 0xcd, 0x0d, 0x02, 0x07, 0xcc, 0xa0, 0xce, 0x10, 0x42, 0x03, 0x00, 0x00, +0x5c, 0x11, 0x42, 0x03, 0x00, 0x00, 0x7c, 0x12, 0x41, 0x00, 0x65, 0x45, 0x15, 0x43, 0x04, 0x7a, +0x5a, 0x00, 0x1a, 0x16, 0x41, 0x00, 0x75, 0x55, 0x17, 0x41, 0x00, 0x69, 0x49, 0x18, 0x41, 0x00, +0x6f, 0x4f, 0x1a, 0x02, 0x00, 0xa3, 0x2f, 0xf6, 0x1b, 0x02, 0x00, 0x29, 0x28, 0x9e, 0x1e, 0x42, +0x00, 0x61, 0x41, 0x3c, 0x21, 0x42, 0x03, 0x00, 0x00, 0x5b, 0x22, 0x42, 0x03, 0x00, 0x00, 0x5d, +0x27, 0x02, 0x01, 0xa0, 0x22, 0x24, 0x28, 0x02, 0x00, 0xf5, 0x21, 0xe1, 0x29, 0x01, 0x02, 0x3b, +0xca, 0x2b, 0x02, 0x01, 0xcd, 0x27, 0xcf, 0x2c, 0x43, 0x00, 0x79, 0x59, 0x3e, 0x19, 0x2d, 0x42, +0x03, 0x00, 0x00, 0x23, 0x2e, 0x42, 0x00, 0x63, 0x43, 0x26, 0x2f, 0x42, 0x03, 0x00, 0x00, 0x40, +0x30, 0x42, 0x03, 0x00, 0x00, 0x7b, 0x31, 0x42, 0x00, 0x6e, 0x4e, 0x7d, 0x32, 0x42, 0x03, 0x00, +0x00, 0xe6, 0x33, 0x01, 0x01, 0x00, 0x3f, 0x34, 0x02, 0x01, 0x00, 0x3a, 0x2a, 0x35, 0x03, 0x04, +0x2d, 0x5f, 0x00, 0x1f, 0x39, 0x00, 0x00, 0x20, 0x56, 0x03, 0x00, 0x26, 0x2a, 0x3c, 0x1c, 0x00, +0x02, 0x02, 0x03, 0x00, 0x00, 0x7e, 0x03, 0x02, 0x06, 0xd8, 0x00, 0xc8, 0x04, 0x00, 0x00, 0xe7, +0x05, 0x02, 0x06, 0x9f, 0x00, 0xca, 0x06, 0x02, 0x06, 0xfd, 0x00, 0xcb, 0x07, 0x02, 0x06, 0xa7, +0x00, 0xcc, 0x08, 0x02, 0x03, 0x00, 0x00, 0x60, 0x09, 0x02, 0x07, 0x00, 0x00, 0xcd, 0x0a, 0x02, +0x07, 0x00, 0x00, 0xce, 0x0b, 0x02, 0x07, 0x00, 0x00, 0xcf, 0x0c, 0x02, 0x07, 0x00, 0x00, 0xd0, +0x0d, 0x02, 0x07, 0xce, 0xc8, 0xd1, 0x12, 0x42, 0x03, 0x00, 0x00, 0xaa, 0x13, 0x41, 0x00, 0x72, +0x52, 0x14, 0x41, 0x00, 0x74, 0x54, 0x1f, 0x42, 0x00, 0x73, 0x53, 0xd0, 0x20, 0x42, 0x00, 0x64, +0x44, 0xd1, 0x25, 0x42, 0x03, 0x00, 0x00, 0x88, 0x26, 0x42, 0x00, 0x6c, 0x4c, 0x9d, 0x27, 0x00, +0x00, 0x85, 0x29, 0x01, 0x03, 0x00, 0xcb, 0x2b, 0x00, 0x01, 0xd0, 0x32, 0x02, 0x07, 0x00, 0x00, +0xa0, 0x00, 0xf3, 0x13, 0x63, 0x9f, 0x64, 0xd4, 0x65, 0xd8, 0x6c, 0x96, 0x6e, 0xe5, 0x72, 0xfd, +0x73, 0xe7, 0x74, 0x9c, 0x7a, 0xa7, 0x43, 0xac, 0x44, 0xd2, 0x45, 0xb7, 0x4c, 0x95, 0x4e, 0xd5, +0x52, 0xfc, 0x53, 0xe6, 0x54, 0x9b, 0x5a, 0xa6, 0x20, 0xf3, 0x5e, 0x07, 0x61, 0x83, 0x69, 0x8c, +0x6f, 0x93, 0x41, 0xb6, 0x49, 0xd7, 0x4f, 0xe2, 0x20, 0x5e, 0xf4, 0x03, 0x61, 0xc7, 0x41, 0xc6, +0x20, 0xf4, 0xf8, 0x03, 0x75, 0x85, 0x55, 0xde, 0x20, 0xf8, 0xf2, 0x05, 0x61, 0xa5, 0x65, 0xa9, +0x41, 0xa4, 0x45, 0xa8, 0x20, 0xf2, 0xfa, 0x03, 0x7a, 0xbe, 0x5a, 0xbd, 0x20, 0xfa, 0x27, 0x19, +0x61, 0xa0, 0x63, 0x86, 0x65, 0x82, 0x69, 0xa1, 0x6c, 0x92, 0x6e, 0xe4, 0x6f, 0xa2, 0x72, 0xea, +0x73, 0x98, 0x75, 0xa3, 0x79, 0xec, 0x7a, 0xab, 0x41, 0xb5, 0x43, 0x8f, 0x45, 0x90, 0x49, 0xd6, +0x4c, 0x91, 0x4e, 0xe3, 0x4f, 0xe0, 0x52, 0xe8, 0x53, 0x97, 0x55, 0xe9, 0x59, 0xed, 0x5a, 0x8d, +0x20, 0xef, 0xf1, 0x05, 0x6f, 0x8b, 0x75, 0xfb, 0x4f, 0x8a, 0x55, 0xeb, 0x20, 0xf1, 0xf9, 0x09, +0x61, 0x84, 0x65, 0x89, 0x6f, 0x94, 0x75, 0x81, 0x41, 0x8e, 0x45, 0xd3, 0x4f, 0x99, 0x55, 0x9a, +0x20, 0xf9, 0xf7, 0x07, 0x63, 0x87, 0x73, 0xad, 0x74, 0xee, 0x43, 0x80, 0x53, 0xb8, 0x54, 0xdd, +0x20, 0xf7, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, +0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, +0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, +0x20, 0x5e, 0xf8, 0x03, 0x61, 0x86, 0x41, 0x8f, 0x20, 0xf8, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, +0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, +0x20, 0x60, 0xef, 0x0d, 0x61, 0xa0, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x79, 0xec, +0x41, 0xb5, 0x45, 0x90, 0x49, 0xd6, 0x4f, 0xe0, 0x55, 0xe9, 0x59, 0xed, 0x20, 0xef, 0xf9, 0x0c, +0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, +0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0xf9, 0xf7, 0x03, 0x63, 0x87, 0x43, 0x80, 0x20, 0xf7, +0x00, 0x02, 0x02, 0x03, 0x00, 0x00, 0x7e, 0x03, 0x02, 0x06, 0x88, 0x00, 0xc8, 0x04, 0x00, 0x00, +0xa8, 0x05, 0x00, 0x00, 0x87, 0x06, 0x00, 0x00, 0xa9, 0x07, 0x00, 0x00, 0x91, 0x08, 0x02, 0x02, +0x98, 0x00, 0x60, 0x09, 0x02, 0x07, 0x00, 0x00, 0xa0, 0x0a, 0x02, 0x07, 0x00, 0x00, 0xcb, 0x0c, +0x02, 0x07, 0x00, 0x00, 0xcc, 0x0d, 0x02, 0x07, 0xcb, 0xc8, 0xa0, 0x13, 0x41, 0x00, 0x72, 0x52, +0x14, 0x41, 0x00, 0x74, 0x54, 0x1b, 0x02, 0x07, 0x00, 0x00, 0xa0, 0x1f, 0x41, 0x00, 0x73, 0x53, +0x20, 0x41, 0x00, 0x64, 0x44, 0x26, 0x41, 0x00, 0x6c, 0x4c, 0x27, 0x00, 0x00, 0x96, 0x28, 0x00, +0x00, 0xad, 0x29, 0x01, 0x03, 0x00, 0xca, 0x2b, 0x02, 0x07, 0xcc, 0x00, 0xa0, 0x00, 0x76, 0x13, +0x63, 0x87, 0x64, 0x83, 0x65, 0x88, 0x6c, 0x8c, 0x6e, 0xa4, 0x72, 0xa9, 0x73, 0xa8, 0x74, 0x9f, +0x7a, 0x91, 0x43, 0x80, 0x44, 0x85, 0x45, 0x89, 0x4c, 0x9c, 0x4e, 0xa5, 0x52, 0x9e, 0x53, 0x9b, +0x54, 0x86, 0x5a, 0x92, 0x20, 0x76, 0x5e, 0x03, 0x6f, 0x93, 0x4f, 0xa7, 0x20, 0x5e, 0xf8, 0x03, +0x75, 0x96, 0x55, 0xa6, 0x20, 0xf8, 0x27, 0x11, 0x61, 0xa0, 0x65, 0x82, 0x69, 0xa1, 0x6c, 0x8d, +0x6f, 0xa2, 0x72, 0xaa, 0x75, 0xa3, 0x79, 0x98, 0x41, 0x8f, 0x45, 0x90, 0x49, 0x8b, 0x4c, 0x8a, +0x4f, 0x95, 0x52, 0xab, 0x55, 0x97, 0x59, 0x9d, 0x20, 0x27, 0x22, 0x07, 0x61, 0x84, 0x6f, 0x94, +0x75, 0x81, 0x41, 0x8e, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0x22, 0x00 }; + +// France (Standard) +Bit8u layout_FR[581] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x09, 0x00, 0x00, 0x46, 0x52, 0x2c, 0xbd, 0x00, 0x46, 0x52, 0x05, +0x03, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x03, 0x68, 0x01, 0x6f, +0x01, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x5b, 0x03, 0xca, 0x01, 0xd9, +0x01, 0x00, 0x00, 0xb5, 0x01, 0x1c, 0x01, 0x2d, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x41, 0x00, 0x26, 0x31, 0x03, 0x42, 0x04, 0x82, 0x32, 0xc9, 0x04, 0x42, +0x00, 0x22, 0x33, 0x23, 0x05, 0x42, 0x00, 0x27, 0x34, 0x7b, 0x06, 0x43, 0x00, 0x28, 0x35, 0x5b, +0x1b, 0x07, 0x43, 0x00, 0x2d, 0x36, 0x7c, 0x1f, 0x08, 0x42, 0x04, 0x8a, 0x37, 0xc8, 0x09, 0x43, +0x00, 0x5f, 0x38, 0x5c, 0x1c, 0x0a, 0x42, 0x00, 0x87, 0x39, 0x5e, 0x0b, 0x42, 0x00, 0x85, 0x30, +0x40, 0x0c, 0x43, 0x00, 0x29, 0xf8, 0x5d, 0x1d, 0x0d, 0x42, 0x03, 0x00, 0x00, 0x7d, 0x10, 0x43, +0x04, 0x61, 0x41, 0x00, 0x01, 0x11, 0x43, 0x04, 0x7a, 0x5a, 0x00, 0x1a, 0x12, 0x41, 0x00, 0x65, +0x45, 0x15, 0x41, 0x00, 0x79, 0x59, 0x16, 0x41, 0x00, 0x75, 0x55, 0x17, 0x41, 0x00, 0x69, 0x49, +0x18, 0x41, 0x00, 0x6f, 0x4f, 0x1a, 0x43, 0x07, 0xca, 0xcb, 0x00, 0x1e, 0x1b, 0x42, 0x00, 0x24, +0x9c, 0xcf, 0x1e, 0x43, 0x04, 0x71, 0x51, 0x00, 0x11, 0x27, 0x43, 0x04, 0x6d, 0x4d, 0x00, 0x0d, +0x28, 0x41, 0x00, 0x97, 0x25, 0x29, 0x41, 0x00, 0xfd, 0xfc, 0x2b, 0x41, 0x00, 0x2a, 0xe6, 0x2c, +0x43, 0x04, 0x77, 0x57, 0x00, 0x17, 0x31, 0x41, 0x00, 0x6e, 0x4e, 0x32, 0x41, 0x00, 0x2c, 0x3f, +0x33, 0x42, 0x00, 0x3b, 0x2e, 0x3c, 0x34, 0x42, 0x00, 0x3a, 0x2f, 0x3e, 0x35, 0x41, 0x00, 0x21, +0xf5, 0x39, 0x00, 0x00, 0x20, 0x56, 0x41, 0x00, 0x3c, 0x3e, 0x00, 0x1b, 0x42, 0x07, 0x00, 0x00, +0xa0, 0x29, 0x41, 0x03, 0x00, 0xa0, 0x35, 0x41, 0x01, 0x00, 0x15, 0x00, 0x60, 0x06, 0x61, 0x85, +0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x20, 0x60, 0x7e, 0x03, 0x6e, 0xa4, 0x4e, 0xa5, +0x20, 0x7e, 0x5e, 0x06, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x20, 0x5e, +0x22, 0x0a, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, +0x4f, 0x99, 0x55, 0x9a, 0x20, 0x22, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x60, 0x0b, +0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, +0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, 0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, 0x6f, 0xe4, 0x41, 0xc7, +0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, +0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, 0x20, 0x5e, 0xf9, 0x0c, +0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, +0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0xf9, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x18, +0x44, 0x0b, 0x00, 0x00, 0xab, 0x00, 0xac, 0x00, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, +0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, +0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, 0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, +0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, +0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, 0x20, 0x5e, 0x22, 0x0d, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, +0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, +0x59, 0xf3, 0x20, 0x22, 0x00 }; + +// Greece (319) +Bit8u layout_GK[1117] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x13, 0x00, 0x00, 0x47, 0x4b, 0x2c, 0x00, 0x00, 0x45, 0x4c, 0x2c, +0x3f, 0x01, 0x47, 0x4b, 0x2c, 0x3f, 0x01, 0x45, 0x4c, 0x09, 0x03, 0x00, 0x00, 0x00, 0x00, 0x0d, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, +0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x03, 0x3a, 0x02, 0x00, 0x00, 0x00, 0x00, 0x65, 0x03, 0x79, +0x01, 0x49, 0x02, 0x00, 0x00, 0xe1, 0x02, 0x24, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe1, 0x02, 0x7e, +0x02, 0x2d, 0x03, 0x00, 0x00, 0x53, 0x03, 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x53, 0x03, 0x5a, +0x03, 0x13, 0x04, 0x00, 0x00, 0x5a, 0x03, 0xf7, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x52, 0x03, 0x00, +0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, +0x00, 0x22, 0x07, 0x01, 0x01, 0x00, 0x26, 0x08, 0x01, 0x01, 0x00, 0x2f, 0x09, 0x01, 0x01, 0x00, +0x28, 0x0a, 0x01, 0x01, 0x00, 0x29, 0x0b, 0x01, 0x01, 0x00, 0x3d, 0x0c, 0x01, 0x00, 0x27, 0x3f, +0x0d, 0x01, 0x00, 0x2b, 0x2a, 0x12, 0x41, 0x00, 0x65, 0x45, 0x15, 0x41, 0x00, 0x79, 0x59, 0x16, +0x41, 0x00, 0x75, 0x55, 0x17, 0x41, 0x00, 0x69, 0x49, 0x18, 0x41, 0x00, 0x6f, 0x4f, 0x1e, 0x41, +0x00, 0x61, 0x41, 0x27, 0x01, 0x03, 0xcb, 0xcc, 0x28, 0x01, 0x03, 0xca, 0xc9, 0x29, 0x03, 0x04, +0x5c, 0x7c, 0x00, 0x1c, 0x2b, 0x01, 0x01, 0xc8, 0x40, 0x2e, 0x41, 0x00, 0x63, 0x43, 0x31, 0x41, +0x00, 0x6e, 0x4e, 0x33, 0x02, 0x00, 0x2c, 0x3b, 0x3c, 0x34, 0x02, 0x00, 0x2e, 0x3a, 0x3e, 0x35, +0x03, 0x04, 0x2d, 0x5f, 0x00, 0x1f, 0x39, 0x00, 0x00, 0x20, 0x56, 0x01, 0x00, 0x3c, 0x3e, 0x00, +0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, +0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, 0x7e, +0x07, 0x61, 0xc6, 0x6e, 0xa4, 0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, +0x0b, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, +0xd7, 0x4f, 0xe2, 0x55, 0xea, 0x20, 0x5e, 0xef, 0x0f, 0x61, 0xa0, 0x63, 0x87, 0x65, 0x82, 0x69, +0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x79, 0xec, 0x41, 0xb5, 0x43, 0x80, 0x45, 0x90, 0x49, 0xd6, 0x4f, +0xe0, 0x55, 0xe9, 0x59, 0xed, 0x20, 0xef, 0xf9, 0x0c, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, +0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x20, +0xf9, 0x00, 0x04, 0x01, 0x01, 0x00, 0x9c, 0x07, 0x01, 0x01, 0x00, 0x89, 0x0c, 0x01, 0x01, 0x00, +0xf8, 0x10, 0x01, 0x00, 0x88, 0x8e, 0x11, 0x01, 0x00, 0xed, 0x8a, 0x12, 0x42, 0x00, 0xde, 0xa8, +0x87, 0x13, 0x41, 0x00, 0xeb, 0xc7, 0x14, 0x41, 0x00, 0xee, 0xd0, 0x15, 0x41, 0x00, 0xf2, 0xd1, +0x16, 0x41, 0x00, 0xe2, 0xac, 0x17, 0x41, 0x00, 0xe3, 0xad, 0x18, 0x41, 0x00, 0xe9, 0xbe, 0x19, +0x41, 0x00, 0xea, 0xc6, 0x1a, 0x01, 0x01, 0x00, 0xae, 0x1b, 0x01, 0x01, 0x00, 0xaf, 0x1e, 0x41, +0x00, 0xd6, 0xa4, 0x1f, 0x41, 0x00, 0xec, 0xcf, 0x20, 0x41, 0x00, 0xdd, 0xa7, 0x21, 0x41, 0x00, +0xf3, 0xd2, 0x22, 0x41, 0x00, 0xd8, 0xa6, 0x23, 0x41, 0x00, 0xe1, 0xaa, 0x24, 0x41, 0x00, 0xe8, +0xbd, 0x25, 0x41, 0x00, 0xe4, 0xb5, 0x26, 0x41, 0x00, 0xe5, 0xb6, 0x27, 0x02, 0x07, 0xc8, 0xc9, +0xca, 0x28, 0x01, 0x00, 0x8c, 0x8b, 0x29, 0x01, 0x00, 0xab, 0xf1, 0x2a, 0x04, 0x1f, 0x00, 0x00, +0x00, 0x00, 0x78, 0x2b, 0x01, 0x00, 0x99, 0x9a, 0x2c, 0xc1, 0x00, 0xe0, 0x00, 0xa9, 0x2c, 0x2d, +0x41, 0x00, 0xf4, 0xd3, 0x2e, 0x41, 0x00, 0xf6, 0xd4, 0x2f, 0x41, 0x00, 0xfa, 0xd5, 0x30, 0x41, +0x00, 0xd7, 0xa5, 0x31, 0x41, 0x00, 0xe7, 0xb8, 0x32, 0x41, 0x00, 0xe6, 0xb7, 0x56, 0x01, 0x00, +0xf5, 0x97, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0x87, 0x36, 0x04, 0x1f, 0x00, 0x00, 0x00, 0x00, +0x79, 0x00, 0xef, 0x0f, 0xd6, 0x9b, 0xde, 0x9d, 0xe1, 0x9e, 0xe3, 0x9f, 0xe9, 0xa2, 0xf2, 0xa3, +0xfa, 0xfd, 0xa4, 0x86, 0xa8, 0x8d, 0xaa, 0x8f, 0xad, 0x90, 0xbe, 0x92, 0xd1, 0x95, 0xd5, 0x98, +0x20, 0xef, 0xf9, 0x05, 0xe3, 0xa0, 0xf2, 0xfb, 0xad, 0x91, 0xd1, 0x96, 0x20, 0xf9, 0xf7, 0x03, +0xe3, 0xa1, 0xf2, 0xfc, 0x20, 0xf7, 0x00, 0x0c, 0x01, 0x01, 0x00, 0xf8, 0x10, 0x01, 0x00, 0xf9, +0x51, 0x11, 0x01, 0x00, 0xaa, 0x57, 0x12, 0x41, 0x00, 0x9c, 0x84, 0x13, 0x41, 0x00, 0xa8, 0x90, +0x14, 0x41, 0x00, 0xab, 0x92, 0x15, 0x41, 0x00, 0xac, 0x93, 0x16, 0x41, 0x00, 0x9f, 0x87, 0x17, +0x41, 0x00, 0xa0, 0x88, 0x18, 0x41, 0x00, 0xa6, 0x8e, 0x19, 0x41, 0x00, 0xa7, 0x8f, 0x1e, 0x41, +0x00, 0x98, 0x80, 0x1f, 0x41, 0x00, 0xa9, 0x91, 0x20, 0x41, 0x00, 0x9b, 0x83, 0x21, 0x41, 0x00, +0xad, 0x94, 0x22, 0x41, 0x00, 0x9a, 0x82, 0x23, 0x41, 0x00, 0x9e, 0x86, 0x24, 0x41, 0x00, 0xa5, +0x8d, 0x25, 0x41, 0x00, 0xa1, 0x89, 0x26, 0x41, 0x00, 0xa2, 0x8a, 0x27, 0x01, 0x03, 0xc8, 0xc9, +0x29, 0x01, 0x00, 0x60, 0xf1, 0x2a, 0x04, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x2b, 0x01, 0x00, +0xfd, 0x7c, 0x2c, 0x41, 0x00, 0x9d, 0x85, 0x2d, 0x41, 0x00, 0xae, 0x95, 0x2e, 0x41, 0x00, 0xaf, +0x96, 0x2f, 0xc1, 0x00, 0xe0, 0x00, 0x97, 0x2f, 0x30, 0x41, 0x00, 0x99, 0x81, 0x31, 0x41, 0x00, +0xa4, 0x8c, 0x32, 0x41, 0x00, 0xa3, 0x8b, 0x56, 0x01, 0x00, 0x15, 0x7c, 0x00, 0x36, 0x04, 0x1f, +0x00, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x27, 0x0f, 0x98, 0xe1, 0x9c, 0xe2, 0x9e, 0xe3, 0xa0, 0xe5, +0xa6, 0xe6, 0xac, 0xe7, 0xe0, 0xe9, 0x80, 0xea, 0x84, 0xeb, 0x86, 0xec, 0x88, 0xed, 0x8e, 0xee, +0x93, 0xef, 0x97, 0xf0, 0x20, 0x27, 0x22, 0x05, 0xa0, 0xe4, 0xac, 0xe8, 0x88, 0xf4, 0x93, 0xf5, +0x20, 0x22, 0x00, 0x0c, 0x01, 0x01, 0x00, 0xf8, 0x10, 0x10, 0x00, 0x00, 0x11, 0x01, 0x00, 0xed, +0x7c, 0x12, 0x41, 0x00, 0xde, 0xa8, 0x13, 0x41, 0x00, 0xeb, 0xc7, 0x14, 0x41, 0x00, 0xee, 0xd0, +0x15, 0x41, 0x00, 0xf2, 0xd1, 0x16, 0x41, 0x00, 0xe2, 0xac, 0x17, 0x41, 0x00, 0xe3, 0xad, 0x18, +0x41, 0x00, 0xe9, 0xbe, 0x19, 0x41, 0x00, 0xea, 0xc6, 0x1a, 0x01, 0x01, 0x00, 0xae, 0x1b, 0x01, +0x01, 0x00, 0xaf, 0x1e, 0x41, 0x00, 0xd6, 0xa4, 0x1f, 0x41, 0x00, 0xec, 0xcf, 0x20, 0x41, 0x00, +0xdd, 0xa7, 0x21, 0x41, 0x00, 0xf3, 0xd2, 0x22, 0x41, 0x00, 0xd8, 0xa6, 0x23, 0x41, 0x00, 0xe1, +0xaa, 0x24, 0x41, 0x00, 0xe8, 0xbd, 0x25, 0x41, 0x00, 0xe4, 0xb5, 0x26, 0x41, 0x00, 0xe5, 0xb6, +0x27, 0x02, 0x07, 0xc8, 0xc9, 0xca, 0x29, 0x01, 0x00, 0xab, 0xf1, 0x2a, 0x04, 0x1f, 0x00, 0x00, +0x00, 0x00, 0x7c, 0x2b, 0x01, 0x00, 0x5c, 0x7c, 0x2c, 0xc1, 0x00, 0xe0, 0x00, 0xa9, 0x2c, 0x2d, +0x41, 0x00, 0xf4, 0xd3, 0x2e, 0x41, 0x00, 0xf6, 0xd4, 0x2f, 0x41, 0x00, 0xfa, 0xd5, 0x30, 0x41, +0x00, 0xd7, 0xa5, 0x31, 0x41, 0x00, 0xe7, 0xb8, 0x32, 0x41, 0x00, 0xe6, 0xb7, 0x56, 0x01, 0x00, +0xf5, 0x7c, 0x00, 0x36, 0x04, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x00, 0xef, 0x0f, 0xd6, 0x9b, +0xde, 0x9d, 0xe1, 0x9e, 0xe3, 0x9f, 0xe9, 0xa2, 0xf2, 0xa3, 0xfa, 0xfd, 0xa4, 0x86, 0xa8, 0x8d, +0xaa, 0x8f, 0xad, 0x90, 0xbe, 0x92, 0xd1, 0x95, 0xd5, 0x98, 0x20, 0xef, 0xf9, 0x03, 0xe3, 0xa0, +0xf2, 0xfb, 0x20, 0xf9, 0x27, 0x03, 0xe3, 0xa1, 0xf2, 0xfc, 0x20, 0x27, 0x00 }; + +// Germany (Standard) +Bit8u layout_GR[596] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x13, 0x00, 0x00, 0x47, 0x52, 0x2c, 0x00, 0x00, 0x44, 0x45, 0x2c, +0x81, 0x00, 0x47, 0x52, 0x2c, 0x81, 0x00, 0x44, 0x45, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x05, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, +0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x03, 0x19, 0x01, 0x20, 0x01, 0x00, 0x00, 0x52, 0x03, 0x00, +0x00, 0x20, 0x01, 0x00, 0x00, 0xb5, 0x01, 0x12, 0x01, 0x71, 0x01, 0x00, 0x00, 0x54, 0x03, 0xa2, +0x01, 0xd8, 0x01, 0x00, 0x00, 0x55, 0x03, 0x01, 0x02, 0x1e, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, +0x00, 0x00, 0x7c, 0x03, 0x02, 0x01, 0x00, 0x22, 0xfd, 0x04, 0x02, 0x01, 0x00, 0xf5, 0xfc, 0x07, +0x01, 0x01, 0x00, 0x26, 0x08, 0x02, 0x01, 0x00, 0x2f, 0x7b, 0x09, 0x03, 0x01, 0x00, 0x28, 0x5b, +0x1b, 0x0a, 0x03, 0x01, 0x00, 0x29, 0x5d, 0x1d, 0x0b, 0x02, 0x01, 0x00, 0x3d, 0x7d, 0x0c, 0x03, +0x00, 0xe1, 0x3f, 0x5c, 0x1c, 0x0d, 0x01, 0x03, 0xca, 0xc8, 0x10, 0x42, 0x03, 0x00, 0x00, 0x40, +0x12, 0x41, 0x00, 0x65, 0x45, 0x15, 0x43, 0x04, 0x7a, 0x5a, 0x00, 0x1a, 0x16, 0x41, 0x00, 0x75, +0x55, 0x17, 0x41, 0x00, 0x69, 0x49, 0x18, 0x41, 0x00, 0x6f, 0x4f, 0x1a, 0x41, 0x00, 0x81, 0x9a, +0x1b, 0x02, 0x00, 0x2b, 0x2a, 0x7e, 0x1e, 0x41, 0x00, 0x61, 0x41, 0x27, 0x41, 0x00, 0x94, 0x99, +0x28, 0x41, 0x00, 0x84, 0x8e, 0x29, 0x03, 0x05, 0xc9, 0xf8, 0x00, 0x1e, 0x2b, 0x01, 0x00, 0x23, +0x27, 0x2c, 0x43, 0x00, 0x79, 0x59, 0x3c, 0x19, 0x2d, 0x42, 0x03, 0x00, 0x00, 0x3e, 0x2e, 0x41, +0x00, 0x63, 0x43, 0x31, 0x42, 0x03, 0x00, 0x00, 0x23, 0x32, 0x42, 0x03, 0x00, 0x00, 0xe6, 0x33, +0x01, 0x01, 0x00, 0x3b, 0x34, 0x01, 0x01, 0x00, 0x3a, 0x35, 0x03, 0x04, 0x2d, 0x5f, 0x00, 0x1f, +0x39, 0x00, 0x00, 0x20, 0x56, 0x02, 0x00, 0x3c, 0x3e, 0x7c, 0x00, 0x04, 0x02, 0x05, 0x00, 0x15, +0xa0, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, +0x8d, 0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, +0x60, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, +0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, 0x20, 0x5e, 0xef, 0x0f, 0x61, 0xa0, 0x63, 0x87, 0x65, +0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x79, 0xec, 0x41, 0xb5, 0x43, 0x80, 0x45, 0x90, 0x49, +0xd6, 0x4f, 0xe0, 0x55, 0xe9, 0x59, 0xed, 0x20, 0xef, 0x00, 0x60, 0x06, 0x61, 0x85, 0x65, 0x8a, +0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x20, 0x60, 0x5e, 0x06, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, +0x6f, 0x93, 0x75, 0x96, 0x20, 0x5e, 0x27, 0x09, 0x61, 0xa0, 0x63, 0x87, 0x65, 0x82, 0x69, 0xa1, +0x6f, 0xa2, 0x75, 0xa3, 0x43, 0x80, 0x45, 0x90, 0x20, 0x27, 0x00, 0x03, 0x02, 0x07, 0x00, 0x00, +0xa0, 0x04, 0x02, 0x07, 0x00, 0x00, 0xa0, 0x0d, 0x01, 0x03, 0xc8, 0xa0, 0x12, 0x42, 0x03, 0x00, +0x00, 0xaa, 0x1f, 0x41, 0x00, 0x73, 0x53, 0x26, 0x41, 0x00, 0x6c, 0x4c, 0x29, 0x00, 0x01, 0xa0, +0x2d, 0x41, 0x00, 0x78, 0x58, 0x31, 0x41, 0x00, 0x6e, 0x4e, 0x32, 0x42, 0x07, 0x00, 0x00, 0xa0, +0x00, 0xef, 0x13, 0x61, 0xa5, 0x63, 0x86, 0x65, 0xa9, 0x6c, 0x88, 0x6e, 0xe4, 0x6f, 0xa2, 0x73, +0x98, 0x78, 0xab, 0x7a, 0xbe, 0x41, 0xa4, 0x43, 0x8f, 0x45, 0xa8, 0x4c, 0x9d, 0x4e, 0xe3, 0x4f, +0xe0, 0x53, 0x97, 0x58, 0x8d, 0x5a, 0xbd, 0x20, 0xef, 0x00, 0x0d, 0x10, 0x00, 0x00, 0x1f, 0x41, +0x00, 0x73, 0x53, 0x22, 0x41, 0x00, 0x67, 0x47, 0x23, 0x41, 0x00, 0x68, 0x48, 0x24, 0x41, 0x00, +0x6a, 0x4a, 0x29, 0x00, 0x01, 0xc8, 0x00, 0x5e, 0x0d, 0x63, 0x86, 0x67, 0x9b, 0x68, 0xa9, 0x6a, +0x9f, 0x73, 0xc7, 0x75, 0xed, 0x43, 0x8f, 0x47, 0x9d, 0x48, 0xa8, 0x4a, 0xac, 0x53, 0xc6, 0x55, +0xec, 0x20, 0x5e, 0x00 }; + +// Croatia +Bit8u layout_HR[993] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x27, 0x00, 0x00, 0x42, 0x41, 0x2c, 0x00, 0x00, 0x48, 0x52, 0x2c, +0x00, 0x00, 0x53, 0x49, 0x2c, 0x00, 0x00, 0x59, 0x55, 0x2c, 0xea, 0x00, 0x42, 0x41, 0x2c, 0xea, +0x00, 0x48, 0x52, 0x2c, 0xea, 0x00, 0x53, 0x49, 0x2c, 0xea, 0x00, 0x59, 0x55, 0x05, 0x02, 0x00, +0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x03, 0xde, 0x01, 0x65, 0x02, 0x00, +0x00, 0x71, 0x00, 0x29, 0x01, 0x7f, 0x01, 0x00, 0x00, 0x5a, 0x03, 0x26, 0x03, 0x2d, 0x03, 0x00, +0x00, 0x52, 0x03, 0x00, 0x00, 0x2d, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x07, 0x00, 0x00, 0xc8, 0x03, +0x01, 0x01, 0x00, 0x22, 0x04, 0x03, 0x07, 0x00, 0x00, 0xc9, 0x1e, 0x06, 0x02, 0x07, 0x00, 0x00, +0xca, 0x07, 0x01, 0x01, 0x00, 0x26, 0x08, 0x02, 0x05, 0x00, 0x2f, 0xcb, 0x09, 0x02, 0x01, 0x00, +0x28, 0xfa, 0x0a, 0x02, 0x05, 0x00, 0x29, 0xcc, 0x0b, 0x01, 0x01, 0x00, 0x3d, 0x0c, 0x02, 0x04, +0x27, 0x3f, 0xcd, 0x0d, 0x02, 0x04, 0x2b, 0x2a, 0xce, 0x10, 0x42, 0x03, 0x00, 0x00, 0x5c, 0x11, +0x42, 0x03, 0x00, 0x00, 0x7c, 0x12, 0x41, 0x00, 0x65, 0x45, 0x15, 0x43, 0x04, 0x7a, 0x5a, 0x00, +0x1a, 0x16, 0x41, 0x00, 0x75, 0x55, 0x17, 0x41, 0x00, 0x69, 0x49, 0x18, 0x41, 0x00, 0x6f, 0x4f, +0x1a, 0x42, 0x03, 0xa0, 0xa0, 0xf6, 0x1b, 0x42, 0x03, 0xa0, 0xa0, 0x9e, 0x1e, 0x41, 0x00, 0x61, +0x41, 0x21, 0x42, 0x03, 0x00, 0x00, 0x5b, 0x22, 0x42, 0x03, 0x00, 0x00, 0x5d, 0x27, 0x43, 0x07, +0xa0, 0xa0, 0x00, 0x1d, 0x28, 0x42, 0x03, 0xa0, 0xa0, 0xe1, 0x29, 0x01, 0x03, 0xce, 0xcd, 0x2b, +0x42, 0x03, 0xa0, 0xa0, 0xcf, 0x2c, 0x43, 0x04, 0x79, 0x59, 0x00, 0x19, 0x2e, 0x41, 0x00, 0x63, +0x43, 0x2f, 0x42, 0x03, 0x00, 0x00, 0x40, 0x30, 0x42, 0x03, 0x00, 0x00, 0x7b, 0x31, 0x42, 0x00, +0x6e, 0x4e, 0x7d, 0x32, 0x42, 0x03, 0x00, 0x00, 0xf5, 0x33, 0x02, 0x01, 0x00, 0x3b, 0x3c, 0x34, +0x02, 0x01, 0x00, 0x3a, 0x3e, 0x35, 0x03, 0x04, 0x2d, 0x5f, 0x00, 0x1f, 0x39, 0x00, 0x00, 0x20, +0x56, 0x01, 0x00, 0x3c, 0x3e, 0x00, 0x02, 0x02, 0x03, 0x00, 0x00, 0x7e, 0x03, 0x02, 0x07, 0x00, +0x00, 0xc8, 0x06, 0x02, 0x03, 0x00, 0x00, 0xf8, 0x08, 0x02, 0x07, 0x00, 0x00, 0xca, 0x0a, 0x02, +0x07, 0x00, 0x00, 0xcb, 0x0c, 0x02, 0x07, 0x00, 0x00, 0xcc, 0x0d, 0x02, 0x07, 0x00, 0x00, 0xcd, +0x1a, 0x41, 0x00, 0xa4, 0xa5, 0x1b, 0x42, 0x04, 0x9b, 0x9d, 0xa0, 0x1f, 0x41, 0x00, 0x73, 0x53, +0x27, 0x41, 0x00, 0x91, 0x92, 0x28, 0x41, 0x00, 0x86, 0x8f, 0x29, 0x01, 0x03, 0xcd, 0xcc, 0x2b, +0x42, 0x04, 0xa6, 0xa7, 0xa0, 0x32, 0x42, 0x03, 0x00, 0x00, 0x15, 0x00, 0x76, 0x07, 0x63, 0x91, +0x73, 0xa4, 0x7a, 0xa6, 0x43, 0x92, 0x53, 0xa5, 0x5a, 0xa7, 0x20, 0x76, 0x5e, 0x06, 0x61, 0x83, +0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x20, 0x5e, 0x60, 0x06, 0x61, 0x85, 0x65, 0x8a, +0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x20, 0x60, 0x27, 0x09, 0x61, 0xa0, 0x63, 0x86, 0x65, 0x82, +0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x43, 0x8f, 0x45, 0x90, 0x20, 0x27, 0x22, 0x0a, 0x61, 0x84, +0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x4f, 0x99, 0x55, 0x9a, +0x20, 0x22, 0x2c, 0x03, 0x63, 0x87, 0x43, 0x80, 0x20, 0x2c, 0x00, 0x02, 0x02, 0x03, 0x00, 0x00, +0x7e, 0x03, 0x02, 0x07, 0x00, 0x00, 0xc8, 0x05, 0x02, 0x07, 0x00, 0x00, 0xca, 0x06, 0x02, 0x07, +0x00, 0x00, 0xcb, 0x07, 0x02, 0x07, 0x00, 0x00, 0xcc, 0x08, 0x02, 0x03, 0x00, 0x00, 0x60, 0x09, +0x02, 0x07, 0x00, 0x00, 0xcd, 0x0a, 0x02, 0x07, 0x00, 0x00, 0xce, 0x0b, 0x02, 0x07, 0x00, 0x00, +0xcf, 0x0c, 0x02, 0x07, 0x00, 0x00, 0xd0, 0x0d, 0x02, 0x07, 0x00, 0x00, 0xd1, 0x12, 0x42, 0x03, +0x00, 0x00, 0xaa, 0x13, 0x41, 0x00, 0x72, 0x52, 0x14, 0x41, 0x00, 0x74, 0x54, 0x1a, 0x41, 0x00, +0xe7, 0xe6, 0x1b, 0x41, 0x00, 0xd0, 0xd1, 0x1f, 0x41, 0x00, 0x73, 0x53, 0x20, 0x41, 0x00, 0x64, +0x44, 0x25, 0x42, 0x03, 0x00, 0x00, 0x88, 0x26, 0x42, 0x00, 0x6c, 0x4c, 0x9d, 0x27, 0x41, 0x00, +0x9f, 0xac, 0x28, 0x41, 0x00, 0x86, 0x8f, 0x29, 0x01, 0x03, 0xd1, 0xd0, 0x2b, 0x41, 0x00, 0xa7, +0xa6, 0x00, 0xf3, 0x13, 0x63, 0x9f, 0x64, 0xd4, 0x65, 0xd8, 0x6c, 0x96, 0x6e, 0xe5, 0x72, 0xfd, +0x73, 0xe7, 0x74, 0x9c, 0x7a, 0xa7, 0x43, 0xac, 0x44, 0xd2, 0x45, 0xb7, 0x4c, 0x95, 0x4e, 0xd5, +0x52, 0xfc, 0x53, 0xe6, 0x54, 0x9b, 0x5a, 0xa6, 0x20, 0xf3, 0x5e, 0x07, 0x61, 0x83, 0x69, 0x8c, +0x6f, 0x93, 0x41, 0xb6, 0x49, 0xd7, 0x4f, 0xe2, 0x20, 0x5e, 0xf4, 0x03, 0x61, 0xc7, 0x41, 0xc6, +0x20, 0xf4, 0xf8, 0x03, 0x75, 0x85, 0x55, 0xde, 0x20, 0xf8, 0xf2, 0x05, 0x61, 0xa5, 0x65, 0xa9, +0x41, 0xa4, 0x45, 0xa8, 0x20, 0xf2, 0xfa, 0x03, 0x7a, 0xbe, 0x5a, 0xbd, 0x20, 0xfa, 0xef, 0x19, +0x61, 0xa0, 0x63, 0x86, 0x65, 0x82, 0x69, 0xa1, 0x6c, 0x92, 0x6e, 0xe4, 0x6f, 0xa2, 0x72, 0xea, +0x73, 0x98, 0x75, 0xa3, 0x79, 0xec, 0x7a, 0xab, 0x41, 0xb5, 0x43, 0x8f, 0x45, 0x90, 0x49, 0xd6, +0x4c, 0x91, 0x4e, 0xe3, 0x4f, 0xe0, 0x52, 0xe8, 0x53, 0x97, 0x55, 0xe9, 0x59, 0xed, 0x5a, 0x8d, +0x20, 0xef, 0xf1, 0x05, 0x6f, 0x8b, 0x75, 0xfb, 0x4f, 0x8a, 0x55, 0xeb, 0x20, 0xf1, 0xf9, 0x09, +0x61, 0x84, 0x65, 0x89, 0x6f, 0x94, 0x75, 0x81, 0x41, 0x8e, 0x45, 0xd3, 0x4f, 0x99, 0x55, 0x9a, +0x20, 0xf9, 0xf7, 0x07, 0x63, 0x87, 0x73, 0xad, 0x74, 0xee, 0x43, 0x80, 0x53, 0xb8, 0x54, 0xdd, +0x20, 0xf7, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, +0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, +0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, +0x20, 0x5e, 0xf8, 0x03, 0x61, 0x86, 0x41, 0x8f, 0x20, 0xf8, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, +0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, +0x20, 0x60, 0xef, 0x0d, 0x61, 0xa0, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x79, 0xec, +0x41, 0xb5, 0x45, 0x90, 0x49, 0xd6, 0x4f, 0xe0, 0x55, 0xe9, 0x59, 0xed, 0x20, 0xef, 0xf9, 0x0c, +0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, +0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0xf9, 0xf7, 0x03, 0x63, 0x87, 0x43, 0x80, 0x20, 0xf7, +0x00 }; + +// Hungary (101-key) +Bit8u layout_HU[964] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x04, 0x00, 0x00, 0x48, 0x55, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, +0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x03, 0xd3, 0x01, 0x44, 0x02, 0x00, 0x00, 0x5a, 0x03, +0x45, 0x01, 0x4c, 0x01, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x4c, 0x01, 0x00, 0x00, 0xb5, 0xe1, +0x05, 0x03, 0x59, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x07, 0x00, 0xcc, 0xc8, 0x03, 0x01, 0x03, 0x00, +0xcd, 0x04, 0x03, 0x05, 0x00, 0x2b, 0xc9, 0x1e, 0x05, 0x01, 0x01, 0x00, 0x21, 0x06, 0x02, 0x07, +0x00, 0x00, 0xca, 0x07, 0x01, 0x01, 0x00, 0x2f, 0x08, 0x02, 0x05, 0x00, 0x3d, 0xcb, 0x09, 0x02, +0x01, 0x00, 0x28, 0xfa, 0x0a, 0x02, 0x01, 0x00, 0x29, 0xef, 0x0b, 0x41, 0x00, 0x94, 0x99, 0x0c, +0x42, 0x00, 0x81, 0x9a, 0xf9, 0x0d, 0xc2, 0x04, 0xa2, 0x0d, 0xe0, 0x00, 0xce, 0x83, 0x10, 0x42, +0x03, 0x00, 0x00, 0x5c, 0x11, 0x42, 0x03, 0x00, 0x00, 0x7c, 0x12, 0x42, 0x00, 0x65, 0x45, 0x8e, +0x13, 0x42, 0x03, 0x00, 0x00, 0xf5, 0x14, 0x42, 0x03, 0x00, 0x00, 0xcf, 0x15, 0x41, 0x00, 0x79, +0x59, 0x16, 0x41, 0x00, 0x75, 0x55, 0x17, 0x42, 0x00, 0x69, 0x49, 0xd6, 0x18, 0x41, 0x00, 0x6f, +0x4f, 0x1a, 0x42, 0x03, 0xa0, 0xa0, 0xf6, 0x1b, 0x42, 0x00, 0xa3, 0xe9, 0x9e, 0x1e, 0x42, 0x00, +0x61, 0x41, 0x84, 0x21, 0x42, 0x03, 0x00, 0x00, 0x5b, 0x22, 0x42, 0x03, 0x00, 0x00, 0x5d, 0x24, +0x42, 0x03, 0x00, 0x00, 0xa1, 0x27, 0x42, 0x00, 0x82, 0x90, 0x24, 0x28, 0x42, 0x00, 0xa0, 0xb5, +0xe1, 0x29, 0x42, 0x00, 0xa1, 0xd6, 0x30, 0x2b, 0x42, 0x03, 0xa0, 0xa0, 0x5c, 0x2c, 0x42, 0x00, +0x7a, 0x5a, 0x3e, 0x2d, 0x42, 0x03, 0x00, 0x00, 0x23, 0x2e, 0x42, 0x00, 0x63, 0x43, 0x26, 0x2f, +0x42, 0x03, 0x00, 0x00, 0x40, 0x30, 0x42, 0x03, 0x00, 0x00, 0x7b, 0x31, 0x42, 0x00, 0x6e, 0x4e, +0x7d, 0x32, 0x42, 0x03, 0x00, 0x00, 0x3c, 0x33, 0x02, 0x00, 0x2c, 0x3f, 0x3b, 0x34, 0x02, 0x00, +0x2e, 0x3a, 0x3e, 0x35, 0x03, 0x00, 0x2d, 0x5f, 0x2a, 0x1f, 0x39, 0x00, 0x00, 0x20, 0x00, 0x16, +0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, 0x6f, 0xe4, 0x41, 0xc7, +0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, +0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, 0x20, 0x5e, 0xf8, 0x03, +0x61, 0x86, 0x41, 0x8f, 0x20, 0xf8, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, +0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, 0x27, 0x0d, +0x61, 0xa0, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x79, 0xec, 0x41, 0xb5, 0x45, 0x90, +0x49, 0xd6, 0x4f, 0xe0, 0x55, 0xe9, 0x59, 0xed, 0x20, 0x27, 0x22, 0x0c, 0x61, 0x84, 0x65, 0x89, +0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, 0x4f, 0x99, +0x55, 0x9a, 0x20, 0x22, 0xf7, 0x03, 0x63, 0x87, 0x43, 0x80, 0x20, 0xf7, 0x00, 0x02, 0x02, 0x03, +0x00, 0xce, 0x7e, 0x03, 0x02, 0x07, 0x00, 0xd0, 0xc8, 0x04, 0x01, 0x03, 0x00, 0xcf, 0x05, 0x02, +0x07, 0x00, 0x00, 0xca, 0x06, 0x02, 0x07, 0x00, 0x00, 0xcb, 0x07, 0x02, 0x07, 0x00, 0x00, 0xcc, +0x08, 0x02, 0x03, 0x00, 0x00, 0x60, 0x09, 0x02, 0x07, 0x00, 0x00, 0xcd, 0x0b, 0x42, 0x03, 0x00, +0x00, 0xf1, 0x0d, 0xc2, 0x05, 0x00, 0x0d, 0xe0, 0x00, 0xd1, 0x83, 0x13, 0x41, 0x00, 0x72, 0x52, +0x14, 0x41, 0x00, 0x74, 0x54, 0x16, 0x42, 0x03, 0x00, 0x00, 0xaa, 0x1a, 0x41, 0x00, 0x8b, 0x8a, +0x1f, 0x42, 0x00, 0x73, 0x53, 0xd0, 0x20, 0x42, 0x00, 0x64, 0x44, 0xd1, 0x25, 0x42, 0x03, 0x00, +0x00, 0x88, 0x26, 0x42, 0x00, 0x6c, 0x4c, 0x9d, 0x2b, 0x41, 0x00, 0xfb, 0xeb, 0x00, 0xf3, 0x13, +0x63, 0x9f, 0x64, 0xd4, 0x65, 0xd8, 0x6c, 0x96, 0x6e, 0xe5, 0x72, 0xfd, 0x73, 0xe7, 0x74, 0x9c, +0x7a, 0xa7, 0x43, 0xac, 0x44, 0xd2, 0x45, 0xb7, 0x4c, 0x95, 0x4e, 0xd5, 0x52, 0xfc, 0x53, 0xe6, +0x54, 0x9b, 0x5a, 0xa6, 0x20, 0xf3, 0x5e, 0x07, 0x61, 0x83, 0x69, 0x8c, 0x6f, 0x93, 0x41, 0xb6, +0x49, 0xd7, 0x4f, 0xe2, 0x20, 0x5e, 0xf4, 0x03, 0x61, 0xc7, 0x41, 0xc6, 0x20, 0xf4, 0xf8, 0x03, +0x75, 0x85, 0x55, 0xde, 0x20, 0xf8, 0xf2, 0x05, 0x61, 0xa5, 0x65, 0xa9, 0x41, 0xa4, 0x45, 0xa8, +0x20, 0xf2, 0xfa, 0x03, 0x7a, 0xbe, 0x5a, 0xbd, 0x20, 0xfa, 0x27, 0x19, 0x61, 0xa0, 0x63, 0x86, +0x65, 0x82, 0x69, 0xa1, 0x6c, 0x92, 0x6e, 0xe4, 0x6f, 0xa2, 0x72, 0xea, 0x73, 0x98, 0x75, 0xa3, +0x79, 0xec, 0x7a, 0xab, 0x41, 0xb5, 0x43, 0x8f, 0x45, 0x90, 0x49, 0xd6, 0x4c, 0x91, 0x4e, 0xe3, +0x4f, 0xe0, 0x52, 0xe8, 0x53, 0x97, 0x55, 0xe9, 0x59, 0xed, 0x5a, 0x8d, 0x20, 0x27, 0x2b, 0x05, +0x6f, 0x8b, 0x75, 0xfb, 0x4f, 0x8a, 0x55, 0xeb, 0x20, 0x2b, 0x22, 0x09, 0x61, 0x84, 0x65, 0x89, +0x6f, 0x94, 0x75, 0x81, 0x41, 0x8e, 0x45, 0xd3, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0x22, 0xf7, 0x07, +0x63, 0x87, 0x73, 0xad, 0x74, 0xee, 0x43, 0x80, 0x53, 0xb8, 0x54, 0xdd, 0x20, 0xf7, 0x00, 0x02, +0x01, 0x03, 0x00, 0xcc, 0x03, 0x01, 0x03, 0x00, 0xce, 0x04, 0x01, 0x03, 0x00, 0xcd, 0x0a, 0x02, +0x07, 0x00, 0x00, 0xcc, 0x0b, 0x42, 0x07, 0x00, 0x00, 0xcd, 0x0c, 0x42, 0x07, 0x00, 0x00, 0xce, +0x0d, 0x42, 0x05, 0x00, 0x95, 0xcf, 0x13, 0x42, 0x03, 0x00, 0x00, 0x15, 0x14, 0x42, 0x07, 0x00, +0x00, 0xa0, 0x17, 0x42, 0x03, 0x00, 0x00, 0x8d, 0x1a, 0x41, 0x00, 0x93, 0xa7, 0x1b, 0x42, 0x05, +0x00, 0x97, 0xa0, 0x28, 0x41, 0x01, 0x00, 0x8f, 0x29, 0x41, 0x01, 0x00, 0x8d, 0x2b, 0x41, 0x00, +0x96, 0x98, 0x00, 0x7e, 0x03, 0x6e, 0xa4, 0x4e, 0xa5, 0x20, 0x7e, 0x5e, 0x04, 0x61, 0x83, 0x65, +0x88, 0x69, 0x8c, 0x20, 0x5e, 0xf8, 0x02, 0x61, 0x86, 0x20, 0xf8, 0x60, 0x03, 0x61, 0x85, 0x65, +0x8a, 0x20, 0x60, 0x27, 0x0b, 0x61, 0xa0, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x41, +0x8f, 0x45, 0x90, 0x49, 0x8d, 0x4f, 0x95, 0x55, 0x97, 0x20, 0x27, 0x2b, 0x05, 0x6f, 0x93, 0x75, +0x96, 0x4f, 0xa7, 0x55, 0x98, 0x20, 0x2b, 0x22, 0x09, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, +0x94, 0x75, 0x81, 0x41, 0x8e, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0x22, 0x2c, 0x03, 0x63, 0x87, 0x43, +0x80, 0x20, 0x2c, 0x00 }; + +// Italy (Standard) +Bit8u layout_IT[236] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x09, 0x00, 0x00, 0x49, 0x54, 0x2c, 0x8d, 0x00, 0x49, 0x54, 0x04, +0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x03, 0xd0, 0x00, 0x00, +0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0x01, 0xca, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, 0x00, 0x22, +0x04, 0x02, 0x01, 0x00, 0x9c, 0x23, 0x07, 0x01, 0x01, 0x00, 0x26, 0x08, 0x02, 0x01, 0x00, 0x2f, +0x7b, 0x09, 0x03, 0x01, 0x00, 0x28, 0x5b, 0x1b, 0x0a, 0x03, 0x01, 0x00, 0x29, 0x5d, 0x1d, 0x0b, +0x02, 0x01, 0x00, 0x3d, 0x7d, 0x0c, 0x01, 0x00, 0x27, 0x3f, 0x0d, 0x03, 0x00, 0x8d, 0x5e, 0x7e, +0x1e, 0x10, 0x42, 0x03, 0x00, 0x00, 0x40, 0x1a, 0x04, 0x08, 0x8a, 0x82, 0x5b, 0x00, 0x7b, 0x1b, +0x04, 0x08, 0x2b, 0x2a, 0x5d, 0x00, 0x7d, 0x27, 0x02, 0x00, 0x95, 0x87, 0x40, 0x28, 0x02, 0x00, +0x85, 0xf8, 0x23, 0x29, 0x03, 0x04, 0x5c, 0x7c, 0x00, 0x1c, 0x2b, 0x02, 0x00, 0x97, 0xf5, 0x60, +0x33, 0x02, 0x01, 0x00, 0x3b, 0x3c, 0x34, 0x02, 0x01, 0x00, 0x3a, 0x3e, 0x35, 0x03, 0x04, 0x2d, +0x5f, 0x00, 0x1f, 0x56, 0x01, 0x00, 0x3c, 0x3e, 0x00, 0x2b, 0x01, 0x01, 0x00, 0x15, 0x00, 0x06, +0x02, 0x03, 0x00, 0x00, 0xd5, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00 }; + +// Netherlands (102-key) +Bit8u layout_NL[552] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x09, 0x00, 0x00, 0x4e, 0x4c, 0x2c, 0x8f, 0x00, 0x4e, 0x4c, 0x04, +0x02, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x03, 0x93, 0x01, 0x9a, +0x01, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00, 0xb5, 0x01, 0x16, 0x01, 0x40, +0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x00, 0x00, 0xfb, 0x03, 0x02, 0x01, 0x00, 0x22, 0xfd, 0x04, +0x02, 0x03, 0x00, 0x00, 0xfc, 0x05, 0x02, 0x03, 0x00, 0x00, 0xac, 0x06, 0x02, 0x03, 0x00, 0x00, +0xab, 0x07, 0x02, 0x01, 0x00, 0x26, 0xf3, 0x08, 0x03, 0x01, 0x00, 0x5f, 0x9c, 0x1f, 0x09, 0x02, +0x01, 0x00, 0x28, 0x7b, 0x0a, 0x02, 0x01, 0x00, 0x29, 0x7d, 0x0b, 0x01, 0x01, 0x00, 0x27, 0x0c, +0x03, 0x00, 0x2f, 0x3f, 0x5c, 0x1c, 0x0d, 0x02, 0x06, 0xf8, 0xc9, 0xcd, 0x12, 0x41, 0x00, 0x65, +0x45, 0x13, 0x42, 0x03, 0x00, 0x00, 0xf4, 0x15, 0x41, 0x00, 0x79, 0x59, 0x16, 0x41, 0x00, 0x75, +0x55, 0x17, 0x41, 0x00, 0x69, 0x49, 0x18, 0x41, 0x00, 0x6f, 0x4f, 0x1a, 0x03, 0x07, 0xcc, 0xca, +0x00, 0x1e, 0x1b, 0x02, 0x00, 0x2a, 0x7c, 0xdd, 0x1e, 0x41, 0x00, 0x61, 0x41, 0x1f, 0x42, 0x03, +0x00, 0x00, 0xe1, 0x27, 0x01, 0x00, 0x2b, 0xf1, 0x28, 0x01, 0x03, 0xcb, 0xc8, 0x29, 0x02, 0x00, +0x40, 0xf5, 0xaa, 0x2b, 0x01, 0x00, 0x3c, 0x3e, 0x2c, 0x42, 0x03, 0x00, 0x00, 0xae, 0x2d, 0x42, +0x03, 0x00, 0x00, 0xaf, 0x2e, 0x42, 0x00, 0x63, 0x43, 0xbd, 0x31, 0x41, 0x00, 0x6e, 0x4e, 0x32, +0x42, 0x03, 0x00, 0x00, 0xe6, 0x33, 0x03, 0x01, 0x00, 0x3b, 0x5b, 0x1b, 0x34, 0x02, 0x01, 0x00, +0x3a, 0xfa, 0x35, 0x03, 0x00, 0x2d, 0x3d, 0x5d, 0x1d, 0x39, 0x00, 0x00, 0x20, 0x56, 0x03, 0x00, +0x5d, 0x5b, 0x7c, 0x1d, 0x00, 0x02, 0x02, 0x07, 0x00, 0x00, 0xa0, 0x04, 0x02, 0x07, 0x00, 0x00, +0xa0, 0x07, 0x02, 0x07, 0x00, 0x00, 0xa0, 0x13, 0x42, 0x03, 0x00, 0x00, 0x14, 0x1b, 0x02, 0x07, +0x00, 0x00, 0xa0, 0x29, 0x01, 0x01, 0x00, 0x15, 0x2e, 0x42, 0x03, 0x00, 0x00, 0x9b, 0x00, 0x60, +0x06, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x20, 0x60, 0x7e, 0x03, 0x6e, +0xa4, 0x4e, 0xa5, 0x20, 0x7e, 0x5e, 0x06, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, +0x96, 0x20, 0x5e, 0x27, 0x07, 0x61, 0xa0, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x45, +0x90, 0x20, 0x27, 0x22, 0x0a, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, +0x98, 0x41, 0x8e, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0x22, 0x2c, 0x03, 0x63, 0x87, 0x43, 0x80, 0x20, +0x2c, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, +0x8d, 0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, +0x60, 0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, 0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, +0x7e, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, +0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, 0x20, 0x5e, 0xef, 0x0d, 0x61, 0xa0, 0x65, 0x82, 0x69, +0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x79, 0xec, 0x41, 0xb5, 0x45, 0x90, 0x49, 0xd6, 0x4f, 0xe0, 0x55, +0xe9, 0x59, 0xed, 0x20, 0xef, 0xf9, 0x0c, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, +0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0xf9, 0xf7, +0x03, 0x63, 0x87, 0x43, 0x80, 0x20, 0xf7, 0x00 }; + +// Norway +Bit8u layout_NO[477] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x09, 0x00, 0x00, 0x4e, 0x4f, 0x2c, 0x9b, 0x00, 0x4e, 0x4f, 0x04, +0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x03, 0xec, 0x00, 0xf9, +0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0xf9, 0x00, 0x00, 0x00, 0x61, 0x03, 0x74, 0x01, 0x7f, +0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0x22, 0x40, 0x04, 0x02, 0x03, 0x00, 0x00, 0x9c, 0x05, +0x02, 0x01, 0x00, 0xcf, 0x24, 0x07, 0x01, 0x01, 0x00, 0x26, 0x08, 0x02, 0x01, 0x00, 0x2f, 0x7b, +0x09, 0x03, 0x01, 0x00, 0x28, 0x5b, 0x1b, 0x0a, 0x03, 0x01, 0x00, 0x29, 0x5d, 0x1d, 0x0b, 0x02, +0x01, 0x00, 0x3d, 0x7d, 0x0c, 0x01, 0x00, 0x2b, 0x3f, 0x0d, 0x03, 0x06, 0x5c, 0xc8, 0xcb, 0x1c, +0x12, 0x41, 0x00, 0x65, 0x45, 0x15, 0x41, 0x00, 0x79, 0x59, 0x16, 0x41, 0x00, 0x75, 0x55, 0x17, +0x41, 0x00, 0x69, 0x49, 0x18, 0x41, 0x00, 0x6f, 0x4f, 0x1a, 0x41, 0x00, 0x86, 0x8f, 0x1b, 0x03, +0x07, 0xcc, 0xca, 0xc9, 0x1e, 0x1e, 0x41, 0x00, 0x61, 0x41, 0x27, 0x41, 0x00, 0x9b, 0x9d, 0x28, +0x41, 0x00, 0x91, 0x92, 0x29, 0x01, 0x00, 0x7c, 0xf5, 0x2b, 0x01, 0x00, 0x27, 0x2a, 0x2e, 0x41, +0x00, 0x63, 0x43, 0x31, 0x41, 0x00, 0x6e, 0x4e, 0x32, 0x42, 0x03, 0x00, 0x00, 0xe6, 0x33, 0x02, +0x01, 0x00, 0x3b, 0x3c, 0x34, 0x02, 0x01, 0x00, 0x3a, 0x3e, 0x35, 0x03, 0x04, 0x2d, 0x5f, 0x00, +0x1f, 0x39, 0x00, 0x00, 0x20, 0x56, 0x01, 0x00, 0x3c, 0x3e, 0x00, 0x06, 0x02, 0x03, 0x00, 0x00, +0xd5, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, +0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, +0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, 0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, +0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, +0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, 0x20, 0x5e, 0xef, 0x0f, 0x61, 0xa0, 0x63, 0x87, 0x65, 0x82, +0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x79, 0xec, 0x41, 0xb5, 0x43, 0x80, 0x45, 0x90, 0x49, 0xd6, +0x4f, 0xe0, 0x55, 0xe9, 0x59, 0xed, 0x20, 0xef, 0xf9, 0x0c, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, +0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, +0x20, 0xf9, 0x00, 0x05, 0x01, 0x01, 0x00, 0xaf, 0x29, 0x01, 0x01, 0x00, 0x15, 0x00, 0x60, 0x06, +0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x20, 0x60, 0x7e, 0x03, 0x6e, 0xa4, +0x4e, 0xa5, 0x20, 0x7e, 0x5e, 0x06, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, +0x20, 0x5e, 0x27, 0x09, 0x61, 0xa0, 0x63, 0x87, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, +0x43, 0x80, 0x45, 0x90, 0x20, 0x27, 0x22, 0x0a, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, +0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0x22, 0x00 }; + +// Poland (101-key, prog.) +Bit8u layout_PL[261] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x09, 0x00, 0x00, 0x50, 0x4c, 0x2c, 0xc9, 0x01, 0x50, 0x4c, 0x08, +0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x03, 0x70, 0x00, 0x00, +0x00, 0x00, 0x00, 0x9c, 0x02, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, 0x03, 0xaf, 0x00, 0x00, +0x00, 0x00, 0x00, 0x16, 0x03, 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x02, 0xaf, 0x00, 0x00, +0x00, 0x00, 0x00, 0x5a, 0x03, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x18, 0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x00, 0xe0, 0x00, 0x00, 0x12, +0x43, 0x03, 0x00, 0x00, 0xa9, 0xa8, 0x16, 0x42, 0x03, 0x00, 0x00, 0xaa, 0x1e, 0x43, 0x03, 0x00, +0x00, 0xa5, 0xa4, 0x1f, 0x43, 0x03, 0x00, 0x00, 0x98, 0x97, 0x26, 0x43, 0x03, 0x00, 0x00, 0x88, +0x9d, 0x2c, 0x43, 0x03, 0x00, 0x00, 0xbe, 0xbd, 0x2d, 0x43, 0x03, 0x00, 0x00, 0xab, 0x8d, 0x2e, +0x43, 0x03, 0x00, 0x00, 0x86, 0x8f, 0x31, 0x43, 0x03, 0x00, 0x00, 0xe4, 0xe3, 0x00, 0x12, 0x43, +0x03, 0x00, 0x00, 0x91, 0x90, 0x18, 0x43, 0x07, 0x00, 0x00, 0x00, 0xa3, 0x1e, 0x43, 0x03, 0x00, +0x00, 0x86, 0x8f, 0x1f, 0x43, 0x03, 0x00, 0x00, 0x9e, 0x98, 0x26, 0x43, 0x03, 0x00, 0x00, 0x92, +0x9c, 0x2c, 0x43, 0x03, 0x00, 0x00, 0xa7, 0xa1, 0x2d, 0x43, 0x03, 0x00, 0x00, 0xa6, 0xa0, 0x2e, +0x43, 0x03, 0x00, 0x00, 0x8d, 0x95, 0x31, 0x43, 0x03, 0x00, 0x00, 0xa4, 0xa5, 0x00, 0x16, 0x42, +0x03, 0x00, 0x00, 0xd5, 0x00 }; + +// Russian Federation (Standard) +Bit8u layout_RU[1130] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x09, 0x00, 0x00, 0x52, 0x55, 0x2c, 0xb9, 0x01, 0x52, 0x55, 0x0b, +0x02, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0xa2, 0x01, 0x00, +0x00, 0x00, 0x00, 0x28, 0x03, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x03, 0x8b, 0x02, 0x00, +0x00, 0x00, 0x00, 0x62, 0x03, 0xb6, 0x01, 0x00, 0x00, 0x00, 0x00, 0x68, 0x03, 0x6d, 0x03, 0x00, +0x00, 0x00, 0x00, 0x68, 0x03, 0x99, 0x02, 0x00, 0x00, 0x00, 0x00, 0x57, 0x03, 0x53, 0x04, 0x00, +0x00, 0x00, 0x00, 0x57, 0x03, 0x81, 0x03, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x03, 0xc5, 0x00, 0x00, +0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x03, 0x00, 0x00, +0x40, 0x04, 0x02, 0x03, 0x00, 0x00, 0x23, 0x05, 0x02, 0x03, 0x00, 0x00, 0xcf, 0x07, 0x02, 0x03, +0x00, 0x00, 0x5e, 0x08, 0x02, 0x03, 0x00, 0x00, 0x26, 0x09, 0x02, 0x03, 0x00, 0x00, 0x24, 0x1a, +0x02, 0x03, 0x00, 0x00, 0x5b, 0x1b, 0x02, 0x03, 0x00, 0x00, 0x5d, 0x2b, 0x02, 0x03, 0x00, 0x00, +0x7c, 0x33, 0x02, 0x03, 0x00, 0x00, 0x3c, 0x34, 0x02, 0x03, 0x00, 0x00, 0x3e, 0x35, 0x02, 0x03, +0x00, 0x00, 0x2f, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x03, 0x01, 0x01, 0x00, 0x22, +0x04, 0x01, 0x01, 0x00, 0xfc, 0x05, 0x02, 0x05, 0x00, 0x3b, 0xa0, 0x07, 0x01, 0x01, 0x00, 0x3a, +0x08, 0x01, 0x01, 0x00, 0x3f, 0x10, 0x41, 0x00, 0xa9, 0x89, 0x11, 0x41, 0x00, 0xe6, 0x96, 0x12, +0x41, 0x00, 0xe3, 0x93, 0x13, 0x41, 0x00, 0xaa, 0x8a, 0x14, 0x42, 0x00, 0xa5, 0x85, 0xfd, 0x15, +0x41, 0x00, 0xad, 0x8d, 0x16, 0x41, 0x00, 0xa3, 0x83, 0x17, 0x41, 0x00, 0xe8, 0x98, 0x18, 0x41, +0x00, 0xe9, 0x99, 0x19, 0x41, 0x00, 0xa7, 0x87, 0x1a, 0x41, 0x00, 0xe5, 0x95, 0x1b, 0x41, 0x00, +0xea, 0x9a, 0x1e, 0x41, 0x00, 0xe4, 0x94, 0x1f, 0x41, 0x00, 0xeb, 0x9b, 0x20, 0x41, 0x00, 0xa2, +0x82, 0x21, 0x41, 0x00, 0xa0, 0x80, 0x22, 0x41, 0x00, 0xaf, 0x8f, 0x23, 0xc1, 0x00, 0xe0, 0x00, +0x90, 0x23, 0x24, 0x41, 0x00, 0xae, 0x8e, 0x25, 0x41, 0x00, 0xab, 0x8b, 0x26, 0x41, 0x00, 0xa4, +0x84, 0x27, 0x41, 0x00, 0xa6, 0x86, 0x28, 0x41, 0x00, 0xed, 0x9d, 0x29, 0xc1, 0x00, 0xf1, 0x29, +0xf0, 0x00, 0x2a, 0x03, 0x0f, 0x00, 0x00, 0x00, 0x78, 0x2b, 0x01, 0x01, 0x00, 0x2f, 0x2c, 0x41, +0x00, 0xef, 0x9f, 0x2d, 0x41, 0x00, 0xe7, 0x97, 0x2e, 0x41, 0x00, 0xe1, 0x91, 0x2f, 0x41, 0x00, +0xac, 0x8c, 0x30, 0x41, 0x00, 0xa8, 0x88, 0x31, 0x41, 0x00, 0xe2, 0x92, 0x32, 0x41, 0x00, 0xec, +0x9c, 0x33, 0x41, 0x00, 0xa1, 0x81, 0x34, 0x41, 0x00, 0xee, 0x9e, 0x35, 0x01, 0x00, 0x2e, 0x2c, +0x00, 0x05, 0x02, 0x07, 0x00, 0x00, 0xa0, 0x12, 0x42, 0x03, 0x00, 0x00, 0xfd, 0x36, 0x03, 0x0f, +0x00, 0x00, 0x00, 0x79, 0x00, 0x03, 0x01, 0x01, 0x00, 0x22, 0x04, 0x01, 0x01, 0x00, 0xfc, 0x05, +0x02, 0x01, 0x00, 0x3b, 0xfd, 0x07, 0x01, 0x01, 0x00, 0x3a, 0x08, 0x01, 0x01, 0x00, 0x3f, 0x10, +0x41, 0x00, 0xa9, 0x89, 0x11, 0x41, 0x00, 0xe6, 0x96, 0x12, 0x41, 0x00, 0xe3, 0x93, 0x13, 0x41, +0x00, 0xaa, 0x8a, 0x14, 0x41, 0x00, 0xa5, 0x85, 0x15, 0x41, 0x00, 0xad, 0x8d, 0x16, 0x41, 0x00, +0xa3, 0x83, 0x17, 0x41, 0x00, 0xe8, 0x98, 0x18, 0x41, 0x00, 0xe9, 0x99, 0x19, 0x41, 0x00, 0xa7, +0x87, 0x1a, 0x41, 0x00, 0xe5, 0x95, 0x1b, 0x41, 0x00, 0xea, 0x9a, 0x1e, 0x41, 0x00, 0xe4, 0x94, +0x1f, 0x41, 0x00, 0xeb, 0x9b, 0x20, 0x41, 0x00, 0xa2, 0x82, 0x21, 0x41, 0x00, 0xa0, 0x80, 0x22, +0x41, 0x00, 0xaf, 0x8f, 0x23, 0xc1, 0x00, 0xe0, 0x00, 0x90, 0x23, 0x24, 0x41, 0x00, 0xae, 0x8e, +0x25, 0x41, 0x00, 0xab, 0x8b, 0x26, 0x41, 0x00, 0xa4, 0x84, 0x27, 0x41, 0x00, 0xa6, 0x86, 0x28, +0x41, 0x00, 0xed, 0x9d, 0x29, 0xc1, 0x00, 0xf1, 0x29, 0xf0, 0x00, 0x2a, 0x03, 0x0f, 0x00, 0x00, +0x00, 0x7a, 0x2b, 0x01, 0x01, 0x00, 0x2f, 0x2c, 0x41, 0x00, 0xef, 0x9f, 0x2d, 0x41, 0x00, 0xe7, +0x97, 0x2e, 0x41, 0x00, 0xe1, 0x91, 0x2f, 0x41, 0x00, 0xac, 0x8c, 0x30, 0x41, 0x00, 0xa8, 0x88, +0x31, 0x41, 0x00, 0xe2, 0x92, 0x32, 0x41, 0x00, 0xec, 0x9c, 0x33, 0x41, 0x00, 0xa1, 0x81, 0x34, +0x41, 0x00, 0xee, 0x9e, 0x35, 0x01, 0x00, 0x2e, 0x2c, 0x00, 0x05, 0x02, 0x03, 0x00, 0x00, 0xfd, +0x36, 0x03, 0x0f, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x03, 0x01, 0x01, 0x00, 0x22, 0x04, 0x01, 0x01, +0x00, 0xef, 0x05, 0x02, 0x05, 0x00, 0x3b, 0xa0, 0x07, 0x01, 0x01, 0x00, 0x3a, 0x08, 0x01, 0x01, +0x00, 0x3f, 0x10, 0x41, 0x00, 0xbd, 0xbe, 0x11, 0x41, 0x00, 0xa4, 0xa5, 0x12, 0x41, 0x00, 0xe7, +0xe8, 0x13, 0x41, 0x00, 0xc6, 0xc7, 0x14, 0x42, 0x00, 0xa8, 0xa9, 0xcf, 0x15, 0x41, 0x00, 0xd4, +0xd5, 0x16, 0x41, 0x00, 0xac, 0xad, 0x17, 0x41, 0x00, 0xf5, 0xf6, 0x18, 0x41, 0x00, 0xf9, 0xfa, +0x19, 0x41, 0x00, 0xf3, 0xf4, 0x1a, 0x41, 0x00, 0xb5, 0xb6, 0x1b, 0x41, 0x00, 0x9e, 0x9f, 0x1e, +0x41, 0x00, 0xaa, 0xab, 0x1f, 0x41, 0x00, 0xf1, 0xf2, 0x20, 0x41, 0x00, 0xeb, 0xec, 0x21, 0x41, +0x00, 0xa0, 0xa1, 0x22, 0x41, 0x00, 0xd8, 0xdd, 0x23, 0x41, 0x00, 0xe1, 0xe2, 0x24, 0x41, 0x00, +0xd6, 0xd7, 0x25, 0x41, 0x00, 0xd0, 0xd1, 0x26, 0x41, 0x00, 0xa6, 0xa7, 0x27, 0x41, 0x00, 0xe9, +0xea, 0x28, 0x41, 0x00, 0xf7, 0xf8, 0x29, 0x41, 0x00, 0x84, 0x85, 0x2a, 0x03, 0x0f, 0x00, 0x00, +0x00, 0x7c, 0x2b, 0x01, 0x01, 0x00, 0x2f, 0x2c, 0xc1, 0x00, 0xde, 0x2c, 0xe0, 0x00, 0x2d, 0x41, +0x00, 0xfb, 0xfc, 0x2e, 0x41, 0x00, 0xe3, 0xe4, 0x2f, 0x41, 0x00, 0xd2, 0xd3, 0x30, 0x41, 0x00, +0xb7, 0xb8, 0x31, 0x41, 0x00, 0xe5, 0xe6, 0x32, 0x41, 0x00, 0xed, 0xee, 0x33, 0x41, 0x00, 0xa2, +0xa3, 0x34, 0x41, 0x00, 0x9c, 0x9d, 0x35, 0x01, 0x00, 0x2e, 0x2c, 0x00, 0x05, 0x02, 0x07, 0x00, +0x00, 0xa0, 0x12, 0x42, 0x03, 0x00, 0x00, 0xcf, 0x36, 0x03, 0x0f, 0x00, 0x00, 0x00, 0x7d, 0x00, +0x03, 0x01, 0x01, 0x00, 0x22, 0x04, 0x01, 0x01, 0x00, 0xef, 0x05, 0x01, 0x01, 0x00, 0x3b, 0x07, +0x01, 0x01, 0x00, 0x3a, 0x08, 0x01, 0x01, 0x00, 0x3f, 0x10, 0x41, 0x00, 0xbd, 0xbe, 0x11, 0x41, +0x00, 0xa4, 0xa5, 0x12, 0x41, 0x00, 0xe7, 0xe8, 0x13, 0x41, 0x00, 0xc6, 0xc7, 0x14, 0x41, 0x00, +0xa8, 0xa9, 0x15, 0x41, 0x00, 0xd4, 0xd5, 0x16, 0x41, 0x00, 0xac, 0xad, 0x17, 0x41, 0x00, 0xf5, +0xf6, 0x18, 0x41, 0x00, 0xf9, 0xfa, 0x19, 0x41, 0x00, 0xf3, 0xf4, 0x1a, 0x41, 0x00, 0xb5, 0xb6, +0x1b, 0x41, 0x00, 0x9e, 0x9f, 0x1e, 0x41, 0x00, 0xaa, 0xab, 0x1f, 0x41, 0x00, 0xf1, 0xf2, 0x20, +0x41, 0x00, 0xeb, 0xec, 0x21, 0x41, 0x00, 0xa0, 0xa1, 0x22, 0x41, 0x00, 0xd8, 0xdd, 0x23, 0x41, +0x00, 0xe1, 0xe2, 0x24, 0x41, 0x00, 0xd6, 0xd7, 0x25, 0x41, 0x00, 0xd0, 0xd1, 0x26, 0x41, 0x00, +0xa6, 0xa7, 0x27, 0x41, 0x00, 0xe9, 0xea, 0x28, 0x41, 0x00, 0xf7, 0xf8, 0x29, 0x41, 0x00, 0x84, +0x85, 0x2a, 0x03, 0x0f, 0x00, 0x00, 0x00, 0x7e, 0x2b, 0x01, 0x01, 0x00, 0x2f, 0x2c, 0xc1, 0x00, +0xde, 0x2c, 0xe0, 0x00, 0x2d, 0x41, 0x00, 0xfb, 0xfc, 0x2e, 0x41, 0x00, 0xe3, 0xe4, 0x2f, 0x41, +0x00, 0xd2, 0xd3, 0x30, 0x41, 0x00, 0xb7, 0xb8, 0x31, 0x41, 0x00, 0xe5, 0xe6, 0x32, 0x41, 0x00, +0xed, 0xee, 0x33, 0x41, 0x00, 0xa2, 0xa3, 0x34, 0x41, 0x00, 0x9c, 0x9d, 0x35, 0x01, 0x00, 0x2e, +0x2c, 0x00, 0x36, 0x03, 0x0f, 0x00, 0x00, 0x00, 0x7f, 0x00 }; + +// Slovakia +Bit8u layout_SK[993] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x09, 0x00, 0x00, 0x53, 0x4b, 0x2c, 0xf5, 0x00, 0x53, 0x4b, 0x05, +0x02, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x03, 0x35, 0x01, 0xad, +0x01, 0x00, 0x00, 0x5a, 0x03, 0x44, 0x03, 0x4b, 0x03, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x4b, +0x03, 0x00, 0x00, 0x63, 0x03, 0x6e, 0x02, 0xd7, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x2b, 0x31, +0xc8, 0x03, 0x01, 0x01, 0xa0, 0x32, 0x04, 0x03, 0x05, 0xa0, 0x33, 0xc9, 0x1e, 0x05, 0x01, 0x01, +0xa0, 0x34, 0x06, 0x02, 0x05, 0xa0, 0x35, 0xca, 0x07, 0x01, 0x01, 0xa0, 0x36, 0x08, 0x02, 0x04, +0xec, 0x37, 0xcb, 0x09, 0x02, 0x00, 0xa0, 0x38, 0xfa, 0x0a, 0x02, 0x04, 0xa1, 0x39, 0xcc, 0x0b, +0x01, 0x00, 0x82, 0x30, 0x0c, 0x02, 0x04, 0x3d, 0x25, 0xcd, 0x0d, 0x02, 0x07, 0xcc, 0xa0, 0xce, +0x10, 0x42, 0x03, 0x00, 0x00, 0x5c, 0x11, 0x42, 0x03, 0x00, 0x00, 0x7c, 0x12, 0x41, 0x00, 0x65, +0x45, 0x15, 0x43, 0x04, 0x7a, 0x5a, 0x00, 0x1a, 0x16, 0x41, 0x00, 0x75, 0x55, 0x17, 0x41, 0x00, +0x69, 0x49, 0x18, 0x41, 0x00, 0x6f, 0x4f, 0x19, 0x42, 0x03, 0x00, 0x00, 0x27, 0x1a, 0x02, 0x00, +0xa3, 0x2f, 0xf6, 0x1b, 0x02, 0x00, 0x84, 0x28, 0x9e, 0x1e, 0x42, 0x00, 0x61, 0x41, 0x3c, 0x21, +0x42, 0x03, 0x00, 0x00, 0x5b, 0x22, 0x42, 0x03, 0x00, 0x00, 0x5d, 0x27, 0x02, 0x00, 0x93, 0x22, +0x24, 0x28, 0x02, 0x00, 0xf5, 0x21, 0xe1, 0x29, 0x01, 0x02, 0x3b, 0xca, 0x2b, 0x02, 0x01, 0xa0, +0x29, 0xcf, 0x2c, 0x43, 0x00, 0x79, 0x59, 0x3e, 0x19, 0x2d, 0x42, 0x03, 0x00, 0x00, 0x23, 0x2e, +0x42, 0x00, 0x63, 0x43, 0x26, 0x2f, 0x42, 0x03, 0x00, 0x00, 0x40, 0x30, 0x42, 0x03, 0x00, 0x00, +0x7b, 0x31, 0x42, 0x00, 0x6e, 0x4e, 0x7d, 0x33, 0x01, 0x01, 0x00, 0x3f, 0x34, 0x02, 0x01, 0x00, +0x3a, 0x2a, 0x35, 0x03, 0x04, 0x2d, 0x5f, 0x00, 0x1f, 0x39, 0x00, 0x00, 0x20, 0x56, 0x02, 0x00, +0x26, 0x2a, 0x3c, 0x00, 0x02, 0x02, 0x03, 0x00, 0x00, 0x7e, 0x03, 0x02, 0x06, 0x96, 0x00, 0xc8, +0x04, 0x00, 0x00, 0xe7, 0x05, 0x02, 0x06, 0x9f, 0x00, 0xca, 0x06, 0x02, 0x06, 0x9c, 0x00, 0xcb, +0x07, 0x02, 0x06, 0xa7, 0x00, 0xcc, 0x08, 0x02, 0x03, 0x00, 0x00, 0x60, 0x09, 0x02, 0x07, 0x00, +0x00, 0xcd, 0x0a, 0x02, 0x07, 0x00, 0x00, 0xce, 0x0b, 0x02, 0x07, 0x00, 0x00, 0xcf, 0x0c, 0x02, +0x07, 0x00, 0x00, 0xd0, 0x0d, 0x02, 0x07, 0xce, 0xc8, 0xd1, 0x12, 0x42, 0x03, 0x00, 0x00, 0xaa, +0x13, 0x41, 0x00, 0x72, 0x52, 0x14, 0x41, 0x00, 0x74, 0x54, 0x1f, 0x42, 0x00, 0x73, 0x53, 0xd0, +0x20, 0x42, 0x00, 0x64, 0x44, 0xd1, 0x25, 0x42, 0x03, 0x00, 0x00, 0x88, 0x26, 0x42, 0x00, 0x6c, +0x4c, 0x9d, 0x29, 0x01, 0x03, 0x00, 0xcb, 0x2b, 0x00, 0x00, 0xe5, 0x00, 0xf3, 0x13, 0x63, 0x9f, +0x64, 0xd4, 0x65, 0xd8, 0x6c, 0x96, 0x6e, 0xe5, 0x72, 0xfd, 0x73, 0xe7, 0x74, 0x9c, 0x7a, 0xa7, +0x43, 0xac, 0x44, 0xd2, 0x45, 0xb7, 0x4c, 0x95, 0x4e, 0xd5, 0x52, 0xfc, 0x53, 0xe6, 0x54, 0x9b, +0x5a, 0xa6, 0x20, 0xf3, 0x5e, 0x07, 0x61, 0x83, 0x69, 0x8c, 0x6f, 0x93, 0x41, 0xb6, 0x49, 0xd7, +0x4f, 0xe2, 0x20, 0x5e, 0xf4, 0x03, 0x61, 0xc7, 0x41, 0xc6, 0x20, 0xf4, 0xf8, 0x03, 0x75, 0x85, +0x55, 0xde, 0x20, 0xf8, 0xf2, 0x05, 0x61, 0xa5, 0x65, 0xa9, 0x41, 0xa4, 0x45, 0xa8, 0x20, 0xf2, +0xfa, 0x03, 0x7a, 0xbe, 0x5a, 0xbd, 0x20, 0xfa, 0xef, 0x19, 0x61, 0xa0, 0x63, 0x86, 0x65, 0x82, +0x69, 0xa1, 0x6c, 0x92, 0x6e, 0xe4, 0x6f, 0xa2, 0x72, 0xea, 0x73, 0x98, 0x75, 0xa3, 0x79, 0xec, +0x7a, 0xab, 0x41, 0xb5, 0x43, 0x8f, 0x45, 0x90, 0x49, 0xd6, 0x4c, 0x91, 0x4e, 0xe3, 0x4f, 0xe0, +0x52, 0xe8, 0x53, 0x97, 0x55, 0xe9, 0x59, 0xed, 0x5a, 0x8d, 0x20, 0xef, 0xf1, 0x05, 0x6f, 0x8b, +0x75, 0xfb, 0x4f, 0x8a, 0x55, 0xeb, 0x20, 0xf1, 0xf9, 0x09, 0x61, 0x84, 0x65, 0x89, 0x6f, 0x94, +0x75, 0x81, 0x41, 0x8e, 0x45, 0xd3, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0xf9, 0xf7, 0x07, 0x63, 0x87, +0x73, 0xad, 0x74, 0xee, 0x43, 0x80, 0x53, 0xb8, 0x54, 0xdd, 0x20, 0xf7, 0x00, 0x02, 0x02, 0x03, +0x00, 0x00, 0x7e, 0x03, 0x02, 0x06, 0x8c, 0x00, 0xc8, 0x04, 0x00, 0x00, 0xa8, 0x05, 0x00, 0x00, +0x87, 0x06, 0x00, 0x00, 0x9f, 0x07, 0x00, 0x00, 0x91, 0x08, 0x02, 0x02, 0x98, 0x00, 0x60, 0x09, +0x02, 0x07, 0x00, 0x00, 0xa0, 0x0a, 0x02, 0x07, 0x00, 0x00, 0xcb, 0x0c, 0x02, 0x07, 0x00, 0x00, +0xcc, 0x0d, 0x02, 0x07, 0xcb, 0xc8, 0xa0, 0x13, 0x41, 0x00, 0x72, 0x52, 0x14, 0x41, 0x00, 0x74, +0x54, 0x1b, 0x02, 0x07, 0x00, 0x00, 0xa0, 0x1f, 0x41, 0x00, 0x73, 0x53, 0x20, 0x41, 0x00, 0x64, +0x44, 0x26, 0x41, 0x00, 0x6c, 0x4c, 0x28, 0x00, 0x00, 0xad, 0x29, 0x01, 0x03, 0x00, 0xca, 0x2b, +0x02, 0x06, 0xa4, 0x00, 0xa0, 0x00, 0x76, 0x13, 0x63, 0x87, 0x64, 0x83, 0x65, 0x88, 0x6c, 0x8c, +0x6e, 0xa4, 0x72, 0xa9, 0x73, 0xa8, 0x74, 0x9f, 0x7a, 0x91, 0x43, 0x80, 0x44, 0x85, 0x45, 0x89, +0x4c, 0x9c, 0x4e, 0xa5, 0x52, 0x9e, 0x53, 0x9b, 0x54, 0x86, 0x5a, 0x92, 0x20, 0x76, 0x5e, 0x03, +0x6f, 0x93, 0x4f, 0xa7, 0x20, 0x5e, 0xf8, 0x03, 0x75, 0x96, 0x55, 0xa6, 0x20, 0xf8, 0x27, 0x11, +0x61, 0xa0, 0x65, 0x82, 0x69, 0xa1, 0x6c, 0x8d, 0x6f, 0xa2, 0x72, 0xaa, 0x75, 0xa3, 0x79, 0x98, +0x41, 0x8f, 0x45, 0x90, 0x49, 0x8b, 0x4c, 0x8a, 0x4f, 0x95, 0x52, 0xab, 0x55, 0x97, 0x59, 0x9d, +0x20, 0x27, 0x22, 0x07, 0x61, 0x84, 0x6f, 0x94, 0x75, 0x81, 0x41, 0x8e, 0x4f, 0x99, 0x55, 0x9a, +0x20, 0x22, 0x00, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, 0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, +0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, +0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, +0x20, 0x5e, 0xf8, 0x03, 0x61, 0x86, 0x41, 0x8f, 0x20, 0xf8, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, +0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, +0x20, 0x60, 0x27, 0x0d, 0x61, 0xa0, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x79, 0xec, +0x41, 0xb5, 0x45, 0x90, 0x49, 0xd6, 0x4f, 0xe0, 0x55, 0xe9, 0x59, 0xed, 0x20, 0xef, 0xf9, 0x0c, +0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, +0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0xf9, 0xf7, 0x03, 0x63, 0x87, 0x43, 0x80, 0x20, 0xf7, +0x00 }; + +// Spain +Bit8u layout_SP[471] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x1d, 0x00, 0x00, 0x53, 0x50, 0x2c, 0x00, 0x00, 0x45, 0x53, 0x2c, +0xac, 0x00, 0x53, 0x50, 0x2c, 0xac, 0x00, 0x45, 0x53, 0x2c, 0xad, 0x00, 0x53, 0x50, 0x2c, 0xad, +0x00, 0x45, 0x53, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, +0x03, 0x30, 0x01, 0x3d, 0x01, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x3d, 0x01, 0x00, 0x00, 0xb5, +0x01, 0x00, 0x00, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x00, 0x00, 0x7c, 0x03, 0x02, 0x01, +0x00, 0x22, 0x40, 0x04, 0x02, 0x01, 0x00, 0xfa, 0x23, 0x05, 0x02, 0x07, 0x00, 0x00, 0xc9, 0x07, +0x02, 0x01, 0x00, 0x26, 0xaa, 0x08, 0x01, 0x01, 0x00, 0x2f, 0x09, 0x01, 0x01, 0x00, 0x28, 0x0a, +0x01, 0x01, 0x00, 0x29, 0x0b, 0x01, 0x01, 0x00, 0x3d, 0x0c, 0x01, 0x00, 0x27, 0x3f, 0x0d, 0x01, +0x00, 0xad, 0xa8, 0x12, 0x41, 0x00, 0x65, 0x45, 0x15, 0x41, 0x00, 0x79, 0x59, 0x16, 0x41, 0x00, +0x75, 0x55, 0x17, 0x41, 0x00, 0x69, 0x49, 0x18, 0x41, 0x00, 0x6f, 0x4f, 0x1a, 0x02, 0x03, 0xc8, +0xca, 0x5b, 0x1b, 0x02, 0x00, 0x2b, 0x2a, 0x5d, 0x1e, 0x41, 0x00, 0x61, 0x41, 0x27, 0x42, 0x00, +0xa4, 0xa5, 0x7e, 0x28, 0x02, 0x03, 0xcb, 0xcc, 0x7b, 0x29, 0x03, 0x00, 0xa7, 0xa6, 0x5c, 0x1c, +0x2b, 0x42, 0x00, 0x87, 0x80, 0x7d, 0x31, 0x41, 0x00, 0x6e, 0x4e, 0x33, 0x02, 0x01, 0x00, 0x3b, +0x3c, 0x34, 0x02, 0x01, 0x00, 0x3a, 0x3e, 0x35, 0x03, 0x00, 0x2d, 0x5f, 0x5c, 0x1f, 0x39, 0x00, +0x00, 0x20, 0x56, 0x01, 0x00, 0x3c, 0x3e, 0x00, 0x60, 0x06, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, +0x6f, 0x95, 0x75, 0x97, 0x20, 0x60, 0x7e, 0x03, 0x6e, 0xa4, 0x4e, 0xa5, 0x20, 0x7e, 0x5e, 0x06, +0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x20, 0x5e, 0x27, 0x07, 0x61, 0xa0, +0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x45, 0x90, 0x20, 0x27, 0x22, 0x0a, 0x61, 0x84, +0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x4f, 0x99, 0x55, 0x9a, +0x20, 0x22, 0x00, 0x06, 0x02, 0x03, 0x00, 0x00, 0xd5, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x00, +0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, 0x45, 0xd4, +0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, 0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, 0x6f, 0xe4, +0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, +0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, 0x20, 0x5e, +0xef, 0x0d, 0x61, 0xa0, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x79, 0xec, 0x41, 0xb5, +0x45, 0x90, 0x49, 0xd6, 0x4f, 0xe0, 0x55, 0xe9, 0x59, 0xed, 0x20, 0xef, 0xf9, 0x0c, 0x61, 0x84, +0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, +0x4f, 0x99, 0x55, 0x9a, 0x20, 0xf9, 0x00 }; + +// Finland +Bit8u layout_SU[683] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x1d, 0x00, 0x00, 0x53, 0x55, 0x2c, 0x00, 0x00, 0x53, 0x56, 0x2c, +0x00, 0x00, 0x46, 0x49, 0x2c, 0x99, 0x00, 0x53, 0x55, 0x2c, 0x99, 0x00, 0x53, 0x56, 0x2c, 0x99, +0x00, 0x46, 0x49, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, +0x03, 0x55, 0x01, 0x62, 0x01, 0x00, 0x00, 0x5b, 0x03, 0xdd, 0x01, 0xff, 0x01, 0x00, 0x00, 0x52, +0x03, 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0xb5, 0x01, 0xfc, 0x00, 0x06, 0x01, 0x00, 0x00, 0x00, +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +0x02, 0x01, 0x00, 0x22, 0x40, 0x04, 0x02, 0x03, 0x00, 0x00, 0x9c, 0x05, 0x02, 0x01, 0x00, 0xcf, +0x24, 0x07, 0x01, 0x01, 0x00, 0x26, 0x08, 0x02, 0x01, 0x00, 0x2f, 0x7b, 0x09, 0x03, 0x01, 0x00, +0x28, 0x5b, 0x1b, 0x0a, 0x03, 0x01, 0x00, 0x29, 0x5d, 0x1d, 0x0b, 0x02, 0x01, 0x00, 0x3d, 0x7d, +0x0c, 0x03, 0x00, 0x2b, 0x3f, 0x5c, 0x1c, 0x0d, 0x02, 0x03, 0xcb, 0xc8, 0x7c, 0x10, 0x42, 0x03, +0x00, 0x00, 0x40, 0x12, 0x41, 0x00, 0x65, 0x45, 0x15, 0x41, 0x00, 0x79, 0x59, 0x16, 0x41, 0x00, +0x75, 0x55, 0x17, 0x41, 0x00, 0x69, 0x49, 0x18, 0x41, 0x00, 0x6f, 0x4f, 0x1a, 0x41, 0x00, 0x86, +0x8f, 0x1b, 0x03, 0x07, 0xcc, 0xca, 0xc9, 0x1e, 0x1e, 0x41, 0x00, 0x61, 0x41, 0x27, 0x41, 0x00, +0x94, 0x99, 0x28, 0x41, 0x00, 0x84, 0x8e, 0x29, 0x01, 0x00, 0xf5, 0xab, 0x2b, 0x01, 0x00, 0x27, +0x2a, 0x2e, 0x41, 0x00, 0x63, 0x43, 0x31, 0x41, 0x00, 0x6e, 0x4e, 0x32, 0x42, 0x03, 0x00, 0x00, +0xe6, 0x33, 0x02, 0x01, 0x00, 0x3b, 0x3c, 0x34, 0x02, 0x01, 0x00, 0x3a, 0x3e, 0x35, 0x03, 0x04, +0x2d, 0x5f, 0x00, 0x1f, 0x39, 0x00, 0x00, 0x20, 0x56, 0x02, 0x00, 0x3c, 0x3e, 0x7c, 0x00, 0x05, +0x01, 0x03, 0x00, 0xa0, 0x29, 0x00, 0x00, 0x15, 0x00, 0x60, 0x06, 0x61, 0x85, 0x65, 0x8a, 0x69, +0x8d, 0x6f, 0x95, 0x75, 0x97, 0x20, 0x60, 0x7e, 0x03, 0x6e, 0xa4, 0x4e, 0xa5, 0x20, 0x7e, 0x5e, +0x06, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x20, 0x5e, 0x27, 0x09, 0x61, +0xa0, 0x63, 0x87, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x43, 0x80, 0x45, 0x90, 0x20, +0x27, 0x22, 0x0a, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, +0x8e, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0x22, 0x00, 0x06, 0x02, 0x03, 0x00, 0x00, 0xd5, 0x12, 0x42, +0x03, 0x00, 0x00, 0xd5, 0x00, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, 0x75, +0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, 0x7e, 0x07, 0x61, +0xc6, 0x6e, 0xa4, 0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, +0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, +0xe2, 0x55, 0xea, 0x20, 0x5e, 0xef, 0x0f, 0x61, 0xa0, 0x63, 0x87, 0x65, 0x82, 0x69, 0xa1, 0x6f, +0xa2, 0x75, 0xa3, 0x79, 0xec, 0x41, 0xb5, 0x43, 0x80, 0x45, 0x90, 0x49, 0xd6, 0x4f, 0xe0, 0x55, +0xe9, 0x59, 0xed, 0x20, 0xef, 0xf9, 0x0c, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, +0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0xf9, 0x00, +0x06, 0x02, 0x03, 0x00, 0x00, 0xd5, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x1f, 0x41, 0x00, 0x73, +0x53, 0x28, 0x42, 0x07, 0x00, 0x00, 0xcd, 0x29, 0x01, 0x03, 0x00, 0xa0, 0x2c, 0x41, 0x00, 0x7a, +0x5a, 0x00, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, +0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, 0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, +0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, +0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, +0x20, 0x5e, 0x27, 0x0f, 0x61, 0xa0, 0x63, 0x87, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, +0x79, 0xec, 0x41, 0xb5, 0x43, 0x80, 0x45, 0x90, 0x49, 0xd6, 0x4f, 0xe0, 0x55, 0xe9, 0x59, 0xed, +0x20, 0x27, 0x22, 0x0d, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, +0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x59, 0xf3, 0x20, 0x22, 0x76, 0x05, +0x73, 0xf9, 0x7a, 0xf7, 0x53, 0xdd, 0x5a, 0xef, 0x20, 0x76, 0x00 }; + +// Sweden +Bit8u layout_SV[683] = { +0x4b, 0x4c, 0x46, 0x00, 0x01, 0x1d, 0x00, 0x00, 0x53, 0x55, 0x2c, 0x00, 0x00, 0x53, 0x56, 0x2c, +0x00, 0x00, 0x46, 0x49, 0x2c, 0x99, 0x00, 0x53, 0x55, 0x2c, 0x99, 0x00, 0x53, 0x56, 0x2c, 0x99, +0x00, 0x46, 0x49, 0x05, 0x02, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, +0x03, 0x55, 0x01, 0x62, 0x01, 0x00, 0x00, 0x5b, 0x03, 0xdd, 0x01, 0xff, 0x01, 0x00, 0x00, 0x52, +0x03, 0x00, 0x00, 0x62, 0x01, 0x00, 0x00, 0xb5, 0x01, 0xfc, 0x00, 0x06, 0x01, 0x00, 0x00, 0x00, +0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, +0x02, 0x01, 0x00, 0x22, 0x40, 0x04, 0x02, 0x03, 0x00, 0x00, 0x9c, 0x05, 0x02, 0x01, 0x00, 0xcf, +0x24, 0x07, 0x01, 0x01, 0x00, 0x26, 0x08, 0x02, 0x01, 0x00, 0x2f, 0x7b, 0x09, 0x03, 0x01, 0x00, +0x28, 0x5b, 0x1b, 0x0a, 0x03, 0x01, 0x00, 0x29, 0x5d, 0x1d, 0x0b, 0x02, 0x01, 0x00, 0x3d, 0x7d, +0x0c, 0x03, 0x00, 0x2b, 0x3f, 0x5c, 0x1c, 0x0d, 0x02, 0x03, 0xcb, 0xc8, 0x7c, 0x10, 0x42, 0x03, +0x00, 0x00, 0x40, 0x12, 0x41, 0x00, 0x65, 0x45, 0x15, 0x41, 0x00, 0x79, 0x59, 0x16, 0x41, 0x00, +0x75, 0x55, 0x17, 0x41, 0x00, 0x69, 0x49, 0x18, 0x41, 0x00, 0x6f, 0x4f, 0x1a, 0x41, 0x00, 0x86, +0x8f, 0x1b, 0x03, 0x07, 0xcc, 0xca, 0xc9, 0x1e, 0x1e, 0x41, 0x00, 0x61, 0x41, 0x27, 0x41, 0x00, +0x94, 0x99, 0x28, 0x41, 0x00, 0x84, 0x8e, 0x29, 0x01, 0x00, 0xf5, 0xab, 0x2b, 0x01, 0x00, 0x27, +0x2a, 0x2e, 0x41, 0x00, 0x63, 0x43, 0x31, 0x41, 0x00, 0x6e, 0x4e, 0x32, 0x42, 0x03, 0x00, 0x00, +0xe6, 0x33, 0x02, 0x01, 0x00, 0x3b, 0x3c, 0x34, 0x02, 0x01, 0x00, 0x3a, 0x3e, 0x35, 0x03, 0x04, +0x2d, 0x5f, 0x00, 0x1f, 0x39, 0x00, 0x00, 0x20, 0x56, 0x02, 0x00, 0x3c, 0x3e, 0x7c, 0x00, 0x05, +0x01, 0x03, 0x00, 0xa0, 0x29, 0x00, 0x00, 0x15, 0x00, 0x60, 0x06, 0x61, 0x85, 0x65, 0x8a, 0x69, +0x8d, 0x6f, 0x95, 0x75, 0x97, 0x20, 0x60, 0x7e, 0x03, 0x6e, 0xa4, 0x4e, 0xa5, 0x20, 0x7e, 0x5e, +0x06, 0x61, 0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x20, 0x5e, 0x27, 0x09, 0x61, +0xa0, 0x63, 0x87, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, 0x43, 0x80, 0x45, 0x90, 0x20, +0x27, 0x22, 0x0a, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, 0x41, +0x8e, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0x22, 0x00, 0x06, 0x02, 0x03, 0x00, 0x00, 0xd5, 0x12, 0x42, +0x03, 0x00, 0x00, 0xd5, 0x00, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, 0x75, +0x97, 0x41, 0xb7, 0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, 0x7e, 0x07, 0x61, +0xc6, 0x6e, 0xa4, 0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, +0x83, 0x65, 0x88, 0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, +0xe2, 0x55, 0xea, 0x20, 0x5e, 0xef, 0x0f, 0x61, 0xa0, 0x63, 0x87, 0x65, 0x82, 0x69, 0xa1, 0x6f, +0xa2, 0x75, 0xa3, 0x79, 0xec, 0x41, 0xb5, 0x43, 0x80, 0x45, 0x90, 0x49, 0xd6, 0x4f, 0xe0, 0x55, +0xe9, 0x59, 0xed, 0x20, 0xef, 0xf9, 0x0c, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, +0x81, 0x79, 0x98, 0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x20, 0xf9, 0x00, +0x06, 0x02, 0x03, 0x00, 0x00, 0xd5, 0x12, 0x42, 0x03, 0x00, 0x00, 0xd5, 0x1f, 0x41, 0x00, 0x73, +0x53, 0x28, 0x42, 0x07, 0x00, 0x00, 0xcd, 0x29, 0x01, 0x03, 0x00, 0xa0, 0x2c, 0x41, 0x00, 0x7a, +0x5a, 0x00, 0x60, 0x0b, 0x61, 0x85, 0x65, 0x8a, 0x69, 0x8d, 0x6f, 0x95, 0x75, 0x97, 0x41, 0xb7, +0x45, 0xd4, 0x49, 0xde, 0x4f, 0xe3, 0x55, 0xeb, 0x20, 0x60, 0x7e, 0x07, 0x61, 0xc6, 0x6e, 0xa4, +0x6f, 0xe4, 0x41, 0xc7, 0x4e, 0xa5, 0x4f, 0xe5, 0x20, 0x7e, 0x5e, 0x0b, 0x61, 0x83, 0x65, 0x88, +0x69, 0x8c, 0x6f, 0x93, 0x75, 0x96, 0x41, 0xb6, 0x45, 0xd2, 0x49, 0xd7, 0x4f, 0xe2, 0x55, 0xea, +0x20, 0x5e, 0x27, 0x0f, 0x61, 0xa0, 0x63, 0x87, 0x65, 0x82, 0x69, 0xa1, 0x6f, 0xa2, 0x75, 0xa3, +0x79, 0xec, 0x41, 0xb5, 0x43, 0x80, 0x45, 0x90, 0x49, 0xd6, 0x4f, 0xe0, 0x55, 0xe9, 0x59, 0xed, +0x20, 0x27, 0x22, 0x0d, 0x61, 0x84, 0x65, 0x89, 0x69, 0x8b, 0x6f, 0x94, 0x75, 0x81, 0x79, 0x98, +0x41, 0x8e, 0x45, 0xd3, 0x49, 0xd8, 0x4f, 0x99, 0x55, 0x9a, 0x59, 0xf3, 0x20, 0x22, 0x76, 0x05, +0x73, 0xf9, 0x7a, 0xf7, 0x53, 0xdd, 0x5a, 0xef, 0x20, 0x76, 0x00 }; diff --git a/src/dos/dos_memory.cpp b/src/dos/dos_memory.cpp index 5a8b737..0fa042f 100644 --- a/src/dos/dos_memory.cpp +++ b/src/dos/dos_memory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -303,15 +303,11 @@ bool DOS_FreeMemory(Bit16u segment) { } -void DOS_BuildUMBChain(const char* use_umbs,bool ems_active) { - if ((strcmp(use_umbs,"false")!=0) && (machine!=MCH_TANDY)) { - Bit16u first_umb_seg=0xca00; - Bit16u first_umb_size=0x600; - - if (strcmp(use_umbs,"max")==0) { - first_umb_seg-=0x100; - first_umb_size+=0x100; - } +void DOS_BuildUMBChain(bool umb_active,bool ems_active) { + if (umb_active && (machine!=MCH_TANDY)) { + Bit16u first_umb_seg = 0xd000; + Bit16u first_umb_size = 0x2000; + if(ems_active || (machine == MCH_PCJR)) first_umb_size = 0x1000; dos_infoblock.SetStartOfUMBChain(UMB_START_SEG); dos_infoblock.SetUMBChainState(0); // UMBs not linked yet @@ -338,27 +334,6 @@ void DOS_BuildUMBChain(const char* use_umbs,bool ems_active) { mcb.SetSize(first_umb_seg-cover_mcb-1); mcb.SetFileName("SC "); - if (!ems_active && (strcmp(use_umbs,"max")==0) && (machine!=MCH_PCJR)) { - Bit16u ems_umb_seg=0xe000; - Bit16u ems_umb_size=0x1000; - - /* Continue UMB-chain */ - umb_mcb.SetSize(first_umb_size-2); - umb_mcb.SetType(0x4d); - - DOS_MCB umb2_mcb(ems_umb_seg); - umb2_mcb.SetPSPSeg(0); // currently free - umb2_mcb.SetSize(ems_umb_size-1); - umb2_mcb.SetType(0x5a); - - /* A system MCB has to take out the space between the previous and this UMB */ - cover_mcb=(Bit16u)(first_umb_seg+umb_mcb.GetSize()+1); - mcb.SetPt(cover_mcb); - mcb.SetType(0x4d); - mcb.SetPSPSeg(0x0008); - mcb.SetSize(ems_umb_seg-cover_mcb-1); - mcb.SetFileName("SC "); - } } else { dos_infoblock.SetStartOfUMBChain(0xffff); dos_infoblock.SetUMBChainState(0); @@ -419,15 +394,17 @@ void DOS_SetupMemory(void) { * buggy games, which compare against the interrupt table. (probably a * broken linked list implementation) */ callbackhandler.Allocate(&DOS_default_handler,"DOS default int"); - real_writeb(0x70,4,(Bit8u)0xFE); //GRP 4 - real_writeb(0x70,5,(Bit8u)0x38); //Extra Callback instruction - real_writew(0x70,6,callbackhandler.Get_callback()); //The immediate word - real_writeb(0x70,8,(Bit8u)0xCF); //An IRET Instruction - real_writed(0,0x01*4,0x700004); - real_writed(0,0x02*4,0x700004); //BioMenace (segment<0x8000) - real_writed(0,0x03*4,0x700004); //Alien Incident (offset!=0) - real_writed(0,0x04*4,0x700004); //Shadow President (lower byte of segment!=0) -// real_writed(0,0x0f*4,0x700004); //Always a tricky one (soundblaster irq) + Bitu ihseg = 0x70; + Bitu ihofs = 0x08; + real_writeb(ihseg,ihofs+0x00,(Bit8u)0xFE); //GRP 4 + real_writeb(ihseg,ihofs+0x01,(Bit8u)0x38); //Extra Callback instruction + real_writew(ihseg,ihofs+0x02,callbackhandler.Get_callback()); //The immediate word + real_writeb(ihseg,ihofs+0x04,(Bit8u)0xCF); //An IRET Instruction + RealSetVec(0x01,RealMake(ihseg,ihofs)); //BioMenace (offset!=4) + RealSetVec(0x02,RealMake(ihseg,ihofs)); //BioMenace (segment<0x8000) + RealSetVec(0x03,RealMake(ihseg,ihofs)); //Alien Incident (offset!=0) + RealSetVec(0x04,RealMake(ihseg,ihofs)); //Shadow President (lower byte of segment!=0) +// RealSetVec(0x0f,RealMake(ihseg,ihofs)); //Always a tricky one (soundblaster irq) // Create a dummy device MCB with PSPSeg=0x0008 DOS_MCB mcb_devicedummy((Bit16u)DOS_MEM_START); diff --git a/src/dos/dos_misc.cpp b/src/dos/dos_misc.cpp index fd0549e..b789b39 100644 --- a/src/dos/dos_misc.cpp +++ b/src/dos/dos_misc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_misc.cpp,v 1.16 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: dos_misc.cpp,v 1.17 2007/01/08 19:45:39 qbix79 Exp $ */ #include "dosbox.h" #include "callback.h" diff --git a/src/dos/dos_mscdex.cpp b/src/dos/dos_mscdex.cpp index e9389a8..7aaf95e 100644 --- a/src/dos/dos_mscdex.cpp +++ b/src/dos/dos_mscdex.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_mscdex.cpp,v 1.37 2006/03/26 11:54:44 qbix79 Exp $ */ +/* $Id: dos_mscdex.cpp,v 1.45 2007/01/21 16:21:22 c2woody Exp $ */ #include #include @@ -26,6 +26,7 @@ #include "dos_inc.h" #include "setup.h" #include "support.h" +#include "bios.h" #include "cdrom.h" @@ -106,14 +107,17 @@ public: bool GetSubChannelData (Bit8u subUnit, Bit8u& attr, Bit8u& track, Bit8u &index, TMSF& rel, TMSF& abs); + int RemoveDrive (Bit16u _drive); int AddDrive (Bit16u _drive, char* physicalPath, Bit8u& subUnit); + bool HasDrive (Bit16u drive); + void ReplaceDrive (CDROM_Interface* newCdrom, Bit8u subUnit); void GetDrives (PhysPt data); void GetDriverInfo (PhysPt data); bool GetVolumeName (Bit8u subUnit, char* name); bool GetCopyrightName (Bit16u drive, PhysPt data); bool GetAbstractName (Bit16u drive, PhysPt data); bool GetDocumentationName(Bit16u drive, PhysPt data); - bool GetDirectoryEntry (Bit16u drive, bool copyFlag, PhysPt pathname, PhysPt buffer, Bitu& error); + bool GetDirectoryEntry (Bit16u drive, bool copyFlag, PhysPt pathname, PhysPt buffer, Bit16u& error); bool ReadVTOC (Bit16u drive, Bit16u volume, PhysPt data, Bit16u& error); bool ReadSectors (Bit16u drive, Bit32u sector, Bit16u num, PhysPt data); bool ReadSectors (Bit8u subUnit, bool raw, Bit32u sector, Bit16u num, PhysPt data); @@ -123,7 +127,7 @@ public: bool GetCDInfo (Bit8u subUnit, Bit8u& tr1, Bit8u& tr2, TMSF& leadOut); Bit32u GetVolumeSize (Bit8u subUnit); bool GetTrackInfo (Bit8u subUnit, Bit8u track, Bit8u& attr, TMSF& start); - Bit16u GetStatusWord (Bit8u subUnit); + Bit16u GetStatusWord (Bit8u subUnit,Bit16u status); bool GetCurrentPos (Bit8u subUnit, TMSF& pos); Bit32u GetDeviceStatus (Bit8u subUnit); bool GetMediaStatus (Bit8u subUnit, Bit8u& status); @@ -196,10 +200,113 @@ Bit8u CMscdex::GetSubUnit(Bit16u _drive) return 0xff; }; +int CMscdex::RemoveDrive(Bit16u _drive) +{ + Bit16u idx = MSCDEX_MAX_DRIVES; + for (Bit16u i=0; i=MSCDEX_MAX_DRIVES) return 4; + if (GetNumDrives()) { + // Error check, driveletter have to be in a row + if (dinfo[0].drive-1!=_drive && dinfo[numDrives-1].drive+1!=_drive) + return 1; + } + // Set return type to ok + int result = 0; + // Get Mounttype and init needed cdrom interface + switch (CDROM_GetMountType(physicalPath,forceCD)) { + case 0x00: { + LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: Mounting physical cdrom: %s" ,physicalPath); +#if defined (WIN32) + // Check OS + OSVERSIONINFO osi; + osi.dwOSVersionInfoSize = sizeof(osi); + GetVersionEx(&osi); + if ((osi.dwPlatformId==VER_PLATFORM_WIN32_NT) && (osi.dwMajorVersion>4)) { + // only WIN NT/200/XP + if (useCdromInterface==CDROM_USE_IOCTL) { + cdrom[numDrives] = new CDROM_Interface_Ioctl(); + LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: IOCTL Interface."); + break; + } + } + if (useCdromInterface==CDROM_USE_ASPI) { + // all Wins - ASPI + cdrom[numDrives] = new CDROM_Interface_Aspi(); + LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: ASPI Interface."); + break; + } +#endif +#if defined (LINUX) || defined(OS2) + // Always use IOCTL in Linux or OS/2 + cdrom[numDrives] = new CDROM_Interface_Ioctl(); + LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: IOCTL Interface."); +#else + // Default case windows and other oses + cdrom[numDrives] = new CDROM_Interface_SDL(); + LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: SDL Interface."); +#endif + } break; + case 0x01: // iso cdrom interface + LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: Mounting iso file as cdrom: %s", physicalPath); + cdrom[numDrives] = new CDROM_Interface_Image((Bit8u)numDrives); + break; + case 0x02: // fake cdrom interface (directories) + cdrom[numDrives] = new CDROM_Interface_Fake; + LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: Mounting directory as cdrom: %s",physicalPath); + LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: You wont have full MSCDEX support !"); + result = 5; + break; + default : // weird result + return 6; + }; + + if (!cdrom[numDrives]->SetDevice(physicalPath,forceCD)) { +// delete cdrom[numDrives] ; mount seems to delete it + return 3; + } + + + if (rootDriverHeaderSeg==0) { Bit16u driverSize = sizeof(DOS_DeviceHeader::sDeviceHeader) + 10; // 10 = Bytes for 3 callbacks @@ -207,10 +314,22 @@ int CMscdex::AddDrive(Bit16u _drive, char* physicalPath, Bit8u& subUnit) Bit16u seg = DOS_GetMemory(driverSize/16+((driverSize%16)>0)); DOS_DeviceHeader devHeader(PhysMake(seg,0)); devHeader.SetNextDeviceHeader (0xFFFFFFFF); + devHeader.SetAttribute(0xc800); devHeader.SetDriveLetter (_drive+1); devHeader.SetNumSubUnits (1); devHeader.SetName ("MSCD001 "); + //Link it in the device chain + Bit32u start = dos_infoblock.GetDeviceChain(); + Bit16u segm = start>>16; + Bit16u offm = start&0xFFFF; + while(start != 0xFFFFFFFF) { + segm = start>>16; + offm = start&0xFFFF; + start = real_readd(segm,offm); + } + real_writed(segm,offm,seg<<16); + // Create Callback Strategy Bit16u off = sizeof(DOS_DeviceHeader::sDeviceHeader); Bitu call_strategy=CALLBACK_Allocate(); @@ -221,7 +340,8 @@ int CMscdex::AddDrive(Bit16u _drive, char* physicalPath, Bit8u& subUnit) real_writeb(seg,off+4,(Bit8u)0xCB); //A RETF Instruction devHeader.SetStrategy(off); - // Create Callback Interruptoff += 5; + // Create Callback Interrupt + off += 5; Bitu call_interrupt=CALLBACK_Allocate(); CallBack_Handlers[call_interrupt]=MSCDEX_Interrupt_Handler; real_writeb(seg,off+0,(Bit8u)0xFE); //GRP 4 @@ -232,77 +352,48 @@ int CMscdex::AddDrive(Bit16u _drive, char* physicalPath, Bit8u& subUnit) rootDriverHeaderSeg = seg; - } else { - // Error check, driveletter have to be in a row - if (dinfo[numDrives-1].drive+1!=_drive) return 1; - }; - - if (GetNumDrives()+14)) { - // only WIN NT/200/XP - if (useCdromInterface==CDROM_USE_IOCTL) { - cdrom[numDrives] = new CDROM_Interface_Ioctl(); - LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: IOCTL Interface."); - break; - } - } - if (useCdromInterface==CDROM_USE_ASPI) { - // all Wins - ASPI - cdrom[numDrives] = new CDROM_Interface_Aspi(); - LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: ASPI Interface."); - break; - } - #endif - #if defined (LINUX) || defined(OS2) - // Always use IOCTL in Linux or OS/2 -// if (useCdromInterface==CDROM_USE_IOCTL) { - cdrom[numDrives] = new CDROM_Interface_Ioctl(); - LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: IOCTL Interface."); - break; -// } - #endif - cdrom[numDrives] = new CDROM_Interface_SDL(); - LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: SDL Interface."); - } break; - case 0x01 : // iso cdrom interface - LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: Mounting iso file as cdrom: %s", physicalPath); - cdrom[numDrives] = new CDROM_Interface_Image((Bit8u)numDrives); - break; - case 0x02 : // fake cdrom interface (directories) - cdrom[numDrives] = new CDROM_Interface_Fake; - LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: Mounting directory as cdrom: %s",physicalPath); - LOG(LOG_MISC,LOG_NORMAL)("MSCDEX: You wont have full MSCDEX support !"); - result = 5; - break; - default : // weird result - return 6; - }; - if (!cdrom[numDrives]->SetDevice(physicalPath,forceCD)) return 3; - subUnit = (Bit8u)numDrives; - // Set drive + } else if (GetNumDrives() == 0) { DOS_DeviceHeader devHeader(PhysMake(rootDriverHeaderSeg,0)); - devHeader.SetNumSubUnits(devHeader.GetNumSubUnits()+1); + Bit16u off = sizeof(DOS_DeviceHeader::sDeviceHeader); + devHeader.SetDriveLetter(_drive+1); + devHeader.SetStrategy(off); + devHeader.SetInterrupt(off+5); + } + + subUnit = (Bit8u)numDrives; + // Set drive + DOS_DeviceHeader devHeader(PhysMake(rootDriverHeaderSeg,0)); + devHeader.SetNumSubUnits(devHeader.GetNumSubUnits()+1); + + if (dinfo[0].drive-1==_drive) { + CDROM_Interface *_cdrom = cdrom[numDrives]; + for (Bit16u i=GetNumDrives(); i>0; i--) { + dinfo[i] = dinfo[i-1]; + cdrom[i] = cdrom[i-1]; + } + cdrom[0] = _cdrom; + dinfo[0].drive = (Bit8u)_drive; + dinfo[0].physDrive = toupper(physicalPath[0]); + } else { dinfo[numDrives].drive = (Bit8u)_drive; dinfo[numDrives].physDrive = toupper(physicalPath[0]); - numDrives++; - // stop audio - StopAudio(subUnit); - return result; } - return 4; + numDrives++; + // stop audio + StopAudio(subUnit); + return result; }; +bool CMscdex::HasDrive(Bit16u drive) { + return (GetSubUnit(drive) != 0xff); +} + +void CMscdex::ReplaceDrive(CDROM_Interface* newCdrom, Bit8u subUnit) { + delete cdrom[subUnit]; + cdrom[subUnit] = newCdrom; + StopAudio(subUnit); +} + PhysPt CMscdex::GetDefaultBuffer(void) { if (defaultBufSeg==0) { @@ -315,7 +406,7 @@ PhysPt CMscdex::GetDefaultBuffer(void) void CMscdex::GetDriverInfo (PhysPt data) { for (Bit16u i=0; i=numDrives) return false; - bool media,changed,open,result; +/* bool media,changed,open,result; result = GetMediaStatus(subUnit,media,changed,open); status = changed ? 0xFF : 0x01; - return result; + return result; */ + status = getSwapRequest() ? 0xFF : 0x01; + return true; }; bool CMscdex::LoadUnloadMedia(Bit8u subUnit, bool unload) @@ -731,7 +823,7 @@ bool CMscdex::LoadUnloadMedia(Bit8u subUnit, bool unload) bool CMscdex::SendDriverRequest(Bit16u drive, PhysPt data) { Bit8u subUnit = GetSubUnit(drive); - if (subUnit>=numDrives) return false; + if (subUnit>=numDrives) return false; // Get SubUnit mem_writeb(data+1,subUnit); // Call Strategy / Interrupt @@ -740,13 +832,12 @@ bool CMscdex::SendDriverRequest(Bit16u drive, PhysPt data) return true; }; -Bit16u CMscdex::GetStatusWord(Bit8u subUnit) +Bit16u CMscdex::GetStatusWord(Bit8u subUnit,Bit16u status) { - if (subUnit>=numDrives) return 0x02; // error : Drive not ready + if (subUnit>=numDrives) return REQUEST_STATUS_ERROR | 0x02; // error : Drive not ready - Bit16u status ; - if (dinfo[subUnit].lastResult) status = REQUEST_STATUS_DONE; // ok - else status = REQUEST_STATUS_ERROR; + if (dinfo[subUnit].lastResult) status |= REQUEST_STATUS_DONE; // ok + else status |= REQUEST_STATUS_ERROR; if (dinfo[subUnit].audioPlay) { // Check if audio is still playing.... @@ -771,144 +862,169 @@ void CMscdex::InitNewMedia(Bit8u subUnit) { }; static CMscdex* mscdex = 0; +static PhysPt curReqheaderPtr = 0; + +static Bit16u MSCDEX_IOCTL_Input(PhysPt buffer,Bit8u drive_unit) { + Bitu ioctl_fct = mem_readb(buffer); + MSCDEX_LOG("MSCDEX: IOCTL INPUT Subfunction %02X",ioctl_fct); + switch (ioctl_fct) { + case 0x00 : /* Get Device Header address */ + mem_writed(buffer+1,RealMake(mscdex->rootDriverHeaderSeg,0)); + break; + case 0x01 :{/* Get current position */ + TMSF pos; + mscdex->GetCurrentPos(drive_unit,pos); + Bit8u addr_mode = mem_readb(buffer+1); + if (addr_mode==0) { // HSG + mem_writed(buffer+2,MSF_TO_FRAMES (pos.min, pos.sec, pos.fr)); + } else if (addr_mode==1) { // Red book + mem_writeb(buffer+2,pos.fr); + mem_writeb(buffer+3,pos.sec); + mem_writeb(buffer+4,pos.min); + mem_writeb(buffer+5,0x00); + } else { + LOG_MSG("MSCDEX: Get position: invalid address mode %x",addr_mode); + return 0x03; // invalid function + } + }break; + case 0x06 : /* Get Device status */ + mem_writed(buffer+1,mscdex->GetDeviceStatus(drive_unit)); + break; + case 0x07 : /* Get sector size */ + if (mem_readb(buffer+1)==0) mem_writed(buffer+2,2048); + else if (mem_readb(buffer+1)==1) mem_writed(buffer+2,2352); + else return 0x03; // invalid function + break; + case 0x08 : /* Get size of current volume */ + mem_writed(buffer+1,mscdex->GetVolumeSize(drive_unit)); + break; + case 0x09 : /* Media change ? */ + Bit8u status; + if (!mscdex->GetMediaStatus(drive_unit,status)) { + status = 0; // state unknown + } + mem_writeb(buffer+1,status); + break; + case 0x0A : /* Get Audio Disk info */ + Bit8u tr1,tr2; TMSF leadOut; + mscdex->GetCDInfo(drive_unit,tr1,tr2,leadOut); + mem_writeb(buffer+1,tr1); + mem_writeb(buffer+2,tr2); + mem_writeb(buffer+3,leadOut.fr); + mem_writeb(buffer+4,leadOut.sec); + mem_writeb(buffer+5,leadOut.min); + mem_writeb(buffer+6,0x00); + break; + case 0x0B :{/* Audio Track Info */ + Bit8u attr; TMSF start; + Bit8u track = mem_readb(buffer+1); + mscdex->GetTrackInfo(drive_unit,track,attr,start); + mem_writeb(buffer+2,start.fr); + mem_writeb(buffer+3,start.sec); + mem_writeb(buffer+4,start.min); + mem_writeb(buffer+5,0x00); + mem_writeb(buffer+6,attr); + break; }; + case 0x0C :{/* Get Audio Sub Channel data */ + Bit8u attr,track,index; + TMSF abs,rel; + mscdex->GetSubChannelData(drive_unit,attr,track,index,rel,abs); + mem_writeb(buffer+1,attr); + mem_writeb(buffer+2,track); + mem_writeb(buffer+3,index); + mem_writeb(buffer+4,rel.min); + mem_writeb(buffer+5,rel.sec); + mem_writeb(buffer+6,rel.fr); + mem_writeb(buffer+7,0x00); + mem_writeb(buffer+8,abs.min); + mem_writeb(buffer+9,abs.sec); + mem_writeb(buffer+10,abs.fr); + break; + }; + case 0x0E :{ /* Get UPC */ + Bit8u attr; char upc[8]; + mscdex->GetUPC(drive_unit,attr,&upc[0]); + mem_writeb(buffer+1,attr); + for (int i=0; i<7; i++) mem_writeb(buffer+2+i,upc[i]); + mem_writeb(buffer+9,0x00); + break; + }; + case 0x0F :{ /* Get Audio Status */ + bool playing,pause; + TMSF resStart,resEnd; + mscdex->GetAudioStatus(drive_unit,playing,pause,resStart,resEnd); + mem_writeb(buffer+1,pause); + mem_writeb(buffer+3,resStart.min); + mem_writeb(buffer+4,resStart.sec); + mem_writeb(buffer+5,resStart.fr); + mem_writeb(buffer+6,0x00); + mem_writeb(buffer+7,resEnd.min); + mem_writeb(buffer+8,resEnd.sec); + mem_writeb(buffer+9,resEnd.fr); + mem_writeb(buffer+10,0x00); + break; + }; + default : LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Unsupported IOCTL INPUT Subfunction %02X",ioctl_fct); + return 0x03; // invalid function + } + return 0x00; // success +} + +static Bit16u MSCDEX_IOCTL_Optput(PhysPt buffer,Bit8u drive_unit) { + Bitu ioctl_fct = mem_readb(buffer); +// MSCDEX_LOG("MSCDEX: IOCTL OUTPUT Subfunction %02X",ioctl_fct); + switch (ioctl_fct) { + case 0x00 : // Unload /eject media + if (!mscdex->LoadUnloadMedia(drive_unit,true)) return 0x02; + break; + case 0x03: //Audio Channel control + MSCDEX_LOG("MSCDEX: Audio Channel Control used. Not handled. Faking succes!"); + case 0x01 : // (un)Lock door + // do nothing -> report as success + break; + case 0x02 : // Reset Drive + LOG(LOG_MISC,LOG_WARN)("cdromDrive reset"); + if (!mscdex->StopAudio(drive_unit)) return 0x02; + break; + case 0x05 : // load media + if (!mscdex->LoadUnloadMedia(drive_unit,false)) return 0x02; + default : LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Unsupported IOCTL OUTPUT Subfunction %02X",ioctl_fct); + return 0x03; // invalid function + } + return 0x00; // success +} static Bitu MSCDEX_Strategy_Handler(void) { -// MSCDEX_LOG("MSCDEX: Device Strategy Routine called."); + curReqheaderPtr = PhysMake(SegValue(es),reg_bx); +// MSCDEX_LOG("MSCDEX: Device Strategy Routine called, request header at %x",curReqheaderPtr); return CBRET_NONE; } static Bitu MSCDEX_Interrupt_Handler(void) { - Bit8u subFuncNr = 0xFF; - PhysPt data = PhysMake(SegValue(es),reg_bx); - Bit8u subUnit = mem_readb(data+1); - Bit8u funcNr = mem_readb(data+2); + if (curReqheaderPtr==0) { + MSCDEX_LOG("MSCDEX: invalid call to interrupt handler"); + return CBRET_NONE; + } + Bit8u subUnit = mem_readb(curReqheaderPtr+1); + Bit8u funcNr = mem_readb(curReqheaderPtr+2); + Bit16u errcode = 0; + PhysPt buffer = 0; MSCDEX_LOG("MSCDEX: Driver Function %02X",funcNr); + if ((funcNr==0x03) || (funcNr==0x0c) || (funcNr==0x80) || (funcNr==0x82)) { + buffer = PhysMake(mem_readw(curReqheaderPtr+0x10),mem_readw(curReqheaderPtr+0x0E)); + } + switch (funcNr) { - case 0x03 : { /* IOCTL INPUT */ - PhysPt buffer = PhysMake(mem_readw(data+0x10),mem_readw(data+0x0E)); - subFuncNr = mem_readb(buffer); - MSCDEX_LOG("MSCDEX: IOCTL INPUT Subfunction %02X",subFuncNr); - switch (subFuncNr) { - case 0x00 : /* Get Device Header address */ - mem_writed(buffer+1,RealMake(mscdex->rootDriverHeaderSeg,0)); - break; - case 0x01 :{/* Get current position */ - TMSF pos; - mscdex->GetCurrentPos(subUnit,pos); - /*mem_writeb(buffer+1,0x01); // Red book - mem_writeb(buffer+2,pos.fr); - mem_writeb(buffer+3,pos.sec); - mem_writeb(buffer+4,pos.min); - mem_writeb(buffer+5,0x00);*/ - //Changed to HSG as default - //(Seems to fix a few broken games which don't test for it) - mem_writeb(buffer+1,0x00); //HSG - mem_writed(buffer+2,MSF_TO_FRAMES (pos.min, pos.sec, pos.fr)); - }break; - case 0x06 : /* Get Device status */ - mem_writed(buffer+1,mscdex->GetDeviceStatus(subUnit)); - break; - case 0x07 : /* Get sector size */ - if (mem_readb(buffer+1)==0x01) mem_writed(buffer+2,2352); - else mem_writed(buffer+2,2048); - break; - case 0x08 : /* Get size of current volume */ - mem_writed(buffer+1,mscdex->GetVolumeSize(subUnit)); - break; - case 0x09 : /* Media change ? */ - Bit8u status; - //TEMP mscdex->GetMediaStatus(subUnit,status); - status = 1; - mem_writeb(buffer+1,status); - break; - case 0x0A : /* Get Audio Disk info */ - Bit8u tr1,tr2; TMSF leadOut; - mscdex->GetCDInfo(subUnit,tr1,tr2,leadOut); - mem_writeb(buffer+1,tr1); - mem_writeb(buffer+2,tr2); - mem_writeb(buffer+3,leadOut.fr); - mem_writeb(buffer+4,leadOut.sec); - mem_writeb(buffer+5,leadOut.min); - mem_writeb(buffer+6,0x00); - break; - case 0x0B :{/* Audio Track Info */ - Bit8u attr; TMSF start; - Bit8u track = mem_readb(buffer+1); - mscdex->GetTrackInfo(subUnit,track,attr,start); - mem_writeb(buffer+2,start.fr); - mem_writeb(buffer+3,start.sec); - mem_writeb(buffer+4,start.min); - mem_writeb(buffer+5,0x00); - mem_writeb(buffer+6,attr); - break; }; - case 0x0C :{/* Get Audio Sub Channel data */ - Bit8u attr,track,index; - TMSF abs,rel; - mscdex->GetSubChannelData(subUnit,attr,track,index,rel,abs); - mem_writeb(buffer+1,attr); - mem_writeb(buffer+2,track); - mem_writeb(buffer+3,index); - mem_writeb(buffer+4,rel.min); - mem_writeb(buffer+5,rel.sec); - mem_writeb(buffer+6,rel.fr); - mem_writeb(buffer+7,0x00); - mem_writeb(buffer+8,abs.min); - mem_writeb(buffer+9,abs.sec); - mem_writeb(buffer+10,abs.fr); - break; - }; - case 0x0E :{ /* Get UPC */ - Bit8u attr; char upc[8]; - mscdex->GetUPC(subUnit,attr,&upc[0]); - mem_writeb(buffer+1,attr); - for (int i=0; i<7; i++) mem_writeb(buffer+2+i,upc[i]); - mem_writeb(buffer+9,0x00); - break; - }; - case 0x0F :{ /* Get Audio Status */ - bool playing,pause; - TMSF resStart,resEnd; - mscdex->GetAudioStatus(subUnit,playing,pause,resStart,resEnd); - mem_writeb(buffer+1,pause); - mem_writeb(buffer+3,resStart.min); - mem_writeb(buffer+4,resStart.sec); - mem_writeb(buffer+5,resStart.fr); - mem_writeb(buffer+6,0x00); - mem_writeb(buffer+7,resEnd.min); - mem_writeb(buffer+8,resEnd.sec); - mem_writeb(buffer+9,resEnd.fr); - mem_writeb(buffer+10,0x00); - break; - }; - default : LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Unsupported IOCTL INPUT Subfunction %02X",subFuncNr); - break; - } + Bit16u error=MSCDEX_IOCTL_Input(buffer,subUnit); + if (error) errcode = error; break; }; case 0x0C : { /* IOCTL OUTPUT */ - PhysPt buffer = PhysMake(mem_readw(data+0x10),mem_readw(data+0x0E)); - subFuncNr = mem_readb(buffer); -// LOG(LOG_MISC,LOG_ERROR)("MSCDEX: IOCTL OUTPUT Subfunction %02X",subFuncNr); - switch (subFuncNr) { - case 0x00 : // Unload /eject) media - mscdex->LoadUnloadMedia(subUnit,true); - break; - case 0x01 : // (un)Lock door - // do nothing -> report as success - break; - case 0x02 : // Reset Drive - LOG(LOG_MISC,LOG_WARN)("cdromDrive reset"); - mscdex->StopAudio(subUnit); - break; - case 0x05 : // load media - mscdex->LoadUnloadMedia(subUnit,false); - break; - default : LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Unsupported IOCTL OUTPUT Subfunction %02X",subFuncNr); - break; - }; + Bit16u error=MSCDEX_IOCTL_Optput(buffer,subUnit); + if (error) errcode = error; break; }; case 0x0D : // device open @@ -916,22 +1032,21 @@ static Bitu MSCDEX_Interrupt_Handler(void) { break; case 0x80 : // Read long case 0x82 : { // Read long prefetch -> both the same here :) - PhysPt buff = PhysMake(mem_readw(data+0x10),mem_readw(data+0x0E)); - Bit32u start = mem_readd(data+0x14); - Bit16u len = mem_readw(data+0x12); - bool raw = (mem_readb(data+0x18)==1); - if (mem_readb(data+0x0D)==0x00) // HSG - mscdex->ReadSectors(subUnit,raw,start,len,buff); + Bit32u start = mem_readd(curReqheaderPtr+0x14); + Bit16u len = mem_readw(curReqheaderPtr+0x12); + bool raw = (mem_readb(curReqheaderPtr+0x18)==1); + if (mem_readb(curReqheaderPtr+0x0D)==0x00) // HSG + mscdex->ReadSectors(subUnit,raw,start,len,buffer); else - mscdex->ReadSectorsMSF(subUnit,raw,start,len,buff); + mscdex->ReadSectorsMSF(subUnit,raw,start,len,buffer); break; }; case 0x83 : // Seek - dont care :) break; case 0x84 : { /* Play Audio Sectors */ - Bit32u start = mem_readd(data+0x0E); - Bit32u len = mem_readd(data+0x12); - if (mem_readb(data+0x0D)==0x00) // HSG + Bit32u start = mem_readd(curReqheaderPtr+0x0E); + Bit32u len = mem_readd(curReqheaderPtr+0x12); + if (mem_readb(curReqheaderPtr+0x0D)==0x00) // HSG mscdex->PlayAudioSector(subUnit,start,len); else // RED BOOK mscdex->PlayAudioMSF(subUnit,start,len); @@ -949,8 +1064,8 @@ static Bitu MSCDEX_Interrupt_Handler(void) { }; // Set Statusword - mem_writew(data+3,mscdex->GetStatusWord(subUnit)); - MSCDEX_LOG("MSCDEX: Status : %04X",mem_readw(data+3)); + mem_writew(curReqheaderPtr+3,mscdex->GetStatusWord(subUnit,errcode)); + MSCDEX_LOG("MSCDEX: Status : %04X",mem_readw(curReqheaderPtr+3)); return CBRET_NONE; } @@ -967,7 +1082,7 @@ static bool MSCDEX_Handler(void) { } } - if (reg_ah!=0x15) return false; + if (reg_ah!=0x15) return false; // not handled here, continue chain PhysPt data = PhysMake(SegValue(es),reg_bx); MSCDEX_LOG("MSCDEX: INT 2F %04X BX= %04X CX=%04X",reg_ax,reg_bx,reg_cx); @@ -1039,43 +1154,79 @@ static bool MSCDEX_Handler(void) { mscdex->GetDrives(data); return true; case 0x150F: { // Get directory entry - Bitu error; + Bit16u error; bool success = mscdex->GetDirectoryEntry(reg_cl,reg_ch&1,data,PhysMake(reg_si,reg_di),error); reg_ax = error; CALLBACK_SCF(!success); }; return true; case 0x1510: /* Device driver request */ - mscdex->SendDriverRequest(reg_cx,data); + if (mscdex->SendDriverRequest(reg_cx,data)) { + CALLBACK_SCF(false); + } else { + reg_ax = 0x0f; // invalid drive + CALLBACK_SCF(true); + } return true; - - default : LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Unknwon call : %04X",reg_ax); - return true; - }; - return false; + LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Unknwon call : %04X",reg_ax); + return true; }; class device_MSCDEX : public DOS_Device { public: device_MSCDEX() { SetName("MSCD001"); } - bool Read (Bit8u * data,Bit16u * size) { return false;} - bool Write(Bit8u * data,Bit16u * size) { + bool Read (Bit8u * /*data*/,Bit16u * /*size*/) { return false;} + bool Write(Bit8u * /*data*/,Bit16u * /*size*/) { LOG(LOG_ALL,LOG_NORMAL)("Write to mscdex device"); return false; } - bool Seek(Bit32u * pos,Bit32u type){return false;} + bool Seek(Bit32u * /*pos*/,Bit32u /*type*/){return false;} bool Close(){return false;} - Bit16u GetInformation(void){return 0x8093;} + Bit16u GetInformation(void){return 0xc880;} + bool ReadFromControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode); + bool WriteToControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode); private: - Bit8u cache; +// Bit8u cache; }; +bool device_MSCDEX::ReadFromControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode) { + if (MSCDEX_IOCTL_Input(bufptr,0)==0) { + *retcode=size; + return true; + } + return false; +} + +bool device_MSCDEX::WriteToControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode) { + if (MSCDEX_IOCTL_Optput(bufptr,0)==0) { + *retcode=size; + return true; + } + return false; +} + int MSCDEX_AddDrive(char driveLetter, const char* physicalPath, Bit8u& subUnit) { int result = mscdex->AddDrive(driveLetter-'A',(char*)physicalPath,subUnit); return result; }; +int MSCDEX_RemoveDrive(char driveLetter) +{ + if(!mscdex) return 0; + return mscdex->RemoveDrive(driveLetter-'A'); +}; + +bool MSCDEX_HasDrive(char driveLetter) +{ + return mscdex->HasDrive(driveLetter-'A'); +}; + +void MSCDEX_ReplaceDrive(CDROM_Interface* cdrom, Bit8u subUnit) +{ + mscdex->ReplaceDrive(cdrom, subUnit); +}; + bool MSCDEX_GetVolumeName(Bit8u subUnit, char* name) { return mscdex->GetVolumeName(subUnit,name); @@ -1113,7 +1264,9 @@ void MSCDEX_SetCDInterface(int intNr, int numCD) void MSCDEX_ShutDown(Section* sec) { - delete mscdex; mscdex = 0; + delete mscdex; + mscdex = 0; + curReqheaderPtr = 0; }; void MSCDEX_Init(Section* sec) @@ -1123,6 +1276,7 @@ void MSCDEX_Init(Section* sec) /* Register the mscdex device */ DOS_Device * newdev = new device_MSCDEX(); DOS_AddDevice(newdev); + curReqheaderPtr = 0; /* Add Multiplexer */ DOS_AddMultiplexHandler(MSCDEX_Handler); /* Create MSCDEX */ diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index 383d151..3003edb 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,11 +16,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_programs.cpp,v 1.56 2006/03/12 21:12:20 qbix79 Exp $ */ +/* $Id: dos_programs.cpp,v 1.69 2007/02/22 08:37:12 qbix79 Exp $ */ #include #include #include +#include +#include #include "programs.h" #include "support.h" #include "drives.h" @@ -51,25 +53,26 @@ public: DOS_Drive * newdrive;char drive; std::string label; std::string umount; + /* Check for unmounting */ if (cmd->FindString("-u",umount,false)) { umount[0] = toupper(umount[0]); - int drive = umount[0]-'A'; - if(drive < DOS_DRIVES && Drives[drive]) { - if(drive == DOS_GetDefaultDrive()) { - WriteOut(MSG_Get("PROGRAM_MOUNT_UMOUNT_CURRENT")); - return; - } - try { /* Check if virtualdrive */ - if( dynamic_cast(Drives[drive]) == 0 ) throw 0; - } - catch(...) { + int i_drive = umount[0]-'A'; + if(i_drive < DOS_DRIVES && Drives[i_drive]) { + switch (DriveManager::UnmountDrive(i_drive)) { + case 0: + Drives[i_drive] = 0; + if(i_drive == DOS_GetDefaultDrive()) + DOS_SetDrive(toupper('Z') - 'A'); + WriteOut(MSG_Get("PROGRAM_MOUNT_UMOUNT_SUCCES"),umount[0]); + break; + case 1: WriteOut(MSG_Get("PROGRAM_MOUNT_UMOUNT_NO_VIRTUAL")); - return; + break; + case 2: + WriteOut(MSG_Get("MSCDEX_ERROR_MULTIPLE_CDROMS")); + break; } - WriteOut(MSG_Get("PROGRAM_MOUNT_UMOUNT_SUCCES"),umount[0]); - delete Drives[drive]; - Drives[drive] = 0; } else { WriteOut(MSG_Get("PROGRAM_MOUNT_UMOUNT_NOT_MOUNTED"),umount[0]); } @@ -231,6 +234,10 @@ public: case 5 : WriteOut(MSG_Get("MSCDEX_LIMITED_SUPPORT")); break; default : WriteOut(MSG_Get("MSCDEX_UNKNOWN_ERROR")); break; }; + if (error && error!=5) { + delete newdrive; + return; + } } else { /* Give a warning when mount c:\ or the / */ #if defined (WIN32) || defined(OS2) @@ -245,7 +252,7 @@ public: return; } if (Drives[drive-'A']) { - WriteOut(MSG_Get("PROGRAM_MOUNT_ALLREADY_MOUNTED"),drive,Drives[drive-'A']->GetInfo()); + WriteOut(MSG_Get("PROGRAM_MOUNT_ALREADY_MOUNTED"),drive,Drives[drive-'A']->GetInfo()); if (newdrive) delete newdrive; return; } @@ -331,7 +338,8 @@ public: } /* Test for and show free EMS */ Bit16u handle; - if (DOS_OpenFile("EMMXXXX0",0,&handle)) { + char emm[9] = { 'E','M','M','X','X','X','X','0',0 }; + if (DOS_OpenFile(emm,0,&handle)) { DOS_CloseFile(handle); reg_ah=0x42; CALLBACK_RunRealInt(0x67); @@ -350,13 +358,17 @@ extern Bit32u floppytype; class BOOT : public Program { private: - FILE *getFSFile(Bit8u * filename, Bit32u *ksize, Bit32u *bsize) { + + FILE *getFSFile_mounted(char const* filename, Bit32u *ksize, Bit32u *bsize, Bit8u *error) { + //if return NULL then put in error the errormessage code if an error was requested + bool tryload = (*error)?true:false; + *error = 0; Bit8u drive; FILE *tmpfile; char fullname[DOS_PATHLENGTH]; localDrive* ldp=0; - if (!DOS_MakeName((char *)filename,fullname,&drive)) return NULL; + if (!DOS_MakeName(const_cast(filename),fullname,&drive)) return NULL; try { ldp=dynamic_cast(Drives[drive]); @@ -364,13 +376,13 @@ private: tmpfile = ldp->GetSystemFilePtr(fullname, "r"); if(tmpfile == NULL) { - WriteOut(MSG_Get("PROGRAM_BOOT_NOT_EXIST")); + if (!tryload) *error=1; return NULL; } fclose(tmpfile); tmpfile = ldp->GetSystemFilePtr(fullname, "rb+"); if(tmpfile == NULL) { - WriteOut(MSG_Get("PROGRAM_BOOT_NOT_OPEN")); + if (!tryload) *error=2; return NULL; } @@ -382,7 +394,29 @@ private: catch(...) { return NULL; } - + } + + FILE *getFSFile(char const * filename, Bit32u *ksize, Bit32u *bsize,bool tryload=false) { + Bit8u error = tryload?1:0; + FILE* tmpfile = getFSFile_mounted(filename,ksize,bsize,&error); + if(tmpfile) return tmpfile; + //File not found on mounted filesystem. Try regular filesystem + tmpfile = fopen(filename,"rb+"); + if(!tmpfile) { + if( (tmpfile = fopen(filename,"r")) ) { + //File exists; So can't be opened in correct mode => error 2 + fclose(tmpfile); + if(tryload) error = 2; + } + // Give the delayed errormessages from the mounted variant (or from above) + if(error == 1) WriteOut(MSG_Get("PROGRAM_BOOT_NOT_EXIST")); + if(error == 2) WriteOut(MSG_Get("PROGRAM_BOOT_NOT_OPEN")); + return NULL; + } + fseek(tmpfile,0L, SEEK_END); + *ksize = (ftell(tmpfile) / 1024); + *bsize = ftell(tmpfile); + return tmpfile; } void printError(void) { @@ -405,10 +439,14 @@ private: public: void Run(void) { - FILE *usefile; + FILE *usefile_1=NULL; + FILE *usefile_2=NULL; Bitu i; - Bit32u floppysize, rombytesize; + Bit32u floppysize; + Bit32u rombytesize_1=0; + Bit32u rombytesize_2=0; Bit8u drive; + std::string cart_cmd=""; if(!cmd->GetCount()) { printError(); @@ -436,12 +474,33 @@ public: continue; } + if((temp_line == "-e") || (temp_line == "-E")) { + /* Command mode for PCJr cartridges */ + i++; + if(cmd->FindCommand(i+1, temp_line)) { + for(size_t i=0;i0x1000) break; + clen=rombuf[ct]; + } + if (ct>6) { + WriteOut(MSG_Get("PROGRAM_BOOT_CART_LIST_CMDS"),cmdlist); + } else { + WriteOut(MSG_Get("PROGRAM_BOOT_CART_NO_CMDS")); + } + for(Bitu dct=0;dct0x1000) break; + clen=rombuf[ct]; + } + if (cfound_at<=0) { + if (ct>6) { + WriteOut(MSG_Get("PROGRAM_BOOT_CART_LIST_CMDS"),cmdlist); + } else { + WriteOut(MSG_Get("PROGRAM_BOOT_CART_NO_CMDS")); + } + for(Bitu dct=0;dct0) { + /* run cartridge setup */ + SegSet16(ds,dos.psp()); + SegSet16(es,dos.psp()); + CALLBACK_RunRealFar(romseg,cfound_at); + } else { + for(Bitu dct=0;dctFindExist("cdrom",false)) { WriteOut(MSG_Get("PROGRAM_INTRO_CDROM")); return; @@ -657,6 +850,33 @@ public: Bit32u imagesize; char drive; std::string label; + std::vector paths; + std::string umount; + /* Check for unmounting */ + if (cmd->FindString("-u",umount,false)) { + umount[0] = toupper(umount[0]); + int i_drive = umount[0]-'A'; + if (i_drive < DOS_DRIVES && Drives[i_drive]) { + switch (DriveManager::UnmountDrive(i_drive)) { + case 0: + Drives[i_drive] = 0; + if (i_drive == DOS_GetDefaultDrive()) + DOS_SetDrive(toupper('Z') - 'A'); + WriteOut(MSG_Get("PROGRAM_MOUNT_UMOUNT_SUCCES"),umount[0]); + break; + case 1: + WriteOut(MSG_Get("PROGRAM_MOUNT_UMOUNT_NO_VIRTUAL")); + break; + case 2: + WriteOut(MSG_Get("MSCDEX_ERROR_MULTIPLE_CDROMS")); + break; + } + } else { + WriteOut(MSG_Get("PROGRAM_MOUNT_UMOUNT_NOT_MOUNTED"),umount[0]); + } + return; + } + std::string type="hdd"; std::string fstype="fat"; @@ -712,8 +932,8 @@ public: WriteOut(MSG_Get("PROGRAM_IMGMOUNT_SPECIFY2")); return; } - drive=temp_line[0]-'0'; - if(drive>3) { + drive=temp_line[0]; + if((drive-'0')>3) { WriteOut(MSG_Get("PROGRAM_IMGMOUNT_SPECIFY2")); return; } @@ -721,62 +941,57 @@ public: WriteOut(MSG_Get("PROGRAM_IMGMOUNT_FORMAT_UNSUPPORTED")); return; } - - if (!cmd->FindCommand(2,temp_line)) { - WriteOut(MSG_Get("PROGRAM_IMGMOUNT_SPECIFY_FILE")); - return; - } - if (!temp_line.size()) { - WriteOut(MSG_Get("PROGRAM_IMGMOUNT_SPECIFY_FILE")); - return; - } - struct stat test; - if (stat(temp_line.c_str(),&test)) { - // convert dosbox filename to system filename - char fullname[CROSS_LEN]; - char tmp[CROSS_LEN]; - safe_strncpy(tmp, temp_line.c_str(), CROSS_LEN); - - Bit8u drive; - if (!DOS_MakeName(tmp, fullname, &drive) || strncmp(Drives[drive]->GetInfo(),"local directory",15)) { - WriteOut(MSG_Get("PROGRAM_IMGMOUNG_FILE_NOT_FOUND")); - return; - } - - localDrive *ldp = (localDrive*)Drives[drive]; - ldp->GetSystemFilename(tmp, fullname); - temp_line = tmp; - - if (stat(temp_line.c_str(),&test)) { - WriteOut(MSG_Get("PROGRAM_IMGMOUNG_FILE_NOT_FOUND")); - return; - } - } - if ((test.st_mode & S_IFDIR)) { - WriteOut(MSG_Get("PROGRAM_IMGMOUNG_MOUNT")); + // find all file parameters, assuming that all option parameters have been removed + while(cmd->FindCommand(paths.size() + 2, temp_line) && temp_line.size()) { + + struct stat test; + if (stat(temp_line.c_str(),&test)) { + // convert dosbox filename to system filename + char fullname[CROSS_LEN]; + char tmp[CROSS_LEN]; + safe_strncpy(tmp, temp_line.c_str(), CROSS_LEN); + + Bit8u dummy; + if (!DOS_MakeName(tmp, fullname, &dummy) || strncmp(Drives[dummy]->GetInfo(),"local directory",15)) { + WriteOut(MSG_Get("PROGRAM_IMGMOUNT_NON_LOCAL_DRIVE")); + return; + } + + localDrive *ldp = (localDrive*)Drives[dummy]; + ldp->GetSystemFilename(tmp, fullname); + temp_line = tmp; + + if (stat(temp_line.c_str(),&test)) { + WriteOut(MSG_Get("PROGRAM_IMGMOUNT_FILE_NOT_FOUND")); + return; + } + + if ((test.st_mode & S_IFDIR)) { + WriteOut(MSG_Get("PROGRAM_IMGMOUNT_MOUNT")); + return; + } + } + paths.push_back(temp_line); + } + if (paths.size() == 0) { + WriteOut(MSG_Get("PROGRAM_IMGMOUNT_SPECIFY_FILE")); + return; + } + if (paths.size() == 1) + temp_line = paths[0]; + if (paths.size() > 1 && fstype != "iso") { + WriteOut(MSG_Get("PROGRAM_IMGMOUNT_MULTIPLE_NON_CUEISO_FILES")); return; } if(fstype=="fat") { newdrive=new fatDrive(temp_line.c_str(),sizes[0],sizes[1],sizes[2],sizes[3],0); - } else if (fstype=="iso") { - int error; - MSCDEX_SetCDInterface(CDROM_USE_SDL, -1); - newdrive = new isoDrive(drive, temp_line.c_str(), mediaid, error); - switch (error) { - case 0 : WriteOut(MSG_Get("MSCDEX_SUCCESS")); break; - case 1 : WriteOut(MSG_Get("MSCDEX_ERROR_MULTIPLE_CDROMS")); break; - case 2 : WriteOut(MSG_Get("MSCDEX_ERROR_NOT_SUPPORTED")); break; - case 3 : WriteOut(MSG_Get("MSCDEX_ERROR_PATH")); break; - case 4 : WriteOut(MSG_Get("MSCDEX_TOO_MANY_DRIVES")); break; - case 5 : WriteOut(MSG_Get("MSCDEX_LIMITED_SUPPORT")); break; - default : WriteOut(MSG_Get("MSCDEX_UNKNOWN_ERROR")); break; - }; - if (error) { + if(!(dynamic_cast(newdrive))->created_succesfully) { delete newdrive; - return; + newdrive = 0; } + } else if (fstype=="iso") { } else { FILE *newDisk = fopen(temp_line.c_str(), "rb+"); fseek(newDisk,0L, SEEK_END); @@ -792,11 +1007,11 @@ public: if(fstype=="fat") { if (Drives[drive-'A']) { - WriteOut(MSG_Get("PROGRAM_IMGMOUNT_ALLREADY_MOUNTED")); + WriteOut(MSG_Get("PROGRAM_IMGMOUNT_ALREADY_MOUNTED")); if (newdrive) delete newdrive; return; } - if (!newdrive) WriteOut(MSG_Get("PROGRAM_IMGMOUNT_CANT_CREATE")); + if (!newdrive) {WriteOut(MSG_Get("PROGRAM_IMGMOUNT_CANT_CREATE"));return;} Drives[drive-'A']=newdrive; // Set the correct media byte in the table mem_writeb(Real2Phys(dos.tables.mediaid)+(drive-'A')*2,mediaid); @@ -818,20 +1033,56 @@ public: } } else if (fstype=="iso") { if (Drives[drive-'A']) { - WriteOut(MSG_Get("PROGRAM_IMGMOUNT_ALLREADY_MOUNTED")); - if (newdrive) delete newdrive; + WriteOut(MSG_Get("PROGRAM_IMGMOUNT_ALREADY_MOUNTED")); return; } - if (!newdrive) WriteOut(MSG_Get("PROGRAM_IMGMOUNT_CANT_CREATE")); - Drives[drive-'A']=newdrive; + MSCDEX_SetCDInterface(CDROM_USE_SDL, -1); + // create new drives for all images + std::vector isoDisks; + for (int i = 0; i < paths.size(); i++) { + int error = -1; + DOS_Drive* newDrive = new isoDrive(drive, paths[i].c_str(), mediaid, error); + isoDisks.push_back(newDrive); + switch (error) { + case 0 : break; + case 1 : WriteOut(MSG_Get("MSCDEX_ERROR_MULTIPLE_CDROMS")); break; + case 2 : WriteOut(MSG_Get("MSCDEX_ERROR_NOT_SUPPORTED")); break; + case 3 : WriteOut(MSG_Get("MSCDEX_ERROR_PATH")); break; + case 4 : WriteOut(MSG_Get("MSCDEX_TOO_MANY_DRIVES")); break; + case 5 : WriteOut(MSG_Get("MSCDEX_LIMITED_SUPPORT")); break; + case 6 : WriteOut(MSG_Get("MSCDEX_INVALID_FILEFORMAT")); break; + default : WriteOut(MSG_Get("MSCDEX_UNKNOWN_ERROR")); break; + } + // error: clean up and leave + if (error) { + for(int i = 0; i < isoDisks.size(); i++) { + delete isoDisks[i]; + } + return; + } + } + // Update DriveManager + for(int i = 0; i < isoDisks.size(); i++) { + DriveManager::AppendDisk(drive - 'A', isoDisks[i]); + } + DriveManager::InitializeDrive(drive - 'A'); + // Set the correct media byte in the table - mem_writeb(Real2Phys(dos.tables.mediaid)+(drive-'A')*2,mediaid); - WriteOut(MSG_Get("PROGRAM_MOUNT_STATUS_2"),drive,temp_line.c_str()); + mem_writeb(Real2Phys(dos.tables.mediaid) + (drive - 'A') * 2, mediaid); + + // Print status message (success) + WriteOut(MSG_Get("MSCDEX_SUCCESS")); + std::string tmp(paths[0]); + for (int i = 1; i < paths.size(); i++) { + tmp += "; " + paths[i]; + } + WriteOut(MSG_Get("PROGRAM_MOUNT_STATUS_2"), drive, tmp.c_str()); + } else if (fstype=="none") { - if(imageDiskList[drive] != NULL) delete imageDiskList[drive]; - imageDiskList[drive] = newImage; + if(imageDiskList[drive-'0'] != NULL) delete imageDiskList[drive-'0']; + imageDiskList[drive-'0'] = newImage; updateDPT(); - WriteOut(MSG_Get("PROGRAM_IMGMOUNT_MOUNT_NUMBER"),drive,temp_line.c_str()); + WriteOut(MSG_Get("PROGRAM_IMGMOUNT_MOUNT_NUMBER"),drive-'0',temp_line.c_str()); } // check if volume label is given @@ -845,6 +1096,70 @@ void IMGMOUNT_ProgramStart(Program * * make) { } +Bitu DOS_SwitchKeyboardLayout(const char* new_layout); +Bitu DOS_LoadKeyboardLayout(const char * layoutname, Bit32s codepage, const char * codepagefile); + +class KEYB : public Program { +public: + void Run(void); +}; + +void KEYB::Run(void) { + if (cmd->FindCommand(1,temp_line)) { + if (cmd->FindString("?",temp_line,false)) { + WriteOut(MSG_Get("PROGRAM_KEYB_SHOWHELP")); + } else { + /* first parameter is layout ID */ + Bitu keyb_error=0; + std::string cp_string; + if (cmd->FindCommand(2,cp_string)) { + /* second parameter is codepage number */ + Bit32s par_cp=atoi(cp_string.c_str()); + char cp_file_name[256]; + if (cmd->FindCommand(3,cp_string)) { + /* third parameter is codepage file */ + strcpy(cp_file_name, cp_string.c_str()); + } else { + /* no codepage file specified, use automatic selection */ + strcpy(cp_file_name, "auto"); + } + + keyb_error=DOS_LoadKeyboardLayout(temp_line.c_str(), par_cp, cp_file_name); + } else keyb_error=DOS_SwitchKeyboardLayout(temp_line.c_str()); + switch (keyb_error) { + case KEYB_NOERROR: + WriteOut(MSG_Get("PROGRAM_KEYB_NOERROR"),temp_line.c_str(),dos.loaded_codepage); + break; + case KEYB_FILENOTFOUND: + WriteOut(MSG_Get("PROGRAM_KEYB_FILENOTFOUND"),temp_line.c_str()); + WriteOut(MSG_Get("PROGRAM_KEYB_SHOWHELP")); + break; + case KEYB_INVALIDFILE: + WriteOut(MSG_Get("PROGRAM_KEYB_INVALIDFILE"),temp_line.c_str()); + break; + case KEYB_LAYOUTNOTFOUND: + WriteOut(MSG_Get("PROGRAM_KEYB_LAYOUTNOTFOUND"),temp_line.c_str(),dos.loaded_codepage); + break; + case KEYB_INVALIDCPFILE: + WriteOut(MSG_Get("PROGRAM_KEYB_INVCPFILE"),temp_line.c_str()); + WriteOut(MSG_Get("PROGRAM_KEYB_SHOWHELP")); + break; + default: + LOG(LOG_DOSMISC,LOG_ERROR)("KEYB:Invalid returncode %x",keyb_error); + break; + } + } + } else { + /* no parameter in the command line, just output codepage info */ + WriteOut(MSG_Get("PROGRAM_KEYB_INFO"),dos.loaded_codepage); + } +}; + +static void KEYB_ProgramStart(Program * * make) { + *make=new KEYB; +} + + void DOS_SetupPrograms(void) { /*Add Messages */ @@ -854,9 +1169,8 @@ void DOS_SetupPrograms(void) { MSG_Add("PROGRAM_MOUNT_ERROR_1","Directory %s doesn't exist.\n"); MSG_Add("PROGRAM_MOUNT_ERROR_2","%s isn't a directory\n"); MSG_Add("PROGRAM_MOUNT_ILL_TYPE","Illegal type %s\n"); - MSG_Add("PROGRAM_MOUNT_ALLREADY_MOUNTED","Drive %c already mounted with %s\n"); + MSG_Add("PROGRAM_MOUNT_ALREADY_MOUNTED","Drive %c already mounted with %s\n"); MSG_Add("PROGRAM_MOUNT_USAGE","Usage \033[34;1mMOUNT Drive-Letter Local-Directory\033[0m\nSo a MOUNT c c:\\windows mounts windows directory as the c: drive in DOSBox\n"); - MSG_Add("PROGRAM_MOUNT_UMOUNT_CURRENT","You can not unMOUNT the active drive.\n"); MSG_Add("PROGRAM_MOUNT_UMOUNT_NOT_MOUNTED","Drive %c isn't mounted.\n"); MSG_Add("PROGRAM_MOUNT_UMOUNT_SUCCES","Drive %c has succesfully been removed.\n"); MSG_Add("PROGRAM_MOUNT_UMOUNT_NO_VIRTUAL","Virtual Drives can not be unMOUNTed.\n"); @@ -879,6 +1193,7 @@ void DOS_SetupPrograms(void) { MSG_Add("MSCDEX_ERROR_PATH","MSCDEX: Failure: Path not valid.\n"); MSG_Add("MSCDEX_TOO_MANY_DRIVES","MSCDEX: Failure: Too many CDRom-drives (max: 5). MSCDEX Installation failed.\n"); MSG_Add("MSCDEX_LIMITED_SUPPORT","MSCDEX: Mounted subdirectory: limited support.\n"); + MSG_Add("MSCDEX_INVALID_FILEFORMAT","MSCDEX: Failure: File is either no iso/cue image or contains errors.\n"); MSG_Add("MSCDEX_UNKNOWN_ERROR","MSCDEX: Failure: Unknown error.\n"); MSG_Add("PROGRAM_RESCAN_SUCCESS","Drive cache cleared.\n"); @@ -980,7 +1295,7 @@ void DOS_SetupPrograms(void) { ); MSG_Add("PROGRAM_BOOT_NOT_EXIST","Bootdisk file does not exist. Failing.\n"); MSG_Add("PROGRAM_BOOT_NOT_OPEN","Cannot open bootdisk file. Failing.\n"); - MSG_Add("PROGRAM_BOOT_PRINT_ERROR","This command boots DosBox from either a floppy or hard disk image.\n\n" + MSG_Add("PROGRAM_BOOT_PRINT_ERROR","This command boots DOSBox from either a floppy or hard disk image.\n\n" "For this command, one can specify a succession of floppy disks swappable\n" "by pressing Ctrl-F4, and -l specifies the mounted drive to boot from. If\n" "no drive letter is specified, this defaults to booting from the A drive.\n" @@ -994,23 +1309,42 @@ void DOS_SetupPrograms(void) { MSG_Add("PROGRAM_BOOT_IMAGE_OPEN","Opening image file: %s\n"); MSG_Add("PROGRAM_BOOT_IMAGE_NOT_OPEN","Cannot open %s"); MSG_Add("PROGRAM_BOOT_BOOT","Booting from drive %c...\n"); - MSG_Add("PROGRAM_BOOT_CART_WO_PCJR","PCJr cartridge found, but machine is not PCJr"); + MSG_Add("PROGRAM_BOOT_CART_WO_PCJR","PCjr cartridge found, but machine is not PCjr"); + MSG_Add("PROGRAM_BOOT_CART_LIST_CMDS","Available PCjr cartridge commandos:%s"); + MSG_Add("PROGRAM_BOOT_CART_NO_CMDS","No PCjr cartridge commandos found"); MSG_Add("PROGRAM_IMGMOUNT_SPECIFY_DRIVE","Must specify drive letter to mount image at.\n"); MSG_Add("PROGRAM_IMGMOUNT_SPECIFY2","Must specify drive number (0 or 3) to mount image at (0,1=fda,fdb;2,3=hda,hdb).\n"); MSG_Add("PROGRAM_IMGMOUNT_SPECIFY_GEOMETRY", - "For \033[33mCD-ROM\033[0m images: \033[34;1mimgmount Drive-Letter location-of-image -t iso\033[0m\n" + "For \033[33mCD-ROM\033[0m images: \033[34;1mIMGMOUNT drive-letter location-of-image -t iso\033[0m\n" "\n" "For \033[33mhardrive\033[0m images: Must specify drive geometry for hard drives:\n" - "bytes_per_sector, sectors_per_cylinder, heads_per_cylinder, cylinder_count.\n"); + "bytes_per_sector, sectors_per_cylinder, heads_per_cylinder, cylinder_count.\n" + "\033[34;1mIMGMOUNT drive-letter location-of-image -size bps,spc,hpc,cyl\033[0m\n"); MSG_Add("PROGRAM_IMGMOUNT_TYPE_UNSUPPORTED","Type \"%s\" is unsupported. Specify \"hdd\" or \"floppy\" or\"iso\".\n"); MSG_Add("PROGRAM_IMGMOUNT_FORMAT_UNSUPPORTED","Format \"%s\" is unsupported. Specify \"fat\" or \"iso\" or \"none\".\n"); MSG_Add("PROGRAM_IMGMOUNT_SPECIFY_FILE","Must specify file-image to mount.\n"); - MSG_Add("PROGRAM_IMGMOUNG_FILE_NOT_FOUND","Image file not found.\n"); - MSG_Add("PROGRAM_IMGMOUNG_MOUNT","To mount directories, use the \033[34;1mMOUNT\033[0m command, not the \033[34;1mIMGMOUNT\033[0m command.\n"); - MSG_Add("PROGRAM_IMGMOUNT_ALLREADY_MOUNTED","Drive already mounted at that letter.\n"); + MSG_Add("PROGRAM_IMGMOUNT_FILE_NOT_FOUND","Image file not found.\n"); + MSG_Add("PROGRAM_IMGMOUNT_MOUNT","To mount directories, use the \033[34;1mMOUNT\033[0m command, not the \033[34;1mIMGMOUNT\033[0m command.\n"); + MSG_Add("PROGRAM_IMGMOUNT_ALREADY_MOUNTED","Drive already mounted at that letter.\n"); MSG_Add("PROGRAM_IMGMOUNT_CANT_CREATE","Can't create drive from file.\n"); MSG_Add("PROGRAM_IMGMOUNT_MOUNT_NUMBER","Drive number %d mounted as %s\n"); + MSG_Add("PROGRAM_IMGMOUNT_NON_LOCAL_DRIVE", "The image must be on a host or local drive.\n"); + MSG_Add("PROGRAM_IMGMOUNT_MULTIPLE_NON_CUEISO_FILES", "Using multiple files is only supported for cue/iso images.\n"); + + MSG_Add("PROGRAM_KEYB_INFO","Codepage %i has been loaded\n"); + MSG_Add("PROGRAM_KEYB_SHOWHELP", + "\033[32;1mKEYB\033[0m [keyboard layout ID[ codepage number[ codepage file]]]\n\n" + "Some examples:\n" + " \033[32;1mKEYB\033[0m: Display currently loaded codepage.\n" + " \033[32;1mKEYB\033[0m sp: Load the spanish (SP) layout, use an appropriate codepage.\n" + " \033[32;1mKEYB\033[0m sp 850: Load the spanish (SP) layout, use codepage 850.\n" + " \033[32;1mKEYB\033[0m sp 850 mycp.cpi: Same as above, but use file mycp.cpi.\n"); + MSG_Add("PROGRAM_KEYB_NOERROR","Keyboard layout %s loaded for codepage %i\n"); + MSG_Add("PROGRAM_KEYB_FILENOTFOUND","Keyboard file %s not found\n\n"); + MSG_Add("PROGRAM_KEYB_INVALIDFILE","Keyboard file %s invalid\n"); + MSG_Add("PROGRAM_KEYB_LAYOUTNOTFOUND","No layout in %s for codepage %i\n"); + MSG_Add("PROGRAM_KEYB_INVCPFILE","None or invalid codepage file for layout %s\n\n"); /*regular setup*/ PROGRAMS_MakeFile("MOUNT.COM",MOUNT_ProgramStart); @@ -1020,4 +1354,5 @@ void DOS_SetupPrograms(void) { PROGRAMS_MakeFile("INTRO.COM",INTRO_ProgramStart); PROGRAMS_MakeFile("BOOT.COM",BOOT_ProgramStart); PROGRAMS_MakeFile("IMGMOUNT.COM", IMGMOUNT_ProgramStart); + PROGRAMS_MakeFile("KEYB.COM", KEYB_ProgramStart); } diff --git a/src/dos/dos_tables.cpp b/src/dos/dos_tables.cpp index 9145d42..b22a849 100644 --- a/src/dos/dos_tables.cpp +++ b/src/dos/dos_tables.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_tables.cpp,v 1.22 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: dos_tables.cpp,v 1.26 2007/01/08 20:36:53 qbix79 Exp $ */ #include "dosbox.h" #include "mem.h" @@ -43,7 +43,7 @@ static Bitu call_casemap; static Bit16u dos_memseg; Bit16u DOS_GetMemory(Bit16u pages) { - if (pages+dos_memseg>=0xe000) { + if (pages+dos_memseg>=0xd000) { E_Exit("DOS:Not enough memory for internal tables"); } Bit16u page=dos_memseg; @@ -73,7 +73,7 @@ static Bit8u country_info[0x22] = { }; void DOS_SetupTables(void) { - dos_memseg=0xd000; + dos_memseg=0xc800; Bit16u seg,seg2;Bitu i; dos.tables.mediaid=RealMake(DOS_GetMemory(4),0); dos.tables.tempdta=RealMake(DOS_GetMemory(4),0); @@ -108,8 +108,37 @@ void DOS_SetupTables(void) { /* Allocate DCBS DOUBLE BYTE CHARACTER SET LEAD-BYTE TABLE */ - dos.tables.dcbs=RealMake(DOS_GetMemory(12),0); - mem_writed(Real2Phys(dos.tables.dcbs),0); //empty table + dos.tables.dbcs=RealMake(DOS_GetMemory(12),0); + mem_writed(Real2Phys(dos.tables.dbcs),0); //empty table + /* FILENAME CHARACTER TABLE */ + dos.tables.filenamechar=RealMake(DOS_GetMemory(2),0); + mem_writew(Real2Phys(dos.tables.filenamechar)+0x00,0x16); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x02,0x01); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x03,0x00); // allowed chars from + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x04,0xff); // ...to + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x05,0x00); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x06,0x00); // excluded chars from + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x07,0x20); // ...to + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x08,0x02); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x09,0x0e); // number of illegal separators + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x0a,0x2e); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x0b,0x22); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x0c,0x2f); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x0d,0x5c); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x0e,0x5b); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x0f,0x5d); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x10,0x3a); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x11,0x7c); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x12,0x3c); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x13,0x3e); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x14,0x2b); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x15,0x3d); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x16,0x3b); + mem_writeb(Real2Phys(dos.tables.filenamechar)+0x17,0x2c); + /* COLLATING SEQUENCE TABLE */ + dos.tables.collatingseq=RealMake(DOS_GetMemory(17),0); + mem_writew(Real2Phys(dos.tables.collatingseq),0x100); + for (i=0; i<256; i++) mem_writeb(Real2Phys(dos.tables.collatingseq)+i+2,i); /* Create a fake FCB SFT */ seg=DOS_GetMemory(4); diff --git a/src/dos/drive_cache.cpp b/src/dos/drive_cache.cpp index 25e64ab..bc3c924 100644 --- a/src/dos/drive_cache.cpp +++ b/src/dos/drive_cache.cpp @@ -1,6 +1,6 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_cache.cpp,v 1.46 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: drive_cache.cpp,v 1.49 2007/01/08 19:45:39 qbix79 Exp $ */ #include "drives.h" #include "dos_inc.h" @@ -690,11 +690,13 @@ bool DOS_Drive_Cache::SetResult(CFileInfo* dir, char* &result, Bit16u entryNr) bool DOS_Drive_Cache::FindFirst(char* path, Bitu& id) { Bit16u dirID; - Bitu dirFindFirstID = this->nextFreeFindFirst++; //increase it for the next search + Bitu dirFindFirstID = this->nextFreeFindFirst; // Cache directory in if (!OpenDir(path,dirID)) return false; + this->nextFreeFindFirst++; //increase it for the next search + if (dirFindFirstID == MAX_OPENDIRS) { // no free slot found... LOG(LOG_MISC,LOG_ERROR)("DIRCACHE: FindFirst/Next: All slots full. Resetting"); @@ -745,43 +747,3 @@ bool DOS_Drive_Cache::FindNext(Bitu id, char* &result) } return true; }; - -// **************************************************************************** -// No Dir Cache, -// **************************************************************************** - -static DIR* srch_opendir = 0; - -DOS_No_Drive_Cache::DOS_No_Drive_Cache(const char* path) -{ - SetBaseDir(path); -}; - -void DOS_No_Drive_Cache::SetBaseDir(const char* path) -{ - strcpy(basePath,path); -} - -bool DOS_No_Drive_Cache::OpenDir(const char* path, Bit16u& id) -{ - id = 0; - strcpy(dirPath,path); - if((srch_opendir=opendir(dirPath))==NULL) return false; - return true; -}; - -bool DOS_No_Drive_Cache::ReadDir(Bit16u id, char* &result) -{ - static char res[CROSS_LEN] = { 0 }; - dirent * ent; - - if (!srch_opendir) return false; - if ((ent=readdir(srch_opendir))==NULL) { - strcpy(res,ent->d_name); - result=res; - closedir(srch_opendir); - srch_opendir=NULL; - return false; - } - return true; -}; diff --git a/src/dos/drive_fat.cpp b/src/dos/drive_fat.cpp index 4a6ea24..d7556aa 100644 --- a/src/dos/drive_fat.cpp +++ b/src/dos/drive_fat.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_fat.cpp,v 1.12 2006/02/20 08:59:52 qbix79 Exp $ */ +/* $Id: drive_fat.cpp,v 1.20 2007/01/08 19:45:39 qbix79 Exp $ */ #include #include @@ -72,9 +72,8 @@ private: /* OUT - char * filearray: Name in DOS directory format, eleven char, e.g. bob txt */ static void convToDirFile(char *filename, char *filearray) { Bit32u charidx = 0; - Bit32u flen; - int i; - flen = strlen(filename); + Bit32u flen,i; + flen = (Bit32u)strlen(filename); memset(filearray, 32, 11); for(i=0;i= 11) break; @@ -87,19 +86,20 @@ static void convToDirFile(char *filename, char *filearray) { } } -fatFile::fatFile(const char* name, Bit32u startCluster, Bit32u fileLen, fatDrive *useDrive) { +fatFile::fatFile(const char* /*name*/, Bit32u startCluster, Bit32u fileLen, fatDrive *useDrive) { Bit32u seekto = 0; firstCluster = startCluster; myDrive = useDrive; filelength = fileLen; + open = true; loadedSector = false; curSectOff = 0; seekpos = 0; memset(§orBuffer[0], 0, sizeof(sectorBuffer)); if(filelength > 0) { - Seek(&seekto, DOS_SEEK_SET); - myDrive->loadedDisk->Read_AbsoluteSector(currentSector, sectorBuffer); + Seek(&seekto, DOS_SEEK_SET); + myDrive->loadedDisk->Read_AbsoluteSector(currentSector, sectorBuffer); loadedSector = true; } } @@ -111,6 +111,19 @@ bool fatFile::Read(Bit8u * data, Bit16u *size) { return true; } + if (!loadedSector) { + currentSector = myDrive->getAbsoluteSectFromBytePos(firstCluster, seekpos); + if(currentSector == 0) { + /* EOC reached before EOF */ + *size = 0; + loadedSector = false; + return true; + } + curSectOff = 0; + myDrive->loadedDisk->Read_AbsoluteSector(currentSector, sectorBuffer); + loadedSector = true; + } + sizedec = *size; sizecount = 0; while(sizedec != 0) { @@ -118,8 +131,7 @@ bool fatFile::Read(Bit8u * data, Bit16u *size) { *size = sizecount; return true; } - data[sizecount] = sectorBuffer[curSectOff]; - curSectOff++; + data[sizecount++] = sectorBuffer[curSectOff++]; seekpos++; if(curSectOff >= myDrive->getSectorSize()) { currentSector = myDrive->getAbsoluteSectFromBytePos(firstCluster, seekpos); @@ -127,14 +139,15 @@ bool fatFile::Read(Bit8u * data, Bit16u *size) { /* EOC reached before EOF */ //LOG_MSG("EOC reached before EOF, seekpos %d, filelen %d", seekpos, filelength); *size = sizecount; + loadedSector = false; return true; } curSectOff = 0; myDrive->loadedDisk->Read_AbsoluteSector(currentSector, sectorBuffer); + loadedSector = true; //LOG_MSG("Reading absolute sector at %d for seekpos %d", currentSector, seekpos); } --sizedec; - sizecount++; } *size =sizecount; return true; @@ -159,9 +172,25 @@ bool fatFile::Write(Bit8u * data, Bit16u *size) { loadedSector = true; } filelength = seekpos+1; + if (!loadedSector) { + currentSector = myDrive->getAbsoluteSectFromBytePos(firstCluster, seekpos); + if(currentSector == 0) { + /* EOC reached before EOF - try to increase file allocation */ + myDrive->appendCluster(firstCluster); + /* Try getting sector again */ + currentSector = myDrive->getAbsoluteSectFromBytePos(firstCluster, seekpos); + if(currentSector == 0) { + /* No can do. lets give up and go home. We must be out of room */ + goto finalizeWrite; + } + } + curSectOff = 0; + myDrive->loadedDisk->Read_AbsoluteSector(currentSector, sectorBuffer); + + loadedSector = true; + } } - sectorBuffer[curSectOff] = data[sizecount]; - curSectOff++; + sectorBuffer[curSectOff++] = data[sizecount++]; seekpos++; if(curSectOff >= myDrive->getSectorSize()) { if(loadedSector) myDrive->loadedDisk->Write_AbsoluteSector(currentSector, sectorBuffer); @@ -174,8 +203,8 @@ bool fatFile::Write(Bit8u * data, Bit16u *size) { currentSector = myDrive->getAbsoluteSectFromBytePos(firstCluster, seekpos); if(currentSector == 0) { /* No can do. lets give up and go home. We must be out of room */ + loadedSector = false; goto finalizeWrite; - } } curSectOff = 0; @@ -184,13 +213,13 @@ bool fatFile::Write(Bit8u * data, Bit16u *size) { loadedSector = true; } --sizedec; - sizecount++; } + if(curSectOff>0 && loadedSector) myDrive->loadedDisk->Write_AbsoluteSector(currentSector, sectorBuffer); finalizeWrite: myDrive->directoryBrowse(dirCluster, &tmpentry, dirIndex); tmpentry.entrysize = filelength; - tmpentry.loFirstClust = firstCluster; + tmpentry.loFirstClust = (Bit16u)firstCluster; myDrive->directoryChange(dirCluster, &tmpentry, dirIndex); *size =sizecount; @@ -198,7 +227,7 @@ finalizeWrite: } bool fatFile::Seek(Bit32u *pos, Bit32u type) { - Bit32s seekto; + Bit32s seekto=0; switch(type) { case DOS_SEEK_SET: @@ -212,14 +241,19 @@ bool fatFile::Seek(Bit32u *pos, Bit32u type) { seekto = (Bit32s)filelength + (Bit32s)*pos; break; } - LOG_MSG("Seek to %d with type %d (absolute value %d)", *pos, type, seekto); +// LOG_MSG("Seek to %d with type %d (absolute value %d)", *pos, type, seekto); if((Bit32u)seekto > filelength) seekto = (Bit32s)filelength; if(seekto<0) seekto = 0; seekpos = (Bit32u)seekto; currentSector = myDrive->getAbsoluteSectFromBytePos(firstCluster, seekpos); - curSectOff = seekpos % myDrive->getSectorSize(); - myDrive->loadedDisk->Read_AbsoluteSector(currentSector, sectorBuffer); + if (currentSector == 0) { + /* not within file size, thus no sector is available */ + loadedSector = false; + } else { + curSectOff = seekpos % myDrive->getSectorSize(); + myDrive->loadedDisk->Read_AbsoluteSector(currentSector, sectorBuffer); + } *pos = seekpos; return true; } @@ -232,7 +266,7 @@ bool fatFile::Close() { } Bit16u fatFile::GetInformation(void) { - return 0x202; + return 0; } bool fatFile::UpdateDateTimeFromHost(void) { @@ -244,10 +278,10 @@ Bit32u fatDrive::getClustFirstSect(Bit32u clustNum) { } Bit32u fatDrive::getClusterValue(Bit32u clustNum) { - Bit32u fatoffset; + Bit32u fatoffset=0; Bit32u fatsectnum; Bit32u fatentoff; - Bit32u clustValue; + Bit32u clustValue=0; switch(fattype) { case FAT12: @@ -291,10 +325,9 @@ Bit32u fatDrive::getClusterValue(Bit32u clustNum) { } void fatDrive::setClusterValue(Bit32u clustNum, Bit32u clustValue) { - Bit32u fatoffset; + Bit32u fatoffset=0; Bit32u fatsectnum; Bit32u fatentoff; - Bit32u tmpValue; switch(fattype) { case FAT12: @@ -318,23 +351,24 @@ void fatDrive::setClusterValue(Bit32u clustNum, Bit32u clustValue) { } switch(fattype) { - case FAT12: - tmpValue = *((Bit16u *)&fatSectBuffer[fatentoff]); + case FAT12: { + Bit16u tmpValue = *((Bit16u *)&fatSectBuffer[fatentoff]); if(clustNum & 0x1) { clustValue &= 0xfff; clustValue <<= 4; tmpValue &= 0xf; - tmpValue |= clustValue; + tmpValue |= (Bit16u)clustValue; } else { clustValue &= 0xfff; tmpValue &= 0xf000; - tmpValue |= clustValue; + tmpValue |= (Bit16u)clustValue; } *((Bit16u *)&fatSectBuffer[fatentoff]) = tmpValue; break; + } case FAT16: - *((Bit16u *)&fatSectBuffer[fatentoff]) = clustValue; + *((Bit16u *)&fatSectBuffer[fatentoff]) = (Bit16u)clustValue; break; case FAT32: *((Bit32u *)&fatSectBuffer[fatentoff]) = clustValue; @@ -348,11 +382,8 @@ void fatDrive::setClusterValue(Bit32u clustNum, Bit32u clustValue) { } bool fatDrive::getEntryName(char *fullname, char *entname) { - Bit16u len = strlen(fullname); char dirtoken[DOS_PATHLENGTH]; - Bit32u currentClust = 0; - direntry foundEntry; char * findDir; char * findFile; strcpy(dirtoken,fullname); @@ -369,7 +400,7 @@ bool fatDrive::getEntryName(char *fullname, char *entname) { } bool fatDrive::getFileDirEntry(char * filename, direntry * useEntry, Bit32u * dirClust, Bit32u * subEntry) { - Bit16u len = strlen(filename); + Bit32u len = (Bit32u)strlen(filename); char dirtoken[DOS_PATHLENGTH]; Bit32u currentClust = 0; @@ -404,7 +435,7 @@ bool fatDrive::getFileDirEntry(char * filename, direntry * useEntry, Bit32u * di } /* Search found directory for our file */ - imgDTA->SetupSearch(0,0x5,findFile); + imgDTA->SetupSearch(0,0x7,findFile); imgDTA->SetDirID(0); if(!FindNextInternal(currentClust, *imgDTA, &foundEntry)) return false; @@ -415,7 +446,7 @@ bool fatDrive::getFileDirEntry(char * filename, direntry * useEntry, Bit32u * di } bool fatDrive::getDirClustNum(char *dir, Bit32u *clustNum, bool parDir) { - Bit16u len = strlen(dir); + Bit32u len = (Bit32u)strlen(dir); char dirtoken[DOS_PATHLENGTH]; Bit32u currentClust = 0; direntry foundEntry; @@ -443,13 +474,11 @@ bool fatDrive::getDirClustNum(char *dir, Bit32u *clustNum, bool parDir) { } *clustNum = currentClust; - return true; } else { /* Set to root directory */ *clustNum = 0; - return true; } - return false; + return true; } Bit32u fatDrive::getSectorSize(void) { @@ -582,6 +611,7 @@ bool fatDrive::allocateCluster(Bit32u useCluster, Bit32u prevCluster) { } fatDrive::fatDrive(const char *sysFilename, Bit32u bytesector, Bit32u cylsector, Bit32u headscyl, Bit32u cylinders, Bit32u startSector) { + created_succesfully = true; FILE *diskfile; Bit32u filesize; struct partTable mbrData; @@ -593,14 +623,14 @@ fatDrive::fatDrive(const char *sysFilename, Bit32u bytesector, Bit32u cylsector, } diskfile = fopen(sysFilename, "rb+"); - if(!diskfile) return; + if(!diskfile) {created_succesfully = false;return;} fseek(diskfile, 0L, SEEK_END); filesize = (Bit32u)ftell(diskfile) / 1024L; - /* Load disk image */ + /* Load disk image */ loadedDisk = new imageDisk(diskfile, (Bit8u *)sysFilename, filesize, (filesize > 2880)); if(!loadedDisk) { - delete this; + created_succesfully = false; return; } @@ -609,6 +639,9 @@ fatDrive::fatDrive(const char *sysFilename, Bit32u bytesector, Bit32u cylsector, loadedDisk->Set_Geometry(headscyl, cylinders,cylsector, bytesector); loadedDisk->Read_Sector(0,0,1,&mbrData); + + if(mbrData.magic1!= 0x55 || mbrData.magic2!= 0xaa) LOG_MSG("Possibly invalid partition table in disk image."); + startSector = 63; int m; for(m=0;m<4;m++) { @@ -620,6 +653,8 @@ fatDrive::fatDrive(const char *sysFilename, Bit32u bytesector, Bit32u cylsector, } } + if(m==4) LOG_MSG("No good partiton found in image."); + partSectOff = startSector; } else { /* Floppy disks don't have partitions */ @@ -629,13 +664,12 @@ fatDrive::fatDrive(const char *sysFilename, Bit32u bytesector, Bit32u cylsector, loadedDisk->Read_AbsoluteSector(0+partSectOff,&bootbuffer); if ((bootbuffer.magic1 != 0x55) || (bootbuffer.magic2 != 0xaa)) { /* Not a FAT filesystem */ - delete this; - return; + LOG_MSG("Loaded image has no valid magicnumbers at the end!"); } if(!bootbuffer.sectorsperfat) { /* FAT32 not implemented yet */ - delete this; + created_succesfully = false; return; } @@ -673,20 +707,28 @@ fatDrive::fatDrive(const char *sysFilename, Bit32u bytesector, Bit32u cylsector, cwdDirCluster = 0; memset(fatSectBuffer,0,1024); - curFatSect = 0xffffffff; + curFatSect = 0xffffffff; } bool fatDrive::AllocationInfo(Bit16u *_bytes_sector, Bit8u *_sectors_cluster, Bit16u *_total_clusters, Bit16u *_free_clusters) { Bit32u hs, cy, sect,sectsize; Bit32u countFree = 0; - int i; + Bit32u i; loadedDisk->Get_Geometry(&hs, &cy, §, §size); *_bytes_sector = (Bit16u)sectsize; *_sectors_cluster = bootbuffer.sectorspercluster; - *_total_clusters = CountOfClusters; + if (CountOfClusters<65536) *_total_clusters = (Bit16u)CountOfClusters; + else { + // maybe some special handling needed for fat32 + *_total_clusters = 65535; + } for(i=0;iGetBiosType(); } bool fatDrive::FileCreate(DOS_File **file, char *name, Bit16u attributes) { @@ -726,7 +773,7 @@ bool fatDrive::FileCreate(DOS_File **file, char *name, Bit16u attributes) { if(!getDirClustNum(name, &dirClust, true)) return false; memset(&fileEntry, 0, sizeof(direntry)); memcpy(&fileEntry.entryname, &pathName[0], 11); - fileEntry.attrib = attributes; + fileEntry.attrib = (Bit8u)(attributes & 0xff); addDirectoryEntry(dirClust, fileEntry); /* Check if file exists now */ @@ -738,7 +785,9 @@ bool fatDrive::FileCreate(DOS_File **file, char *name, Bit16u attributes) { *file = new fatFile(name, fileEntry.loFirstClust, fileEntry.entrysize, this); ((fatFile *)(*file))->dirCluster = dirClust; ((fatFile *)(*file))->dirIndex = subEntry; - + /* Maybe modTime and date should be used ? (crt matches findnext) */ + ((fatFile *)(*file))->time = fileEntry.crtTime; + ((fatFile *)(*file))->date = fileEntry.crtDate; return true; } @@ -749,7 +798,7 @@ bool fatDrive::FileExists(const char *name) { return true; } -bool fatDrive::FileOpen(DOS_File **file, char *name, Bit32u flags) { +bool fatDrive::FileOpen(DOS_File **file, char *name, Bit32u /*flags*/) { direntry fileEntry; Bit32u dirClust, subEntry; if(!getFileDirEntry(name, &fileEntry, &dirClust, &subEntry)) return false; @@ -757,11 +806,13 @@ bool fatDrive::FileOpen(DOS_File **file, char *name, Bit32u flags) { *file = new fatFile(name, fileEntry.loFirstClust, fileEntry.entrysize, this); ((fatFile *)(*file))->dirCluster = dirClust; ((fatFile *)(*file))->dirIndex = subEntry; - + /* Maybe modTime and date should be used ? (crt matches findnext) */ + ((fatFile *)(*file))->time = fileEntry.crtTime; + ((fatFile *)(*file))->date = fileEntry.crtDate; return true; } -bool fatDrive::FileStat(const char *name, FileStat_Block *const stat_block) { +bool fatDrive::FileStat(const char * /*name*/, FileStat_Block *const /*stat_block*/) { /* TODO: Stub */ return false; } @@ -780,7 +831,7 @@ bool fatDrive::FileUnlink(char * name) { return true; } -bool fatDrive::FindFirst(char *_dir, DOS_DTA &dta,bool fcb_findfirst) { +bool fatDrive::FindFirst(char *_dir, DOS_DTA &dta,bool /*fcb_findfirst*/) { direntry dummyClust; Bit8u attr;char pattern[DOS_NAMELENGTH_ASCII]; dta.GetSearchParams(attr,pattern); @@ -799,6 +850,7 @@ bool fatDrive::FindFirst(char *_dir, DOS_DTA &dta,bool fcb_findfirst) { return false; } dta.SetDirID(0); + dta.SetDirIDCluster((Bit16u)(cwdDirCluster&0xffff)); return FindNextInternal(cwdDirCluster, dta, &dummyClust); } @@ -870,7 +922,7 @@ nextfile: memcpy(extension,§buf[entryoffset].entryname[8],3); trimString(&find_name[0]); trimString(&extension[0]); - if(!(sectbuf[entryoffset].attrib & DOS_ATTR_DIRECTORY)) { + if(!(sectbuf[entryoffset].attrib & DOS_ATTR_DIRECTORY) || extension[0]!=0) { strcat(find_name, "."); strcat(find_name, extension); } @@ -891,7 +943,7 @@ nextfile: bool fatDrive::FindNext(DOS_DTA &dta) { direntry dummyClust; - return FindNextInternal(cwdDirCluster, dta, &dummyClust); + return FindNextInternal(dta.GetDirIDCluster(), dta, &dummyClust); } bool fatDrive::GetFileAttr(char *name, Bit16u *attr) { @@ -910,6 +962,7 @@ bool fatDrive::GetFileAttr(char *name, Bit16u *attr) { /* Find directory entry in parent directory */ Bit32s fileidx = 2; + if (dirClust==0) fileidx = 0; // root directory while(directoryBrowse(dirClust, &fileEntry, fileidx)) { if(memcmp(&fileEntry.entryname, &pathName[0], 11) == 0) { *attr=fileEntry.attrib; @@ -923,15 +976,11 @@ bool fatDrive::GetFileAttr(char *name, Bit16u *attr) { } bool fatDrive::directoryBrowse(Bit32u dirClustNumber, direntry *useEntry, Bit32s entNum) { - direntry sectbuf[16]; /* 16 directory entries per sector */ - Bit32u logentsector; /* Logical entry sector */ - Bit32u entryoffset; /* Index offset within sector */ + direntry sectbuf[16]; /* 16 directory entries per sector */ + Bit32u logentsector; /* Logical entry sector */ + Bit32u entryoffset = 0; /* Index offset within sector */ Bit32u tmpsector; - Bit8u attrs; Bit16u dirPos = 0; - char srch_pattern[DOS_NAMELENGTH_ASCII]; - char find_name[DOS_NAMELENGTH_ASCII]; - char extension[4]; while(entNum>=0) { @@ -961,15 +1010,11 @@ bool fatDrive::directoryBrowse(Bit32u dirClustNumber, direntry *useEntry, Bit32s } bool fatDrive::directoryChange(Bit32u dirClustNumber, direntry *useEntry, Bit32s entNum) { - direntry sectbuf[16]; /* 16 directory entries per sector */ - Bit32u logentsector; /* Logical entry sector */ - Bit32u entryoffset; /* Index offset within sector */ + direntry sectbuf[16]; /* 16 directory entries per sector */ + Bit32u logentsector; /* Logical entry sector */ + Bit32u entryoffset = 0; /* Index offset within sector */ Bit32u tmpsector = 0; - Bit8u attrs; Bit16u dirPos = 0; - char srch_pattern[DOS_NAMELENGTH_ASCII]; - char find_name[DOS_NAMELENGTH_ASCII]; - char extension[4]; while(entNum>=0) { @@ -1007,13 +1052,9 @@ bool fatDrive::addDirectoryEntry(Bit32u dirClustNumber, direntry useEntry) { Bit32u logentsector; /* Logical entry sector */ Bit32u entryoffset; /* Index offset within sector */ Bit32u tmpsector; - Bit8u attrs; Bit16u dirPos = 0; - char srch_pattern[DOS_NAMELENGTH_ASCII]; - char find_name[DOS_NAMELENGTH_ASCII]; - char extension[4]; - while(true) { + for(;;) { logentsector = dirPos / 16; entryoffset = dirPos % 16; @@ -1041,11 +1082,11 @@ bool fatDrive::addDirectoryEntry(Bit32u dirClustNumber, direntry useEntry) { if ((sectbuf[entryoffset].entryname[0] == 0xe5) || (sectbuf[entryoffset].entryname[0] == 0x00)) { sectbuf[entryoffset] = useEntry; loadedDisk->Write_AbsoluteSector(tmpsector,sectbuf); - return true; + break; } } - return false; + return true; } void fatDrive::zeroOutCluster(Bit32u clustNumber) { @@ -1144,7 +1185,8 @@ bool fatDrive::RemoveDir(char *dir) { if(filecount > 0) return false; /* Find directory entry in parent directory */ - fileidx = 2; + if (dirClust==0) fileidx = 0; // root directory + else fileidx = 2; bool found = false; while(directoryBrowse(dirClust, &tmpentry, fileidx)) { if(memcmp(&tmpentry.entryname, &pathName[0], 11) == 0) { @@ -1163,7 +1205,7 @@ bool fatDrive::RemoveDir(char *dir) { return true; } -bool fatDrive::Rename(char *oldname, char*newname) { +bool fatDrive::Rename(char * /*oldname*/, char * /*newname*/) { return false; } diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index db81455..907636e 100644 --- a/src/dos/drive_iso.cpp +++ b/src/dos/drive_iso.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_iso.cpp,v 1.12 2006/02/12 13:32:30 qbix79 Exp $ */ +/* $Id: drive_iso.cpp,v 1.17 2007/01/21 16:21:22 c2woody Exp $ */ #include #include @@ -30,7 +30,7 @@ using namespace std; class isoFile : public DOS_File { public: - isoFile(isoDrive *drive, const char *name, FileStat_Block *stat, Bit32u offset, Bit16u info); + isoFile(isoDrive *drive, const char *name, FileStat_Block *stat, Bit32u offset); bool Read(Bit8u *data, Bit16u *size); bool Write(Bit8u *data, Bit16u *size); bool Seek(Bit32u *pos, Bit32u type); @@ -46,7 +46,7 @@ private: Bit16u info; }; -isoFile::isoFile(isoDrive *drive, const char *name, FileStat_Block *stat, Bit32u offset, Bit16u info) +isoFile::isoFile(isoDrive *drive, const char *name, FileStat_Block *stat, Bit32u offset) { this->drive = drive; time = stat->time; @@ -58,7 +58,6 @@ isoFile::isoFile(isoDrive *drive, const char *name, FileStat_Block *stat, Bit32u fileEnd = fileBegin + size; cachedSector = -1; open = true; - this->info = info; this->name = NULL; SetName(name); } @@ -136,11 +135,13 @@ bool isoFile::Close() Bit16u isoFile::GetInformation(void) { - return info; + return 0x40; // read-only drive } +int MSCDEX_RemoveDrive(char driveLetter); int MSCDEX_AddDrive(char driveLetter, const char* physicalPath, Bit8u& subUnit); -bool MSCDEX_HasMediaChanged(Bit8u subUnit); +void MSCDEX_ReplaceDrive(CDROM_Interface* cdrom, Bit8u subUnit); +bool MSCDEX_HasDrive(char driveLetter); bool MSCDEX_GetVolumeName(Bit8u subUnit, char* name); isoDrive::isoDrive(char driveLetter, const char *fileName, Bit8u mediaid, int &error) @@ -150,11 +151,14 @@ isoDrive::isoDrive(char driveLetter, const char *fileName, Bit8u mediaid, int &e memset(sectorHashEntries, 0, sizeof(sectorHashEntries)); memset(&rootEntry, 0, sizeof(isoDirEntry)); - error = MSCDEX_AddDrive(driveLetter, fileName, subUnit); + safe_strncpy(this->fileName, fileName, CROSS_LEN); + error = UpdateMscdex(driveLetter, fileName, subUnit); if (!error) { if (loadImage()) { - strcpy(info, "isoDrive"); + strcpy(info, "isoDrive "); + strcat(info, fileName); + this->driveLetter = driveLetter; this->mediaid = mediaid; char buffer[32] = { 0 }; if (!MSCDEX_GetVolumeName(subUnit, buffer)) strcpy(buffer, ""); @@ -185,6 +189,28 @@ isoDrive::isoDrive(char driveLetter, const char *fileName, Bit8u mediaid, int &e isoDrive::~isoDrive() { } +int isoDrive::UpdateMscdex(char driveLetter, const char* path, Bit8u& subUnit) { + if (MSCDEX_HasDrive(driveLetter)) { + CDROM_Interface_Image* oldCdrom = CDROM_Interface_Image::images[subUnit]; + CDROM_Interface* cdrom = new CDROM_Interface_Image(subUnit); + char pathCopy[CROSS_LEN]; + safe_strncpy(pathCopy, path, CROSS_LEN); + if (!cdrom->SetDevice(pathCopy, 0)) { + CDROM_Interface_Image::images[subUnit] = oldCdrom; + delete cdrom; + return 3; + } + MSCDEX_ReplaceDrive(cdrom, subUnit); + return 0; + } else { + return MSCDEX_AddDrive(driveLetter, path, subUnit); + } +} + +void isoDrive::Activate(void) { + UpdateMscdex(driveLetter, fileName, subUnit); +} + bool isoDrive::FileOpen(DOS_File **file, char *name, Bit32u flags) { if (flags == OPEN_WRITE) { @@ -201,7 +227,7 @@ bool isoDrive::FileOpen(DOS_File **file, char *name, Bit32u flags) file_stat.attr = DOS_ATTR_ARCHIVE | DOS_ATTR_READ_ONLY; file_stat.date = DOS_PackDate(1900 + de.dateYear, de.dateMonth, de.dateDay); file_stat.time = DOS_PackTime(de.timeHour, de.timeMin, de.timeSec); - *file = new isoFile(this, name, &file_stat, EXTENT_LOCATION(de) * ISO_FRAMESIZE, 0x202); + *file = new isoFile(this, name, &file_stat, EXTENT_LOCATION(de) * ISO_FRAMESIZE); (*file)->flags = flags; } return success; @@ -374,6 +400,14 @@ bool isoDrive::isRemovable(void) return true; } +Bits isoDrive::UnMount(void) { + if(MSCDEX_RemoveDrive(driveLetter)) { + delete this; + return 0; + } + return 2; +} + int isoDrive::GetDirIterator(const isoDirEntry* de) { int dirIterator = nextFreeDirIterator; @@ -464,8 +498,8 @@ inline bool isoDrive :: readSector(Bit8u *buffer, Bit32u sector) int isoDrive :: readDirEntry(isoDirEntry *de, Bit8u *data) { // copy data into isoDirEntry struct, data[0] = length of DirEntry - if (data[0] > sizeof(isoDirEntry)) return -1; - memcpy(de, data, data[0]); +// if (data[0] > sizeof(isoDirEntry)) return -1;//check disabled as isoDirentry is currently 258 bytes large. So it always fits + memcpy(de, data, data[0]);//Perharps care about a zero at the end. // xa not supported if (de->extAttrLength != 0) return -1; diff --git a/src/dos/drive_local.cpp b/src/dos/drive_local.cpp index bc5ea8e..b610673 100644 --- a/src/dos/drive_local.cpp +++ b/src/dos/drive_local.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drive_local.cpp,v 1.64 2006/03/13 19:58:09 qbix79 Exp $ */ +/* $Id: drive_local.cpp,v 1.74 2007/01/09 17:44:20 c2woody Exp $ */ #include #include @@ -33,17 +33,18 @@ class localFile : public DOS_File { public: - localFile(const char* name, FILE * handle,Bit16u devinfo); + localFile(const char* name, FILE * handle); bool Read(Bit8u * data,Bit16u * size); bool Write(Bit8u * data,Bit16u * size); bool Seek(Bit32u * pos,Bit32u type); bool Close(); Bit16u GetInformation(void); bool UpdateDateTimeFromHost(void); + void FlagReadOnlyMedium(void); private: FILE * fhandle; + bool read_only_medium; enum { NONE,READ,WRITE } last_action; - Bit16u info; }; @@ -72,13 +73,13 @@ bool localDrive::FileCreate(DOS_File * * file,char * name,Bit16u attributes) { if(!existing_file) dirCache.AddEntry(newname, true); /* Make the 16 bit device information */ - *file=new localFile(name,hand,0x202); + *file=new localFile(name,hand); return true; }; bool localDrive::FileOpen(DOS_File * * file,char * name,Bit32u flags) { - char * type; + const char* type; switch (flags &3) { case OPEN_READ:type="rb"; break; case OPEN_WRITE:type="rb+"; break; @@ -107,14 +108,14 @@ bool localDrive::FileOpen(DOS_File * * file,char * name,Bit32u flags) { } return false; } - - *file=new localFile(name,hand,0x202); + + *file=new localFile(name,hand); (*file)->flags=flags; //for the inheritance flag and maybe check for others. // (*file)->SetFileName(newname); return true; }; -FILE * localDrive::GetSystemFilePtr(char * name, char * type) { +FILE * localDrive::GetSystemFilePtr(char const * const name, char const * const type) { char newname[CROSS_LEN]; strcpy(newname,basedir); @@ -125,7 +126,7 @@ FILE * localDrive::GetSystemFilePtr(char * name, char * type) { return fopen(newname,type); } -bool localDrive::GetSystemFilename(char *sysName, char *dosName) { +bool localDrive::GetSystemFilename(char *sysName, char const * const dosName) { strcpy(sysName, basedir); strcat(sysName, dosName); @@ -135,17 +136,47 @@ bool localDrive::GetSystemFilename(char *sysName, char *dosName) { } bool localDrive::FileUnlink(char * name) { + char newname[CROSS_LEN]; strcpy(newname,basedir); strcat(newname,name); CROSS_FILENAME(newname); - if (!unlink(dirCache.GetExpandName(newname))) { + char *fullname = dirCache.GetExpandName(newname); + if (unlink(fullname)) { + //Unlink failed for some reason try finding it. + struct stat buffer; + if(stat(fullname,&buffer)) return false; // File not found. + + FILE* file_writable = fopen(fullname,"rb+"); + if(!file_writable) return false; //No acces ? ERROR MESSAGE NOT SET. FIXME ? + fclose(file_writable); + + //File exists and can technically be deleted, nevertheless it failed. + //This means that the file is probably open by some process. + //See if We have it open. + bool found_file = false; + for(Bitu i = 0;i < DOS_FILES;i++){ + if(Files[i] && Files[i]->IsName(name)) { + Bitu max = DOS_FILES; + while(Files[i]->IsOpen() && max--) { + Files[i]->Close(); + if (Files[i]->RemoveRef()<=0) break; + } + found_file=true; + } + } + if(!found_file) return false; + if (!unlink(fullname)) { + dirCache.DeleteEntry(newname); + return true; + } + return false; + } else { dirCache.DeleteEntry(newname); return true; - }; + } return false; -}; - +} bool localDrive::FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst) { @@ -173,23 +204,31 @@ bool localDrive::FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst) { Bit8u sAttr; dta.GetSearchParams(sAttr,tempDir); - if (sAttr == DOS_ATTR_VOLUME) { - if ( strcmp(dirCache.GetLabel(), "") == 0 ) { -// LOG(LOG_DOSMISC,LOG_ERROR)("DRIVELABEL REQUESTED: none present, returned NOLABEL"); -// dta.SetResult("NO_LABEL",0,0,0,DOS_ATTR_VOLUME); -// return true; - DOS_SetError(DOSERR_NO_MORE_FILES); - return false; - } - dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME); - return true; - } else if ((sAttr & DOS_ATTR_VOLUME) && (*_dir == 0) && !fcb_findfirst) { - //should check for a valid leading directory instead of 0 - //exists==true if the volume label matches the searchmask and the path is valid - if (WildFileCmp(dirCache.GetLabel(),tempDir)) { + if (this->isRemote() && this->isRemovable()) { + // cdroms behave a bit different than regular drives + if (sAttr == DOS_ATTR_VOLUME) { dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME); return true; } + } else { + if (sAttr == DOS_ATTR_VOLUME) { + if ( strcmp(dirCache.GetLabel(), "") == 0 ) { +// LOG(LOG_DOSMISC,LOG_ERROR)("DRIVELABEL REQUESTED: none present, returned NOLABEL"); +// dta.SetResult("NO_LABEL",0,0,0,DOS_ATTR_VOLUME); +// return true; + DOS_SetError(DOSERR_NO_MORE_FILES); + return false; + } + dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME); + return true; + } else if ((sAttr & DOS_ATTR_VOLUME) && (*_dir == 0) && !fcb_findfirst) { + //should check for a valid leading directory instead of 0 + //exists==true if the volume label matches the searchmask and the path is valid + if (WildFileCmp(dirCache.GetLabel(),tempDir)) { + dta.SetResult(dirCache.GetLabel(),0,0,0,DOS_ATTR_VOLUME); + return true; + } + } } return FindNext(dta); } @@ -382,6 +421,11 @@ bool localDrive::isRemovable(void) { return false; } +Bits localDrive::UnMount(void) { + delete this; + return 0; +} + localDrive::localDrive(const char * startdir,Bit16u _bytes_sector,Bit8u _sectors_cluster,Bit16u _total_clusters,Bit16u _free_clusters,Bit8u _mediaid) { strcpy(basedir,startdir); sprintf(info,"local directory %s",startdir); @@ -450,7 +494,7 @@ bool localFile::Seek(Bit32u * pos,Bit32u type) { bool localFile::Close() { // only close if one reference left if (refCtr==1) { - fclose(fhandle); + if(fhandle) fclose(fhandle); fhandle = 0; open = false; }; @@ -458,13 +502,12 @@ bool localFile::Close() { } Bit16u localFile::GetInformation(void) { - return info; + return read_only_medium?0x40:0; } -localFile::localFile(const char* _name, FILE * handle,Bit16u devinfo) { +localFile::localFile(const char* _name, FILE * handle) { fhandle=handle; - info=devinfo; struct stat temp_stat; fstat(fileno(handle),&temp_stat); struct tm * ltime; @@ -477,12 +520,17 @@ localFile::localFile(const char* _name, FILE * handle,Bit16u devinfo) { size=(Bit32u)temp_stat.st_size; attr=DOS_ATTR_ARCHIVE; last_action=NONE; + read_only_medium=false; open=true; name=0; SetName(_name); } +void localFile::FlagReadOnlyMedium(void) { + read_only_medium = true; +} + bool localFile::UpdateDateTimeFromHost(void) { if(!open) return false; struct stat temp_stat; @@ -502,6 +550,7 @@ bool localFile::UpdateDateTimeFromHost(void) { // CDROM DRIVE // ******************************************** +int MSCDEX_RemoveDrive(char driveLetter); int MSCDEX_AddDrive(char driveLetter, const char* physicalPath, Bit8u& subUnit); bool MSCDEX_HasMediaChanged(Bit8u subUnit); bool MSCDEX_GetVolumeName(Bit8u subUnit, char* name); @@ -512,7 +561,9 @@ cdromDrive::cdromDrive(const char driveLetter, const char * startdir,Bit16u _byt { // Init mscdex error = MSCDEX_AddDrive(driveLetter,startdir,subUnit); - strcpy(info,"CDRom."); + strcpy(info, "CDRom "); + strcat(info, startdir); + this->driveLetter = driveLetter; // Get Volume Label char name[32]; if (MSCDEX_GetVolumeName(subUnit,name)) dirCache.SetLabel(name); @@ -520,13 +571,15 @@ cdromDrive::cdromDrive(const char driveLetter, const char * startdir,Bit16u _byt bool cdromDrive::FileOpen(DOS_File * * file,char * name,Bit32u flags) { - if (flags==OPEN_READWRITE) { - flags = OPEN_READ; - } else if (flags==OPEN_WRITE) { + if ((flags&3)==OPEN_READWRITE) { + flags &= ~OPEN_READWRITE; + } else if ((flags&3)==OPEN_WRITE) { DOS_SetError(DOSERR_ACCESS_DENIED); return false; } - return localDrive::FileOpen(file,name,flags); + bool retcode = localDrive::FileOpen(file,name,flags); + if(retcode) (dynamic_cast(*file))->FlagReadOnlyMedium(); + return retcode; }; bool cdromDrive::FileCreate(DOS_File * * file,char * name,Bit16u attributes) @@ -597,3 +650,11 @@ bool cdromDrive::isRemote(void) { bool cdromDrive::isRemovable(void) { return true; } + +Bits cdromDrive::UnMount(void) { + if(MSCDEX_RemoveDrive(driveLetter)) { + delete this; + return 0; + } + return 2; +} diff --git a/src/dos/drive_virtual.cpp b/src/dos/drive_virtual.cpp index ae1e786..628201d 100644 --- a/src/dos/drive_virtual.cpp +++ b/src/dos/drive_virtual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,6 +85,7 @@ Virtual_File::Virtual_File(Bit8u * in_data,Bit32u in_size) { file_pos=0; date=DOS_PackDate(2002,10,1); time=DOS_PackTime(12,34,56); + open=true; } bool Virtual_File::Read(Bit8u * data,Bit16u * size) { @@ -129,7 +130,7 @@ bool Virtual_File::Close(){ Bit16u Virtual_File::GetInformation(void) { - return 0; + return 0x40; // read-only drive } @@ -176,7 +177,7 @@ bool Virtual_Drive::TestDir(char * dir) { } bool Virtual_Drive::FileStat(const char* name, FileStat_Block * const stat_block){ - VFILE_Block * cur_file=first_file; + VFILE_Block * cur_file=first_file; while (cur_file) { if (strcasecmp(name,cur_file->name)==0) { stat_block->attr=DOS_ATTR_ARCHIVE; @@ -203,9 +204,14 @@ bool Virtual_Drive::FindFirst(char * _dir,DOS_DTA & dta,bool fcb_findfirst) { search_file=first_file; Bit8u attr;char pattern[DOS_NAMELENGTH_ASCII]; dta.GetSearchParams(attr,pattern); - if(attr & DOS_ATTR_VOLUME) { + if (attr == DOS_ATTR_VOLUME) { dta.SetResult("DOSBOX",0,0,0,DOS_ATTR_VOLUME); return true; + } else if ((attr & DOS_ATTR_VOLUME) && !fcb_findfirst) { + if (WildFileCmp("DOSBOX",pattern)) { + dta.SetResult("DOSBOX",0,0,0,DOS_ATTR_VOLUME); + return true; + } } return FindNext(dta); } @@ -262,3 +268,8 @@ bool Virtual_Drive::isRemote(void) { bool Virtual_Drive::isRemovable(void) { return false; } + +Bits Virtual_Drive::UnMount(void) { + return 1; +} + diff --git a/src/dos/drives.cpp b/src/dos/drives.cpp index 8b82162..fa5f50f 100644 --- a/src/dos/drives.cpp +++ b/src/dos/drives.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ #include "dosbox.h" #include "dos_system.h" #include "drives.h" +#include "mapper.h" #include "support.h" bool WildFileCmp(const char * file, const char * wild) @@ -82,3 +83,113 @@ DOS_Drive::DOS_Drive() { char * DOS_Drive::GetInfo(void) { return info; } + +// static members variables +int DriveManager::currentDrive; +DriveManager::DriveInfo DriveManager::driveInfos[26]; + +void DriveManager::AppendDisk(int drive, DOS_Drive* disk) { + driveInfos[drive].disks.push_back(disk); +} + +void DriveManager::InitializeDrive(int drive) { + currentDrive = drive; + DriveInfo& driveInfo = driveInfos[currentDrive]; + if (driveInfo.disks.size() > 0) { + driveInfo.currentDisk = 0; + DOS_Drive* disk = driveInfo.disks[driveInfo.currentDisk]; + Drives[currentDrive] = disk; + disk->Activate(); + } +} + +/* +void DriveManager::CycleDrive(bool pressed) { + if (!pressed) return; + + // do one round through all drives or stop at the next drive with multiple disks + int oldDrive = currentDrive; + do { + currentDrive = (currentDrive + 1) % DOS_DRIVES; + int numDisks = driveInfos[currentDrive].disks.size(); + if (numDisks > 1) break; + } while (currentDrive != oldDrive); +} + +void DriveManager::CycleDisk(bool pressed) { + if (!pressed) return; + + int numDisks = driveInfos[currentDrive].disks.size(); + if (numDisks > 1) { + // cycle disk + int currentDisk = driveInfos[currentDrive].currentDisk; + DOS_Drive* oldDisk = driveInfos[currentDrive].disks[currentDisk]; + currentDisk = (currentDisk + 1) % numDisks; + DOS_Drive* newDisk = driveInfos[currentDrive].disks[currentDisk]; + driveInfos[currentDrive].currentDisk = currentDisk; + + // copy working directory, acquire system resources and finally switch to next drive + strcpy(newDisk->curdir, oldDisk->curdir); + newDisk->Activate(); + Drives[currentDrive] = newDisk; + } +} +*/ + +void DriveManager::CycleAllDisks(void) { + for (int idrive=0; idrive 1) { + // cycle disk + int currentDisk = driveInfos[idrive].currentDisk; + DOS_Drive* oldDisk = driveInfos[idrive].disks[currentDisk]; + currentDisk = (currentDisk + 1) % numDisks; + DOS_Drive* newDisk = driveInfos[idrive].disks[currentDisk]; + driveInfos[idrive].currentDisk = currentDisk; + + // copy working directory, acquire system resources and finally switch to next drive + strcpy(newDisk->curdir, oldDisk->curdir); + newDisk->Activate(); + Drives[idrive] = newDisk; + LOG_MSG("Drive %c: disk %d of %d now active", 'A'+idrive, currentDisk+1, numDisks); + } + } +} + +int DriveManager::UnmountDrive(int drive) { + int result = 0; + // unmanaged drive + if (driveInfos[drive].disks.size() == 0) { + result = Drives[drive]->UnMount(); + } else { + // managed drive + int currentDisk = driveInfos[drive].currentDisk; + result = driveInfos[drive].disks[currentDisk]->UnMount(); + // only delete on success, current disk set to NULL because of UnMount + if (result == 0) { + driveInfos[drive].disks[currentDisk] = NULL; + for (int i = 0; i < (int)driveInfos[drive].disks.size(); i++) { + delete driveInfos[drive].disks[i]; + } + driveInfos[drive].disks.clear(); + } + } + + return result; +} + +void DriveManager::Init(Section* /* sec */) { + + // setup driveInfos structure + currentDrive = 0; + for(int i = 0; i < DOS_DRIVES; i++) { + driveInfos[i].currentDisk = 0; + } + +// MAPPER_AddHandler(&CycleDisk, MK_f3, MMOD1, "cycledisk", "Cycle Disk"); +// MAPPER_AddHandler(&CycleDrive, MK_f3, MMOD2, "cycledrive", "Cycle Drv"); +} + +void DRIVES_Init(Section* sec) { + DriveManager::Init(sec); +} diff --git a/src/dos/drives.h b/src/dos/drives.h index 8a3d39c..93cdc01 100644 --- a/src/dos/drives.h +++ b/src/dos/drives.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: drives.h,v 1.31 2006/02/12 13:32:30 qbix79 Exp $ */ +/* $Id: drives.h,v 1.36 2007/01/21 16:21:22 c2woody Exp $ */ #ifndef _DRIVES_H__ #define _DRIVES_H__ @@ -29,12 +29,31 @@ bool WildFileCmp(const char * file, const char * wild); +class DriveManager { +public: + static void AppendDisk(int drive, DOS_Drive* disk); + static void InitializeDrive(int drive); + static int UnmountDrive(int drive); +// static void CycleDrive(bool pressed); +// static void CycleDisk(bool pressed); + static void CycleAllDisks(void); + static void Init(Section* sec); + +private: + static struct DriveInfo { + std::vector disks; + Bit32u currentDisk; + } driveInfos[DOS_DRIVES]; + + static int currentDrive; +}; + class localDrive : public DOS_Drive { public: localDrive(const char * startdir,Bit16u _bytes_sector,Bit8u _sectors_cluster,Bit16u _total_clusters,Bit16u _free_clusters,Bit8u _mediaid); virtual bool FileOpen(DOS_File * * file,char * name,Bit32u flags); - virtual FILE *GetSystemFilePtr(char * name, char * type); - virtual bool GetSystemFilename(char *sysName, char *dosName); + virtual FILE *GetSystemFilePtr(char const * const name, char const * const type); + virtual bool GetSystemFilename(char* sysName, char const * const dosName); virtual bool FileCreate(DOS_File * * file,char * name,Bit16u attributes); virtual bool FileUnlink(char * name); virtual bool RemoveDir(char * dir); @@ -50,6 +69,7 @@ public: virtual Bit8u GetMediaByte(void); virtual bool isRemote(void); virtual bool isRemovable(void); + virtual Bits UnMount(void); private: char basedir[CROSS_LEN]; friend void DOS_Shell::CMD_SUBST(char* args); @@ -142,6 +162,7 @@ public: virtual Bit8u GetMediaByte(void); virtual bool isRemote(void); virtual bool isRemovable(void); + virtual Bits UnMount(void); public: Bit32u getAbsoluteSectFromBytePos(Bit32u startClustNum, Bit32u bytePos); Bit32u getSectorSize(void); @@ -153,6 +174,7 @@ public: bool directoryBrowse(Bit32u dirClustNumber, direntry *useEntry, Bit32s entNum); bool directoryChange(Bit32u dirClustNumber, direntry *useEntry, Bit32s entNum); imageDisk *loadedDisk; + bool created_succesfully; private: Bit32u getClusterValue(Bit32u clustNum); void setClusterValue(Bit32u clustNum, Bit32u clustValue); @@ -203,8 +225,10 @@ public: virtual void SetDir(const char* path); virtual bool isRemote(void); virtual bool isRemovable(void); + virtual Bits UnMount(void); private: Bit8u subUnit; + char driveLetter; }; #ifdef _MSC_VER @@ -257,7 +281,7 @@ struct isoDirEntry { Bit16u VolumeSeqNumberL; Bit16u VolumeSeqNumberM; Bit8u fileIdentLength; - Bit8u ident[100]; + Bit8u ident[222]; } GCC_ATTRIBUTE(packed); #ifdef _MSC_VER @@ -303,14 +327,16 @@ public: virtual void EmptyCache(void){} virtual bool isRemote(void); virtual bool isRemovable(void); + virtual Bits UnMount(void); bool readSector(Bit8u *buffer, Bit32u sector); virtual char const* GetLabel(void) {return discLabel;}; + virtual void Activate(void); private: int readDirEntry(isoDirEntry *de, Bit8u *data); bool loadImage(); bool lookupSingle(isoDirEntry *de, const char *name, Bit32u sectorStart, Bit32u length); bool lookup(isoDirEntry *de, const char *path); - + int UpdateMscdex(char driveLetter, const char* physicalPath, Bit8u& subUnit); int GetDirIterator(const isoDirEntry* de); bool GetNextDirEntry(const int dirIterator, isoDirEntry* de); void FreeDirIterator(const int dirIterator); @@ -333,7 +359,9 @@ private: isoDirEntry rootEntry; Bit8u mediaid; + char fileName[CROSS_LEN]; Bit8u subUnit; + char driveLetter; char discLabel[32]; }; @@ -359,6 +387,7 @@ public: void EmptyCache(void){} bool isRemote(void); virtual bool isRemovable(void); + virtual Bits UnMount(void); private: VFILE_Block * search_file; }; diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 9438e40..992e6b7 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dosbox.cpp,v 1.99 2006/03/28 10:17:34 qbix79 Exp $ */ +/* $Id: dosbox.cpp,v 1.115 2007/02/22 08:44:06 qbix79 Exp $ */ #include #include @@ -96,11 +96,15 @@ void DEBUG_Init(Section*); void CMOS_Init(Section*); void MSCDEX_Init(Section*); +void DRIVES_Init(Section*); +void CDROM_Image_Init(Section*); /* Dos Internal mostly */ void EMS_Init(Section*); void XMS_Init(Section*); +void DOS_KeyboardLayout_Init(Section*); + void AUTOEXEC_Init(Section*); void SHELL_Init(void); @@ -148,7 +152,7 @@ increaseticks: ticksScheduled = 0; } else { Bit32u ticksNew; - ticksNew=GetTicks(); + ticksNew=GetTicks(); ticksScheduled += ticksAdded; if (ticksNew > ticksLast) { ticksRemain = ticksNew-ticksLast; @@ -158,16 +162,37 @@ increaseticks: ticksRemain = 20; } ticksAdded = ticksRemain; - if (CPU_CycleAuto && (ticksScheduled >= 1000 || ticksDone >= 1000) ) { - /* ratio we are aiming for is around 90% usage*/ - Bits ratio = (ticksScheduled * (90*1024/100)) / ticksDone ; -// LOG_MSG("Done %d schedulded %d ratio %d cycles %d", ticksDone, ticksScheduled, ratio, CPU_CycleMax); - if (ratio <= 1024) - CPU_CycleMax = (CPU_CycleMax * ratio) / 1024; - else - CPU_CycleMax = 1 + (CPU_CycleMax >> 1) + (CPU_CycleMax * ratio) / 2048; - ticksDone = 0; - ticksScheduled = 0; + if (CPU_CycleAutoAdjust) { + if(ticksScheduled >= 250 || ticksDone >= 250 || (ticksAdded > 15 && ticksScheduled >= 5) ) { + /* ratio we are aiming for is around 90% usage*/ + Bits ratio = (ticksScheduled * (CPU_CyclePercUsed*90*1024/100/100)) / ticksDone; + Bit32s new_cmax = CPU_CycleMax; + Bit64s cproc = (Bit64s)CPU_CycleMax * (Bit64s)ticksScheduled; + if(cproc > 0) { + double ratioremoved = (double) CPU_IODelayRemoved / (double) cproc; + if(ratioremoved < 1.0) { + ratio = (Bits)((double)ratio * (1 - ratioremoved)); + if (ratio <= 1024) + new_cmax = (CPU_CycleMax * ratio) / 1024; + else + new_cmax = 1 + (CPU_CycleMax >> 1) + (CPU_CycleMax * ratio) / 2048; + } + } + + // maybe care about not going negative + if (new_cmax > 0) + CPU_CycleMax = new_cmax; + if (CPU_CycleLimit > 0) { + if (CPU_CycleMax>CPU_CycleLimit) CPU_CycleMax = CPU_CycleLimit; + } + CPU_IODelayRemoved = 0; + ticksDone = 0; + ticksScheduled = 0; + } else if (ticksAdded > 15) { + CPU_CycleMax /= 3; + if (CPU_CycleMax < 100) + CPU_CycleMax = 100; + } } } else { ticksAdded = 0; @@ -271,24 +296,31 @@ void DOSBOX_Init(void) { "frameskip -- How many frames dosbox skips before drawing one.\n" "aspect -- Do aspect correction, if your output method doesn't support scaling this can slow things down!.\n" "scaler -- Scaler used to enlarge/enhance low resolution modes.\n" - " Supported are none,normal2x,normal3x,advmame2x,advmame3x,advinterp2x,advinterp3x,tv2x,tv3x,rgb2x,rgb3x,scan2x,scan3x.\n" + " Supported are none,normal2x,normal3x,advmame2x,advmame3x,hq2x,hq3x,\n" + " 2xsai,super2xsai,supereagle,advinterp2x,advinterp3x,\n" + " tv2x,tv3x,rgb2x,rgb3x,scan2x,scan3x.\n" ); secprop=control->AddSection_prop("cpu",&CPU_Init,true);//done +#if (C_DYNAMIC_X86) + secprop->Add_string("core","auto"); +#else secprop->Add_string("core","normal"); - secprop->Add_string("cycles","3000"); +#endif + secprop->Add_string("cycles","auto"); secprop->Add_int("cycleup",500); secprop->Add_int("cycledown",20); MSG_Add("CPU_CONFIGFILE_HELP", - "core -- CPU Core used in emulation: simple,normal,full" + "core -- CPU Core used in emulation: normal,simple" #if (C_DYNAMIC_X86) - ",dynamic" + ",dynamic,auto.\n" + " auto switches from normal to dynamic if appropriate" #endif ".\n" "cycles -- Amount of instructions dosbox tries to emulate each millisecond.\n" - " Setting this higher than your machine can handle is bad!\n" - " You can also let DOSBox guess the correct value by setting it to auto.\n" - " Please note that this guessing feature is still experimental.\n" + " Setting this value too high results in sound dropouts and lags.\n" + " You can also let DOSBox guess the correct value by setting it to max.\n" + " The default setting (auto) switches to max if appropriate.\n" "cycleup -- Amount of cycles to increase/decrease with keycombo.\n" "cycledown Setting it lower than 100 will be a percentage.\n" ); @@ -391,18 +423,27 @@ void DOSBOX_Init(void) { "disney -- Enable Disney Sound Source emulation.\n" ); - secprop=control->AddSection_prop("bios",&BIOS_Init,false);//done - MSG_Add("BIOS_CONFIGFILE_HELP", - "joysticktype -- Type of joystick to emulate: none, 2axis, 4axis,\n" - " fcs (Thrustmaster) ,ch (CH Flightstick).\n" + secprop=control->AddSection_prop("joystick",&BIOS_Init,false);//done + MSG_Add("JOYSTICK_CONFIGFILE_HELP", + "joysticktype -- Type of joystick to emulate: auto (default), none,\n" + " 2axis (supports two joysticks), 4axis,\n" + " fcs (Thrustmaster), ch (CH Flightstick).\n" " none disables joystick emulation.\n" - " 2axis is the default and supports two joysticks.\n" + " auto chooses emulation depending on real joystick(s).\n" + "timed -- enable timed intervals for axis. (false is old style behaviour).\n" + "autofire -- continuously fires as long as you keep the button pressed.\n" + "swap34 -- swap the 3rd and the 4th axis. can be useful for certain joysticks.\n" + "buttonwrap -- enable button wrapping at the number of emulated buttons.\n" ); secprop->AddInitFunction(&INT10_Init); secprop->AddInitFunction(&MOUSE_Init); //Must be after int10 as it uses CurMode secprop->AddInitFunction(&JOYSTICK_Init); - secprop->Add_string("joysticktype","2axis"); + secprop->Add_string("joysticktype","auto"); + secprop->Add_bool("timed",true); + secprop->Add_bool("autofire",false); + secprop->Add_bool("swap34",false); + secprop->Add_bool("buttonwrap",true); // had to rename these to serial due to conflicts in config secprop=control->AddSection_prop("serial",&SERIAL_Init,true); @@ -412,12 +453,13 @@ void DOSBOX_Init(void) { secprop->Add_string("serial4","disabled"); MSG_Add("SERIAL_CONFIGFILE_HELP", "serial1-4 -- set type of device connected to com port.\n" - " Can be disabled, dummy, modem, directserial.\n" + " Can be disabled, dummy, modem, nullmodem, directserial.\n" " Additional parameters must be in the same line in the form of\n" - " parameter:value. Parameters for all types are irq, startbps, bytesize,\n" - " stopbits, parity (all optional).\n" - " for directserial: realport (required).\n" + " parameter:value. Parameter for all types is irq.\n" + " for directserial: realport (required), rxdelay (optional).\n" " for modem: listenport (optional).\n" + " for nullmodem: server, rxdelay, txdelay, telnet, usedtr,\n" + " transparent, port, inhsocket (all optional).\n" " Example: serial1=modem listenport:5000\n" ); @@ -428,14 +470,19 @@ void DOSBOX_Init(void) { secprop->Add_bool("xms",true); secprop->AddInitFunction(&EMS_Init,true);//done secprop->Add_bool("ems",true); - secprop->Add_string("umb","true"); + secprop->Add_bool("umb",true); + secprop->AddInitFunction(&DOS_KeyboardLayout_Init,true); + secprop->Add_string("keyboardlayout", "none"); MSG_Add("DOS_CONFIGFILE_HELP", "xms -- Enable XMS support.\n" "ems -- Enable EMS support.\n" - "umb -- Enable UMB support (false,true,max).\n" + "umb -- Enable UMB support.\n" + "keyboardlayout -- Language code of the keyboard layout (or none).\n" ); // Mscdex secprop->AddInitFunction(&MSCDEX_Init); + secprop->AddInitFunction(&DRIVES_Init); + secprop->AddInitFunction(&CDROM_Image_Init); #if C_IPX secprop=control->AddSection_prop("ipx",&IPX_Init,true); secprop->Add_bool("ipx", false); diff --git a/src/dosbox.ico b/src/dosbox.ico deleted file mode 100644 index 1602b2a621562076d0d572cc12f73a211a79ac32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 114926 zcmd?SkAIWpz4(1&D%BPUDc<33X$)bs2$q`~QZh6&X{14_(h`eeMaoR831I_TK-;bZ z4OX-!$N7t)SaR5=wy(g!?^flt>HO~NCOyaFG#=*+E2}=o=Q%$Fc7UCy&+~%iJnzpH z*mvL8>-!%(7c{?m=en=Y@1NIIO`D<>Yci&2*JwA)pQ7#J^`1SK-`}BWLwvSrQ{nyV zHJbMRwkcX|?dA6~H0?XDOws1fz5MjO+RT}S_tC30ZQ$oq zv>UhwH`KJN3ZKhcZLWN9d0c*Z%X|N>E&J9ZntS9kZE18w>wMvLZP`ywX}52GT-%UL zYv26Y|Dmn^#|zrc55K2X)~(Z;cRi&A-}_p-b=PsNF8+pgXZJp>w*8;DIjfn_X{fRjVJ?Zsof6XAWykz2Das z-}8*Ndh1?oaZ9h}zOP$b|Kuy$lC~GLK=wbin;&{qyS3{nZSAAHk3Xh$KKo z8`mW@-*3)qD<679o4x!YZT_lmEiiUg`^L(x+D#Fz`N4=*edliN#=reXE%4!a?ZM|i z($+rzui6dGd$enH4T zlJ8Zl8qiwz9n>0QecG)9C$-hNi(2z1|BqI4-vQSAnD))BqgwsjUuo{n*R(~i{Jl1N zVNkp2?k(EANGXf85jUWA|cKm>Qk&b_ck*{^kwZ-2(@-dlJuUjo{n=!8xsF?L*payHeUc`(Dy+XRXcOeOBA@ zcG<-{|fAG6n`03wr|EIOUM}N}hH9w_Q)ZU@F!p~~;|NURI z(67&EH?4k1TekJMws1pQtGOq|wFBCUPyQ3U{Yb0%)~njWJ05^u7qo`0PiXBg{h!*( z&o65Cg4cVV{e!lW&sY8ZAGHN5quK`65W~*t@=HD}<-EjB!!R?S1fk!tz`?}`vuhZ7?zJBwM zwGQ5|_|Aald-Drz@x~#|Z2P|E-*!xkvF@AxE~mBc`-QghgA3Y{*fDLvx*urYdiF=m zzeijB?Z>olJ@X@;_wfEP?SW@sMK<;z2S3u4WCYGtNE-G{{7Z7uL9R&+D4x5 z1jaleq0geV zPic2VpVn5zdboGLc7N(O@b_cdO?U0qR{Z~cw3Y7J)AiJz_C0FU*LQVw)wj!|yr{3= z!zcA!dw3{(Sh%38tF*MMR6VNe+SQ{x@S#kwr?iXD+V|A&+0*{A{I73s=UuzZ#^6CN zWAJvk&_Wb2Dxucq$ zncCay_dHeq@>BLUsNd%PFMh@JrLr`6X0p5U&^`}T%gv# zSKICU2+(qudM4H@A)U*?-~8~MDnURKKM!dhkhtuo~8fDBnCKQc|>xvPFO)e88H zD_ULuX?Q%Wp5=Sg3%gwb*Uk#$AItFYRUY{*gGuc5ZilDcZf8C6iCp3K)OV>R+Y30f zcNx3|*$NWA>Q2eGnba-wcnm|nA=4U$r(Iy>YMJUhI0IkIrm$vr)Z1mvOe7a^OPQ7{ z6@ug&p0tNcz`V>ZgUk6f*T`GJmfQxAWCG!XdTwXf^npg`zo)gaHTB=z9=pTg@TJ`z z2QNM8G}p%zlX8CC&t%lp3=2sp_=k_`bZ#r$*+ugqQym8*` z_IR03pidiS+U-ai4t{O8f!b>TxXfXsJ$ARD=8}m_`J8J&RK5J(unT;Kn@b$r6ga_z z(1m-u`SExRw-7GvNIQJ2Ug*OWK;I75kW+S+HVXngAL?2QA- z84)f3FqzNJcfF(M7vQVyYdu8#) zaLO=~qdwoTnarophd>__c|7^y(Ii*89lYTdf;WfaTF}etkfZ`Tsf*JdxlDM;lQz?Q zjXB&NBM+jDNHSsgyoN9DfV;UN>w({7a3>MOdb;h6F>JyQW&(Bq zKYRj@;I{M9H#%$^cKD(`ug~EdHC?9Z%ct`p!v{@aC7BbMhG_Nzc(6av zz!g3tj|_t6v`6GDZ-`Jbxsmn-c<1){Afx~*+-bmq5P)C8Wg;fLlqcRmAcL>L0pJDR zgFOuom%?+YsOgI6@7PM)DsPFF0{@=YuH+}S##Z}77M~+O>TtP)zdXihXgCmnPJGLd zH{6`LLZfM=l$7xKQuXP)+X#hxMqt<%$d4MMD0{mR$@@%K)aCLG2h3PEP0{C+cg9JFEyh7 z_{lqMt-gnBhLQB-N4?yF+nO$5NJ8L50-%sEBb9&%h8ILQjI`+rd42UP%@-JkK3?xI z3p7y~Y2UCfA27_}K*DB=#h4}#@VMasJgKszy7|x@CSRPX`LLnfq!`F^<(w7gh ze)-hr3Jm#>g1j#s2)MYE7akZB0>F7(;6XvPLt+OjLJLCedZZ&=kIakiwx1tHI!x1* zOa{C~2CeH<@y|M!k7J%gZf2 zc~jI9Tww$PBHgSI#RV_g4No8?3$de$K}p)^S+d;+8i~jv(+};re{sarlfD! zNMvEERJ3|DF^oC^m%|_w6@V&1PE$TdfHm^@a0n?3a2M$3O}86)Gc8mc_Id3{xX%=x zG#nuxav+k9u=;%G%_NYb;@oh9Fx4m*3!c!MOb+Xfg6TkVXt%ws@%Hb=V|Bq0@YfFj zhTZngLv4-rEtO_IYU+WcE0r>#Ys#!P1L?Ha6$~Z=J~3F{>I8F`e2SLzCJcDq;f|QG zQK;h+NoDn3uLA)H_^Pv}E8sHo5fBesy4_yXWIlx?1{_@LNCxs~2XoXhjK+zKrbB@g zq!8KjMN*)_ZU^RMz+}Er7tF&zL`>Z`D&l@VxcCl8UD5+7AOu#krfoLiPgf88c@EWL#M8r%5Ldj|y0NShd%uw9s z(o>Gm=xBb}kz3%f~T!dIP6N5*zyE~K!z(lS< z!UL&Y`E1tAGkrESeBN{+ccFyK^tuw~;ZB(bSrQEr@fqk_mjMAnW&o`h3RDj#d6)M_ zjDTM9SbJmZEw@+)t(Ma*?Uu$B^{ocNI%;uL-a61~e{4&}6)|0@>WC{;?TUwO+zAY) ze34`%8;{1~kz_Iv$wT2ZG6ptumn~?*8EAM60Mg^mC-w7j9VYL$SZvicmuZXZu52Xf z3V0o0O!N1SU zC(Wd8i`#U4lO=0bgZp8x!)KbXe$0l&$$L}Dq#n!ruvCT_s*dXc7trFDZ*JzvbrAHpgRw@oL@X8qxK9%3;QBNnO_ip@_rbO4>3* zVT;8QwguyY7M~ss>Mj?s!)HEU#Iz+-v8W!?lcr&b+q`<*X0b7{u4E`1O+{mTpy!h# z;gNXI7S&zBa5x^-^=hzfgn$!@CF?eUsz3}nr?nAV}Yn1LOo<%HnZC0vRNN$YfJOt0JI(xXvVFasXk?rbnvZKSw0|6LA` zX-1RSb~BJwuVcYP!j*Let#MnVB-3Kn+2WO!F!(b<(WDuP$MiFLIHp_bSY+7NuP5BT zNC?Rf;VkMpNZM+~f_2<1g6u_HuB~P?V(Q^|T(7IP=p!vjeZ(4%Mw2Yg8crsX$yhd< z4L}9k$Y>;K>L^-Mua4UiUd(7d8?H99uB-`(0=k(^>XB^3^2ROh)~;LL*ljgV@6KAS zA^RZoA85~}(iWRNIA{+3puWvGeM=^uFpX%PB_6lcWo%yVB!C3gTB^b3t&sgi~V);lYqT6ECdc4k- zG`$g&mB$eYxWrW0)`Tt4H?}5rMvv-IZvftN*(@1r#-eY^Ff9&AG8?vyST^al5gQU^ z>Zk+5j7TVvb|glEsZp0+J!%W^xzxW zOi9u{L&1+Xr(#aRgVj6)5OqKEliG?WUt zVD&&Cg#N(1`cN;nXbhQ-=`J1ctYI($9ATR+oY)$Ry&F3ddnRTJ*PV&SgLT!hHJfxj zX^REp$@7RV@CR*c^6y8YTVwA>*2F$WL~Piipv@YL#w$04MgD@C&EA8oe)62Koo}QA=e& zx0oLBe_Bhi-qF!yK4A43x4#f=w4eTNiO{~JB_1xR92&~>XTmmpByX#O@xqXyuG(g^ z1oc1)K}aUdBqqXD9Y+;pZP9ofdl3M7nn=X*I?Nn1hmn~` z#8sVzxnkAkd2C0FVT;${V8SFxToYqBDwaQq60wF+Hlmtz>ri-T2nHCuCEV4Ry~Scp z1WUqUOUYokGVZHK|Ltk@;9X{Q`>18eoqEGs^4-BkyY0KX>s-lT5cRD`lTk}c*fkUg z>cL72&QUU&j|2$QFlnwxGMY>p$s|VChp9siMWb0Plnq^s>O>CLB-TK68TZ}y^=)7O z`tv8ASo6DZY%98o%U!-ygt#f?ioP3N^YrJRKmO+Dx83&jeP7G9kH7iqtI@4`Bpk*M zM+*tWx|vLwVudWWkvd2m3)oCEN z-1LIg@Wbv7Z|o!4e#lalFSRYlR*9MY2*t_8x0Nx5qE?* zfOPj)_G6P`5q(5YMR0BPC`dLF@gY4MbpSbXfxrjN6bfS~V~JYNBw||=kKcA1T5H(VDyV*xoyriw?C@58oW>G3y#y>QjzPw?vNHxscnk+iur>cWhf@vxq?z;fAW z)|GO2e8{_wWesHYkfG!%)VT^qMU{FiKaH{J_@IQsVROF0n*M zEJidQ?Xm)YTUWiO-Z$zBgn~Yw;_6#&Z}jZON2<%T#9i@B#$vHnTH;|~&-9mM(1H30 z8X?{fVqkb&)l>qH-xG=@t7E}X2!7zKF%8LsJ+w zUyA>S|5Kk&+kJMAYsjltzLBwIN0)A| zB<4tL4J3WutSuM>>v3!4rf9e%=8f4b`p0iV@m~PaO*aAjO*g>`zkcHLci;aw(_d+^ zh5ON?;eKl-xMt1gpa1#^g(0~N;C~^C;N5qFdNh)4smsPI!FM)j3)-@7N8P59pe^PY zjiR}eBBzi(*wT^-V=99!8Cy1}kD7WmG-}56NO16tWLsm&8)4lHmRR-k)}SLD^_pRy z_&+PU2D)%7ZDH?Fwh}{gx-wYVAHU^=wywx`-!P2;DHoh^w-NJ(&}P-aWOcmS7LQfO zT;@>17>XK>d?XcdWl@7RJa_b>?!qn3+6Lj1{u0Z_i6@@^#cdDV&3NGTd+)vLoA-Qr z_1dLRKW(WylNq$ct=2d=u$>7eUj6!}pZ)Ch2OfCf_1Euu@2+ot@2ab>(Uw2{e)M;B z=$(EYhd+&?t0p4#;+oY3lWDwYk0UnZ7!8XZint=akb`JhVkaX>PRXItWgesdG0#BT zmXc9@BoMB&j@VAeE6tLA>_Xl>g#TY!>T#H8k!aN7!&LX{mfig&x8KrQntI{8FTC*B zpa1;Wt+(F#=Ra>LJnWXSWjF7(@ZrsWzWLTITW;OGWy{Ss-^$Bdw^Z_5es0}z^PlDS zw{H2}uYd9DU)&8?!2Z4O-2+(rc0DK8%WrSxYyABA=9{<7n8B5D*}dvAu%zu;Fvv}~ z`>i)~kKIhWyK)P+<5o9sVGRska=~s^!!Jwtf9sY%v!dO6jm7ZspZTt*wXMV&)Gg6e zP%O?MUKW}>n)G;)|2>i`CJ7S^m?JtIS<>Hf`x`^n-M6>4Mk-@wOeZVGf3jn^mjRo@ zm%y!&WB@83<7d-d#KXiF$w(}QDC9BaZ-OYgDd1^V58Qhf;D7YdHP>jXHZr)ZFx2zqsSBUTcVroDJP*h+)KE*h{GdK$-W4k>qxETf z-sLqdBW7I~$JB-)*KI~#{QuJWl#$1o#<&3Sk2hPL~f#L zQQuq7{{+@Y?hD{An6+`i>f);XRmH^({%wAL@r2*GZ5x-}IA#9b_lkbFX5T(-`K+%N zY~1+MpB63ShRe7eH$A&}@!4g|WCeV<`0QqRIJ>!MaYeDy-@rr-tiZpmue|)|rK7#Q z%}2{moji4_xw*MZx7*2(;6ad*$%IQXgRnW_NgyKrUssopOfx~V8LTd;L?iWE>Tr&d zrz0nuPd1-AS$^^)bI4P9?X)Agn#swU+!&8eXD&DHcaD$e{JDwohHVYow)GVI8yXtM zoi*TTvSzGe!td`{)HiqGjRorO)3l|_7c5vXYgXCnvY!2*3#?5{fQN>%zDIuY=zM`+ z^xjgDky#67EvPynNXpgZa${p-H8n?$9PvAyPXAa%1*@2>DVm%tnk+iIxMG5T6%{%D z9hp|!bgH@hXfrEk)$+f$G|=vF5n*R_vJQAj!NIUCJe{+4E zvi~bLaiV+C+=ahUMAdffT@LIrRxc`Bw5X?HqL>MC4GkxH7R`PBhAH#cJ#g1OpI*at z3!YoBckhzDOS-FixPt$TZ4F1dyAK{b*wejZTW&D~0QSkr#gj#wmlc7Y9Nbm`_)Seh zu6fO;jyCu9o@$;qZ|c0(WGOkuKr&Mz(OftaFUe$D^l03X&a4pl^*~oLDK322RuYVt zv_wX@E>L2?@r)(~K6pHNvZ=On>JC6X(XfBpHrC!Ft7|Cs=lo7Z7bkcqZWxC)K)<+% zk@KG@0|D^#T5aib3U&qm>eXey4`?}OMR9Rex8nZ!>s}Y~?^>{T!IJ0pKDXpK;IG=h ze_M}$&&(&f4|ex-Z`*dzzZfBqJE#Y64dILUH{rhm{=D8^gcl}g?rrXEbx{9uc-zge zk;;x(OX3;KT_9W%acAKFfzoW=jwd@B%w*!H2U|{;Y>L}#b?qhYlMG=X9t4f^ns?R; z2lP0LAv>JDt)T}l;1vuE+=w7D=r68VwsP^x%`1^vm>>smi~0b6pSE<>fdf}CP`0QH z*kC3lL?_DTE`Hy z-k(4M{2k>@<+9qTQ>S)J?VUFdG&BRhyOo-sK}O1~hW59Yl(djs3irE=7UBPaq{AJG zMkNUosI#>6XENcTu+3g+SKuqynQ!VmbU93LM?`o||ALPY@sPN9?E zkF0`$Jr zaDQQR1OG9<6Ag=wRU!`573da74+40B5GXWEOrVaob#yk>Hk~{Lt2C)y9EZ`Q1@uD>4RcYRq;73@{)bWTkA z{o^Rv+=Sc=?Z0_5D(0-%1CfA=+&Bx$9c=ErSlfxTBKRH9AAW^*Po3%oetT&>2GH%Z z=7-{$cx+P=M?M)yTN)dwl}CM;MvoD;WQGP?p2=9x_(&S1XVi=QpK4~NnKPLTOCYKM zC2-*&ikr2dik-P}wC?!0qQ5*SeV{b^F@Yal(E|s}ee12IOLw9Dfb6>KuD|~J7hl|7 zRt5s9s;YVbALX}h-2)H2chA-PR`L56U%cbR>+a}Y-Cd>htFS(I~5~DMO*Q&{M5XTnKL`)%~JrJYHsrkkgV?VcqB>>-nX-(Cf2+|HT(CBVct^5Ab6kMEB2s0Of!6zNOdQamR~l ztlkg#1%+Z@0A`i(Bfm5f-PaQql+h!l= z^7uUF2nl+^ZPOOC=q03a1b)%~QG8iKTA~ZxlCklVwNa^<(FO3pd#d@QXg?GQlOtci zj}nCKbHzsl!fnop33!1e$RbhJ*o7TCy3y1D!S37+}LJ5TM3&*S+{b)!||= zfamiQ;J>@T{Tt-B0{`mO-TQlrov_)svjQL|@pS-w<>IqNxL=cq04i1-F@D4SyPN0K z!k-9eIsTexzp)r>G_+pqQ+a<+9$HQ>XUwAO5F(hH9nD;kA&%k68LML)Jhr95ASV z(W!La5buy|STJrWv1A6Vq})vN9ecU*9&tsfmdH7!8 zA%~SJKz~pW04Az10-^-_Lv4{ZfIm;H76Zb`)6r9{FAogRY2b)EywQj+Ks}BaKd(nohbvalgXVE~?4wq+AIY7P zmT)DR42RcI+0}8O_d*AnbebrWj;R;Gf_PO^doN6d2hahKMXYj-e*&&7Dq6XDa#B8! zcxVD`Ah>aY2eEN*I=~_TNWg&&8-RZmcqrRWaBzcw|DAhreU|Q8r37R_)v;r_`-?#) znjbI2Io?n)p)9J{L2M5{eC)>tzyvkj7l0lECGv{7pNH3W*>#cUlcz-fOS=rWE#(?I zT|y#nFsvt|HgCN8=@vF@;4}LKYzxq`^3{dVatHJWwS@02C}042TQ>{i;>VxBrFw z4=C_=;UeK9bywa0r9UUU&p@ryR-tC1Wv@3kN{rc%|EhOrlkMQ4x@ULIa=Wzew`@j5>dEulY@Td%nf_I#`@PY=~%I11M~qhP_-H}fD#ln0Pq6;+TV!j1AOs(U<*{k@&_M0c8rJ;gYP7{AcRN9 zPFCRT67q`vtEqwUxlawQ|Jj4Rnxeyp{;O|mE47cNlV-F!6QsHw)Hj9nY|OB?VE+ZL<@nPDO(NzW6SMR3 zBhg^(v~H|h4^YDI{CAEE8pefokgcEukz282M0r&`tINvZfC2)RuV4SlzH0>j2kupl z->MA<_CB|FZ&`Ow)qXLY0=LM{L5VV*6*X`a*$0t%wEi+lf?x;^UO3v@0sN?WSX5Y5 z0)JWWRFrhVB(~Y9@p;H`yL|ylGJ_QHEas+=XP^}OSK8{+X~WQsfJ?UxwpefgqtR!m zrp>6w$|)C+FhGQhIm>r8mG3OT4<>3m=gbiVND`-@sdA$D#!v|p6KJUhe-A)_9QcFC zt$2Uc;i^StkB9`I=~k`!?6c`>Ke}Pcd+(9#-M4DPhFP=m`d4>%WB4SblTwz^hG7ot?F;6Z&`6lf)i%1Y+@i zO4fQL6V-#KTS|lC|Jl394TMcs-AMoGmXb;`puxdp1o)epE;W<=V$$YQ%!iF?jb3> z_Q?&aW)U5Kg-?89KT)yzht$iYB1Spldx5*6hR_Q~7@IheJF?>$VLp{6K4UJ!4=ZOkrO z$Jy7!5+R3LN%J7>yc(AXlON1tA9Of%NkTL{Gh7n2Ml!ajtY%p-zk)y) zFN*w2%V5H^4<#wJ5#p58;RCr075{Y6#+S9x>l>v!lBpYPK|tcjf9V{=2M)lv5=Wr` zl!@gDahuvvz%Mtd?VLtd67W&?0G*o{gHlev*a1)?)(c9>Gfdzw-v1!*Z{Iha@yaVt zJ~@5*zP0>~(#Pk(aylfV4swXa>v|5XPz z5b{)sArYh$Q2Y;@!}Sv^P>i=SUy=~yzZ%2>$NU7tePjeh?BV=hUaQ7y zue~;V_38&71bjgo9Khqs&Hq85TZnR1q6_L{{RII>rlI+TCB@knHx0@Q`Gq{<48x*I zTZ@JEx4m3Sm#aMzNYS^pDY%K|9KD4;Nw@1075}3g6T?0lCCu!Ijm8NhZaGt(m{B^u zZ5r^apc-t-%^2K6-9_+#h>6rG4j_}Qq#Qh;sB&a(1Z1GW^${jeZ;&+t@D04Qpiu0L zx9kpv<8+}$@~Ii6MMYzM$j?QwtO}MFnbLB3Dep>#gU1^OGB{{%GHmzZBrr*uH)BVIe;pByz6A358cv<0Pz>XGDR4 z*E5!b`b|>d68-~XqBEW)NhjdTqF@8D(n5Wl5a4GcOuaocBE5P2Ee^VKECHKg84>=+ z0Hy;;x0jyJV3gpee|OjxOL%-Ux+t+t_SGK0c=6(;Q@s~@d*_i+S6YT!NFXHdcqJ$x z7`V_)z*Zr-@j~Q}ky4>w17RwWjHvF4iJ}k3Pjr*+{>cqD+;A1}UwZ}oJIl709X_$Y z7&SSzc%|gEHlM}ef#{Qy6QT_9s6{3~A>d1n_re8Y(q2h)PMbEZ;{rMF4w4;2XGe+H zjw;QM?E7;Q!vC$(((ewNBiV#*anxm!6hIU1Pz(MKsUiI0L?mjV02J@HWlj(F$7yVO zr;9ja@z}KEh`>cDs41_y@TlZK@!Ic2E@TJ-B=IQ}SB?Nm3So9S8yZxi=8sr0Dl`-R zD(XRGyr#T&)zu$ONBLdBzy}Zh+m}E6Df~`FQ!Q_*l zAnutq6Zj=cpEj+K_6G~SlB@5WbG%Oi(_GujB)Pi+UeAb6r@cRJWGpm|#S#u5^k;(_ zUDLFON5cu*?vj#dc+eJ4h9XI!|Kg$=|BmCp-vmy3e-D_@8i3(`l@*#PzOf8`QCr)* z!^sMz3Ltpkwb(n;-7*@!3lkfW8)oY>u zU&aOyaF~=I+ymnY2N3R#QA{V)Rcs)OnVh7=S8&D%_W*P%c^NbSKa!O=dg>I3YJxUG z)H$7fV>RMPjkmQA46uVN;C59;f)1Niw?>0eI_Z)+{og-lkA>{939wZq6mHQI@xgf9 zNNx?y=yKw}3mK<%iWLBIp}v4G;|qS8li$R2f}diVFd96lqQOpK zxH&r)3Bwn(fLH-1>F{DA?l?=Wa2$iX z4gQyHckDPBF+(Y<9=NzuilxSTLd6`kyJO?C+-s>Wt}qryT_*4H^iv zAYcxWw4%R2t#BZ0a1!PdGeEqpG6GFI5P5|*(F1U^*m6k^_{o7$=D!R+>CUUJQ4s*J z%UBNvNPd;AUR~8d$rGTF8*t`y){Iw-IbnTrjAyr9C_mME3E)ZgkeL;+FMu!XPjZe- zz|l+PO~+ALJ8GzuR^(8>+ur`U^f<6>ED)`BWh+O5M87m0S7(Q0{~MmMgKai0I?we? zGTtw}p6tkSzhf6FAdSG_>^olYg$V}=PLP0JU|Z=k99AR0gd7PK8{VO~j> zh`2P=@Bd2puUh-$`fJy(f9a(H_>iA`=<>3%5B49sU)%_mF3OAlWO|mZT)C2x&yfqK zM9W?1RVHsHiP_%^`8%cwE_gfh0-_He&Y5#@(O8Y#dO|#})}ONx8vD;CP9!}^hklBl zX|}nU|ou{@+SCx|tL0~8A=&4==X*#KQ^ zfno<(qlxlEdHIEdxB;xXFfbv@D*ng^6He)bAlW}<3c3&KKe=j^=)PY9In;jz@b_+b zP8i_uiDP&Q+_Ml+V8B+c6zVTNG7Yg;lqLh;t9TH%2M6HtU^Qa)fdAr-F|u$IP=bK8 zg8at-yJ0-u(QL?-9U}Ur^`2cUT_Ym@Y~}ShXbyC_`roLewZ1Mh*k6|!aXnND`@sQt zB;&cU;zhL*42TRAKrW~NTrL4$-f(NthqbjAc8IIGSa84#^!OivKbKQ}kE(Qihc=IE zrf=8)^sl{Ew*9luK3o6FQlx*wf#>!v*)Ad=W`Ncp?u+k7wv(wQC%1Ko*dyJiKmtMs z1#tbu3%Nw-hwWF9h)}6%7N7kGDNl+C}$Vz_eLLadM61U?!Z5hetfFmKBYA z*f6LEyfoH%y)LSs@!+PgD^FMXI|I&f6~(~?H3;zz;Q;J_$|)*t|AO1X03!a%6%>Kk z$?wZ|NCptrQR&(mNnAReCl>W7%}=2d@IRV9Yr}@w8(w>jl=xd4HmrXI?LS-UezOj2 zSG^%8a2<#Q$t-{f?ms@ZqnwZj(^_RSRCqbQ=vv*Pm3sof#iLvKNQ3CG0# z*LSh6*pZ;qE9~<`Tyfyf8j}Cr!|ug^H0x zv*VIv6UF_J8=l-L0xxnfkCz25xcs}OOFPDDzm8?I#a56Y=y4uNBM> zI9JX-`R($Z;9rTN^7^DMBRng<$2jog|KsD=r-#{9?Da%4HeW=~=z2Jip#Immhuxx) z6m9$twqlgjS*(Nct%G42EoTfYQ!RJ2*^zccA}O+7&Ic&41rI`Yma|hnz$D1Z0~1GuqZU!?ys&^#+=SQvt}?ij;=lS0Kr1=b9=ui*7k=e!HU5BLWJQW74A4_6&7 zlQhtJ+N1dF0EzL#|NhTE`eRXU<>tkb1450gJlH|XO;xv4l3Q-d4+HL#(L5EOpd8iL zd8r$51NdA81{5w3`v1JEU3P}BIiDyu8r;O@L2O;tmi+|!qyJC|p%mLk(Es7Oe#+nR zp&{}gcwDO6f+AB*1ykk54qoaM8=!jZMDd`8q|2t@7(oEhgc2MOf9x15n#6BmIMIAi zU)(;Lz+wKiugsQQ_w3oTj}?FU<^A_RST>z>*pq?)*nbrmIK2PLc2!%Z+UawGX);5!&_XQ3Q{?9(zs$(2k3?lu$95la4_@-O@CeQeVe1!r^FDl>8R zlfwV?>=7pc>ZOO=MxS}OztY-2NHes1MyX&P1x_AX1Q)s6S08*{?$6O3(?jv6p+}|q0GpDAcpZ=(T!0FomvCSFPw_xeedRlVU7{|D!l}HI znB3Mw{+9z~d?tI_QvtesTB!eIqU=_T(f{3U)H~R;O8JL9MU~Y)n&fB%PQ}un4A5DM z;jJJcNkf~Hz=Q~#K9f1Z1N25nVpupp79*r+?jZLhiBeq9URqFhpuA9^75=imh0p&4 zuNUwsbgfn3i?Uz6-$_jCY@jv{0tym<04Omy{NVlfQwUSZZb|e)bAewtO>sSPC;TUR zw*b7D{W+KD&Qzuo_1`0|-?l}Ic67J3x5{}f>`Zr%0XySh_ny@nW#gr3h5x_7Q6-!& zV7k0{AB~X#OEgj)%g4O$lwxxw4pYvYWVX>|IsZWrpn`#u(jEf)vmRNJtco8ZFen3V zC_MDlR1{4VI~$Pw8>P&tn1A2;+1Jg!?z-zXZWJpo2HIIH-4W1#{iP6MevVR;3;k~AT|x*-f8Mu=b4D(au=mTpYRMFT&4P`qu&qV7cp@qaLK z6u-Un(x-yHaQ_*$is;Ev6aT0E8**#_s?id3vH!smKV3o;6b$+vD#icE@t;5p6pWM9 zoe;eO0>Jg3NW9@nxyb42lpGkA!8=as* zX8Myaty+a#fEqPcul}IB=gZs#RSuFpR3L=27)Tu1E}ponVmlth>!F(a(|*fo>N>&pNAuk-+Cez3vXVvDiMDcE0UbHyU2`=J4l zFL?~g5t5OSydz^-k-q~!fP8o%`OA`60g3=kAfE^uDEOOcNSlTiBHeG|_7>Xvmd?Hc z{@?%01TG>vqJrcGNP2~M;57liaKVdZ-DT9miiP@2isu8!3dtSQrjqIr0g$^fq%Rfl zn-BWOF?i5R$TZ<(;n=_*IVXU>3-WVxP`e}P$^>t>gilw7Q~4nA|B5}(-|ms!^K6KU zdS#n=EaBtajfYzOPNu_{j7^9bNGKvD$g!Fu7mgpN&vf3@OP53)3pXMM1$mTkOkQ{N zvStv_KyP!OBz#nR-`eR1u7LmGu`h`WB(d=!H66){zw!#%;Msp+k2}iBsDpQi$1Sd& zm=)F3hx4oaUQxaZ2QxdsPVI5ZaL6YPAFhgWe1&%_CI|x>fu9a2IfRF8E4pb(>VuX# z4$Tn%uj^YJq+tvvvXcKRsSEe_4ciF;+D~>ih}X;Rk6DzsXU*Dp{e#8#|1$|e+`F^OCX2|7paO6L zURu9lmgolQ0^HdBK^5KnvWr2GOQ0i(E;4-`)Fb82_&s8K3;M6)hzfT>f$+e%YRs9$ zheB+DpYu^1oECH5!zS)*HBA5^-SAbX$p3Zym&fk&rV_)Upix~Jr2~paNZD`s+g8VcMhnmRltMZ1xfB6P7@nsDtS_a+M zIj7?wc^8#Gywk^pDKm*Ib0&;OHum_XJZ!2h&4r#Q}X}c@{j=Y*u80& zLl1j{=@MHslV>;IL#-n40KQmqvYY>7^WXlMytG8(7)8>;WJQk>i4%b-dncJ_6@*K# zltP8VKWZqHzozo<1M79LgN7YHpKTc3FNi-?O3jO7TB@WRl2k5X(oJ|A+vsh)trnNA;f5 zmP5%{q7ae)`g%?Yk-cLHn}VO{*B0<8|A+9OQ@KK}Azxe%Sq3XB4Lwdf#BbXOU-97y zpq<4NPGq0Z+U{?z}8^pVi6bESkYd&O^Qb=J;=KRDp^q-E?jt&Cw zgHARR{<1h+;mhLr*9h2oXv(^WpZ(sabhfjf2ihy>_U}I-`#PLt2vvJS4*gGpVBx2b ze~I)!E@7VtmmWHV0u;+9D)tZa=KTSq3-$R(H8`PzaYm=ne?)r>;VzCuh0{5P*cVYa z6|E&5;){WQU;zFfmLsifI=xQO7E4?XS{j1>oE2vGrIQ?Xl(r0pt=3Ju+5F{;rEY#3 z@7xJf<;0zUyJXiJi)L?=I0LYTWJO5`DOJo0$;17x2tWop{%~&2{P_>V*1IliKBWNm z7qk0Kd@I6pe1Hk=ga&*B_%#K+!hpbkj&{33qC=TeJfT9O<0M^Z1+S;T{9^NRv|o_# zN1q~E;;sqsKmPHLH#e?B|D*qWX2Qh=ah=mGINKs`WQXzppW=YTdbc}}XLqZ$Kd!g* zSBB#*TRimJHdIs2>6E>8!u2&o^r!=oD3L2sj1`oIC`U*{23cm#oA(#_SBMaVd~pc) z*R7qtLDabnmE<`F`vd(rT~c5d9Q#R-&>}9Ie-><?nGhv}2|*~@Of4FG81G$%k#}nYyrzd}oOLzj8(-r`-jR4LS2APV>_m8%H4F|5dP?6<@MQj2;LOd1BKk zIQVf9D#j0Uj5!xwlE8UeXsQ{~)7Z&{NBa-WFOHG$Q2$_M3+LI`!cm$&9ppc{h>h!gb^-vbw2WT+9AxSplb_rbsdt{mYlmfBW*-{SPiWH098tN5R^;rawrQ zS1KI%7)Ss(5NCrD2wjaZfBBAa;e8Px(I%q!k$s+(EgV<-gjspx&&B!ox$U80Pf`x; zNO9tcP8PVH{ZD&Ju?yy~kJKP1M{LRrR$A1VGTwJup^}tysYhc(l_$sx1}Q-tfW`P0 z3=mN81Exwz4&{u3>LpZBG(&LbokW9uaqiF|Y?%}XmEQADfIvYX9)_5cilPr`Y0VYi zUtGL@(K)UJ{+&C|?G%ju37A!h53ZsKLp-i|^CaS>$b-gbN}yN&fgATvXwQRWPI$4+ zU*l|~|C8+xhA-;kyeMM)K}x)tP;^B0f3$b8HIj3b0(tiN2RZPE%>lYClQ-TW{^9%5 zzT;Oqm3nNhW`eGSLVX?t6x7SXOUG$4lrCH$x-fo6p+E(pgc)}JkCRQ%9|Uyv^;Df8 z=XpYCg{=mA(#u*j`5`U^DohgPeONTyo^ywGej&*&$*C#@C`AvpqfqxH=2UjSb_caN zdMNdA|Du@)zM>blR%sDZEy{ed)oK$&|mcAl#}grmx?SF$?j>j`*(tQssPI)E`ru82x&Q)lhYo#Ycwp8OwE|MVx6J zj-F2>75#|~9caH`lJ39^hlj-38EY*G#vW=@hDj{H@G4!$)M40x2MSaaNJ1QKxN;em zvAY*HKyp4*U?mIQL4znc3N^%EyON}=om1Ne-V4kiD!4> z+==8Dg1&;whlQ26Pr1G@f2}Gsi=G2i5vqb5s6-{qBzz&s&xYa&;-4;$$pL$Y4;7De z2W&%}gh0!iUHpGK139gco$=Maq$LXbSAVR(%0XTawc(u$b%Z#}79*o-l|prb;6g{5 z97I4u#JS@Vj?g8#^A8kCsSPX3wi^+Bsc}IUQTf8`G7Hc)^!Ud`T1k3fS}<8dS6^0k6b+R5%r+@V#`ILHupqoJpV*O9Q*( zm2OgbTUmDF&*}eT2P_5PR4{9`1)_1o5>6zl1CswKZ8uV>q{U^SE7Iz-4u&&pUQL{N z_tj4tt4^FaA-u&d-4iF+#HHBmnBUKTvbx3W`{5XZ0z0fECq|!~l<3gVz$(6n(9kOiG8tfgt%G z{J*Yt!oRGABaW*3D?@d4;c(se*F5q0o1Zi;DpP~)tA!UQ*wflwRwjE|PgI>iDHKgi zQlk>uEnYd+0r=(QgCH2)8A9(XeF*{yTgb6x;GnQ$00uyN!TnB{Ok6DFXb1ba#AIOY z1ZToC%I{DXwL35QPry7UPPrxL&s{{z3BQ((QL zqq-FhNDsKdafLx|>T>@d@Q>I=LM}^*Zha;gUbFRyH=p=A+}L+{%w_LpA3yS_#@xO| z>|H%Un?Alljeq>Z8vmrfTR1=^1ZYE3FkB%akn}3GrE>VFw?5SV`1moD);3Yx(kwqo zeY>{&((k3hExjyPP#}JJP;MYK13d(t zqE{6{CMO$T?vew->p88K7I$k>&s0M1ti^30{}TNe$tb5()Anqk{~q)>{jCqds|L?p$zCR)v#YF+slv{cZ=x{2j^+N_1fzH_Ha*3v6Grt zKk*J<<QXzCot5&W@To9bB?kwf7E~)?#R_|Ad%e4>%SZ)=IVzIlKQ_gJ zkpzbu6aUq7HcH;@&`0$Y2bPAPNxb^`({JAQvzvbQ#0q+JFOMlVsDD$gyuSeyy!FUj zZYldUh=XvHYyS4flhar~DKT1eFK?ZNjipBtno2u5ZcS6I1cd9>Jvw(T%)~|j#YugK z)~%Z(9}pFYlc}V{A9CU7`PBX&{$7B= zhDS?v9jy_T!QXxVX-=z?bJ*m>vTyz`g9FUIcaIuZahTWDkBAPy5Rk?z_^^@}7dv=~ zCTwwrMQjUzi1x>Mf%XFY!_PkZ!*wtb<3`5(XPo;tpX1Ift(epPdp1e``Q@X0B+#o{w8?f+*tZp@8kXvDIZRHPw)cZK( zG3sEGGy4EA1J$lkseiQcrzH%I4IXl_{fF=$-JbfB5ZhKP#(cOnLZ+KLh~}gM#@} z=FB;F@=t%l+N~Ym&aa(}RK(hahKR=M?xJua^K>f4scTfNNi6`!pQ`k7QhwW*9 zfmrQWku$88Y8w3tYdOyAnrr&{%2s!CNDWS{B(rlB&S|pgQp&^gFk&b|kRV1teAh=M z7xpl~3;1_))SVI~ktWW(0|N-b{3(zAD_1rv$63BFjzsTK3HOg5pGF3)lA=HHs-qr>4F3BRGcebZf*6XyBwpjtR-rxM9T%kKCyMx@f9m% zXAGx=r$#J8R!e0|W&iKqefo*pZjwETQjva%)|7p0R#LU8m#&riwA5%fZdg^o!oGcT z%c{z-J*b*LPAF%juxSQgM&J-a62dDNR?hel&Ik4ffL@@!B22^LU?M{Ot;gFVcuXQw7AQtKtEfiizadJpM6+QyEu_7C7;xv+?D(a9Xt|>5>td}=v!7EA-x0gfQP$SK~($6g&z2evqi_z9xCE%-`lDl7LCjq>A%|3Wj zI8zuCUX@ey_H8fYn7I|`zj}v5CadF(V=RkAo5F+lSNMgm1(`ZM-hp z|8Ds6uW#D7zEFeQu&br3z&;&Jb8CNDz(%BjTp6Xm2eob<{_aoE__k;^+l+ ztL=6RhX6)7|AN*yj^SpQX_VlIrp25{L_AE~hZfu^;9q8bIqG3O zWe^3mRCx0aM`c@d_JxNt zo2>m-tL}X>;r(RAgS4*5=6uk$TzD*RL&{2;w#|qLyl;dpaHIl1i(!PCpZUbw;CXRJ`g_fgkywJzEt2b!v}R zF^H~OUDhWOwj3?Can@H~p%^5NB_$#0C`nFACL2T81og$~`Sw511tG29%V%w*!o`vS z{mPgxB$L*^*-9(SnlV221Mb~q- zPFZ&kmRJs0*gp3+OSS1x2i~~;`dMFfmEKg!pJp@gd-)R?K{`N&F7rS6AGUvbIYyjQ zvHNutU`ff~U?vuMb&a)AP9~GHDfazRZPC5+PP9J!Uq!&Ze?R_L-y=(>FI|3MW8u8E z?KqqCoB%#)S587LE+C+`_8f*!z?T)X=j*_Wg#++_uu$c>@!XA%f(PN)S+FtZ!|`y( zp>rqyP~LR$;_*udrI2}cB{`-E32B`Q{u|_k=(S6)bd#yHRF51dC;f)o-}=o$dWl%u zbuTjAi!c7F^li3zdO`vIu8Av}<*@xECm|=L{k8FHD-|HT*`|J7Z{pURn?)jDZb>G){UFUV4=XL)0o{K1f zA^YnTN$3Cq1{W=%mVhu3k`GrCo@1a?sHAvs7BIovmY(`skq=(jf{9>=oQS*(wvrt*9e<%i+ z{Dw*uxGuaEf6b0APW%6B*-AFRC8*fBi!S)ww>6Mu%YJhR7LZep(|{aw6A2DpB+>V+ zFT(w91{jJ{(OohAqq7YCM0+5glYwqFcfAyuqQHm-_RkV(NuC_Vi>*2sC8W%r(6tXh z#d{#1sRSsIi;4;U3h6s07Qi_8^y`;ju8q5NrtZY`(-(h=o{tCWWy|jCYxG$KZ^H6f zX8p;H@>i)0PT0wE>9DWSpifJ~DIZvPkLbs?{Q0&=sL|nC^alD5{8Rb6OeyD&1neoW zUKH6o@64FE%#G_aUUN+#K5oco{SCky9J>XDNq!IHA3gf^U1+&W-~RPo+5wl{jQyi2 zkXDgQ(>*K{rr{otR325HBGODy2zyk7cRq>@h+9hZJ%T~es1 zYwp~ob4kjafxB}0*lun1VGtK z>({gSkN(5kFTYF{Dc6l}9~J#~qind_Tvv9_yXxkfZ(qm368MMdWa20ZkqXdjufh5y zUwGTxnOiV=NGIDebKr`D-RB zghRrD_L)w}ZEf?&?BZIygLS|VhIDzNg;_Ow?L|iR8%xbVJEJpD@WglDBrv#S+S?z< z(K$;(@@^etZrV0icFV2v9@uj8(Y0_I7C%;>N#y_qn{XTc58$*&rGrb9DF*%Su0!hV zP@#$OgBUvt`YEYkY2g0nvT^8dQ0Ca6iBKOkpz8mE{8Ph4a=~L(v*-k=e<}wPH(0Cx z*;#nc>$5KZV^)o$Fl(>%U%!6SotxI3zm7|;Cv7v0xoxh=YNB=x?htep;Sr)6Xe-ix zKYjNXfA+IK{Zpwv{!qYY>*uY%cNXMx#KkLg9`2q?-<vz$T=c-s2Oc2C z1q-41weuAvgm{AH9c25Vfw^!ZgB8W0b06`q4W!ZI091YL&6gQSF*5GfUnNMj^*_D3 zlNNm0LZ{sq_BCj|MU0!ySjvAUG0IOWP&7bjv;hFj$Z(=oOcY=7EEFuO_@8~G0zH;( z{rXGfXWalU^;(Kr5W{D2)YcAgCtwrekpri3>T?og4%S?8$G<-mzhsl_4551(1vu++bC5knzia@OqJs@U zz>tu>O!WsZ`(pce{-+l9RzB`MItwqK92^Rh66d`1%}1ps%)=%xHJXOKy;APW2}-*W z&?V-t;?00dPv;B78v&zF%rt5C@FV^($Y=FcUXHMJvkh6BpLTYF0MQxn+uijKL_~_PcD6feTkEOt&*(Rfk>Jk z@j!P2%rl97Tktn*SVv?}&iCmj-Uki?aWw0)FLLNp3ZSX*p~MH>|MJ^J^q2zN14Q^Q zy$kwp{+7W1Z<@UHTB2x z4f#4{aR3mO^p=@wR!s$HHbUb!3OqddJosOYgk{#B!0=!*6&|6PLJ_xM#+L}79d2kW zlq3=TjOf;LRj>E-g$zj|j$z@0btk~=*}3Q|O!{w#0oWWf*0B6scq;+>`N8Gp%zIAT zQtkoH&rb5%ehvAGh?~TIW#g^ z7gH>2b0T2uDljvs5=^4NG=-ZsykzkE4OYl(7U0D|*7RG=$cHc!QOBSZe%!Y^a~ z$3w?LDY}JG7N7H4&Tya-&j0f_q5tx;wEb_o57(D_QM1JM?ij@m9i2$<1zqE=zm6dn zFJF!bBAx|*D6q|fQU5jK+- zUC8nqFuV=>_Dz&(V~xe-q%|nC1#2Pl7z8uZu?)CfC6BwTf7#9d0d;q{am3;;Jk$b5Pa-t?AOBC%Pm8_+y|Qe_$@nba z;asD*`WJ@&%TDco;gd0_ogh>wd#3{(|60ce&@5iZ&_c1{%#zJE6ZyZ7u&B;~3cll} z{aB04g{`?L@p|;=+pNC<)mF8jq5mxS-<@r&P0qmc*Z_+OvFdrC!Qox(BIOR!b?Nz- zyJ#50`l>I&UdA8vT@;qwOH7^y#K+FaCeRZ zT?;rvp4OtqjRpryU4HLfFJFpNoWPigbi@CI1`PeA$;;YaDva2xt^y1KW@7!NQwemN z{jR(L^L+NdIfcsLfqFRu-Tp#tS`6b@`^FX^HU1U-ruHGm@pqhl>Hq$~NRv){b=rai zb5PE0HYyrwL$4 zHK89kg6QwAHNb4^3_iZ`#rdwW&R%pEp8>%@GuF)S@9p0@mnwNwv#)ib*zcW%@yn_!)nQ!zp#bg{|FixSLP`O!fhmK9*^zwo zS5Yz_MLwDY*nwnOLf=yPhV|uC$5dtZ+U7A5GZc}pGx5avRDZ$cK%fKjMMtcxO&w4% zep>z=qd7*?4%dM`_4>fa^;CU!_^%tM>6iX9_=G#R%v7L#thm)?v1clST*uf>-EXbyIgdDBNB zAG2DsfaNLvgZxcM{g0_PY=|S=)K;6pJihzT?n8&Vx)y@*)axIV{u`t*ZI0SEnr4oW z>L~f|A3PQS79vA~)S|~nLq$&}MJv)9Wd9iE#v*w`8tK9<3~3W_N6|05zk_Qpd5{4> zKg#w(xo(zEWxYB~4ho6Ks+{dQpFy5Q^$S+Sco+c*fNzH&C*E<%0L&{Q^Q>NPt~5nL#LkqiST&xX?cp1aTt@?<{}ko#hu_tkx;yuXYgs zBFDWm5E@AphJuL_7=QoD{t^CDH9$8;;-8M?tC!0(xJ|G2asEO7>-hih)1O!93+25W z14msc%ptGC749nSnT%RD&X_|Oz8qKpCZ_g)q(PijKf3n`wlx7Y-Gz%koCV2ei}5i4 zmFMK@|GW9SQ`Uyg^~;y9T@0gju$edp2~tmThm9vZ1@V=PCaFBCi;T?Is^jp}_3g!L znLG-t`R9e;9{_(CqR`hLuF^4<^G~1b-?a9B=U|QA)uDhjJX`|)(-#cV0>w&l{z11H z`v>|ZwRK&L{M$g5?nD)?sIdD7m-BGdbdS5D4t2;tH76FThNh1#IRBDacmK>7k<8*$ zL;dGIr?Q3*pnsCizRbY~uKo8#cedR}sSgHTtqlvO$JJ#$&RxRwr{Gn-jXK&J<&XgKHr$Fz{Qlk$4bN-FBS|o?2 ztY|9bcrz_)IBega$y(44b0fGB{~D22cV=v zDQJ>@Ov?~+&Q*?z%$>G*EIDs(?+B8Lkka69aXKJTk^SEu?1^b#rh1Ha|wi%c<>8@K}#nm`E z#;CwEqOP0u7yqkki@9(@5(5RJ5vetXjoPv4A|-oBHcPG%L?MQB0ruZ4&OgfYxJ$zS z&41AG?^{p&Y}`&zxY2C5+pqW)B#)hTr^)ig^)>^cDli#EfP|vAl!+yJAd7*n8dvCu z$}xocapd2=4f|aAN1a=|6({!-1DGJ#Fzx0;uKy=>tWc#YA`@&l1N2bM)icF#~P4{KsU<2Ed%^>O!Re7$KwD z1i(1yY+J;mnE_4=TUdG}z@a1cp`t|P;I~|{>{rA&+1aDJG5*p1I@tqiAl`2@Bwal z;2W1+cKfD%5G@o2QI9B~XdXb3dwwADO;It(=^`Ety@i!08AUE|*EUpc9Tz<=+Pk;L z@PCIxH0AbqvNQxPfQ2?9{0kDpI#aP)W_UPQY8>|Xa%HDjDLT%99?t(C`@i0J1dP7* z^AIcwf1sB3F$nyu@-uE5x3^X<>*yj862VVSKe2kj#mN8vttU=7_GCrl|6=|B;cbc; zPhD@{CGq#ICzQ&;;e|ipy6P&jp)R|9(gwsHhal`<>Ax;qN@7fN*pcYPU5sIlaZUhc z!#)f?d@~EW4yx&j5+jKR>Ws6sJqZMOtGANd?3BU(k7j9;U3KMuD&9t1XC zdZcFZ#RC3c^q=ehbN$~s0VvM0L0##_GceS-;gfCbyO}c|ct8&Dt}&doTzIXXp)f|d z`jBSmZ!?Do9Dwu4fy4w*TDQ4gzUv~_OYXXfCd<*NNbp$~UB=rcS(|KSCIB_K0Fzqn z!gSVC08rj?Ghdv{IC_$@j&00@(O1aLiq!hI_jhkiar_St7R%ngAaTG9y`c^NcWwn6 ziuTd1XeyI;8m&@@E_uEh_Mg#zhJO6NngRJ`4gHz}&OU69%fK@GyL0Bb^gq6mlKzRa zRVjESAG=N}6OMe(ar$op;Y4mUOyIK~CDoHl8SQ)_M0S~yLw*K0l0XvN^@T*42#WjcU?Un#Tt86o*@w0Y(I z6$8lpG#ZGuHFJ@C5`VuX4~~pm^`#^MK;%y&Z_%W?BK{TGF!sOVJH)ria4?rC;Kz=G ze%EO|nZ3W>lu0Z8$94OrXP5z{{F@!%TAhC)S%Kd{eN=E32sx5Xf^SZS37oHlQ1SpT zfAG_nkmJMwC?6OM^(Q@55MF#Vw6+Vafa(85{+FMASCt4ofqbQkj{r!(ww@yY!RUWu zx}pDF8;v@Veam+*TZUCA*~kaL!3HgD8uV)eKtJq{UmN1- ze{&fEkTR#E2EyVlqCX}`B=*N~g*a2GPc^tZnu2y_V73`Pg4iDNOngw;<~ns?p{?cK@M6!izH>0%U&TlxowM{MEWclL)! z4j*ZyqjgWpS0V(GIQ+`}ji;X4J74l0{V)HYG&1q;3oqnM_2lR%JV?7zP(9fF=d6cz zE}=K0pC$ONJkfOp_z$lV#9KDPDCsM$LWjvk%1NkSWgCGrgCRT*o%`88liI49< z^6|drj`xkz?FW~$I9k2Qn$Vvr%AckMM!2sSp!Zw4=;T^OJE8nH@K2fndK}XO*t;3< zM`!adD*jupuFscxmqn%o05Iy61$Zv|Y=-9FxSS;X&zUEy^MVUdJo`ou&ZZS9)*ofj zq_K0n<&C0!L!tqA+IhjPTek2{=8GcWTsW=_@Bi#)KSP}xY&5q__~>1~CKY@m(b2a~ zG68`3l354#!fYfUyIX-r;z>JiU4){zgzOV(I@ORX2FBC2#TTjbucV?Q zA<>@z=CKfsQSwawV`qxE&`1W{JDP(89V<8x{Q6&0|IkPNKi0jW|KW4rc;j5&kpCpV zsbL+zI*VMcPn@GDG?y@vCUoov?rzk8qo@|>?6aSxl8Fq)qgvu^+sH>TUJd!?c8YF! zY`GL5B}VvPOb0ZqKE{hg#X>|sDu3$I@$6TV{(~z3ztbf@QcqRlZd-tqU;;J)qew3` za^c;iSZ+$lQRcw|3X*R5=?mn)Q1MX9dy0Addz1lYnkAe5S6IdDjb@`TJUna-_+R-W)rzKXq zR2oMA^^zCSS*zRNVw5sIU(o0I#SQOXcl8TDyFe@(XUA+jfqjU8&%rUbAU( zqm%%(`~p`0*Mx=M{CgRRE}A)=3^0K3yx{ZZ==o`)4rCteoGGY`c@!r-I17d6W|9yD zGPdztW0>%X^q*e9&yuxpA15GhwcN0Qe-ZuN&dq(EsHZH{9~I>wfy; z*XF~bI{z#G&0T*q6Uh}qG6c>F&NyeTk}Du*H=cQ+L$C*CPXaL?;YTSSv>Wne<{d@c zohAMk`8an-A1C8i8KH*tP1FMN`7M_m#BX2936ZHYB_x^vsy`-mu)Baup^XkRU?i%$ zS(JuRm(jvpwH*puanw>Kshi zBlWV^<862y@BjF(U%mReKUM(@p%i2N;J8Q4C;{&2N4EX^6MyujKQxZ^o92mn!d{%V zgjI)EaP*lKfCHlWRI6w9uCo6TfhNi6ETv;WKJQGxwsSs7^P?~QT^$RahNe-(eKaRdSi$0PNkMs6U4^llx9FG~ZeD;j7o(@&cs^oLO#adt|5Ui{f6NoBDY^PhB)uB@uJynJ%S@FD@n> z0MirWhqffoyVW1lbh)@doO8&4z3Zp}K{)Hw-9)LFfP39UqWa`T&VAh@t98${waMaA~#U4E&GhZn@j;35kH;nB0y*%txe4(;0)zaxX__iy*@ zZ=2j#Rlv(LDj5RIzurN9=EjpweCILsLs+0Q*jm6tMq?A5NNm#{@P25hzZ4E6Hu+(qQ=4-}~|o zugzeWJvj>fy}hwG{a$bZdI)|~{s0tA)v7E0(K{Hg6|8JJVwDGcG=Olv{E zUA2Wkk}lcU+N}vf~ z3JkH5%cO9jy!B4AdtLM9>Ad$SP3AD3@C}>L;CLx5s2a~w2le6eE4mJ@?HcRo*nR%) zLlbwKL?PzSOrbuZ?R6{VrE^i4H3r5(tT##hYdRiFyYSZlemK?eu<$=Rfrg3F``f}b zS`P+;<*z57`|5QhD(ad!J_E|lzF;RY8BMbZFY1fyWy9G7>=eML=DRszwevu85^5MTf1*S|K`#VRw$aF%6@x#@V3g)v|*n5mU_--uCk z?RrZ)pNtmy^o0K)`iXFjli`{{{Bp_dk8aw1XxZ-H;xA&=$EN`D&;Nj>m*6*ZC)zay z!hJGfGL_PhEW|$g@WU1RF}4IP{r>+PUG_sDlv$lEJK;yD*9>TSXU_cX#6xJLv9bNs zzd|GKk8nC-*X`1tBVa%DS%Cuh@3Mcv{;fv~GzDoiHXjZKeK%BIVFsp9{{VXnja~`= zyO)u3w~RyfvfaP=&2J7ZTd4yVXC6f)Chl9X_N2-7H-B(vkzgwK)P{KLOv}&ao%m>7Rrf2 z=!v1(y3lFVTkd93??QTglQE30}Ab!Y-; zNyoK&A0A)jJ>rELCHZYP9;tnDx2dnk8pt;#e@i&As^k%+r^G%pc;RE}QqPVXr=46! za7^ie#(<&Kr(ggGbD6ZN4&Yz3d&akq=1=!fhTz#Zf+!1P2zB`+PSum^I>x$yW943B zijKYyUO4NmB_AE_7@hvZC!YkbNU;Oqp9=p2@V}^S5%;QXrVx%YNKZJe{y%E}l(L7c zLb8$Blf(Oc#5YhroVa0CPZv^sbQv5(09sYSb=W|uMJOD7Xd;+vxqYp-RLryXie9lu|pkt0sIfvgIXLggQwYmeemX6 zWJ;;aiv$d&(DNJD5*Q=R+IWSod|%UmrTX{*6DH%C`d9DtfO} z^HnGTiqHttlK)?6VQCvci~z}Ro2h-tKNZdde-U2w;zY1B$YBlhou!{4Da zRA?Z~L0oS7blm(Dd#O;9_wgw(N>A%}=?Wsfe8;$_(HMaf99hvMPrWu<3)Mkd3$Fc9 zZ7_xEHsChAi@p*}80yn(0ZC9HjEaq1`sq7}4A{sPP=_WBkas1;vRqmo+`xz``HSg8 zN6rBBE62OjA8H}uJQZKDp=N(}w5a@F(js8~INguzMxU1sSb$$2!9W84O2l!2tHJb| zdC;0SH>)>EnT;-9k@^9c;{OlvVs}mC7NqktvrH;k zQU{+gc};xMicJIt#5JHUJ^M{pi9(NKdU?q+7e z^zM*w2LG1&SK(h}Z7Y|-0q9i|+`dA(QdRzcXP_FZM&n@qmIlh@2K4t4B8%qtb_+m{ zTn+<+DnUz3YjjM{famDU$1hcoVgTTloD>YIk9Dj*T!Wp!2WRm# zhZqB=CS}XmQDIk~ZWE)WnY-9@%Yj{>}R7Eg72DIUoib8HE zVJGhBVxC<28pkAd7kNnB6Z%PV4g>)IrM;C^^+iCyuz`C~{Rf$$t-;Vxyj}+z#ghXX zHENgXkR4goZ9L9|v4N3csr0VlkKx}Ft}Y)`CAj1>Vz=1cs4eK`(r4L#l84xGZ!I}{ z*BC8{kQAKa^qzGvagJ2F_t8AsWw-t3shMo z5Ng8s?dq5S*dMns_ceEBfv^!2IXC!su`Kv^BZJ{cEn6bK0Rn3LB(B!-LhjS2F7<RN z1}(eg>;)6vf1foWqnpK|j9Z)5ED%3ZbRQvp<@;oJ)8qH3VIQe(*;<(TFX3O&8)_&} zu7*Gs4d`CXt1@rDj0- zWR6HC_1Us{KjDZ5sPJG&%Pi&gBL`e^>q2pA-L$52jPa zLL?dn|03tfdc5UEqw>pc@_4Ab)0?`Gm>a)`{O>r}LHPlP@GB<>|CCl3VppL(N#!#E z0=|UvOy*E$lDQ5 z5De5vtDaW>FT$UGe_*5#sfMkA!zE9>)y#yGiRx#%$>4&URC9E#=9RB^Tzg^^;&~VE zcZ}oT>Zl`Ktpyj^2JuLR|3(84-6D#89sp7xND+@$1|g6=AcrVCO)pseOy4PftMVbX zTF0(Q)1GDLb4vt?A^g-Qod%3lg#p+B^my!mXM{rt^(Yi@Y6Y#w_{a|KLcx;%2L3Ho zp8ie>zv~%n09xDyokXMr{x$W_y`9Mvq2an^M@pL;!NZMGq2&+w!G9L<FeVN(7YmM8UPfAoE zx0duS?Frf&3tU_+4##)ZDf-1*h!q6NT{46~Al?MQ2jza9u)k~66iTxZFo#|Ptq@r) z{O|6q-5hgTPBC0+7J#|(S!D|xM8!YRf1RX5kr5lV6MaD^cRl%mCA%{C%N}sBs9;=M(dR!LrnM08oAh z)+vzcSXQ!Mv0jY)=kyZ*_`@^c0scHlo!3CHoH6x}aZdl~%y1)P1vh)0V9@eZ0(Lkc z{BKiuV#;n@TaV?3&6M6ll!GA0NxX8$5mdl_n&lrqs*X!5`EKbB{wTx~m@p7pIOvUw zo^MWF1QYa9v!U$)4ZycxIonSG5e8TiQ#XvC49&evBNkFo!Jk|pU z&5TlNU#RVT2>%iLr@glpx9yP<{*A^S`dpCcUN!yC=zdV60WR^+REfs7j@NMlk&+eo zWw#^|tgbzU4v-pnk1{;fHcqDj1VJ8-rHH5Fl7FoK_!1fJH?P?OXV1Clu6yqJ0YE>3 zeEEsFn8*Neqx|-UI(@bR54O)i6wLD1QSk{5Vo}Bpx%rr$X%Ik>`jcT6&sH~ zOM-y>;s&J|%KyNSz&-runWv4aFGPo(Cie`f}24pvuXHBa>eLI^y`Wh z7{Y>vdVW%u>__c+b?wqP0ZS46Ff95n-rq~{9|53}Cs%EjoW82ZV?|2fpK>blCtIzk zMM-4C*-Z6oBWMAHp9TN=1bM9Qb6ge9CFp|MO%nX0YmVdUGM5}3oK=DBW0d2nirs0f z9;xU#XKzv#3B(KWhRaZCKDmHDLg_J={Putsee#n(x(7wDR(L{V)1TQS`rR{?ObWyN zI!@?>jBv#UGMIu)!HO=%sgc6*oKE*MY-~1F390`FISzx(!GfL1WpagVu3=RjPaQ8H z_Fp_Ucntgt8iUxLW*rX@=(zaD0>9j`gIK!sFx*c`QwL}NQOH+WKO^IqB4?eB zdnhEGbqx=&_V6mFzB$t-5v!&&3wS2Q>w)+=1*au=BE>yaQ_Y3fULZhjJy~;q@+4*kh5$Y>gHR90%NPJn7+W1Pr9<@7|Hkhh z0st=(PBrWnJ{}tdQ1vMPEmX_W_{}O5JQf_m`g;%iNDUVK9h@flf2h_@&@~YwRvoa6 zugfeAo?5d*#hc@XAAGOLcyrF2NrY+%OFyXeSEBXfxJ01*n3&H}IhBpy9>4NV6AN;A zVH>UBcaOcMbgnM9(LGbGGqffF#|pCm(dO~Y3%g8P;Pw?==sYftmuS5SV+Z+f&eZh( zmHZ2&GDC$(hBLn%4RZE(Z~|sTKZUWOw3R3na+?QoWnW_e1Q3K|dR04ZDMU86(L3Qy zO@R7eiF^~}ksYqJr+`)d9_eM+l7N-O*0d#?CYs)NRLPrEg$IbzDt5*-`98PE<5szp z-4gBPiV2^>Z6cv%-){0*fVrdv5R^i{o(Md!gn@eoGSgw6sNTzJ041wW962;;d;W;DjTx56w2{0I)bT6Jl}Cv`S4wfYq6FTy8{j~>Vv zNC!+zNo&fdR(wIR3&n4y?p$gRfY=Oeo9?`V>Su~uXOC_=$v!6p%5C2Q4otkSi$};y zhHGIOQov-&(E$r{Uyf08@MG+}ow$ zvWr=SL)jNRJkVDv9vPg{j`Ty9ileS&N2xFSgwb8cg}>`gfOe))OE3VOV5E|kNHPmA z?WQh{Ca>Wj-7#YxYpih0A{yP&=@wA2r_VJLKy1nU!X(gvfU{`55eG;;+WW zw3*jED@_af`Lm|giZB)3y$@8dAkqX7rheZSUG&ykIh0^o(7M^Yc!ki}6UO`BMVsMD zI+GblSS4?qcF(OynDqz$^;oTH7Xq}#2zqk(e{FBM5RE`Txy)2tGllFZdSG75IbD)p zd2PBdz%lyS?8Y+({gOyfFXrd-y8T^@9r;UF5`5DuY4v$0)YIf^yqe(Y3vb;-`_CDV z11Pm}w?K=?;gvmqLH|R4su0gxk>Lhe?!nET;AUS${a;xB-exFTuxfVQQ^qLv zC2*6`4mrEGom>kJ*CaHP(9W?6KNX-(EWXL>a|5(S(J8_y%E!4<0{YFj)*0&=`wNc; zEXf3{Tzsb>*(N_iD$#g0<;s;ncTD{4%Eupnb@Adm*&ZZws_;!IJ2TIpq43o~RuOFA zH;Jeid2eQzjRv0)Bt-ZcVTcOQ3|w^kv|XG84uVUJ9)xyG_bcBs{lD>Yb|%xQK-zJN zwkP2&d!pm{&v9D6)<}i{7|1F&f)oHZ=zv*R)!%^>!Pb@5C!d`@&}->_DL+3;%yJvq zXPhzGi~0^x>;|oGT(JwE0WP^~I^Y`&=;=TF)$YZ2f~NIzaCyjYS3V6Xbp}ldEG5vi z;0`rFQ%(mHKp>cmLaP79@CphXS?yoV#@9p4L>u|fTpL-)+#nz&1g7o63wG^)=hVjY z-+OQLn(y2}|5HCPo}oaonWp`NV{!WTR2xmzzu_CED>h}p%}5FJ7xxbeut7XHI%R7I z3r8`}Y&@T1PofA-^G`!Q5w16JQ;TeOR7MaXj>H3U_pZYr$Ipl8kN|lfS-ea|E2LDA zn;HT(IQ-I1GMS74~^avqci8Ebo>LcI;J1*mgd6@hvnaR_Ou&! z$@au-z6Mtxu1&eM=x}t&r%g@?)wF8*t&$RUKdA#sW!ON*_KzMM$A3}Mn&^LghrA)Q z9Kz)QIyjW_6tmBeFaU_?VmO)#e!~mn6+O95{zdosSDwHn>h?bljSR-JsdzM3LJ8!^ z^RHHulK=f24AUdc!caP2PTWw;WvWM@Ui7ar<8r8v6M8CuWcLzaI1lqVZ7E zlZ~efPSbHBDe!N|f9MainuQF&|J26iJl7Ke4tmPb@Tz`!kvCom^ajuU3=}W<4cUu&0`G7jDr)0tZ&&HW*(4%vQ9o+ z*Y*3)$Np&#grd=^Mc<32oh$~+o&qWG@d)ex7xAqjP!XbPoCjCxRt6u7zo#AHmP1SiwPDMiWh~r0BnC^26u8 zbnZ(^sebymzan@6{a_lB(@Dm@skWos(xk3TojUqM$#9&H*ItV*#Vcwa0hSl)PCxlC=szJtx3a0`NHmf! z73mI8s1#|4xGJ_E+T}x08gn;&U?xnL!bjO1es%!3BEFn!I9OW1xQ zUn9WJs^=R{WJ4M~C_6w}V9ph@KYo7qUv+nr0TieEXDk~kL}`CP{ZlHH68^`Z$AG`C zHSG+Y0lc(^3i|9wU(TBjtnxE~s8X&jR^LtR67T7m62XRM8GvROEI-pT=gqa+&;&`x zuzQ5pA=xqJVix|uttO@p_|!$}7=iDJ_`U^Zj3>xsTQ4HlZajBO$Cs{yxM3ItudqLK z-c^85yU?W7Xc@Ezc$X3oQZzF_e~{D9@23AvHh>9C^JkJjJ&Db9dCSo7%cK71em||B zn$>E(W(Vzr?{M&b4uT$Q_1<1qkyt-xp3_i{)7;K1X38}YZ)w-T1<=mk;K9dtb?C@( z5VGCtU~XMp6AeH(yJ7Iu%xDn3<9Ozp4MpPCkvTF5OqfN`25 z(yp_Id-~Eki0>GL`J#1@9F`EkFW#jQ==sP$s(%Rp7VF`3I+%&(tP&MKrHYAv0F6&? z@O-k6vYeVHu-PdEqgK9}p3*tGfHp0}(nUT`B%f3FHx%YmnIzg- zaXiGh3=p5hCfN`(427ne#I1vu6^#8e<8fMF5(997n}lY2(|uI(VE_RUdHxPnJM-Ti z3()9e+^mE12hlcj=}^dMunRP(zaL)+GXmLi%NQ|K=wiESw{=iFYAm|BXr*zWfN{`$G>pwq@{zf=?72e;-S%izygc}V5 z8ac#FESa+c;}e-jmsA2razn`zWiH7-N>U{MsHQ^xx!0>QeEE&3SOCAo;JH4s=nX)E zFoBluARIDAcn?3mdX6G0Crp24#fJokak$FNhVReQQJc4ojEp2v_5i;%d2$rZxX*|F zt?^@lXvhv$>Z!f~D@gb^6Ap(B{!uTLA<=AU5Gr@|6_FFE`@r$@bW}*j#SO2^q=ynC%<&xOI&;+ zy9(B)5dfuhB-;zM>gSU=8FDb@#7L>hKKx*GS5Smkr#dEs6R2?siGJu-dYJJGu>kBt zlX464yvdM23z+9i|F?H01D#fB*iPDwY7mqU93IuC`XA95IZ$g24c7y8@`AkeJq4dP ziixzhv#V=#tjk0><}7*Z*=NT&U)sh9TO)AY-Jq$5e1w$Db+h8EygU0khDiTianFxl zcj-6O8(?KYl|sEL)ewFx|CcDGSDB$eqL$$WMwo(tbpk!4CX5oST^$=%Ue)ml&~W;4 zhjZ7HAnysrD|`D7Qb@W2wXe-D(}stdCmCsDUPN8gf(i0W~PH=VRA8qocsKTn-sNU{kNtJ`X^0}3P*eaPp;_oS>ZtX z0P7!1b+!UlI%)?7h<*osdvbQAT1lt(;{S4ET*mBSiIv)7_P(BLxPZrMW-vQGq%*@9 z5(;^TwQo{<_>BLAq=aiuy#M}gQ?)o=O==+Jq5nQpOz;ze1Ey9FSa53D4c5@2dCIht z|BrWyKA-98Fc_GoV_b*Z6?UE-Hl10RUvPLVKOj+W6y7zeT_N)^mq2g(`0>@ zz<5rT3brp=N@DKK7ytLi{RtwYVX)syo5=t^QY%^ZYR>;_#zTDUee}J;+%OwC3EBYS zwT*lb`a}lf>6EZ#0$_qspg47C(51uyzMRIvat*wPA7=lb`_jWEXa96eKu{xE`bE?; zQ_qHFuuQ6x5Bj=tZ;s-mBJc!-h7kLN0eCi_O_dnKl2N3S0S3S*trvN@4C{@#uw5LJ!PYwW(q7|^hd)pTrNA!vJxzv=0fUKDU z9e?EVfP5LAh`tXebwMMhE*3+_D4Ujb;{^k!2Nhe`#Q_^flT$g33}75V58pR=+f6tH zT-U#FCgm3dWnF2f``CUgzSdv8vPn0?6{HIlqu}5)X5QWNMjk=6Iac{zm_+s0^PV zZVx$zCQp7?F40@5F*|?pN|p2C${Up-*+DASmFSfTru{fOYWmnFqXqE&F%pw?XB;GE z0u&e41dLlk$9w)_EA0XXJJg8jEnwZ56g}jv8#$J4>LO`FryXN_Ih80ZDkY%k`}4P7B>HiG#Q{IEv!y=T9t`3KFC==Y|EB(>|5$*oxFZ2O z7(DFtX7-eaJ(j1C+}m%MpVmdtEJF)U*Y+|`(Dv8Eb>dM*?|U3mh!tV>@j=R*i4t>c zCtU>Fy~}`wVBn9Rf5)vKzL-fca7WNjZw0gdLfMyR4B3y=qq6Xt6Z$IZUvtyin1v3^ z(m8UrLn)C^mgQNq0T`ILQ!T) z=RO+*kUdozpi&;1jZf)RkV`DC*%kdr9F%~zoF)Nd3pO}OPN$lp6BMR10h2&&3PMVF z)m&s>&@{4xHl3XBC>S^VzYYB_31BWJ0I&};4f=HMxh5)bt8n%oNBeb*!2o!VrVHlM zEWcQQd4LzX=r(ooMlHYcLM57r1sI*kjyTC!pH<}$?&=|RG}Gf6gl1Zm3)Ue z7Zqd`#;d|AFsb&xuumzJ-rmh0QTP&fF|$_3ht4$ zJ_xC1;jd&)C@0h*XoS{G=bS^R=;D&956X!5a-vAY(X+ z5_t!ejl^Bj!39plTL&DA+v)`J3d2|V2Z(|R;D90jIR6Mv{xtotxk>=2sa-=;d`LLUel_~uS6EG)Qez_VZtz9E9++7>=PX03Bw+9hdEZ1xBs|Jm{!YJ1H z7aYugNB^rUXUuqY?W?MQSiDq$F_l7fv6YHD_`eEf<#RSL-j z==@`f+2kBT1-wRGvG$NY2*$a-FvKA<+~vvu+2h)#SU*z9YyedY$V(}O#rn4oc4lMM zOqk0z(JX|GPV7SEB`NLtkUFZ{W!Nn|*uwyrsyhxNgar*OjfL+PErK z=~rq*%>iRAx@iJ=HrE(&$7}dh&?n@gie~m}*L#l)wy zaNmQKch9Hse_`Uk^s)aBy!>T{{uct`&~BQo(6+#Y#|-@{;QTgdyB%DJ6CJ6f08Vgk z7yYLp{FQQCN&krt)~uXEhQnrWZu919 zXVOvso2~w1SirW&SNH7sgTpz`VXLn~q>%k@3>+zZvz<6#LpW(?yh{e`qBF4JNY)(2 zR3}&t{p6sLCi>nT-_do)V;p@Sn?Qzp2mJrwtbgnO1K*hl*Vq_Qa{2#Xzg+I2N8V8X z2dKaJ;MpFO^!2lS_Q z@E>ve)(?9fj~A2+Qh{3jK^y(wzI8AeBO$12S>a}4pp-eR_IQEh-nh}KY%R$VZ3Q>n zzL7m4*WWt!ItLuAecq&;0H>FvlBhB|4|5&;&o?OR3Hv}SnC0rf$&!4MfKNZY_;Fku zqkt)P8Jx@?xLCU2q`DP+Gs%`Vs#UfHY=F`ew{?+^G@H}LspogBJHEtpUN*L>Nek3w zU?Q{|Hs08c{R{j@AQ8ygm0A_-hfMi!*0wv7*#GoD1sH*}_KdC)WWQq+IYdgol+y{)B54E(@y0@#ErXcD8Xu#h3U7?t zf5`t+7J$0R?B2Hq195}GV`oW0;vW=5D%G)90qG^BYK#laiv`A$%8^LZKHBl|^GA1W zWUVksStV^#=r&(4fu*v#|EixNzfiQ43S~e)E|km8@Iawt2TcBByT4Wo*@aTQG~$#S zhb?=cMEJ9k-s>05to1nkDoW+0PCZNJytP*9tpiOjOU$^ZNRv@-KItm-6qCVPLHz`Z zK3;ombg`ii%m@U)eOSND!P0Y=k^+zR8|&!Ww^m>~<8Ui;-w;9!?d7go46Fibeu025 zcdeN?hH*KzU&jnN#DD+!ngBGtX+n=EI88sVp553@|5JP%fo3R4lg~tyGd@{>B~P?v z@*n-_R-is)57&zx;GYwT!?{8!pEvuTZmiQVE0BYl1QBlb#D~Xsu@fguH%v*6td@Ji zY?E=v;^T9J>A|h%7)17j41sa=f7W*u0K)%?>q{Sxtemm(SN~0wZ);^80a?QY0jwbK zyLswcKxy@c4KgYh$PmC4#xcM(ga7UGcOB=f!T@z1)Y{_=;n;$y%DePme<+^Lq_U-Y z*<+LBWp6H&%77jy|C83ht-cYfC`ZM;>{2 z>8pz$U-?@kAEI9lP(weUR=~fRy5PsDJUz&gi)Ql~yBB8DHu!hXCtqA=ULA*wXIiO} zFoIIZp}#Ypj8#jaP=%(C4*bM>^Wi& zG@`Yn6`SJM&NuQzIlahH_oOlB_!=y`6BGXOJMg)@+|UoyG1WHYTHSH2=0oq4B4GlU z$Sy8^2{-6BXhK3$XYIK_Q&KA*LD#5{DgJ-re{BZ&T%bPt6#Ns>9HW(g)IpCyEx)`B z|H1S3Pon$uk|og3ifIBEHnz$}_CMVZJ3&8QN8oODGJq3f0-wPa9dH>Di7_7Q;?vv?juJ_+ZqWn(RU+VhZU;geI zIT+Xyda`@{o9C}xp$rX4KVu5>Ld(Cg+uu!%SBMP1G?l%a@5%kQt%NTe!2SmtqgflI zHrguE`Oi~|>;VJP!cLeHkmJL+7pd%&`OArC&WZ(N9a2A|2a)~;j!-8wJhkFg=7VgW z4!lA9!B__$V_>mS`|`)%6<8@5@RI&Zjk`zgt_vU82K>#J{x4Mn{6uHN(>S^y3ICAv zAqs9VBER#y#~xEgKUNatBNG18=Q9Cw?qbw-}wImgDINAdcsZ}=J#H|$LGnEq5;l-#FY4VO`*)G<0m11t%}q-x;k)l zA5@*yIN{6$-VesdR}dFeB1Qa{ks7ql%fI_wDgcxLe-2pkCcFn+EA%hL`weIh`Ty$v zOIu7AvxM~@ebRJ(!jgUr>K}XTFaPo}=;wLv^D%<{!{_f}0SzI9byuZWfdu$$zo`ZsD!u~-hjKKh=RqHGYJcR5I1myY$)JTS; zUjh7HC=4XGku(S2rOJAObY=bkTf#XSnFpLO+ll-iX;KmZ=zT3q@IQV2GpZTE`z80M zoR*3acgNB3gW#VL)gtf7XAL-3;#kXS<>7zmNB@I{Q?h)+B>9q=Gru1W}Fh{5UyPbk#KZk5c#Id3YajmjD|SZxnJsIVWHL^A6E zEaY&Hg-^FfzU2o3u$xCByurm1`q|XwGdenmahT*8c!{9bbbaO!NI0G&;s5FRCpK|v z!wTAnZ&tWbz@1DO-_`a;94cR+srh_oe%JK9`|hJ`E){(nbIbOx}2{G{$X=bicU-ADiaUH*@+8Q<>>$b579@AdeP;-Fu}Qn93k|KBM)Q8>UZ+My)z&o5H| z2{N+3RHRG!k)4U0 zUv1sWADI^~YRa%_0e*u>^=x|pTp@sJz-tlpOa{=GX_dJpB z+^3n>3`I}phx)BvsL#EAWd`N`s(0(ch2dHtW_y5t%Vs@5-`M3)E8EJ(S%2&w48Xjd zP8SM^l%TQ0M}l>q_X|DU@dM|7|9}7EkAM6{rI2s z;-lNX_cwp@y}!{9KlRZ^AMx?M+xP|laoa~R|J8oKFgW3B5$rDZDQaDknHp_+z6^fq zQ=!180)bC`^r=q;24kP%7P`;h@YIh2+&G|T|BZ(8(MKA{kM&eDA|9)Mx{XKQb{qf4 zXI-amb>y{9Kr$Y%?!P`H+l92;;P>VTYLG>-j0zke$LU`cy8Sz28#9w~dv5nny> zh0peE9bDxIG{xUb_W+uQb`nA*fh?|WSpn23=P7@GDo$gGzu-0D1%C{faln+QG~>7# zqo_QYtps9M$3ySN1;r-RFCeq%`#MgnAgY#MeDNvTmoI;z{pzc4x#epAyWEYOqyQ5@ z+H#5qwscc`m@%HGMy7*21vb>$1=>3Y%`gGDiUa1fIn8HK)ITx zgIgfPCmVSb5Hr+af8+b*O9sii^$xj-{ZF`gI=PvV`ufSdV4)xVAPEOZVO(#fdL z6KOT9Pz)3(CspYc|M#$3ovEQ{wq>P~Ivy1uzt{JLy>_%&$PTumRjR}6Xsu=!Qe;q9 zE43(dFp{b@v&2o)Bak18F)s3`Sg|CAR;X9`*1dyfI3XsB(?{}MT~N=(O!%SPe5X&m z^81;Rxc(%ROeI5sq-ctTP+GMV6vx%UfCcu$3xhFOu|MVyw8&e@w`z2+O$L%J;JpSz z$!hJ`U_J`eQ*|hLtkoKn)E`XNJ=OO4&XiC*87?M=Ja{+lLa35VwmZ;|Z5$&xCRJ$o zLIHv!&i2FeJ5!$-h$bN|l^UuHrJ~hzYbZ1n2+$Zdl>#k4l}^QDL#Y7o>GZKyEtyJX z`P_a_=bn4+T}=ga z^EL3CNKa<7`Fy3842)E(H9#weKGPzv{oc{QyB!oBnL09?Kr~1^>*q zu($Y`a-@}tR?_*ARw_w&EKKVNl}I$1guoDd&XR_B2}cT7jq#;PBH$-OyyWTpWQc(! z;nG2tQftXhdiUMfE3Z8D+*5!3%DeCS-%SRddhXrl_yC)QZ=OqXLJ5n%W1&E6Xe1rA zfaqoiWD7Rj#_IAs%oq_1n$=cRnm^PDmmw5jJ;uq)01FUE#?ymC#dHWU0S9S%lJ=@V z`~2`{OGh>j4f+O}gC0+Dpd1nZf4RGVFxtZ3T`c$_`9|X*YoXuwnPAwq1d=`+ZMACI zYOxx&vsD_#rqZoww3!Tq(&0iSl^&v@7{IaN7QIE7{ZOmb8iD+5xEhP4hnNI$P#~Jm z#sb-75(1MUI6GT>Di*q$z0Br}#n>C65a?vtBy@+8HKu{GR3Nb`+`cgTg_0+4 z2Q&94g5^@#N_HChfkp@w^3__UoC@sO-dyPSZXYPwcGFi6N9Yn;pc_y)-AZRcj|w*d z$v_y8I#{f>0wc9*mCmWifI&KFX$(V!=18lR96@Y_DYk(vn4okkTLW*Bwv(%~_*zr> zVltPWqsC#ca@rTB9=blz3KohW{1+q9 z5cJdk7SDLxu7>iCQ!8(8E$qDh&pg#kwP;fjY(>J=8lmFWP$~<#BY_d<2RqQtR9Vgx z4Da_d`OR=NO!vf*YC3-`n~a7>!d0>>v*N@U>9wI`xR9>a;Fv-h2~vceV4mb)GMUfk zDNIDaK)ghLG&)p_GP7i(6~pjVB#L~A(y%kkbfs%7b8Q3$CtNX9Ll31|R-{s4rH8U< zo=_c0XDMWgW-CP^8bj$M43my>3#3pjRQ#7<`@+EXfqcVPXe9<}kwn%n`nx-;wGi#l zG6T_p&-C`B_B`atq|>3Om5CI?b~;kbXKSh+C`RlmeN!UgN>%$hHq<&ck_JS0s5M0K zWGY)bmTIO^eEC8lObSi7NwxXr(oRh)rda zDJB@!YDHTZ>nvcnS&g)^;cU1WEi&;)!B!e(jIz8fup9%u?5-3tFG2xl3nmDUz&e95 z(l^qu6rv*#ZRPXPJRKfGQTuxDU{B|EZ((yI<~xkDH!b@6yZcl5P^s>>8o__*-jD~&zdISFq+9P|u&y_|NF$Uo@sYRmHonJ+PhQR50^{o0@+upL<7ZA zhACj@rs)xi=uIOK$eXHr`fRJpfe}AZlvXlUp)i~&mHLJWAr13GyXIKYbfjj{R4$SQ zOsl~5h=%E}S{jLfzT>Hv?0gI~@@9r6JSb?kGg6>hVGpG<02EcSRXb64>ZL*3E;TUN5`Zx2~tf= z!Gfwo>6Vk}^W=tyX&V)>9MNC0hBJ*}r_{&|*iOBWNl;_cppLZg|IlkJL4iHZl|6+@ zH04hf*~AzH`D`=*d%-j?l2t6i*?Gb;^xv}KVod0?<@8aF*>LLFYKgD~yl3BEv@1<& zl>@B;Vf%ExiK0&MN6Y}uEz0@a8P4OFrTPx{D|P7fXe(i+0n`OA@Lw6EO`#g5JCpmzY?4$9KH@&+kH}f0uo=l) zM7v}X1G!Q$pXYb{z^>eY3@e07;)KHw4fgbGf2f?yXI96B|In_gpkGc|*pqzduxA)X zbu2he*>KDsRRY9IGXv1$$$M~+!0LT)#Bh}Qx$1Dl=kwK_VMlH=PoK68bK?+UXR4xh zvx0blH8OAvyV6N`D6XZ!IvI9-M_8T&Dyxv;`&BK`!Al$}hez!Z>#l;e*{Mt3}Y zee|Vv?!VvZD>XCVbY$#mUj`Y#X7^CG3jIuOU)?j1a}vXe0!Mq9JqbIRtrZH?az|9%}yWfmJ+pyZ`TY)`pNCqTL(BgUZr8yo9YNuSrUz!>2W0mPGRVXsv1^`M?yN_Jj7KJuIE{a;af$PPW zs3-V4$I3U;*+QBdnGL{w5u2jSLsx2#l5vW7>a0F6naYGCXv)h@I8ux@6J>Sj)_*CH zjct=>x@;O3depw1S+Po)YHLtX|1gc!WMLc#z$&kx!mA`YSIgV0TYDb*$``!#kkSAB z(F4N^wyht;8zB*8So8opw5HoJ`EXt6ph)hrDUn<>%e2RPotHYj@r z5YJ6{P!mq6!lKl1s@X@h@OajPPQyFkX)t|-NFEt(Wdck#|5-wMv)%|9Ixv!hp36AC zJw7X#$QJ4erXvR=1-#Hm(6cGxOEf(6sGv}fT@$rzd^W6x<>YceH?uj5(E{7dI&vh! zD6K%aSV~aOUP;AM$z;OGTXw$a-5%K5<9#R?XczrG{_huh+6Nv26dz!Gi`-wwDL^y- z4ezlLN;ZY!MXjk|&XARyhAO8mt?xBKiVrk;sepvVIv0W_IWj zYo>&KP8SX41omw37Y(J>_*jY{y3^BOcHl@jI|_vm%Zf2x>Pt!#+}T(JtT_E{(12EOu;x3?$#*^25Pzvo}rUf%9Qa_THa0c0a{Lx~1S zY(J;Pur2rR`@2RIWp(B>e6IyV4EATR;b9Ps6k zsN6*|&e!mI-~?)KJ!O)R*c5%9I*a1IW5+dNdx!Q6cwp(mQU{}zI($^vu+y*xXieea zpS?N$U+^W;m?iL=XI*&XjKsZ;2UPJ27o=XYth0(zW$!xDY)7fZr%KqT&Z4QqZEXVhdqf{ z;?xXAE)U@cR1C9!`&cpd0UyW(gp^j8Od>eYj0Es}Ae0bOIU38@g{IX<77>H4j=oVvHmVrTS)mkIJ{h8LNsNk_m=~G4y!pz)YSJ zHaM$MuVeYb`ppdSnzF}AVCcc4t#jvbKBCA{Jd}=5hPFFdTak#MSfI@4p(I6YE*J{}H z26&-X6H}1sKt1vYaHx+Q3W-9@FaYLYfz6w}n}aMHEAR6%cT52+j;RC|X{GA=M>r6M znJ}k5%oe5yg_UHIaKa<_fn^@H!y&M0v2r~bjt})Z`nKMrUtzP*Y+^5ww_!zxBTybY!BPj+Q=Y<&4aB}9)}8^ml_dIRviPNnb)7JUS0Ttw}0XM`7h>I?LF|zy;G*_ zJuqeO-UGU(aODo-DJ3>Dg&>u{h;>+nz_pWN> z^gpY3Ic1f3ckjiG^;dk#P z2D60-(oeVzqh>QsIpAX?2O5y#J8*z~(cmR7_|iBqMK2FbS=E^GOH1poXp{S4zWGl+ z>2J(+`o*aq{F|?*et+ugzxnmQ`quo-zx%^~_k(}+KmXr+bNU&=S~_!`nSnDiaApS1 z%)pr$I5PuhX5h>WoSA_$GjL`G&dk7>88|ZoXJ+8c44j#PGc#~z2F}dDnHe}U17~L7 z%nY2Ffip93W(Lm8z?m61GXwwso`K65{+C6`RakT z#23HccHtGDZJV*=p0@OBzia!0mw(fC)v}#!b9(yQKKq3)x6OO;|8D#2FaNo1>3zG} zuK%-dw*5ij-nQhL=i9Dr{$tzR@Be+gc?r6K< zvUzP+-tth}qEfl7`)hyEcI6*^qb)G+_O_Xy+tfB^_?K-ruD`D>_1})P6?Y7`eQxuE zZIRD^scpr#zSH)Z{D!vcM*nx)wRb9)mxdT-mp;>NaB+rQg(`Hf$0n{nN`w&>IUz3orF`D9!7|I6OH_%(HH`=d)9Mlpy+ zlNg8*F(`p3h7f@S2m}Nq5fTLDErIY#N+@@T$7iSyd1 zrCVC4(7X!DE8ai_U+$;4Vht6Nt)~<{gJ{2%3Mjci`2o)h-ff^XmG4uYrmv_OTh3D{ z=!0u)Jr%KH9VJ`#2^9s{>F<9?sa9{KJQvkd+1n0M!M(pxTHrM7=C9O(6>F&!v^OI> zg_>W{MJWrbsTqqJDbbPdDCNp^)Z%s9sFb=r!1;&hE9Nn?mCD-oG36e+fm#Y2c_~*@ zJ~^LI-XHZ+Np&V_c3d8nxT%>6|L!&A`{{jZ*7hzcbK6Ih=fW(?H8`6}s%fG;(_5&B zWoxO>l{M6y4|^!zWgS$=ijS#TakZ5E#;=sRrkN6F9iYNiwNrERj!Z%3s$^1!LY*49!$f&KfFp%ZF6V`VXi@ z8=I+_3o@u|%yC5NX7u|bYANQ=bIEqfH+?JRhilR{@1xw}n<(9mgOns4G>~qh5^DES z0orZU!c`lnSs!#$!OJ&LzPXs|h<7Q^#f`vqE9D(iLTQ21sCU*=aqF9?fGho!aPbyO zar-yQVf-XYqH6)(H&Wp}zf!EZaTxO^N`ZOzKl6Z^lY5kkey56xTK*oD`Tl-Nmb{)y ztlJA3+DIki|I~SlDJPzoq6;)saN#jZa`Y~hy1A7aH$8+}h&44MY&jL4qo=aAeoW#4cG6fHE{PpkchyVS?`t|?5{Pi>W;s@&={#y_7 z!~Zn#KX0Z0^6lG+*Q26hqMF$AqN1KWiHVAN@+2yz3E#v#iHc%J#l%EK;YYl~cR6^^ z?r&nV`z1|H_!8gd??C($ALjBz6*PSB;W{;6Iy<7fFAJgvYbPPCvVTo}6cgGw@poTOtYJ+wo8z zDul-ik=WVc5n>mD6GB2HO=tzD@#G=sCA$fihJ>KY{pcN=jdo-3j~&u)$7{l;^EsOn zZRhe4*<(bhM&-@6GBq0F9maxe? zHt8YGCH=ywA$Dp$Uye&c`XwPeK01eU`g!;nCrhlo#BV%1;p!$8H^=tL(bP z;puwY?Jy3B9iPvWpi#cOpQo1dg?g@vtG45-<@@Aven=B~ferx&AvlGP zuZ4CJ9^VY;5?%-!LqMZ=Cz15aB^Wij6C&5Qqu)H9TD>~aG>ZS7ZA{4dOSY?NXj|Vd zm+Sa;YCS)MFW1R+YK(y=x3lA85_o*MTpzK7t5WSF0|vHudUQc9e}t3xJT-=9r^cK} z_`Hw^Ihi%N8q)*ZVZ=OjyH1Y*$@zHl&`;#*CLos@W5f`;wv z_OPIx0ntg3eEsN>!-xEP9_^&qHT^`$G!Stjz?Uw zN~PB^RH9y$UTrWWi;{cIY7tkb=E);OI<82pGl{y42GNo_RF&ae>+0&F(YPwTK7y}* zRHxsCFYENzR7+5<=deu3pozo=k-nE9N~VeQDsC^0#^=d}I3cnO5grSz9gCR^5wP9mb`qq z4q6xRSx38eZOK0Wb*pgr*8%9uYsveTe73J{ANj(6mH$_DOZ10192zd6sW9qZ8iT=2 zrjhy6(L@FYgT{zsvA6}RbJohVj5w`9k~k$t&TnU^3{IoweLPBq6Bvi%7|9$PbU0bA zBaH}?^?I&|LE~Oa7Sk54TL(z~U-^IW>d?Z^cA-0lXt(c*ZCQxf|nay3^J#~9UQ9Hlh@$wpS3 z%w#gk3}P8-{6?6CT%HKiB35(imUOLpwaS0~eE<2t!n$1tcFA^i$##7K_~a}9SF2Wi zcI^>IE>0G4l0&!*njQqOpTQ6t4KkyVVPMdN3{HXQ$y%X|M(a&B3njKwaza!DO*TfG zQIhlIj@5hjez@1;CzH)jI6m~)yL$Cc9v-V#+nB_w*Ltj7yYSE#UvB^MojvQ*k2vA8 z2YDP`H-GWsFMq>#bK^+WtJPwYY4vK4wLe|`c(2FapMHvqyDDD&;p)|UKgQGJkEjBM zD9)gbGni<0wzf|sJiVU5aMBhqoWK;pU?mbZ_%OR492#%H=?OP)Y69<$>FD_HpFhfY z$18NA!(7i#I>-+EsZ%?C{PCm38D7)29a}Tula7uUh>*9J5Xr$NoSxkj1GWpUj!#c= zXzfOkjG<*1l6(1ywlO>%sM1DjGHN+afyEV;d&SPqE8NS1gM*)ApV+WM;ohl<76=sH zweG_k^L>|Jd1ueGZ4O6TJYB+Y7Xtc2ms69*UtIiK=(f=<)S8Wo;b%(a1$Xya_u4bT z&x3>Ap6?hI4C5Z?D=e1ZD=I9Oz+T+!KqWGmOa=qtKRG%(ols;GS0H0?f3jGdQ-YeE zn-7-OXliPrqw&;O@1cQz7oI;?eqA5tI4N{u`e=L9*FJs9*CpJgJKXU~+L-NIw%vp_ zf5e4OZ;USNJl@#YNWXv~1V49sUhZDI!`*eLxVXBS$s8OsOXRpyCc`GqKr`B5{>?lQ zS1hwB(8~121WU1{IB<|zJWyJb87;u=d^3j?nVL>bXQx0}>#o?Cf7*BX#B`q{q`vop z8K-81hle@dnK@?hI}@{8T3V=zk@o^F3@+}3g9PMr!rb!x`h@fXKrO!L`Fj??spPQWf1Rwz-YkQ~9ms8k@hpP8unN@+-4rGFG zG=QBcz@G*)+SnKt7ItF>Fff<$B!}bjNdUj{%TOQk$%P(Ucrw3Msl>FCnYSM9(Z{O- zf&zj9djhMfFa^y17zt0|c9am+fX$=f+zb)=rqZaiV4J?_7p}JI6b-ArA z6&(PvFb6HA!?oq^?!nKMZVE+txqJPvps%yR1s!nweDqBMayr5O%8d2XQLOJstW;Vu zEVbeaFPOW`Oz$_r_e(8I)Q84!@X8EquK0ITh)yk+8RKl?j8V2z5+!n>N@kSp=Oo*m z$KE#USt&!7=H`@?fT5i=HJaga?{YMT>o`mpp z9FvyCGB7}Y;J>|QuGVBD5{0M&oSmzf6->;RbD*=Oxwyi)x<)We3gv+lW-5lghc$hg z&c~R8*6_LZ_AU0=4(Sd@JUv@lzzYitI~CrTsNqb3clmH9R?YCad(IY1MTK**GuR60 zfwRRqDzQI=s}_lpSt>3M^lzu*bHyfB9EZVE`2|?+VXDZP_^S%6us9Fx)PS7I72e<~ zJ3s-M`I^31`svp28KbkOA3>#lLWlOJLHj4A`On`xuO)*IR$j==>>NJsJY;b$W)51L z0~&fP&OrfDITDFZ$1th51`+5l3Q8W0W@FKJ1N~~^jv$?qxAG_J>C7Vp|4L$_|2POyuK+bb61=r-6v!h zSd|L80`Ip3`31~-0tR4a7(~!(%(hdSn(XAZK$BbK1#l#XIw1{J9XeU@9 z)?p@ufK;Q&mlno8Jl*Oz>B^P#>^0UhW2ahOx?@k4lnjI60sNacwQrPV7tU4Ry9``b z4HA}G6-Z>;(7-_BJlG(~B9Tq9N+ieq;GRfyat2KtR}h!1J|CRv958gRsv0O890cO3 z0)c>_p$&xpU_vtq53W`GLs}Wzy8O<_$atZ?2*h7Xy7ZuDt1j~gD|APYYu)FE%&qNGLRZjtHF^j7SsEh{_Y zzJmzu@(7JIjtBV#IVV`~up|^W_keyu5d#}AdO>GqXLMmh*o_-ur>tx@V?9JZp}r$WTA>NV z#^$4kCFSLq1-EmSihI>ngMn>iCaXZxsrM`azeA#RM#Zr0_)zghTxj}=W&pA_BF6jJsVt>C~yN+R?!K_G} zg5}TP+Q^Jhy|0}||A)Ohhy1V(nLRzs9`H@F5}Q-*Iq$4JbLPTxrLw&Kq|5RvBWa5> z)@LUr-AW?7r=`W-KHTMDWvoE)OnC-t;9PYTVdc1#-1vqF-khrt23*cvnOWgC5M*giXl`yMEHe<&&@wc%p?rro7;!%R#`3o^ z@AHrl>+ zi#aqo@Xs@g+Qr)avSg8P_Ad~cSiXu)egV!F2x78$0JZoEylX9&IAu7 zjB#F!M6Fk;82b$>hKP(G_90EIwTWX0Npa;jWjISy?H3T#T!q<7EpBd3umn~GGTQ<- zxGSFhqtbErNZQKnd%j<@CT~G^cQ+Kk(b+HZ*5Hszp&~@nT>}ylEO_7vT@Ev!666=@ z+}K$IH419XyeDjaNIO(MMx2UE#?Ncln`L?$r`J3i8e1)<<~3y*Bd933H6CnHnY{ehq(rs6RS%%8#Clxex~*e z$gC7oP+ZI;G}r^h5u7_EA;>kh(edo~v@iF3|1IG=Cr?UGN*{*#&V3PY9Nr-CfvF;?iRhz zHP?a@+py@`fIBRos=%QES8oO6H&mh>%Gz4+U$|@3DjJK%hy1+`Zwu`HWE*j>{sCz3 zd9a(?FGO<-b`2P+s4l(SRt-kz>NH z$QmMvT!X;y!E>y!(X=qfTf$WwV42VXTTP5HZvb z-UNe%m%kyMPzK*$;pdD+4Blx4Uy3@1%!G@PSHARG|2bIBk=V-0d}&F3EKGv46Md#H z072U4Hur#L+e%AaCl6XI&6eh%06$mAO#)w&3C-xu8_YjO%ryuZGMzASNl@2CEF1-j-$DZ)q*oMOV{CcSr4B_my z(MPBw_V&|r52h3izMU{;LbJ0oDBracVgvJkANTY81(=-&{gZFzCW{ON|F&@T!T!Qd ze}ho?gDS`6@Eh%&>jH4w3HBGYF2J;9*TmJxh^Rw5p0w~-t^JK>GSri;)EtcU==6~u_s6gJSKA-tu8yUm08AvD-P;4tLS|6|yEb1%mzlZiP?{!rBJ zPzJ+pbtCpe?R|H20Gt?NoPY)wNM$D6#SJcs9&aouIr$H8if5QE<+F`ghYdvs?~c9O z(?hfkP)gh7)ESS!UC9O}6ikLhvXk zIZ_xM5M;{Q3m4vO7znUb6Vs(_5Q03l$8tC8MC4s!ddF&@ab`*t3TX)x!n=_uI@VkS zo?8k7>Rw^34mVCBkb4f{kZG8#E+_T!RVQvd*p~WkALMIGtyL`Et*_K)gkuu0^zI!k$ z44wyJBKzDfpxrZwRD|5N8?{eQ8VK>4W9~Pe6 z=>1HQh){vNm&=gRR3aVdkH_cISO>aZzMMaQ>ZD0$|E^$rcGB79j=qhLJEfV5vU5X2 z&Q(=dh?ki~DJfY8b0fzregFL{Lh zbGvciMBf|qSZRG?&J%XKoW_dNnmNG#laL5CLwwk{@QeAMd@?eAWQ6Raw;oq^Pg?Fv zhlEkomem9dz=2a-U6oK&ba!ml%%w{|_~6q|)5v)zKKS5$bl}9@th+r$2@sSi;5q|4 z`x+X3&q7s5n@QTlD{1aVV{ATH4qLB!#4=z7>S6z|&6s}EfrVfAdwF?n*|G=6mMyqL z-`I;@fXu%$@t8)N1mbSDk&!crCJ2f2dgh5NfdAba4jZW^Z26T8ucvd-#-dX* zX24bGm^b&ukp)Rfwo|7{dEiteT{A-uL|NK@*Xi`>H?i8GR;p4{L z8aHd!*6=X6HHiq@nR_wvB1TVKF0jW02C6h=bY37aPccy)B zPqf6=Q!~)ospY$U-kQr(ziSFniQ%FL{u6B>jjvscpqc)4=+GBaCyk#r@$)0(<}@>A zxO8{7PM;1xujj4Gld<$dO-V_9O%N8|dy6rvBPW5uwpuH*c98i{QY?=zudBoINUJZ zceAp_LL4uB9}fBHutn`3my|<&zVN*4zCfA@<-8A0DVG_94~-eK*lVJ7XrD|)u$H&g0NPm$sLtgZ~HG7*{2>Dd>`|`vT(!{A_aCDJ=T1aJZNEJVj~hmIW}b3m?bE(&2dk zi5>xOT5tmJ?~d*1c?&=Ni06V9s{7&NPEBDn{G@aU|I??);K77}vg`$*V~Pr+1HM`w zLEv)$-lKN$#$5{!t;71mM9#IsKXv1Dc=*{n_=2!7&)AdsQmF>>KMCVU7eQ+$ zpl{+Bd)GStbj-<`HL;bDm-OSu=}`6PVL;!^ix~SBK(`(bL5{X0ti(R^*6tRO8@>_v z?|-^yqE8+;&{h{LRDo1e6Aeu>Yy||+7%OyQE#A82;?n)_Vg7d=@IUYmi&?s>R{Cp~ z^J!dD7ZxDaUmBL5Cy8Vbmeu_b#^#=7a|wLG*E`^YESLID`T(a)AYXy{K>%aN68ii5 zvM`s&g$P#_V)%#@jmM(PnD#kgI^)JUI)>3*!W!td9Zg6DV92y8kqqO1A`zNJLYi1c z@PBqZrW>~WxLe?UE~mqRKd@SmZTZ(VgCHzsyOg|PXw1KPu~Uc`T+V1D{?{)|UkyG;`+CPv843 zG(8(mC@R+_KYzGhs)^43hYR9jL;!+#sUwIJ5%`YF9UW~y`Hn4VXK85+8ck^Bf6)J& z#5TKD9RmLU=061gWbIgE8}{~Eki;JoAj{0~0O2>sr=ye|4} zK#-(R6W!1N?FTx_MB<(!vMfB@g$`}hafNM1;#X`t79zmCdidXRqIBvdG!y5*u0wyp zw?;M~GBJN?7Z-C-N!2|K-V=j_i@JL>EtSn)D(FYJ#dw(t?BOV(wx zYnOi%*5A`(#Fw)OlnVS^TGaPK4jN32bv44?~E`0z+T2S|bv z>{oF=*bScGS||YE6nVJZr5o_2|MZ=7WqZb+r^nWOQYU{Tx@I)MuTX31{8FP))g1QxfKT7WyfHKLc!Z1YDQ|>c|&U?e^)#LL+0p82V>a z6qhD8I@v5-<^SU+X=z^T-v(DnToG!3Tn*c%=g z>q9hAjQ*YVR#g-XAq6p;A-{m*C4zc-n6K~XY{;aRBLqC)6RnK`;--ew?Gw{%5P#4? z|7EMMu@0DQ{^dW_>m9Ex-)B$QN|;Ohv29P6WfM*`4(4ND$?*WrrrfQx)J4w7_Z%&Q!3_|JC=SlL+bmbs((c>G|$y7ng?o;l_a6T!hZxQ0p0sxFE#?pdd_uc725X)P&fQPPB@3GmM(jZ@f8m9Tjd zj$A0FaTrAY>m&3cn}P$^){VwWCkN5ma6p{8oQB$=(QL>a2mtXBFASVpJR_IaSt3H9DEKSFwi9IlN@ ztfB$`a+SWz;N&D*^76CIeGebTYV!NQXd!O%D`OwV!gufDk>P;joiqry9rDf|KtIeC5hk%>@0ic4TpKYbhsYggc39=Er-u45xE%r zUXIE}gd``Tf3)i&I8IK74;VRr0IpP;Uzq=x-j{zeKfkX}P}14C0={r(cv6`dUmJ1i z7Nx)eL$5EXgpSr77VZ-JFf0r17vlQC@ZtBW3M7#}zYW8~$_ur%%G!G9LsD|U6Ik*D z?msz)mdp~-3?%*&qEf46PEM@P4lMaYT3?UgbqVRFw7ypP40c!T26(_oAOR1|E})OS zn-zKR1{6y;e;(37WI8Z=uncy>g;iU=W5@7DsYY5^*%w<_ zSX1~U#*QuTGBUI*gNVoHuoa-$WAdFbM0#5i%a6A$4 z@Gdan`+*I(oXBy4HH<7DrDY{XdGUT_yU3uXRpd#?17$?Jt3<=)d3nsoN;@>6i_&?mzKbs0S+?pIeh3acz|z`81SC?G({@RgW?+Bfh&L*Zk< z0c3>#1@@PYX3!RBO=6Ym!5efH7(fq#gD+eN-T;?D3th$p2Aml zBkW;A>A{2^I0>!iwqZ6dS5>0}Wu!$C)Ubv(=0zd?(+=TJ6Ej$dKicWw4A456Sj7Kb zi_{4?J{1V}XO`v$1PmpR(AQuaIsm3p4Da*VJ6@sdCr*6&bp6w1-@{dN%m*GIxPTme zZ#>+X@0yZO3?DQ+(5XxWfr=6P3J7q$?_T!iISFm-*x`-%M?WI|3>JfB*v~*+Rz&|< zCZkhFcA2B zonFK;I)MYJ&Vy6ABX7kT|4c#r67EKl4Fb*EA z7WB_+7YPkC7RQ*(olVkwkY}U$9Rcu)s=?+2@EkZj6G-Y(#Rg^Bj`HF1la;3(C&5iL zofx!`e#Esj32qXEpX~EW>JdBGfGHp|Pz6F9MCY4R5PYxB1YW@bF#aZ_L8}dNgdpI5 ziQ)+vEE>vAn^@*cB+IG1oW#F@Z^#;?jKSTX;EV*Cpbg$g!YV-m1{7(SX;!y{=U-j| zxVlEKiH~2jsJ84mqBlE{>XKrq0u`o~5}$2g!ceZ?@100tDZhVz-V} zJH!n8hZQI080?M$x_5b}GYP+wI1Z*hflPqKQjF-gpqymiz^4Kq$d+YqZBV!gk$*Un z7W%!_N}VMI+r|iXI$J;jRXtS+OiUpfsvz-yWG~zwcDLpq=z3W)B*?0){71)Sp*JiB z_Y&fSnXobfhHy0kzes@q77#%W3fe$aa0LV@v=aCLwoLR{Gj0({0feFq-P&v0kz4S; z-J+A2AOr_)z8C~`4M{XTh~oG3Sc>73cRq(E%1QnOQoM}}5pu1G{cq+njI6a<6Qlh+ zlH33u;g)*{+zwVDeF1Y&0ey0(yF1~EZs5x0^{0rL>|jrn#a6g?0RGD@J|rYKp}V2) zBv>fYwRR$IcMlP>HiWJ~gGeT-t_b-3K3F^QzvOC`%4o!bPe%MH1UdCAC?Hx!#HCCD z^lT(y5&G>RaYw9T=rTh)hsz-s03SJ^%5o$?z>InUpX=*Z*r+3E+mU~`0E|fLLNf43 zx~X^hPG~K_;M+DZiB*IZ|9&6vpY+RBG!=`pUn@fXBfDQGR5_Un3RE2K`C$TnD6qI1 znoepUp3LHENkb4j4!*cwkyBtelJ98JDPY0Z2+ z6a9Nd6%k)ZCBy?$N)jOkcFube#WU;n!}(|6BL0%Y=bE`TPBud~kEutN{XElb09Y!WEB9kZ!pDhM##OX|a~1 zK_UID!h#`K^S|y@2mW4tZ)gDdXCZc&aVMI{$Uy#ej9oiT#V~0L3=H0RzaUF-6=)B$ zMNo$1Gt2Lp_pvGw5G|{9f1`94Z0xi80O2M9`+xl!es?PxU;}ub?(UA2ZXDh*OyEP+ za*wt+qyLZr$o>kfW>#!M0@?ub-|RSghM1wHk^I*vHJ4#9tu1iU8uuLyvJ7FlLuyyw z1Ib#3Ab>a2&}+ysOp@Tr%AUb8!2EkXb$Ahv4ur$GKI7CHd;0|l$lJRhB;F?|f1`X8 zO!&AWbLS9AJq-$K4oa!OYTktW*PwqtLBbou#wIS#$kN%`CfeyaVy%-_D`v>ggKHE+ z-MYL9*`N2oxPzPd25nD zfce9<$bk#4Evqea7j!lvZG@!r5pIOFY{4pQ!uZ>TGLsetARGCwdL;kGIUUy8uoy?N z=)m_br``*!n%vfQxp-411ZEio$6xyEg)?WAU;hKiXaB?h$US_){~fXsHo<{lCzdKw zaBE2_5%~RmFaU&3k$rXu7|&pmH>zDs{ts1fXd84>J; zIZ*6C47sfs860h!kXQ=^4jpL9X|hWeX$>ZsL4?ZhF>*caD#wU)bO!h65R#3MIn)f2 zO{j2giw4=bmlLfOlOIenGKPmwp6nw&VDO&_a5&F^0Gt8uzSmQ01_V-&>GYatk~4}m zOA_A|?wOOp27rCoFyI5#f&Yg7O*T}3;~V7Qe{vO|NW$55%_ zxsp&a79P-#!Q0zVbWz$3E;X8HH^J6tXIpiUqyqqMrZ z8r$0>ykwe8%rFxE8>0qzqYc^lVm?pQ91_BZ^*k9WTksoiSbz|`P#cj85e&B${RT!4 zH_^7ykbelRkyO02ceXeXH^ZW@pDC@n_Aj*%LW2LjUQmh%KCBpIWmH#1#n|z=T$ag% zd!Qo!{t0$%(XbV0t(al{m}#{%C$|L#OwL5A6w=Q-kvD?OA%asR$86jfwtV-OUm~#g zIb48nYvg@Cam$`9Z~&3x>#u>OU&w)+d1P$<@AaLN1CUKhREfZQ5_tR!dK&g0aAes3 zf&2$O1AB&y;=?*I$ulbkjSRUW)47vm;viuUW&@Ps;4@`qwZkQt?mbYx;OZqg*YJQ$ zAMG=D0?B=vpn>v*1TGkSwLln>HUD4NySrMd0;{2x4KhQTutiOe{TGJ~oJYj}ZKucn zBO8N_N{gK%IXQUXNX*FrZz6C0K1h*&Y?b`s2P{2k-JT@+3KtDUwU9Rpez0zPe0!2@ zBK9@m5C8Fw{IkBZzPGhiOOhYaXj+; zd#|pySC4IKILCw@Sl(O{`1-FujaGyH4obl&2kA3 z`Gv@E!!qZ=(hfljWcwm^@{#>{Jl;3*oS)(Y*pm-BIbh4g&2(Fn?DmjjAL=)l0`B*vj0J+LjDQae@2tBWE>Tu z!usT1VXqK|ks7vHFCSa`)Izmf&)3WO>bgh#eRXwpU)k-e^Cy`2if`>fUEQNPzFH;Z z>xDcskEg@_MLED>hobxu&?r}%<-&F|@}7FR>ec5HJq$949dSSQ|EYCq1LMOd9v;cU z!y+12h`ob)M5KCqg}AES4qMlBLY)~2lh_}KQG#6e?fdN7zJ1v62gtzDSJ;hMr&mQp zLI}4j)da*7N)KZNIo}tJn?X19cG1q z|LU$W_9m_^U|{DRvVd_u_JYuG4uJMDXvqea_Nsw#73><@=Y%3*7hFerY;aRA5dsJM z#G;q9F3z>&&uC~@EubkSK=GRI(G95oVj0%L5PwWBGO+P_F)qEx9=xFvA1%)|Dl zy~(h@u>Uq^)ZxRlF0NUmMNnuzHVZPeMjHeNSaEUi48|F*#$k69 zj_O+PVZf!~AvOVdar*&X3(d+%>y;U`2J%BM#uR5`!fq#(?piWU)rF`J?-93`BU+oY zdK8JjZDx;h!d?{Cei57^TErsaSWr#&?*|-gQHn!iGD~ZUv%z6vVQTiXfF=OMbO}XV z21ABC4jO|a!nRA5NCmahMpj^oGszI%!5)|W1a(@LiC`&N%)m}FS~6G95pg-9IP5p% z<|O|6$yyrHVN6<_fOdbU>_v*gF4x0<4iW#o(2uc6jxw#m1V$ZY@Nj)JZJ_E zHn_rp6NhW!v@GN_kjtQ3nHbp8vmbJmbro}G(29C7M~r0owO(w7y=GvUu}^bt(;qpv zpX{X}^_PMBG;?%%73fw42u2n*!0x{al*3DOHO__w{}`wM_Z^3wqSe|s;eW431gEkTHzdX$r*PH?*NwF}N6-s@<#?f-MNKpH-x9Po}Mn!v6QS z!U95q$POYRtTMwYKK_y>|MSydV&v@^fB*Q`eR9NpTN*uq8(o}7y!chmyLtRbDGEgfDHLFM+uu%N&yZi(dQv50E zi@l@-p$U|C>Mlx#`d!n*S5Z3D)(Xq7u+|xiM-47v#(rykFhRoml(PJNDhSt*I$d)! z_EBD~*C}Drb}BHpiV~u>n1A6JYHrp?R61&Wg=7_5>vHimb=3T#T5AohAe|nywl-3c zC7Z2v!blx3Ug!!c95u;8PyrqV1sgs1Y_bP={JxSE-QPcPUX`JL++5pahBAsSwnjnx!g7 zJ0@$LGg2eWebM`rK$%I2^V?AqY@fB38GnHuHPO(={7PyGV3Rs)(*m{B5{xJE+hM@m zhq`Xz)GW;=YDvvbDmbT{3Ii;rS0oj5?FE&E{(GaY7OCwe&s{@>;u($_W}@6SYDPmR zYK9F`?AZ$_1!{LqjapC5`RFF)f9f7JYr$$tn7)q+T~>t}WiP1!U8S`Sm0(FD@Q=D+ znQhecs4{AfI)|F6d>8%MMJ+Y9SnG++S-O`}@|#1{BAid^qXl1hO3Aa=Q_{Qx zROC1RZLJd)dh0hT6m{+-oj*{a*M6b=GS^Vv3-hRXY41{kl)Y2}YKytbbFFpSe08mq z1ogo}ZoHx<%?zfZP&d#2>;o!lbq#8x?WF=U-lK9*gG{mPJt|OJO1UTOqLNW7Ev#TI zB}c8dl+7)a-?2NCd-w{E^wZdqg3XXxIZ-<-m!7@ zZBfIrZl~dHr)7(~@n)Hm6Wgg9H(+7SL-(>}c;ImA9!7JIyJ?Z%FN;qL`rw0{oV2u{w3wWroMr4FHajQgbxu%2%=|QE z!*O=d@fhP%eEYQ9_bHq0i@3#8oD#&&VF$%De9({+hPt*%g*qn zO64U$Q5Jp>L#Kbx(12HDJIBNn#?WW-3hj=w9~g~n3_; zH+=9xObmT~3`QH1Mo;^I-jGHwL{53`m)$Qjwid^JcS*MJI|frGEsU4aFBLvsAj>Um zn6FgQU(*Yfxjbgwwr#RPrBEwO;qmH(g?10@9?a)y3+ER~m36%Mcznr^m&VIvvO=CT zSDA)>U6Ro+<;n)W+nph17RNeWDjc=&yMa-Uw|Zb>arku{Nu~B z(q2v!yH#X(WF#edxNUQrDO1)-r88%4leX{{pzrHQ`&#a1?nQ1*&Bb2wd7Yh9nxfp+ z(t>g3VrLJN>7n(Jt?=iclz~OxY0;p%5e&WTX1jPZu7`MxlK%Q&xP{DNQzN)U1hHkG`?b&Q4CY zUtQ4D@2AuGE%j?^N>A5y2*Mk?9HzB8vp)LhqpmLhkuC?(FP)t;0`T#p{tmxzT}P;5 zO3xIs{Msh_fc8cV0gk2*T>=uz3qtKZRcM{TXh8nyN7g6!l|*#)Z$vYQ(H z8vV-9J|JAbzHh|kq$T(d*12;h&PDsXI0UD5-v4;#m2>CL_4k`qeggEpr)SC(#jE}H zoYe&(r;_dMe@$!1&3&z>s}YxL?1{PovSPmSaDw z%b}Bp4xO}N^_95x9hw$gWw@WP{tu-1d1?G`k6@Hg?CI&*v7>QS!Rpl#dwbv@`PYU9 zKHqJtcq{O;tYOrstr=n&^8&h`oct4pmz^E`O7QAH#L@_XpPwo^dZerCkV_Y<&(*cW zX4-7`&V(7~T_?Gk%^IMwzh4l3phGaF=Qk2pvp)COPabApdMvJ}@JJ){$&1&&5PNLB z@Du6{CfgU_v;xU0o!=`(#H-NISK(%_>t50RU0p7Hu0Ol70%rfRWcnY7%5-Qns_5%F zzs6VL2Lz#0ezPYNYhRGPC)-vsIf$;jbW|)p8WT(Fp3h?*N%GjnqzceqKs~Fkk9B_h)bTcQSJ&&&`O()$qQfIz;VeZ9KdtE5Y$T&JmivFibmExp|c-dIYEa`gz9t9H4F+T*?I&}RSKeHDA;CX#Hi)G{E z>{Igd&#w5S!|wu}F4UZ!Za%i1(6)8#Xn`}jJ4h*Yn>i}JaOKs-G4tca6>c-*DbLkt zxWIl7IZ+~6eJtGXmB3GMUFGF<9TrDpvE@j%Z}$xB_cBLgZb!OY@()e>!QBwI(}!eNmT1hFeVt!N2f!R# zEhz{A1duhlS1>2=z=6q5V9GouGdDMKB|C=4cRM0(8TF}7*MG`!&UOiqgTq#mILABi zy4l=xy+3+{G;iqqWV+7;u$?huCgkT|zpl{<$|9yXNF?^zAt8H0K;HHRt33l15skk( z1?5O(OgFwXa^kJGOZo+q@rtObi56zY#DUaD^GplQy~LUzbmqFlN)|Xgf6GRp9p9 z9L{YHFuMKr9tnCc5cq{hOdbv@l*;0_@*hVQv+0Gr1!51k7oSe)DOJ1@1Uk-HZHpAn zA938?ZhJcrb9+cse(c z{A9gP*he2>FdZFUPo9i9cW#XT$UnUk=gj%>Ho>Q4^&B*>N;juB?LUV8(+S&QN+XM% zatiBG+!pXg-PibqBabU0!ohR(ZO)H*w{M_~Y+iYu_dgG*e=tD}ucrXjst{l#pFI}+JjsGPDF;r@u zgJW~%Y$uoO*@IcLz47ihqF)j|UT@Ra=ViviHAlM~vIN+Sk#E|BQ@|2Kek}iylj!NG z_EPCokb9wm$s2(6mX?-yUh&HBUekGX6Fq81QRwdt&(c^78N~Li6e-U4OdSEFiLG^04oG-Zr-vGwH>#%Yu|VL`H`WQxMRK9`t`onP11M zIdlF-t*x!e`{wU!fc-IM;78M;fxMYSb{?-m=SdH4m(THB)gOI5`u(oxesjbW#pDe! z^W7#Ux$);mUhO_!$lI1wa}nj4!@5 zoAbLQ-tWHqW8Mv0(52*dxufT?=bL>ylb{N5_^$DE@(`Vz1)B(pRrKqUU%f{>aG#05o*_ z$D%}+e8~DP7q2qaZO}a6hV1#~-J+tKj*ch6W22*8Mxy&QWf6joj?qEBMxJ;k&kg7*E;R5!PBOZ zj2j%&)Q7tKuX}|`Jj*2@)Z6dAYjSji3RpFJ_H5B?q7FLVG`)+?&++zloO8(k;55-} zk%&|gn&#lL{CdY|_F`jU%T_lfkKji-RKx9E_jDOaNlZ;eVQ4fm?POQJs-r2<(c4s> z_wJ2vzVW8UZpqAaPyJyd6wt9_?>l+}HE7*&PFKEzsOlGY_g^-q{*pR-cCcmD-O8R5_*IEOd4|QGl(p=x}SoF>9UDn=1XAZD&b!GVkwBqNRrXrKc zQPMBa9E3tz88_8=-lTap&H>i~oJU44?pC%C%Vq)ep9f0b<{GZupI?3TXVmGaufkT~ zSo8V3dGn&N49Yb2j$o1mIiGx3y@~AS95-&v=O~E%`AzSejuK>jE?58HzGS`gS?m}J z3tRE~yr@4njUHZH=%H_!$piiu+iA5aj~;2=#&$$Q`}k-@b>@#muQQk-6o=n;_X51XdkXL1UuOFN?d;Lxufc?yWB>x_OEu^NqM}@n|W?ym#bR?SSNn|IT~D`gvA1Y{4Qi_xNJx7f35s@s_TiL zO(s*(H{a}f7ezo_Crz@2hTEa(vP`SC88hJuScg}%gF4`k5^$zPY$T9%XsnKt)udmO+ z;@}_(I1hf`=i&l6?mvy1jPCbMn$)(dZP%`i8@(y&Tj$R=ZF;XPv@A4~3?dY&qNYm? zDf-`2eV_qcVH=GL^mQ%hzwhz+DJ`2f*Lr**N?kJb5Bx|92CJvFo`<6F^C6e(8ZXQ2 zv2im3z@T@11MF;k_a?Pvdh0xr*(C7O2sDBYjk({e-$mr!c_Cp&>lmb#$bFyAuSrt! zx1s%~r2R*=7c-%GPyOR(*PkIpyfA6w2`m?vk^Jk>P2$!&Z<5PxH-1yJYvVUq3m@(T zrMl+(Lk)uN3&!UlO2s1hczu8?OoK^m_G@fe;z{|%SAE%qDcmH2A5rRzoi^yDKa_p7 zX!cYeaQJ*QF%k>{oN5CJuyI$>Hydql+#j3y;rJ->>j)TLmx~4LA=Tae<0b1`KSxQ5 zF%w3!*~jM>F5oHo#j)(;(iAS23;YD9uCJc=(YXIQgd_|B!VnTHlRy)}1t?zr%d++D>|NFf6KJW9n2M&iMC;RNP_da{A z?{}@WmnS>yP<;Hln`oe&M=@MG+5bFrC|)z}e9W1FOlXMSJ6ug zaX&UTSJ3y)&bI;hF05YtGt;)%QhZaUXNH74+?XtK(}mHn2T zhX;oL;PpGG{*$>V4!w_&cJVf}mz-QSo;QzY*nFYB%yh_h_$^;Hq;N}|wd8bdU*r0_ zKX%W4bbhYu@2}dt3Iy$a9_kc2YJ6`~Y>d@)tV{rf2Wqp_>JBp%Jpn+)Kr^dz#uUPg zE-&^94A;rY>6&L}AOsR0hM1g|`G|xn%>TdnCI95oU#ggW?@=z(%BJcw{=J7?nJ5*f9}Ek z(J1}~q?+Tn2J8WwnYaHYzi95i&injfSLk-oe^9>OE%WNUFMrZM@BeWPgvNfO7G`|K zx4r!}GuNu0iYFbd0&YOeV%)DrweVWx)w%dSLq z9L+t*w!>WNP>VIWl7)(fS=PS^8fACaKLmqu4j(MVZt*Q9;x{kKQ!YaFkPbr9)(!3) zylG*9^8d5d;ZcD6wW>cbIbP|@Ts+?5pTXB6jK2NW!eU9tX}4~E{=iVfRR>k7i_6{h zenuW`Oq(*Bokz4s<+Ep#&+<^b6mlFD9UPR_bJ>beV2gT5=;*lb^wV?a z7!42D%;SowDaNNss!*vHC=;(**Vgux`M7j*%m4@(x*|@EUX@>Te&!s2(($}v#=LP8 z!hF>M%{WxU%45>&*QJ9yp`SoQacq`s*)%!{mCUpa8Z|Rf_ryUzQMn290=*LRTdiAP zJ}3F}G71kD7e7@4dyaydsdP4|IfJWK8T2dYuoL6ram)tCj>(VVvK8yFF$n5@o-`n3 zw79q!Y9CX%y->qv&T-hNOcn`}(LUC-sS3{X z0tpDp@*5l9C#bf=45uIl4iGPwUf&XWgVAqqRIHL-Co3p!&aa#~a||)YuQ;Envw|E3 z!h!Bm;kYFrV7XYFfY!yPR*S{69Zs7J3Aub>aw7O8H^FlbUzUCyAA7J<@B*7!-LyQQp3ys@ATw9E zZ*~1%?%Z6gi~#NKj}7|W?TYJpH~xh$LPIf5mk%?;FRmEP0Q^;}eLlb`8DQF9>DKyO zCP=>{j>R2*43K&X@Cy}34hvN7#*OVqkvKLyb`+Fa7DxyHU`D^kcZ~yL zAph7A!DC}iPGez)2e2n>EO^XF{^9kThEB#1aC8KCKV|4)v@iI9)MUO^#R3j^PQet}SUv%5~Gx{3HFMc^M8CQHT9S$Qlg zBG@jv#Z)sLnb!=Y?^uC8Fm!U3fen4~>zvCy=-8XIqs;0}tP z4x{~R0UulW;D2se3bc=(>jzl>C>~A#JA__~vG7*;reiiibq6cRefdve$a$G)&^25P!hfm@^ zrhHc?!_#H>17!p(XbpHuJn+kL-%P85Uj>Kj2!7SUQXrBk`HFUwFW`=par7*5MCrK0 zMW_R4%D)#E$A;^M!E`>IMoC$Q`a`K;#2}-Bn?_G!p4DJh1Lt%KEss0EB~Zbt`k9v& zD+RIv5i7Of>MaGU)rT`8;$Ofi4;X$PByTs8#oKTFz5;r}CFE1|{DUn$&ySk*D^?0PUL_2T+Z3D84F)=*&1rO~?NDAz*PN>D>&QZ|rT!W#5 zYDPydy8HXH?V(BdPR2fEuFhO#JHGY+Wg~31VD_)SmMcrjMr0YwG94~+Suz=i``!g` z)H6bj847*-aJZpnPcb>fibs7fo&h?6_Ui;_GAVu~=w6W*8|ciw`r@XPNf0)%Vx0dA zhR%!vT;jol*$;8u6?k8x0R6;hN%PshnI2&^lGoS z7dr_W*rd7tqu#lmzqddQ+AJ2M^>GWJy?AlMFn%mL8+o>1(af&JsR|LF5BYT!_S46* zkr6Hn_7~jTgZf2j!z({tiH;LLO-L{hTGd(phmRcgV*lO)mDXN3iU`{BAy6w0D4ABSgY=hD9alT9o z`_!dv_;;n>m|#^~aW&crD448T-uW$DecfJ@@Yq4M*mD!?&;= zBHpmfP_STsWGND_F4}t85t)s0%1~z`5Ncpv~AmPHuIPH^1Sz8M{VV^YGMC!$WTtnY`eZIVJWrRDTK$k zA^Z+&)@5WYwp7*5QJq$OX`)iW{BH6ktja2t$;K~DPMDa~BI}k)^-u*P{T$F?8TiMt z7B=?Fmh;g#m);)`@RbV7OxTxU>9O5rTQV>J%d>JyixsY5K(9@O5#2JC`Hv|YKYppD zDAwdl{K2JECT^)FeYKV_y{j^;Ly&vy<=TvGskN8OEi+&pKmO}?tX4hx7v-nI+KdoH zaP-_M)Ss(`eOzIgT8`B~Y7vN|`tr*!6>dX?3b!9qO-`IpG3A#Q!uk$_yc_K0<;?9` zrYg$a$`x*x1(z=?wA@tK$J1MdBG?CS)e6$PcFP{KxF=a$v=9qc_;La4RYJa=#pgF_ zYx|UarEY~ojr!01O5JKzDnCVGpPQn)+eIN1Gzx`70-;tb6!Kwjc|4$njbF)vZGrW} zuePEA!LqA!E+4;TE93JAPQot!7`A#?Zc#4laS5NL*UM!5Az@*1V{&(Lp`x(V4P3?N zg>Hp~pRX_M6LvQyC-XtF37A6p{KqVoUd!T7DY-(eK){8C|0Js+v+H|nTMw z2Tnfb%SIkUH0WDPPRd$kLYYj6N;Woj!$KoV?sMx)?j9N{{3#!Z8ACe%d48jkFXAV& zxB@-Dq)f&Vq)u_C^n9fy%sb!RvOU?JIKON6fKUYaf?ZZt;^QL|$wZB1BW10!GLFv( zCm%2Qd_4-(yYvkW{p9k~kT4mcUuYJtNaoYZX%(?hp~qZ32vs;L3~;BoT%{XVIHlcf z$<3Z+{klNQm2vq~S}vDgB5N%fk%_Q&U`cE1h^&M&B70ociisrOM+PIMi%i%Dr-kmu zMwH4Q;5Q2OvJw$r*7*43NfB;C#1gu31?5wUTEP@c2_K6t_|IT9E@o?Jz@CU#hBw;( zc=L}}*?+v%-rn8-XP$jJh%ICTmv85VTy#0F_Vi}TC@YXX7>@3@7FF2e!}o) zPF&JT;wGd3CWD9cJ$Q95$c#>1DD$z#mq1ZHyh@}%j8 z{Kwv@og~l>82p&+;S(%KSx@QkRTXQx{>TqJ@gw;oudj5$ZupJvL7wCmgU_<;)SoGG zNf$}yEg|o@{p6F;Zpi%`v%JTUk2wl;mz}*sD)=7D|8$okb*m^ie**;`okafGgA`u@ zpJUvA^wKV}Q+5(RZYj-!uQKC{%j9GBQZ-Rf*?tN-`4>aZV(E#`DC~`|;0xVJ3*ej0 zAUfDi0JgWoQbr@07y;Xi+nLYJH(|Ew1D**=O!c}z}X-+7zh2i=UEx@##5 z?HP@B2`bq|5oJvVKk2l(9&!%Ng`e(L^2tKZ>da0`sNX=^b$iGyvdrMu8~@1@iuw2{ z`f(kF6fC2Nk`>6Ez1xsC*iBJHT%nR;ku$gezS6NDKgPK~Q1nMXQuO#E%7u?}?1ztO z4t6J5HpL=;aKzj9aJ?Pmodv&c_^}J};6si3^2r&1U-wS3_f=B_^86~_xQnrkoYlxX zoR91Ir1z1!zK`M>`X~)~lpTCkBtgDt$6(|phM%*d3S)oMA&R~E3oS&BXusT-;6wZ~ zIm_mf3OTn`7)v3@T^tP`=g{H?O8n$!3OkARjW2-j@}DVcSud%YkdqpI(JAn$mcfrZ zss_2IH3R6c8>FsTOYSihB$+=%@yG$Ktb)HalUKQTn<1yS?A0$wcIpd?fnPe7t)(R7 zw~ibCf&7d2!6$zg<-(7e@%hf}9VD0FERr4hgaU>qNVfPOMZG6UIh_mx~*x9e*kII=zAn2^Z@v1ZPVagwyv+C%vqZ{+xR^!*)arJ69xBUF{ z!F;IGc;RU7W^T@W!u-!{ZjNrfy+>8O8^5is9ZVk{cFRxCAKX;yx+#BfFgQKmZ7?x^ zFu1lCKk&TF&vzRR<}Cc}nsfTLh1)m^4JnGQUk~2A*?0F_NpJ0T6{P1SCFSLDGy*JM zF9@zJQs5tjQB7D%zCxbp?ha3BcX$7(sXcSffqwHkH|w0?=t$r}WyI`Bz(6baWK!=kg{d zG9peq*>c9(FH#(^wXdPU5(yr7QC1e!)g9T69HSoRtN9#x;-ZdFNwp+2!DoV})Abeb zr8X=4gu;RbhKtjACUjU;SBG}k4=HRF&gXHyzo&hN6(|fzy{BbE-+pb?%)-~W+^6b^ zwl-s)Wr+UDl`Hk3_H&0g9F0nqPV!V9vc5{No_R;;+~kH6eE!Ag<<_GtnOZkt$4jeM zUQz0+Lwy>C1RTY+up*8eOtnvTaeVcWYKcCAtz{K9Wu4j@u(eA2k)354E_}oy)ZSCa z?o@E-T3EWTt$&-{gr|LR{Sk?UL|^c<@SVo)?y4Kz2lf}dU5%DGBFVP@J;HPD{p%dt zYro|C+FoWGx3%)>LoFSp~^$l8CX7~EHk65IISfHAomX_>^&Rz|LsRn(G zK0q_H*;&?C>qDY;#vgj-w^iGxW=U-VPI@b^>_q9F4Gp}u)=pp2sLtoR_V}|W?AqEU zbO{o@Qg2bZ;)ZZXvX1@s^tABN&Yj8*tBCz4JR2tLDmikF>U@#l$31;&H9N!DZXzwz zLa&T}II!+Sfh_s$Y;WaGi_q+jS1z3{*q_|MuJrA}`N6IaQq}7HT6J;;+cN5fQh9Hz zv~*p8EPNo_Td(gJD1P$fbU}kIgFSIy(8CE!3I6fT+3(%GyLay!>txC7v~0=4pxnT~ zm1BXqhsTZ_$xe{HS6+Cryl~ymABi~3`GXtYyztjw|NM^&ISbZ` z;nZCk#Y=u8hs%wT`mH$lWC-;+tIGE^@%pCB+IpsRhRqq4tgkB9<2&o1hhwF=b^N72W%axwH0)QrT=K+HJ&A$FOB)8Ot@IvS2g}jC^VdpBgXcY!f%>PUz-*R zWz6|!Rl`jA;+BtN;#QV%*JrS`x#AY?!-qlJ-xasC^r;IjMtdwf{_@LGe!)<>Tys{H zzTtsalj)f=G4D6!WRCJCzFaFlbt)*R^wzss*4FWto|L05XYSl#ZNd5doUrr3Kgzx4 zJ!?L|x|=oqC!H>2(V@vvVQFc5;M(sNcNa(L)-5sN|4Ym#Wvy=z~^l#+LP=`j8Oi!$VE)jDIuln|T*!hFd8^ zqC)i5^_F&Rc%(WxW=36M*QtMMf@f^(6WXCyhU~N`E;oIa_4QX@iNy=}e2K-Co%I%> z^}NU?wa{f)88!bf#ZGW?YQZsm#U3mP*W=c;fAS?Cd%@nwn3;dNoG= zI?Pvi+alD;$5^MWD*T??5_h|>`NI}9+tW&d5AX#~W6Xz|E@zbQ|9iIm5g4JYu0$BO z8E0tkK6Cov&KIVqMr3`KJf8&2-un7#d&|z69?bu}zZs=whgMtYt2;t;Jf1OcKkJ*U zR~H}fTQ$8;ro${?nTF+6G2v!+YUG$t6h`trq1DQIeSLywgpY1QrZeVO-8W-q-hFL)$%zJZE>9O_ zrB^B~DsAOPD%9UBwOYRul|i2{=RaN<{cOdEG}6OQI6YxE!JELO9u*pLrQXq2ZU*^9 za({@AC?88Ugb7cV{Km5!zW||i$&BVqG&&D6r{x4YDpX=+UITdtd1~YUS?ccZ;E)K3 zzBF-mCf4*bY)h9qm@kENcUx-ikm&G%xg7FE)m!tek-W#Y##Z6$tMFC07HxX#_1Aaj ziW-dn8jxNOd+j88w+|0}frZgjbMQ*0y*m4k{M`rzy(KQ+~IR_q1 zMGD(*MaPa_>$-OBQzor8vmM0`^V=16b{7u2x}25R%#HPNv@z|epH{=aGg z2B&&pkHP*QoN9s>|K9$EQ)f^A)g`WEg@wcle4{?tEd3pn`imBX2 zIfw%lA%=D#@NF6N`^XReZoqu&S`pt{(oIZEr>kZwg;t*i?mIvMz||>@ z{gi|_Rt5`-vwKKg-Dbe23dDwn&aX#2>ZiaO<-oaJ2CNrZ*@1g+r*Opb#sGt50tYh~ zc#du(;*KAachMoL*ml$qhZ+mKAzpx(+`R1utS>{%t0=9En3&oHz=sU}4q3R3f)*d6 zu-Cq%kXLV0#HGK{yfu1KmLVQAdjqidS}Fua6=t*qM?R$l z;I~xtci3BZ$t5h;fDhB^dkrzV_QFWSgSG;fuBR--rKY#(fx&=*fT@`nQU?DeAg+_a zhk?LE5r}zaxQsc)t0^#V0|g*fIT$!BsiBv&?E|C+7SkbSwivj30pd%25ignp9L3;b zpSisxE!a$nz*r%b$AMY<&~GI$Z_yF%R4C?STq%UN@pk)Mq?On#y8IdnJQdezk{WBM)FWJ%IAuCVzK>S z{xbgN%l@ICo~?AzZFjL3^LXMH!vyxpMzwd>W_;DY{dI?fq6^Cxe$k$^ z!|w>)z1xzqUf#aOD^5!pYlXYlhb1_a1V%fnPy70R*uCDpm5c&v_oZYVi=!5!(o+8q z72I7VA}eQg^OFyL4Bg$HW^`-ut8TOMLX9$>zT#hft~zhVh@Hs1?pKR*=L<|(Z_3yH zJ{O4=JwNsSc}KUgAadJVrppiX1=cOFm~9fd?=zF#PTBwHk1@)g-S4-fd)u~^SOss; zIw$b(0*fS)^?YlKR0I8dfs}(a+j{l%kOrYKbCw@ zWd7wsEI%qR4f9KDF*5QNmB)B`zcC0G9z;d#>dbN506y{CSMiui7`^7nZ7ZHiTIx5!9Bz^ z8woU*R1KAs92|BSkPI)sa|cY4#9FfJhja&rOv%BSi$v_roDu5-2fl%qi1kRxh(l&_ z=4}q=p!G(M#KB?X_v}t~&he9QA8W(T97H*6c1~LxR#!b97l-sq9f{Qj2=j#_V)6>tuS%*M& zNayb&|LhLPoHp{y=?7PuL;jl8IQM08x&OkzeN$Kt_}Nwp1kX;2d;`bL$Z5-n6v(12 zI!28Ms=JW-a;6T?6iaH5prRAXBpqGS@jU0$lSTcv?02 zgNv0iGCsH8z}q?oWf8gfLMNC@-0US({P!0IPIvyJ7Y3QX07vEDUXX)dlEJpY@YgBR zFDR>NgF*iA@cmNA!vM&wBAm;}IEL#N#8-gl-bzVbI}Pie*rOdBai9M4pdaL-{qi@H zPi8x0e<$jOd+FT;9daFXK+Mmog}C-1e71(9EBg()f(*KatYinxauJXkx?$3)jpQba zGH~yVp2O%6A>X_p4fGOrd=AD-Z=ezKqDgYzzdeMFqOlqhKt`J+yzvps0u_b(`< z4DuiPlQ^}Jq}mSh#8?zRM4w}gjez>~G~@0IBF`Y`$_I(0YO)GZkxg_aIm(i;PDwLa zr7nP-U=JlgrwxQ|8V$WxgSM4nTx**9X>RjIvPqdwjzMV@kG5w+p9!fxMHF2Oow$Xx zeS;K*wLlyLQpkMjg~4Xy58XxE`V!fTVzCBC9oFL5N1B#?gH9Gy@RC6nWb}E7c7ws* zleQc>YgQ)}pzleZNipBzsK_zcx&r6*U_4<=W#Aq)=#Qdp6p&eDuy0x9Ehn3W&19o% zCA+fKl;6FboT1|{#25|E>of4@lB{lGbb7{ilnwpPOI1T2o(m;8OPBgBob+6ruOfg>;Qqd>?EMwr&a&n%TkcVLGG=z*t!2j6v!dc2 z_5b4PU6uCR)^+PHJWvNJ7duy2|E$PdWtFf%R4P3DMsr`q(Ri2f#s2q-^34agM<&ab zrhZqxq|)to=c4@b$`Jp)cgxF{xCQU8UuyMz*QFJ+}F$SCzZnjoLhoye(e|Jk;l0@%T-zn_t&CH>;yJxSIsXQZsz2 zx{uY>4a_v(;dP~=jxMM9MDhyS8dYiC$D9k7&n#zZ_;E#&@rkNcU7TMUSNv>kTyslq zUe0oK+}7f2Tw^VWGYRmVf56(<*jHQ?Uk(zd_q{A%md9%IzH; z%{KXnTaAW{sarydikI4%}8#OM0lIpv28EfI^?n0d-vLo zMULg>I`I6;KA3OP)YNq+_WjtqcOy(eeC3)E5Z2#cFh?q#GlxG%S~iEzk#abT z+GPD<|3jkuANiM&V>Z}5u>V_*#r#Wl;jRDJg;T$KK`EF6lCewi%)2T}h%M1zPA(?9 zxQ%4yr6!(COMVYtkg125Of0O)DZGeG9K&gbr46~J_7E?1E6w&xB~zbFa!K8cxj2?w zB1*{0JAr1p#}bKP*NfKRvrWWOfX)#wAQxpZ@v|$*+J7F7)nwxxKw%YK6j8IDB9``& znIoUPw0hzMWRsUFVXim&zbZcycwFh1QZ|S}8frt08V&4s7CTvJ03? zcHtWGgsiahiy=9%q`6Q{35}b`EO-%F`)Y~U?!<}OKx|(*^oLfgakPR2m~&;7Yly;{ zX*RwuDqK#E(G4WXTnC$I6gefXAuB}-j@`s^jRlvniA+5uWNg7EyQoZZz`QxbS&lYb zi|eM5xL^g%Lj66nt59YW*-JAp-#gJPz6$S0la;GCImI`VE81}uKLPz+O8mTo69-Xj9KMJQyFX#NV~2BecCD= zW(ZQq8U5*^C??m$g=8O?g<}bsa-At`Nhetd0wA;6(3e`+Z(kxCymko5Bcsq3l9#U` zHb0VhzAqyEU$Qshh~(WPPWlKWQVc+|LZn5?vU2HCg0T5 z_oK$d)#5Sf!6h?a*14RS=^DGrv9n&bLd~L){_{lHSu{cO4_#bfR7(S_<#SnAjg}GD z@4|I+viQX4xTjv|WVCa?-G*6pIV69{@`zDN&lXxLv5lL@QVK$hS*0t}cT?ev$hBwR zUzgV#UJ|q2yX-{frVl>6w&V3ZyZZPF|HTRi4+{Lay{h8mYr&Vc*_)WW(&cvefR)*+mH)f__P+p#8JB?o diff --git a/src/fpu/Makefile.am b/src/fpu/Makefile.am index d081a68..541d5a4 100644 --- a/src/fpu/Makefile.am +++ b/src/fpu/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = -I$(top_srcdir)/include noinst_LIBRARIES = libfpu.a -libfpu_a_SOURCES = fpu.cpp fpu_types.h fpu_instructions.h \ +libfpu_a_SOURCES = fpu.cpp fpu_instructions.h \ fpu_instructions_x86.h diff --git a/src/fpu/Makefile.in b/src/fpu/Makefile.in index d6a5121..fd7c88e 100644 --- a/src/fpu/Makefile.in +++ b/src/fpu/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libfpu_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,43 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/fpu -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libfpu_a_AR = $(AR) $(ARFLAGS) -libfpu_a_LIBADD = -am_libfpu_a_OBJECTS = fpu.$(OBJEXT) -libfpu_a_OBJECTS = $(am_libfpu_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libfpu_a_SOURCES) -DIST_SOURCES = $(libfpu_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -99,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -129,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -139,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -148,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -174,43 +139,51 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + noinst_LIBRARIES = libfpu.a -libfpu_a_SOURCES = fpu.cpp fpu_types.h fpu_instructions.h \ +libfpu_a_SOURCES = fpu.cpp fpu_instructions.h \ fpu_instructions_x86.h +subdir = src/fpu +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libfpu_a_AR = $(AR) cru +libfpu_a_LIBADD = +am_libfpu_a_OBJECTS = fpu.$(OBJEXT) +libfpu_a_OBJECTS = $(am_libfpu_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/fpu.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libfpu_a_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libfpu_a_SOURCES) + all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/fpu/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/fpu/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/fpu/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -220,7 +193,7 @@ libfpu.a: $(libfpu_a_OBJECTS) $(libfpu_a_DEPENDENCIES) $(RANLIB) libfpu.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -228,20 +201,36 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpu.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -250,7 +239,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -262,11 +250,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -289,6 +276,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -302,7 +293,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -320,6 +311,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) + installdirs: install: install-am install-exec: install-exec-am @@ -340,7 +332,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -359,8 +351,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -396,14 +386,13 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/fpu/fpu.cpp b/src/fpu/fpu.cpp index 1c326f9..405700b 100644 --- a/src/fpu/fpu.cpp +++ b/src/fpu/fpu.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: fpu.cpp,v 1.27 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: fpu.cpp,v 1.29 2007/01/08 19:45:39 qbix79 Exp $ */ #include "dosbox.h" #if C_FPU @@ -28,74 +28,20 @@ #include "fpu.h" #include "cpu.h" -typedef PhysPt EAPoint; +FPU_rec fpu; -#define TOP fpu.top -#define STV(i) ( (fpu.top+ (i) ) & 7 ) - -#define LoadMb(off) mem_readb(off) -#define LoadMw(off) mem_readw(off) -#define LoadMd(off) mem_readd(off) - -#define SaveMb(off,val) mem_writeb(off,val) -#define SaveMw(off,val) mem_writew(off,val) -#define SaveMd(off,val) mem_writed(off,val) - -#include "fpu_types.h" - -static struct { - FPU_Reg regs[9]; - FPU_P_Reg p_regs[9]; - FPU_Tag tags[9]; - Bit16u cw,cw_mask_all; - Bit16u sw; - Bitu top; - FPU_Round round; -} fpu; - -INLINE void FPU_SetCW(Bitu word){ - fpu.cw = word; - fpu.cw_mask_all = word | 0x3f; - fpu.round = (FPU_Round)((word >> 10) & 3); +void FPU_FLDCW(PhysPt addr){ + Bit16u temp = mem_readw(addr); + FPU_SetCW(temp); } - -static Bit16u FPU_GetTag(void){ + +Bit16u FPU_GetTag(void){ Bit16u tag=0; for(Bitu i=0;i<8;i++) tag |= ( (fpu.tags[i]&3) <<(2*i)); return tag; } -static void FPU_SetTag(Bit16u tag){ - for(Bitu i=0;i<8;i++) - fpu.tags[i]= static_cast((tag >>(2*i))&3); -} - -INLINE Bitu FPU_GET_TOP(void){ - return (fpu.sw & 0x3800)>>11; -} -INLINE void FPU_SET_TOP(Bitu val){ - fpu.sw &= ~0x3800; - fpu.sw |= (val&7)<<11; -} - -INLINE void FPU_SET_C0(Bitu C){ - fpu.sw &= ~0x0100; - if(C) fpu.sw |= 0x0100; -} -INLINE void FPU_SET_C1(Bitu C){ - fpu.sw &= ~0x0200; - if(C) fpu.sw |= 0x0200; -} -INLINE void FPU_SET_C2(Bitu C){ - fpu.sw &= ~0x0400; - if(C) fpu.sw |= 0x0400; -} -INLINE void FPU_SET_C3(Bitu C){ - fpu.sw &= ~0x4000; - if(C) fpu.sw |= 0x4000; -} - #if C_FPU_X86 #include "fpu_instructions_x86.h" #else @@ -109,32 +55,31 @@ INLINE void FPU_SET_C3(Bitu C){ static void EATREE(Bitu _rm){ Bitu group=(_rm >> 3) & 7; - /* data will allready be put in register 8 by caller */ switch(group){ case 0x00: /* FADD */ - FPU_FADD(TOP, 8); + FPU_FADD_EA(TOP); break; case 0x01: /* FMUL */ - FPU_FMUL(TOP, 8); + FPU_FMUL_EA(TOP); break; case 0x02: /* FCOM */ - FPU_FCOM(TOP,8); + FPU_FCOM_EA(TOP); break; case 0x03: /* FCOMP */ - FPU_FCOM(TOP,8); + FPU_FCOM_EA(TOP); FPU_FPOP(); break; case 0x04: /* FSUB */ - FPU_FSUB(TOP,8); + FPU_FSUB_EA(TOP); break; case 0x05: /* FSUBR */ - FPU_FSUBR(TOP,8); + FPU_FSUBR_EA(TOP); break; case 0x06: /* FDIV */ - FPU_FDIV(TOP, 8); + FPU_FDIV_EA(TOP); break; case 0x07: /* FDIVR */ - FPU_FDIVR(TOP,8); + FPU_FDIVR_EA(TOP); break; default: break; @@ -143,7 +88,7 @@ static void EATREE(Bitu _rm){ void FPU_ESC0_EA(Bitu rm,PhysPt addr) { /* REGULAR TREE WITH 32 BITS REALS */ - FPU_FLD_F32(addr,8); + FPU_FLD_F32_EA(addr); EATREE(rm); } @@ -204,10 +149,7 @@ void FPU_ESC1_EA(Bitu rm,PhysPt addr) { FPU_FLDENV(addr); break; case 0x05: /* FLDCW */ - { - Bit16u temp = mem_readw(addr); - FPU_SetCW(temp); - } + FPU_FLDCW(addr); break; case 0x06: /* FSTENV */ FPU_FSTENV(addr); @@ -364,7 +306,7 @@ void FPU_ESC1_Normal(Bitu rm) { void FPU_ESC2_EA(Bitu rm,PhysPt addr) { /* 32 bits integer operants */ - FPU_FLD_I32(addr,8); + FPU_FLD_I32_EA(addr); EATREE(rm); } @@ -457,7 +399,7 @@ void FPU_ESC3_Normal(Bitu rm) { void FPU_ESC4_EA(Bitu rm,PhysPt addr) { /* REGULAR TREE WITH 64 BITS REALS */ - FPU_FLD_F64(addr,8); + FPU_FLD_F64_EA(addr); EATREE(rm); } @@ -560,10 +502,9 @@ void FPU_ESC5_Normal(Bitu rm) { } } - void FPU_ESC6_EA(Bitu rm,PhysPt addr) { /* 16 bit (word integer) operants */ - FPU_FLD_I16(addr,8); + FPU_FLD_I16_EA(addr); EATREE(rm); } diff --git a/src/fpu/fpu_instructions.h b/src/fpu/fpu_instructions.h index 01cfc53..be5acdd 100644 --- a/src/fpu/fpu_instructions.h +++ b/src/fpu/fpu_instructions.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: fpu_instructions.h,v 1.28 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: fpu_instructions.h,v 1.31 2007/01/08 19:45:39 qbix79 Exp $ */ static void FPU_FINIT(void) { @@ -187,6 +187,21 @@ static void FPU_FBLD(PhysPt addr,Bitu store_to) { fpu.regs[store_to].d = temp; } + +static INLINE void FPU_FLD_F32_EA(PhysPt addr) { + FPU_FLD_F32(addr,8); +} +static INLINE void FPU_FLD_F64_EA(PhysPt addr) { + FPU_FLD_F64(addr,8); +} +static INLINE void FPU_FLD_I32_EA(PhysPt addr) { + FPU_FLD_I32(addr,8); +} +static INLINE void FPU_FLD_I16_EA(PhysPt addr) { + FPU_FLD_I16(addr,8); +} + + static void FPU_FST_F32(PhysPt addr) { union { float f; @@ -249,7 +264,6 @@ static void FPU_FBST(PhysPt addr) { mem_writeb(addr+9,p); } - static void FPU_FADD(Bitu op1, Bitu op2){ fpu.regs[op1].d+=fpu.regs[op2].d; //flags and such :) @@ -556,3 +570,27 @@ static void FPU_FLDZ(void){ fpu.regs[TOP].d = 0.0; fpu.tags[TOP] = TAG_Zero; } + + +static INLINE void FPU_FADD_EA(Bitu op1){ + FPU_FADD(op1,8); +} +static INLINE void FPU_FMUL_EA(Bitu op1){ + FPU_FMUL(op1,8); +} +static INLINE void FPU_FSUB_EA(Bitu op1){ + FPU_FSUB(op1,8); +} +static INLINE void FPU_FSUBR_EA(Bitu op1){ + FPU_FSUBR(op1,8); +} +static INLINE void FPU_FDIV_EA(Bitu op1){ + FPU_FDIV(op1,8); +} +static INLINE void FPU_FDIVR_EA(Bitu op1){ + FPU_FDIVR(op1,8); +} +static INLINE void FPU_FCOM_EA(Bitu op1){ + FPU_FCOM(op1,8); +} + diff --git a/src/fpu/fpu_instructions_x86.h b/src/fpu/fpu_instructions_x86.h index a251c0c..f68367b 100644 --- a/src/fpu/fpu_instructions_x86.h +++ b/src/fpu/fpu_instructions_x86.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: fpu_instructions_x86.h,v 1.3 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: fpu_instructions_x86.h,v 1.5 2007/01/08 19:45:39 qbix79 Exp $ */ #define WEAK_EXCEPTIONS @@ -33,11 +33,9 @@ #ifdef WEAK_EXCEPTIONS #define FPUD_LOAD(op,szI,szA) \ __asm { \ - __asm mov eax, 8 \ - __asm shl eax, 4 \ __asm mov ebx, store_to \ __asm shl ebx, 4 \ - __asm op szI PTR fpu.p_regs[eax].m1 \ + __asm op szI PTR fpu.p_regs[128].m1 \ __asm fstp TBYTE PTR fpu.p_regs[ebx].m1 \ } #else @@ -56,6 +54,37 @@ fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); #endif +#ifdef WEAK_EXCEPTIONS +#define FPUD_LOAD_EA(op,szI,szA) \ + __asm { \ + __asm op szI PTR fpu.p_regs[128].m1 \ + } +#else +#define FPUD_LOAD_EA(op,szI,szA) \ + Bit16u new_sw; \ + __asm { \ + __asm mov eax, 8 \ + __asm shl eax, 4 \ + __asm fclex \ + __asm op szI PTR fpu.p_regs[eax].m1 \ + __asm fnstsw new_sw \ + } \ + fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); +#endif + +#ifdef WEAK_EXCEPTIONS +#define FPUD_STORE(op,szI,szA) \ + Bit16u save_cw; \ + __asm { \ + __asm fnstcw save_cw \ + __asm mov eax, TOP \ + __asm fldcw fpu.cw_mask_all \ + __asm shl eax, 4 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm op szI PTR fpu.p_regs[128].m1 \ + __asm fldcw save_cw \ + } +#else #define FPUD_STORE(op,szI,szA) \ Bit16u new_sw,save_cw; \ __asm { \ @@ -72,6 +101,7 @@ __asm fldcw save_cw \ } \ fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); +#endif // handles fsin,fcos,f2xm1,fchs,fabs #define FPUD_TRIG(op) \ @@ -179,6 +209,23 @@ #endif // handles fadd,fmul,fsub,fsubr +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH1(op) \ + Bit16u save_cw; \ + __asm { \ + __asm fnstcw save_cw \ + __asm mov eax, op1 \ + __asm shl eax, 4 \ + __asm fldcw fpu.cw_mask_all \ + __asm mov ebx, op2 \ + __asm shl ebx, 4 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fld TBYTE PTR fpu.p_regs[ebx].m1 \ + __asm op st(1), st(0) \ + __asm fstp TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fldcw save_cw \ + } +#else #define FPUD_ARITH1(op) \ Bit16u new_sw,save_cw; \ __asm { \ @@ -197,8 +244,57 @@ __asm fldcw save_cw \ } \ fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); +#endif + +// handles fadd,fmul,fsub,fsubr +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH1_EA(op) \ + Bit16u save_cw; \ + __asm { \ + __asm fnstcw save_cw \ + __asm mov eax, op1 \ + __asm fldcw fpu.cw_mask_all \ + __asm shl eax, 4 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fxch \ + __asm op st(1), st(0) \ + __asm fstp TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fldcw save_cw \ + } +#else +#define FPUD_ARITH1_EA(op) \ + Bit16u new_sw,save_cw; \ + __asm { \ + __asm fnstcw save_cw \ + __asm fldcw fpu.cw_mask_all \ + __asm mov eax, op1 \ + __asm shl eax, 4 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fxch \ + __asm clx \ + __asm op st(1), st(0) \ + __asm fnstsw new_sw \ + __asm fstp TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fldcw save_cw \ + } \ + fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); +#endif // handles fsqrt,frndint +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH2(op) \ + Bit16u save_cw; \ + __asm { \ + __asm fnstcw save_cw \ + __asm mov eax, TOP \ + __asm fldcw fpu.cw_mask_all \ + __asm shl eax, 4 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm op \ + __asm fstp TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fldcw save_cw \ + } +#else #define FPUD_ARITH2(op) \ Bit16u new_sw,save_cw; \ __asm { \ @@ -214,8 +310,26 @@ __asm fldcw save_cw \ } \ fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); +#endif // handles fdiv,fdivr +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH3(op) \ + Bit16u save_cw; \ + __asm { \ + __asm fnstcw save_cw \ + __asm mov eax, op1 \ + __asm shl eax, 4 \ + __asm fldcw fpu.cw_mask_all \ + __asm mov ebx, op2 \ + __asm shl ebx, 4 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fld TBYTE PTR fpu.p_regs[ebx].m1 \ + __asm op st(1), st(0) \ + __asm fstp TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fldcw save_cw \ + } +#else #define FPUD_ARITH3(op) \ Bit16u new_sw,save_cw; \ __asm { \ @@ -234,6 +348,41 @@ __asm fldcw save_cw \ } \ fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); +#endif + +// handles fdiv,fdivr +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH3_EA(op) \ + Bit16u save_cw; \ + __asm { \ + __asm fnstcw save_cw \ + __asm mov eax, op1 \ + __asm fldcw fpu.cw_mask_all \ + __asm shl eax, 4 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fxch \ + __asm op st(1), st(0) \ + __asm fstp TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fldcw save_cw \ + } +#else +#define FPUD_ARITH3_EA(op) \ + Bit16u new_sw,save_cw; \ + __asm { \ + __asm fnstcw save_cw \ + __asm mov eax, op1 \ + __asm fldcw fpu.cw_mask_all \ + __asm shl eax, 4 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fxch \ + __asm fclex \ + __asm op st(1), st(0) \ + __asm fnstsw new_sw \ + __asm fstp TBYTE PTR fpu.p_regs[eax].m1 \ + __asm fldcw save_cw \ + } \ + fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); +#endif // handles fprem,fprem1,fscale #define FPUD_REMINDER(op) \ @@ -260,8 +409,8 @@ Bit16u new_sw; \ __asm { \ __asm mov ebx, op2 \ - __asm shl ebx, 4 \ __asm mov eax, op1 \ + __asm shl ebx, 4 \ __asm shl eax, 4 \ __asm fld TBYTE PTR fpu.p_regs[ebx].m1 \ __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ @@ -271,6 +420,18 @@ } \ fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); +#define FPUD_COMPARE_EA(op) \ + Bit16u new_sw; \ + __asm { \ + __asm mov eax, op1 \ + __asm shl eax, 4 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm clx \ + __asm op \ + __asm fnstsw new_sw \ + } \ + fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); + // handles fxam,ftst #define FPUD_EXAMINE(op) \ Bit16u new_sw; \ @@ -323,6 +484,22 @@ #endif // handles fyl2x +#ifdef WEAK_EXCEPTIONS +#define FPUD_FYL2X(op) \ + __asm { \ + __asm mov eax, TOP \ + __asm mov ebx, eax \ + __asm inc ebx \ + __asm and ebx, 7 \ + __asm shl ebx, 4 \ + __asm shl eax, 4 \ + __asm fld TBYTE PTR fpu.p_regs[ebx].m1 \ + __asm fld TBYTE PTR fpu.p_regs[eax].m1 \ + __asm op \ + __asm fstp TBYTE PTR fpu.p_regs[ebx].m1 \ + } \ + FPU_FPOP(); +#else #define FPUD_FYL2X(op) \ Bit16u new_sw; \ __asm { \ @@ -341,6 +518,7 @@ } \ fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); \ FPU_FPOP(); +#endif // load math constants #define FPUD_LOAD_CONST(op) \ @@ -364,8 +542,7 @@ #ifdef WEAK_EXCEPTIONS #define FPUD_LOAD(op,szI,szA) \ __asm__ volatile ( \ - "movl $8, %%eax \n" \ - "shl $4, %%eax \n" \ + "movl $128, %%eax \n" \ "shl $4, %0 \n" \ #op #szA " (%1, %%eax) \n" \ "fstpt (%1, %0) " \ @@ -391,6 +568,47 @@ fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); #endif +#ifdef WEAK_EXCEPTIONS +#define FPUD_LOAD_EA(op,szI,szA) \ + __asm__ volatile ( \ + "movl $128, %%eax \n" \ + #op #szA " (%0, %%eax) \n" \ + : \ + : "r" (fpu.p_regs) \ + : "eax", "memory" \ + ); +#else +#define FPUD_LOAD_EA(op,szI,szA) \ + Bit16u new_sw; \ + __asm__ volatile ( \ + "movl $8, %%eax \n" \ + "shl $4, %%eax \n" \ + "fclex \n" \ + #op #szA " (%1, %%eax) \n" \ + "fnstsw %0 \n" \ + : "=m" (new_sw) \ + : "r" (fpu.p_regs) \ + : "eax", "memory" \ + ); \ + fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); +#endif + +#ifdef WEAK_EXCEPTIONS +#define FPUD_STORE(op,szI,szA) \ + Bit16u save_cw; \ + __asm__ volatile ( \ + "fnstcw %0 \n" \ + "shll $4, %1 \n" \ + "fldcw %3 \n" \ + "movl $128, %%eax \n" \ + "fldt (%2, %1) \n" \ + #op #szA " (%2, %%eax) \n" \ + "fldcw %0 " \ + : "=m" (save_cw) \ + : "r" (TOP), "r" (fpu.p_regs), "m" (fpu.cw_mask_all) \ + : "eax", "memory" \ + ); +#else #define FPUD_STORE(op,szI,szA) \ Bit16u new_sw,save_cw; \ __asm__ volatile ( \ @@ -409,6 +627,7 @@ : "eax", "memory" \ ); \ fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); +#endif // handles fsin,fcos,f2xm1,fchs,fabs #define FPUD_TRIG(op) \ @@ -422,7 +641,7 @@ "fstpt (%2, %1) " \ : "=m" (new_sw) \ : "r" (TOP), "r" (fpu.p_regs) \ - : "memory" \ + : "memory" \ ); \ fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); @@ -520,6 +739,24 @@ #endif // handles fadd,fmul,fsub,fsubr +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH1(op) \ + Bit16u save_cw; \ + __asm__ volatile ( \ + "fnstcw %0 \n" \ + "fldcw %4 \n" \ + "shll $4, %2 \n" \ + "shll $4, %1 \n" \ + "fldt (%3, %2) \n" \ + "fldt (%3, %1) \n" \ + #op" \n" \ + "fstpt (%3, %1) \n" \ + "fldcw %0 " \ + : "=m" (save_cw) \ + : "r" (op1), "r" (op2), "r" (fpu.p_regs), "m" (fpu.cw_mask_all) \ + : "memory" \ + ); +#else #define FPUD_ARITH1(op) \ Bit16u new_sw,save_cw; \ __asm__ volatile ( \ @@ -539,8 +776,61 @@ : "memory" \ ); \ fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); +#endif + +// handles fadd,fmul,fsub,fsubr +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH1_EA(op) \ + Bit16u save_cw; \ + __asm__ volatile ( \ + "fnstcw %0 \n" \ + "fldcw %3 \n" \ + "shll $4, %1 \n" \ + "fldt (%2, %1) \n" \ + #op" \n" \ + "fstpt (%2, %1) \n" \ + "fldcw %0 " \ + : "=m" (save_cw) \ + : "r" (op1), "r" (fpu.p_regs), "m" (fpu.cw_mask_all) \ + : "memory" \ + ); +#else +#define FPUD_ARITH1_EA(op) \ + Bit16u new_sw,save_cw; \ + __asm__ volatile ( \ + "fnstcw %1 \n" \ + "fldcw %4 \n" \ + "shll $4, %2 \n" \ + "fldt (%3, %2) \n" \ + clx" \n" \ + #op" \n" \ + "fnstsw %0 \n" \ + "fstpt (%3, %2) \n" \ + "fldcw %1 " \ + : "=m" (new_sw), "=m" (save_cw) \ + : "r" (op1), "r" (fpu.p_regs), "m" (fpu.cw_mask_all) \ + : "memory" \ + ); \ + fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); +#endif // handles fsqrt,frndint +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH2(op) \ + Bit16u save_cw; \ + __asm__ volatile ( \ + "fnstcw %0 \n" \ + "fldcw %3 \n" \ + "shll $4, %1 \n" \ + "fldt (%2, %1) \n" \ + #op" \n" \ + "fstpt (%2, %1) \n" \ + "fldcw %0 " \ + : "=m" (save_cw) \ + : "r" (TOP), "r" (fpu.p_regs), "m" (fpu.cw_mask_all) \ + : "memory" \ + ); +#else #define FPUD_ARITH2(op) \ Bit16u new_sw,save_cw; \ __asm__ volatile ( \ @@ -558,8 +848,27 @@ : "memory" \ ); \ fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); +#endif // handles fdiv,fdivr +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH3(op) \ + Bit16u save_cw; \ + __asm__ volatile ( \ + "fnstcw %0 \n" \ + "fldcw %4 \n" \ + "shll $4, %2 \n" \ + "shll $4, %1 \n" \ + "fldt (%3, %2) \n" \ + "fldt (%3, %1) \n" \ + #op" \n" \ + "fstpt (%3, %1) \n" \ + "fldcw %0 " \ + : "=m" (save_cw) \ + : "r" (op1), "r" (op2), "r" (fpu.p_regs), "m" (fpu.cw_mask_all) \ + : "memory" \ + ); +#else #define FPUD_ARITH3(op) \ Bit16u new_sw,save_cw; \ __asm__ volatile ( \ @@ -579,6 +888,43 @@ : "memory" \ ); \ fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); +#endif + +// handles fdiv,fdivr +#ifdef WEAK_EXCEPTIONS +#define FPUD_ARITH3_EA(op) \ + Bit16u save_cw; \ + __asm__ volatile ( \ + "fnstcw %0 \n" \ + "fldcw %3 \n" \ + "shll $4, %1 \n" \ + "fldt (%2, %1) \n" \ + #op" \n" \ + "fstpt (%2, %1) \n" \ + "fldcw %0 " \ + : "=m" (save_cw) \ + : "r" (op1), "r" (fpu.p_regs), "m" (fpu.cw_mask_all) \ + : "memory" \ + ); +#else +#define FPUD_ARITH3_EA(op) \ + Bit16u new_sw,save_cw; \ + __asm__ volatile ( \ + "fnstcw %1 \n" \ + "fldcw %4 \n" \ + "shll $4, %2 \n" \ + "fldt (%3, %2) \n" \ + "fclex \n" \ + #op" \n" \ + "fnstsw %0 \n" \ + "fstpt (%3, %2) \n" \ + "fldcw %1 " \ + : "=m" (new_sw), "=m" (save_cw) \ + : "r" (op1), "r" (fpu.p_regs), "m" (fpu.cw_mask_all) \ + : "memory" \ + ); \ + fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); +#endif // handles fprem,fprem1,fscale #define FPUD_REMINDER(op) \ @@ -615,7 +961,22 @@ "fnstsw %0 " \ : "=m" (new_sw) \ : "r" (op1), "r" (op2), "r" (fpu.p_regs) \ - : "memory" \ + : "memory" \ + ); \ + fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); + +// handles fcom,fucom +#define FPUD_COMPARE_EA(op) \ + Bit16u new_sw; \ + __asm__ volatile ( \ + "shll $4, %1 \n" \ + "fldt (%2, %1) \n" \ + clx" \n" \ + #op" \n" \ + "fnstsw %0 " \ + : "=m" (new_sw) \ + : "r" (op1), "r" (fpu.p_regs) \ + : "memory" \ ); \ fpu.sw=(new_sw&exc_mask)|(fpu.sw&0x80ff); @@ -677,6 +1038,24 @@ #endif // handles fyl2x +#ifdef WEAK_EXCEPTIONS +#define FPUD_FYL2X(op) \ + __asm__ volatile ( \ + "movl %0, %%eax \n" \ + "incl %%eax \n" \ + "andl $7, %%eax \n" \ + "shll $4, %%eax \n" \ + "shll $4, %0 \n" \ + "fldt (%1, %%eax) \n" \ + "fldt (%1, %0) \n" \ + #op" \n" \ + "fstpt (%1, %%eax) \n" \ + : \ + : "r" (TOP), "r" (fpu.p_regs) \ + : "eax", "memory" \ + ); \ + FPU_FPOP(); +#else #define FPUD_FYL2X(op) \ Bit16u new_sw; \ __asm__ volatile ( \ @@ -697,6 +1076,7 @@ ); \ fpu.sw=(new_sw&0xffbf)|(fpu.sw&0x80ff); \ FPU_FPOP(); +#endif // load math constants #define FPUD_LOAD_CONST(op) \ @@ -756,12 +1136,23 @@ static void FPU_FLD_F32(PhysPt addr,Bitu store_to) { FPUD_LOAD(fld,DWORD,s) } +static void FPU_FLD_F32_EA(PhysPt addr) { + fpu.p_regs[8].m1 = mem_readd(addr); + FPUD_LOAD_EA(fld,DWORD,s) +} + static void FPU_FLD_F64(PhysPt addr,Bitu store_to) { fpu.p_regs[8].m1 = mem_readd(addr); fpu.p_regs[8].m2 = mem_readd(addr+4); FPUD_LOAD(fld,QWORD,l) } +static void FPU_FLD_F64_EA(PhysPt addr) { + fpu.p_regs[8].m1 = mem_readd(addr); + fpu.p_regs[8].m2 = mem_readd(addr+4); + FPUD_LOAD_EA(fld,QWORD,l) +} + static void FPU_FLD_F80(PhysPt addr) { fpu.p_regs[TOP].m1 = mem_readd(addr); fpu.p_regs[TOP].m2 = mem_readd(addr+4); @@ -774,11 +1165,21 @@ static void FPU_FLD_I16(PhysPt addr,Bitu store_to) { FPUD_LOAD(fild,WORD,) } +static void FPU_FLD_I16_EA(PhysPt addr) { + fpu.p_regs[8].m1 = (Bit32u)mem_readw(addr); + FPUD_LOAD_EA(fild,WORD,) +} + static void FPU_FLD_I32(PhysPt addr,Bitu store_to) { fpu.p_regs[8].m1 = mem_readd(addr); FPUD_LOAD(fild,DWORD,l) } +static void FPU_FLD_I32_EA(PhysPt addr) { + fpu.p_regs[8].m1 = mem_readd(addr); + FPUD_LOAD_EA(fild,DWORD,l) +} + static void FPU_FLD_I64(PhysPt addr,Bitu store_to) { fpu.p_regs[8].m1 = mem_readd(addr); fpu.p_regs[8].m2 = mem_readd(addr+4); @@ -863,26 +1264,50 @@ static void FPU_FADD(Bitu op1, Bitu op2){ FPUD_ARITH1(faddp) } +static void FPU_FADD_EA(Bitu op1){ + FPUD_ARITH1_EA(faddp) +} + static void FPU_FDIV(Bitu op1, Bitu op2){ FPUD_ARITH3(fdivp) } +static void FPU_FDIV_EA(Bitu op1){ + FPUD_ARITH3_EA(fdivp) +} + static void FPU_FDIVR(Bitu op1, Bitu op2){ FPUD_ARITH3(fdivrp) } +static void FPU_FDIVR_EA(Bitu op1){ + FPUD_ARITH3_EA(fdivrp) +} + static void FPU_FMUL(Bitu op1, Bitu op2){ FPUD_ARITH1(fmulp) } +static void FPU_FMUL_EA(Bitu op1){ + FPUD_ARITH1_EA(fmulp) +} + static void FPU_FSUB(Bitu op1, Bitu op2){ FPUD_ARITH1(fsubp) } +static void FPU_FSUB_EA(Bitu op1){ + FPUD_ARITH1_EA(fsubp) +} + static void FPU_FSUBR(Bitu op1, Bitu op2){ FPUD_ARITH1(fsubrp) } +static void FPU_FSUBR_EA(Bitu op1){ + FPUD_ARITH1_EA(fsubrp) +} + static void FPU_FXCH(Bitu stv, Bitu other){ FPU_Tag tag = fpu.tags[other]; fpu.tags[other] = fpu.tags[stv]; @@ -916,6 +1341,10 @@ static void FPU_FCOM(Bitu op1, Bitu op2){ FPUD_COMPARE(fcompp) } +static void FPU_FCOM_EA(Bitu op1){ + FPUD_COMPARE_EA(fcompp) +} + static void FPU_FUCOM(Bitu op1, Bitu op2){ FPUD_COMPARE(fucompp) } diff --git a/src/fpu/fpu_types.h b/src/fpu/fpu_types.h deleted file mode 100644 index aee173b..0000000 --- a/src/fpu/fpu_types.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2002-2006 The DOSBox Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* $Id: fpu_types.h,v 1.13 2006/02/09 11:47:48 qbix79 Exp $ */ -typedef union { - double d; -#ifndef WORDS_BIGENDIAN - struct { - Bit32u lower; - Bit32s upper; - } l; -#else - struct { - Bit32s upper; - Bit32u lower; - } l; -#endif - Bit64s ll; -} FPU_Reg; - -typedef struct { - Bit32u m1; - Bit32u m2; - Bit16u m3; - - Bit16u d1; - Bit32u d2; -} FPU_P_Reg; - -enum FPU_Tag { - TAG_Valid = 0, - TAG_Zero = 1, - TAG_Weird = 2, - TAG_Empty = 3 -}; - -enum FPU_Round { - ROUND_Nearest = 0, - ROUND_Down = 1, - ROUND_Up = 2, - ROUND_Chop = 3 -}; - -//get pi from a real library -#define PI 3.14159265358979323846 -#define L2E 1.4426950408889634 -#define L2T 3.3219280948873623 -#define LN2 0.69314718055994531 -#define LG2 0.3010299956639812 diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 12695b1..6efa58f 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -4,5 +4,7 @@ noinst_LIBRARIES = libgui.a libgui_a_SOURCES = sdlmain.cpp sdl_mapper.cpp dosbox_logo.h \ render.cpp render_scalers.cpp render_scalers.h \ render_templates.h render_loops.h render_simple.h \ + render_templates_sai.h render_templates_hq.h \ + render_templates_hq2x.h render_templates_hq3x.h \ midi.cpp midi_win32.h midi_oss.h midi_coreaudio.h midi_alsa.h diff --git a/src/gui/Makefile.in b/src/gui/Makefile.in index 8ab9d14..f70bc97 100644 --- a/src/gui/Makefile.in +++ b/src/gui/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libgui_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,44 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/gui -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libgui_a_AR = $(AR) $(ARFLAGS) -libgui_a_LIBADD = -am_libgui_a_OBJECTS = sdlmain.$(OBJEXT) sdl_mapper.$(OBJEXT) \ - render.$(OBJEXT) render_scalers.$(OBJEXT) midi.$(OBJEXT) -libgui_a_OBJECTS = $(am_libgui_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libgui_a_SOURCES) -DIST_SOURCES = $(libgui_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -100,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -130,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -140,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -149,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -175,45 +139,58 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + noinst_LIBRARIES = libgui.a libgui_a_SOURCES = sdlmain.cpp sdl_mapper.cpp dosbox_logo.h \ render.cpp render_scalers.cpp render_scalers.h \ render_templates.h render_loops.h render_simple.h \ + render_templates_sai.h render_templates_hq.h \ + render_templates_hq2x.h render_templates_hq3x.h \ midi.cpp midi_win32.h midi_oss.h midi_coreaudio.h midi_alsa.h +subdir = src/gui +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libgui_a_AR = $(AR) cru +libgui_a_LIBADD = +am_libgui_a_OBJECTS = sdlmain.$(OBJEXT) sdl_mapper.$(OBJEXT) \ + render.$(OBJEXT) render_scalers.$(OBJEXT) midi.$(OBJEXT) +libgui_a_OBJECTS = $(am_libgui_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/midi.Po ./$(DEPDIR)/render.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/render_scalers.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/sdl_mapper.Po ./$(DEPDIR)/sdlmain.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libgui_a_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libgui_a_SOURCES) + all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/gui/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/gui/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/gui/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -223,7 +200,7 @@ libgui.a: $(libgui_a_OBJECTS) $(libgui_a_DEPENDENCIES) $(RANLIB) libgui.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -235,20 +212,36 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdlmain.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -257,7 +250,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -269,11 +261,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -296,6 +287,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -309,7 +304,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -327,6 +322,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) + installdirs: install: install-am install-exec: install-exec-am @@ -347,7 +343,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -366,8 +362,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -403,14 +397,13 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/gui/dosbox_logo.h b/src/gui/dosbox_logo.h index 4a96e0d..ef34a2f 100644 --- a/src/gui/dosbox_logo.h +++ b/src/gui/dosbox_logo.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dosbox_logo.h,v 1.3 2006/03/29 12:26:41 qbix79 Exp $ */ +/* $Id: dosbox_logo.h,v 1.4 2007/01/08 19:45:39 qbix79 Exp $ */ /* DOSBox icon designed by Ido Beeri */ diff --git a/src/gui/midi.cpp b/src/gui/midi.cpp index a6ca796..0861366 100644 --- a/src/gui/midi.cpp +++ b/src/gui/midi.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/midi_alsa.h b/src/gui/midi_alsa.h index 4c0a547..0df45aa 100644 --- a/src/gui/midi_alsa.h +++ b/src/gui/midi_alsa.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: midi_alsa.h,v 1.13 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: midi_alsa.h,v 1.15 2007/01/08 19:45:39 qbix79 Exp $ */ #define ALSA_PCM_OLD_HW_PARAMS_API #define ALSA_PCM_OLD_SW_PARAMS_API @@ -76,7 +76,6 @@ public: } void PlayMsg(Bit8u * msg) { - unsigned int midiCmd[4]; ev.type = SND_SEQ_EVENT_OSS; ev.data.raw32.d[0] = msg[0]; diff --git a/src/gui/midi_coreaudio.h b/src/gui/midi_coreaudio.h index 1af883b..8fc0057 100644 --- a/src/gui/midi_coreaudio.h +++ b/src/gui/midi_coreaudio.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gui/midi_oss.h b/src/gui/midi_oss.h index 20db394..c4a945a 100644 --- a/src/gui/midi_oss.h +++ b/src/gui/midi_oss.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ private: Bit8u device_num; bool isOpen; public: - MidiHandler_oss() : isOpen(false),MidiHandler() {}; + MidiHandler_oss() : MidiHandler(),isOpen(false) {}; char * GetName(void) { return "oss";}; bool Open(const char * conf) { char devname[512]; diff --git a/src/gui/midi_win32.h b/src/gui/midi_win32.h index eb5b3c9..6c4a893 100644 --- a/src/gui/midi_win32.h +++ b/src/gui/midi_win32.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: midi_win32.h,v 1.12 2006/02/09 11:47:48 qbix79 Exp $ */ +/* $Id: midi_win32.h,v 1.13 2007/01/08 19:45:39 qbix79 Exp $ */ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN diff --git a/src/gui/render.cpp b/src/gui/render.cpp index 27ecf63..8f8117a 100644 --- a/src/gui/render.cpp +++ b/src/gui/render.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: render.cpp,v 1.45 2006/03/29 14:17:27 qbix79 Exp $ */ +/* $Id: render.cpp,v 1.51 2007/02/03 13:00:16 harekiet Exp $ */ #include #include @@ -37,6 +37,8 @@ Render_t render; ScalerLineHandler_t RENDER_DrawLine; +static void RENDER_CallBack( GFX_CallBackFunctions_t function ); + static void Check_Palette(void) { /* Clean up any previous changed palette data */ if (render.pal.changed) { @@ -95,6 +97,43 @@ void RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue) { static void RENDER_EmptyLineHandler(const void * src) { } +static void RENDER_StartLineHandler(const void * s) { + if (s) { + const Bitu *src = (Bitu*)s; + Bitu *cache = (Bitu*)(render.scale.cacheRead); + for (Bits x=render.src.start;x>0;) { + if (GCC_UNLIKELY(src[0] != cache[0])) { + if (!GFX_StartUpdate( render.scale.outWrite, render.scale.outPitch )) { + RENDER_DrawLine = RENDER_EmptyLineHandler; + return; + } + render.scale.outWrite += render.scale.outPitch * Scaler_ChangedLines[0]; + RENDER_DrawLine = render.scale.lineHandler; + RENDER_DrawLine( s ); + return; + } + x--; src++; cache++; + } + } + render.scale.cacheRead += render.scale.cachePitch; + Scaler_ChangedLines[0] += Scaler_Aspect[ render.scale.inLine ]; + render.scale.inLine++; + render.scale.outLine++; +} + +static void RENDER_FinishLineHandler(const void * s) { + if (s) { + const Bitu *src = (Bitu*)s; + Bitu *cache = (Bitu*)(render.scale.cacheRead); + for (Bits x=render.src.start;x>0;) { + cache[0] = src[0]; + x--; src++; cache++; + } + } + render.scale.cacheRead += render.scale.cachePitch; +} + + static void RENDER_ClearCacheHandler(const void * src) { Bitu x, width; Bit32u *srcLine, *cacheLine; @@ -119,33 +158,54 @@ bool RENDER_StartUpdate(void) { if (render.scale.inMode == scalerMode8) { Check_Palette(); } - if (GCC_UNLIKELY(!GFX_StartUpdate(render.scale.outWrite,render.scale.outPitch))) - return false; render.scale.inLine = 0; render.scale.outLine = 0; render.scale.cacheRead = (Bit8u*)&scalerSourceCache; + render.scale.outWrite = 0; + render.scale.outPitch = 0; Scaler_ChangedLines[0] = 0; Scaler_ChangedLineIndex = 0; /* Clearing the cache will first process the line to make sure it's never the same */ if (GCC_UNLIKELY( render.scale.clearCache) ) { // LOG_MSG("Clearing cache"); + //Will always have to update the screen with this one anyway, so let's update already + if (GCC_UNLIKELY(!GFX_StartUpdate( render.scale.outWrite, render.scale.outPitch ))) + return false; + render.fullFrame = true; render.scale.clearCache = false; RENDER_DrawLine = RENDER_ClearCacheHandler; } else { - if (render.pal.changed) + if (render.pal.changed) { + /* Assume pal changes always do a full screen update anyway */ + if (GCC_UNLIKELY(!GFX_StartUpdate( render.scale.outWrite, render.scale.outPitch ))) + return false; RENDER_DrawLine = render.scale.linePalHandler; - else - RENDER_DrawLine = render.scale.lineHandler; + render.fullFrame = true; + } else { + RENDER_DrawLine = RENDER_StartLineHandler; + if (GCC_UNLIKELY(CaptureState & (CAPTURE_IMAGE|CAPTURE_VIDEO))) + render.fullFrame = true; + else + render.fullFrame = false; + } } - render.updating=true; + render.updating = true; return true; } -void RENDER_EndUpdate( bool fullUpdate ) { - if (!render.updating) +static void RENDER_Halt( void ) { + RENDER_DrawLine = RENDER_EmptyLineHandler; + GFX_EndUpdate( 0 ); + render.updating=false; + render.active=false; +} + +extern Bitu PIC_Ticks; +void RENDER_EndUpdate( void ) { + if (GCC_UNLIKELY(!render.updating)) return; RENDER_DrawLine = RENDER_EmptyLineHandler; - if (CaptureState & (CAPTURE_IMAGE|CAPTURE_VIDEO)) { + if (GCC_UNLIKELY(CaptureState & (CAPTURE_IMAGE|CAPTURE_VIDEO))) { Bitu pitch, flags; flags = 0; if (render.src.dblw != render.src.dblh) { @@ -159,40 +219,46 @@ void RENDER_EndUpdate( bool fullUpdate ) { CAPTURE_AddImage( render.src.width, render.src.height, render.src.bpp, pitch, flags, fps, (Bit8u *)&scalerSourceCache, (Bit8u*)&render.pal.rgb ); } - GFX_EndUpdate( fullUpdate ? Scaler_ChangedLines : 0); + if ( render.scale.outWrite ) { + GFX_EndUpdate( Scaler_ChangedLines ); + render.frameskip.hadSkip[render.frameskip.index] = 0; + } else { +#if 0 + Bitu total = 0, i; + render.frameskip.hadSkip[render.frameskip.index] = 1; + for (i = 0;i=miny) { - Bitu templines=(Bitu)lines; - lines-=templines; - linesadded+=templines; - Scaler_Aspect[1+i]=templines-miny; - } else Scaler_Aspect[1+i]=0; + for (i=0;i= miny) { + Bitu templines = (Bitu)lines; + lines -= templines; + linesadded += templines; + Scaler_Aspect[i] = templines; + } else { + Scaler_Aspect[i] = 0; + } } return linesadded; } -void RENDER_CallBack( GFX_CallBackFunctions_t function ) { - if (render.updating) { - /* Still updating the current screen, shut it down correctly */ - RENDER_EndUpdate( false ); - } - - if (function == GFX_CallBackStop) - return; - - if (function == GFX_CallBackRedraw) { - //LOG_MSG("redraw"); - render.scale.clearCache = true; - return; - } +static void RENDER_Reset( void ) { Bitu width=render.src.width; Bitu height=render.src.height; bool dblw=render.src.dblw; @@ -238,6 +304,24 @@ void RENDER_CallBack( GFX_CallBackFunctions_t function ) { else if (render.scale.size == 3) complexBlock = &ScaleAdvMame3x; break; + case scalerOpHQ: + if (render.scale.size == 2) + complexBlock = &ScaleHQ2x; + else if (render.scale.size == 3) + complexBlock = &ScaleHQ3x; + break; + case scalerOpSuperSaI: + if (render.scale.size == 2) + complexBlock = &ScaleSuper2xSaI; + break; + case scalerOpSuperEagle: + if (render.scale.size == 2) + complexBlock = &ScaleSuperEagle; + break; + case scalerOpSaI: + if (render.scale.size == 2) + complexBlock = &Scale2xSaI; + break; case scalerOpTV: if (render.scale.size == 2) simpleBlock = &ScaleTV2x; @@ -274,27 +358,33 @@ forcenormal: gfx_flags = complexBlock->gfxFlags; xscale = complexBlock->xscale; yscale = complexBlock->yscale; +// LOG_MSG("Scaler:%s",complexBlock->name); } else { gfx_flags = simpleBlock->gfxFlags; xscale = simpleBlock->xscale; yscale = simpleBlock->yscale; +// LOG_MSG("Scaler:%s",simpleBlock->name); } switch (render.src.bpp) { case 8: + render.src.start = ( render.src.width * 1) / sizeof(Bitu); if (gfx_flags & GFX_CAN_8) gfx_flags |= GFX_LOVE_8; else gfx_flags |= GFX_LOVE_32; break; case 15: + render.src.start = ( render.src.width * 2) / sizeof(Bitu); gfx_flags |= GFX_LOVE_15; gfx_flags = (gfx_flags & ~GFX_CAN_8) | GFX_RGBONLY; break; case 16: + render.src.start = ( render.src.width * 2) / sizeof(Bitu); gfx_flags |= GFX_LOVE_16; gfx_flags = (gfx_flags & ~GFX_CAN_8) | GFX_RGBONLY; break; case 32: + render.src.start = ( render.src.width * 4) / sizeof(Bitu); gfx_flags |= GFX_LOVE_32; gfx_flags = (gfx_flags & ~GFX_CAN_8) | GFX_RGBONLY; break; @@ -307,15 +397,16 @@ forcenormal: goto forcenormal; } width *= xscale; + Bitu skip = complexBlock ? 1 : 0; if (gfx_flags & GFX_SCALING) { - height = MakeAspectTable(render.src.height, yscale, yscale ); + height = MakeAspectTable(skip, render.src.height, yscale, yscale ); } else { if ((gfx_flags & GFX_CAN_RANDOM) && gfx_scaleh > 1) { gfx_scaleh *= yscale; - height = MakeAspectTable(render.src.height, gfx_scaleh, yscale ); + height = MakeAspectTable( skip, render.src.height, gfx_scaleh, yscale ); } else { gfx_flags &= ~GFX_CAN_RANDOM; //Hardware surface when possible - height = MakeAspectTable(render.src.height, yscale, yscale); + height = MakeAspectTable( skip, render.src.height, yscale, yscale); } } /* Setup the scaler variables */ @@ -384,17 +475,34 @@ forcenormal: render.pal.last = 255; render.pal.changed = false; memset(render.pal.modified, 0, sizeof(render.pal.modified)); + //Finish this frame using a copy only handler + RENDER_DrawLine = RENDER_FinishLineHandler; + render.scale.outWrite = 0; /* Signal the next frame to first reinit the cache */ render.scale.clearCache = true; render.active=true; } +static void RENDER_CallBack( GFX_CallBackFunctions_t function ) { + if (function == GFX_CallBackStop) { + RENDER_Halt( ); + return; + } else if (function == GFX_CallBackRedraw) { + render.scale.clearCache = true; + return; + } else if ( function == GFX_CallBackReset) { + GFX_EndUpdate( 0 ); + RENDER_Reset(); + } else { + E_Exit("Unhandled GFX_CallBackReset %d", function ); + } +} + void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool dblw,bool dblh) { + RENDER_Halt( ); if (!width || !height || width > SCALER_MAXWIDTH || height > SCALER_MAXHEIGHT) { - render.active=false; return; } - RENDER_EndUpdate( false ); render.src.width=width; render.src.height=height; render.src.bpp=bpp; @@ -402,10 +510,10 @@ void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool render.src.dblh=dblh; render.src.fps=fps; render.src.ratio=ratio; - RENDER_CallBack( GFX_CallBackReset ); + RENDER_Reset( ); } -extern void GFX_SetTitle(Bits cycles, Bits frameskip,bool paused); +extern void GFX_SetTitle(Bit32s cycles, Bits frameskip,bool paused); static void IncreaseFrameSkip(bool pressed) { if (!pressed) return; @@ -421,6 +529,18 @@ static void DecreaseFrameSkip(bool pressed) { LOG_MSG("Frame Skip at %d",render.frameskip.max); GFX_SetTitle(-1,render.frameskip.max,false); } +/* Disabled as I don't want to waste a keybind for that. Might be used in the future (Qbix) +static void ChangeScaler(bool pressed) { + if (!pressed) + return; + render.scale.op = (scalerOperation)((int)render.scale.op+1); + if((render.scale.op) >= scalerLast || render.scale.size == 1) { + render.scale.op = (scalerOperation)0; + if(++render.scale.size > 3) + render.scale.size = 1; + } + RENDER_CallBack( GFX_CallBackReset ); +} */ void RENDER_Init(Section * sec) { Section_prop * section=static_cast(sec); @@ -446,8 +566,13 @@ void RENDER_Init(Section * sec) { else if (!strcasecmp(scaler,"normal3x")) { render.scale.op = scalerOpNormal;render.scale.size = 3; } else if (!strcasecmp(scaler,"advmame2x")) { render.scale.op = scalerOpAdvMame;render.scale.size = 2; } else if (!strcasecmp(scaler,"advmame3x")) { render.scale.op = scalerOpAdvMame;render.scale.size = 3; } - else if (!strcasecmp(scaler,"advinterp2x")) { render.scale.op = scalerOpAdvMame;render.scale.size = 2; } - else if (!strcasecmp(scaler,"advinterp3x")) { render.scale.op = scalerOpAdvMame;render.scale.size = 3; } + else if (!strcasecmp(scaler,"advinterp2x")) { render.scale.op = scalerOpAdvInterp;render.scale.size = 2; } + else if (!strcasecmp(scaler,"advinterp3x")) { render.scale.op = scalerOpAdvInterp;render.scale.size = 3; } + else if (!strcasecmp(scaler,"hq2x")) { render.scale.op = scalerOpHQ;render.scale.size = 2; } + else if (!strcasecmp(scaler,"hq3x")) { render.scale.op = scalerOpHQ;render.scale.size = 3; } + else if (!strcasecmp(scaler,"2xsai")) { render.scale.op = scalerOpSaI;render.scale.size = 2; } + else if (!strcasecmp(scaler,"super2xsai")) { render.scale.op = scalerOpSuperSaI;render.scale.size = 2; } + else if (!strcasecmp(scaler,"supereagle")) { render.scale.op = scalerOpSuperEagle;render.scale.size = 2; } else if (!strcasecmp(scaler,"tv2x")) { render.scale.op = scalerOpTV;render.scale.size = 2; } else if (!strcasecmp(scaler,"tv3x")) { render.scale.op = scalerOpTV;render.scale.size = 3; } else if (!strcasecmp(scaler,"rgb2x")){ render.scale.op = scalerOpRGB;render.scale.size = 2; } @@ -462,6 +587,7 @@ void RENDER_Init(Section * sec) { //If something changed that needs a ReInit if(running && (render.aspect != aspect || render.scale.op != scaleOp)) RENDER_CallBack( GFX_CallBackReset ); + if(!running) render.updating=true; running = true; diff --git a/src/gui/render_loops.h b/src/gui/render_loops.h index 40fb97b..a87c7fb 100644 --- a/src/gui/render_loops.h +++ b/src/gui/render_loops.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ static void conc3d(SCALERNAME,SBPP,L)(void) { #else static void conc3d(SCALERNAME,SBPP,R)(void) { #endif +//Skip the first one for multiline input scalers if (!render.scale.outLine) { render.scale.outLine++; return; @@ -30,14 +31,9 @@ lastagain: #if defined(SCALERLINEAR) Bitu scaleLines = SCALERHEIGHT; #else - Bitu scaleLines = SCALERHEIGHT + Scaler_Aspect[ render.scale.outLine ]; + Bitu scaleLines = Scaler_Aspect[ render.scale.outLine ]; #endif - render.scale.outWrite += render.scale.outPitch * scaleLines; - if (!(Scaler_ChangedLineIndex & 1)) { - Scaler_ChangedLines[Scaler_ChangedLineIndex] += scaleLines; - } else { - Scaler_ChangedLines[++Scaler_ChangedLineIndex] = scaleLines; - } + ScalerAddLines( 0, scaleLines ); if (++render.scale.outLine == render.scale.inHeight) goto lastagain; return; @@ -141,25 +137,15 @@ lastagain: } #if defined(SCALERLINEAR) Bitu scaleLines = SCALERHEIGHT; - render.scale.outWrite += render.scale.outPitch * scaleLines; #else - Bitu scaleLines = SCALERHEIGHT; - if ( Scaler_Aspect[ render.scale.outLine ] ) { - scaleLines++; + Bitu scaleLines = Scaler_Aspect[ render.scale.outLine ]; + if ( ((Bits)(scaleLines - SCALERHEIGHT)) > 0 ) { BituMove( render.scale.outWrite + render.scale.outPitch * SCALERHEIGHT, render.scale.outWrite + render.scale.outPitch * (SCALERHEIGHT-1), render.src.width * SCALERWIDTH * PSIZE); - render.scale.outWrite += render.scale.outPitch * (SCALERHEIGHT + 1); - } else { - render.scale.outWrite += render.scale.outPitch * SCALERHEIGHT; } #endif - /* Keep track of changed lines */ - if (Scaler_ChangedLineIndex & 1) { - Scaler_ChangedLines[Scaler_ChangedLineIndex] += scaleLines; - } else { - Scaler_ChangedLines[++Scaler_ChangedLineIndex] = scaleLines; - } + ScalerAddLines( 1, scaleLines ); if (++render.scale.outLine == render.scale.inHeight) goto lastagain; } diff --git a/src/gui/render_scalers.cpp b/src/gui/render_scalers.cpp index dc7d084..ad6ae67 100644 --- a/src/gui/render_scalers.cpp +++ b/src/gui/render_scalers.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,6 +59,16 @@ static INLINE void BituMove( void *_dst, const void * _src, Bitu size) { dst[x] = src[x]; } +static INLINE void ScalerAddLines( Bitu changed, Bitu count ) { + if ((Scaler_ChangedLineIndex & 1) == changed ) { + Scaler_ChangedLines[Scaler_ChangedLineIndex] += count; + } else { + Scaler_ChangedLines[++Scaler_ChangedLineIndex] = count; + } + render.scale.outWrite += render.scale.outPitch * count; +} + + #define BituMove2(_DST,_SRC,_SIZE) \ { \ Bitu bsize=(_SIZE)/sizeof(Bitu); \ @@ -158,6 +168,7 @@ ScalerLineBlock_t ScalerCache = { }; ScalerSimpleBlock_t ScaleNormal1x = { + "Normal", GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32, 1,1, Normal1x_8_8_L, Normal1x_8_15_L, Normal1x_8_16_L, Normal1x_8_32_L, @@ -173,6 +184,7 @@ ScalerSimpleBlock_t ScaleNormal1x = { }; ScalerSimpleBlock_t ScaleNormalDw = { + "Normal", GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32, 2,1, NormalDw_8_8_L, NormalDw_8_15_L, NormalDw_8_16_L, NormalDw_8_32_L, @@ -188,6 +200,7 @@ ScalerSimpleBlock_t ScaleNormalDw = { }; ScalerSimpleBlock_t ScaleNormalDh = { + "Normal", GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32, 1,2, NormalDh_8_8_L, NormalDh_8_15_L, NormalDh_8_16_L, NormalDh_8_32_L, @@ -203,6 +216,7 @@ ScalerSimpleBlock_t ScaleNormalDh = { }; ScalerSimpleBlock_t ScaleNormal2x = { + "Normal2x", GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32, 2,2, Normal2x_8_8_L, Normal2x_8_15_L, Normal2x_8_16_L, Normal2x_8_32_L, @@ -218,6 +232,7 @@ ScalerSimpleBlock_t ScaleNormal2x = { }; ScalerSimpleBlock_t ScaleNormal3x = { + "Normal3x", GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32, 3,3, Normal3x_8_8_L, Normal3x_8_15_L, Normal3x_8_16_L, Normal3x_8_32_L, @@ -233,6 +248,7 @@ ScalerSimpleBlock_t ScaleNormal3x = { }; ScalerSimpleBlock_t ScaleTV2x = { + "TV2x", GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, 2,2, 0, TV2x_8_15_L, TV2x_8_16_L, TV2x_8_32_L, @@ -248,6 +264,7 @@ ScalerSimpleBlock_t ScaleTV2x = { }; ScalerSimpleBlock_t ScaleTV3x = { + "TV3x", GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, 3,3, 0, TV3x_8_15_L, TV3x_8_16_L, TV3x_8_32_L, @@ -263,6 +280,7 @@ ScalerSimpleBlock_t ScaleTV3x = { }; ScalerSimpleBlock_t ScaleScan2x = { + "Scan2x", GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, 2,2, 0, Scan2x_8_15_L, Scan2x_8_16_L, Scan2x_8_32_L, @@ -278,6 +296,7 @@ ScalerSimpleBlock_t ScaleScan2x = { }; ScalerSimpleBlock_t ScaleScan3x = { + "Scan3x", GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, 3,3, 0, Scan3x_8_15_L, Scan3x_8_16_L, Scan3x_8_32_L, @@ -293,6 +312,7 @@ ScalerSimpleBlock_t ScaleScan3x = { }; ScalerSimpleBlock_t ScaleRGB2x = { + "RGB2x", GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, 2,2, 0, RGB2x_8_15_L, RGB2x_8_16_L, RGB2x_8_32_L, @@ -308,6 +328,7 @@ ScalerSimpleBlock_t ScaleRGB2x = { }; ScalerSimpleBlock_t ScaleRGB3x = { + "RGB3x", GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, 3,3, 0, RGB3x_8_15_L, RGB3x_8_16_L, RGB3x_8_32_L, @@ -326,6 +347,7 @@ ScalerSimpleBlock_t ScaleRGB3x = { /* Complex scalers */ ScalerComplexBlock_t ScaleAdvMame2x ={ + "AdvMame2x", GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32, 2,2, AdvMame2x_8_L,AdvMame2x_16_L,AdvMame2x_16_L,AdvMame2x_32_L, @@ -333,6 +355,7 @@ ScalerComplexBlock_t ScaleAdvMame2x ={ }; ScalerComplexBlock_t ScaleAdvMame3x = { + "AdvMame3x", GFX_CAN_8|GFX_CAN_15|GFX_CAN_16|GFX_CAN_32, 3,3, AdvMame3x_8_L,AdvMame3x_16_L,AdvMame3x_16_L,AdvMame3x_32_L, @@ -340,7 +363,48 @@ ScalerComplexBlock_t ScaleAdvMame3x = { }; /* These need specific 15bpp versions */ +ScalerComplexBlock_t ScaleHQ2x ={ + "HQ2x", + GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, + 2,2, + 0,HQ2x_16_L,HQ2x_16_L,HQ2x_32_L, + 0,HQ2x_16_R,HQ2x_16_R,HQ2x_32_R +}; + +ScalerComplexBlock_t ScaleHQ3x ={ + "HQ3x", + GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, + 3,3, + 0,HQ3x_16_L,HQ3x_16_L,HQ3x_32_L, + 0,HQ3x_16_R,HQ3x_16_R,HQ3x_32_R +}; + +ScalerComplexBlock_t ScaleSuper2xSaI ={ + "Super2xSaI", + GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, + 2,2, + 0,Super2xSaI_16_L,Super2xSaI_16_L,Super2xSaI_32_L, + 0,Super2xSaI_16_R,Super2xSaI_16_R,Super2xSaI_32_R +}; + +ScalerComplexBlock_t Scale2xSaI ={ + "2xSaI", + GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, + 2,2, + 0,_2xSaI_16_L,_2xSaI_16_L,_2xSaI_32_L, + 0,_2xSaI_16_R,_2xSaI_16_R,_2xSaI_32_R +}; + +ScalerComplexBlock_t ScaleSuperEagle ={ + "SuperEagle", + GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, + 2,2, + 0,SuperEagle_16_L,SuperEagle_16_L,SuperEagle_32_L, + 0,SuperEagle_16_R,SuperEagle_16_R,SuperEagle_32_R +}; + ScalerComplexBlock_t ScaleAdvInterp2x = { + "AdvInterp2x", GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, 2,2, 0,AdvInterp2x_15_L,AdvInterp2x_16_L,AdvInterp2x_32_L, @@ -348,6 +412,7 @@ ScalerComplexBlock_t ScaleAdvInterp2x = { }; ScalerComplexBlock_t ScaleAdvInterp3x = { + "AdvInterp3x", GFX_CAN_15|GFX_CAN_16|GFX_CAN_32|GFX_RGBONLY, 3,3, 0,AdvInterp3x_15_L,AdvInterp3x_16_L,AdvInterp3x_32_L, diff --git a/src/gui/render_scalers.h b/src/gui/render_scalers.h index 7cc419b..9f1b163 100644 --- a/src/gui/render_scalers.h +++ b/src/gui/render_scalers.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,13 +33,18 @@ typedef enum { scalerMode8, scalerMode15, scalerMode16, scalerMode32 } scalerMode_t; -typedef enum { +typedef enum scalerOperation { scalerOpNormal, scalerOpAdvMame, scalerOpAdvInterp, + scalerOpHQ, + scalerOpSaI, + scalerOpSuperSaI, + scalerOpSuperEagle, scalerOpTV, scalerOpRGB, scalerOpScan, + scalerLast, } scalerOperation_t; typedef void (*ScalerLineHandler_t)(const void *src); @@ -66,6 +71,7 @@ extern scalerChangeCache_t scalerChangeCache; typedef ScalerLineHandler_t ScalerLineBlock_t[5][4]; typedef struct { + char *name; Bitu gfxFlags; Bitu xscale,yscale; ScalerComplexHandler_t Linear[4]; @@ -73,6 +79,7 @@ typedef struct { } ScalerComplexBlock_t; typedef struct { + char *name; Bitu gfxFlags; Bitu xscale,yscale; ScalerLineBlock_t Linear; @@ -97,6 +104,11 @@ extern ScalerSimpleBlock_t ScaleRGB3x; extern ScalerSimpleBlock_t ScaleScan2x; extern ScalerSimpleBlock_t ScaleScan3x; /* Complex scalers */ +extern ScalerComplexBlock_t ScaleHQ2x; +extern ScalerComplexBlock_t ScaleHQ3x; +extern ScalerComplexBlock_t Scale2xSaI; +extern ScalerComplexBlock_t ScaleSuper2xSaI; +extern ScalerComplexBlock_t ScaleSuperEagle; extern ScalerComplexBlock_t ScaleAdvMame2x; extern ScalerComplexBlock_t ScaleAdvMame3x; extern ScalerComplexBlock_t ScaleAdvInterp2x; diff --git a/src/gui/render_simple.h b/src/gui/render_simple.h index 35e337c..84b5033 100644 --- a/src/gui/render_simple.h +++ b/src/gui/render_simple.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,16 +20,28 @@ static void conc4d(SCALERNAME,SBPP,DBPP,L)(const void *s) { #else static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) { +#endif +#ifdef RENDER_NULL_INPUT + if (!s) { + render.scale.cacheRead += render.scale.cachePitch; +#if defined(SCALERLINEAR) + Bitu skipLines = SCALERHEIGHT; +#else + Bitu skipLines = Scaler_Aspect[ render.scale.outLine++ ]; +#endif + ScalerAddLines( 0, skipLines ); + return; + } #endif /* Clear the complete line marker */ + Bitu hadChange = 0; const SRCTYPE *src = (SRCTYPE*)s; SRCTYPE *cache = (SRCTYPE*)(render.scale.cacheRead); render.scale.cacheRead += render.scale.cachePitch; PTYPE * line0=(PTYPE *)(render.scale.outWrite); - Bitu hadChange = 0; #if (SBPP == 9) for (Bits x=render.src.width;x>0;) { - if (*(Bit32u*)src == *(Bit32u*)cache && !( + if (*(Bit32u const*)src == *(Bit32u*)cache && !( render.pal.modified[src[0]] | render.pal.modified[src[1]] | render.pal.modified[src[2]] | @@ -40,7 +52,7 @@ static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) { line0+=4*SCALERWIDTH; #else for (Bits x=render.src.width;x>0;) { - if (*(Bitu*)src == *(Bitu*)cache) { + if (*(Bitu const*)src == *(Bitu*)cache) { x-=(sizeof(Bitu)/sizeof(SRCTYPE)); src+=(sizeof(Bitu)/sizeof(SRCTYPE)); cache+=(sizeof(Bitu)/sizeof(SRCTYPE)); @@ -90,26 +102,15 @@ static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) { } #if defined(SCALERLINEAR) Bitu scaleLines = SCALERHEIGHT; - render.scale.outWrite += render.scale.outPitch * scaleLines; #else - Bitu scaleLines = SCALERHEIGHT; - if ( Scaler_Aspect[ render.scale.outLine++ ] ) { - scaleLines++; - if (hadChange) - BituMove( render.scale.outWrite + render.scale.outPitch * SCALERHEIGHT, + Bitu scaleLines = Scaler_Aspect[ render.scale.outLine++ ]; + if ( scaleLines - SCALERHEIGHT && hadChange ) { + BituMove( render.scale.outWrite + render.scale.outPitch * SCALERHEIGHT, render.scale.outWrite + render.scale.outPitch * (SCALERHEIGHT-1), render.src.width * SCALERWIDTH * PSIZE); - render.scale.outWrite += render.scale.outPitch * (SCALERHEIGHT + 1); - } else { - render.scale.outWrite += render.scale.outPitch * SCALERHEIGHT; - } - /* Keep track of changed lines */ - if ((Scaler_ChangedLineIndex & 1) == hadChange) { - Scaler_ChangedLines[Scaler_ChangedLineIndex] += scaleLines; - } else { - Scaler_ChangedLines[++Scaler_ChangedLineIndex] = scaleLines; } #endif + ScalerAddLines( hadChange, scaleLines ); } #if !defined(SCALERLINEAR) diff --git a/src/gui/render_templates.h b/src/gui/render_templates.h index 21631bc..a3ce579 100644 --- a/src/gui/render_templates.h +++ b/src/gui/render_templates.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,12 @@ #define redMask 0 #define greenMask 0 #define blueMask 0 +#define redBits 0 +#define greenBits 0 +#define blueBits 0 +#define redShift 0 +#define greenShift 0 +#define blueShift 0 #elif DBPP == 15 || DBPP == 16 #define PSIZE 2 #define PTYPE Bit16u @@ -35,10 +41,22 @@ #define redMask 0x7C00 #define greenMask 0x03E0 #define blueMask 0x001F +#define redBits 5 +#define greenBits 5 +#define blueBits 5 +#define redShift 10 +#define greenShift 5 +#define blueShift 0 #elif DBPP == 16 #define redMask 0xF800 #define greenMask 0x07E0 #define blueMask 0x001F +#define redBits 5 +#define greenBits 6 +#define blueBits 5 +#define redShift 11 +#define greenShift 5 +#define blueShift 0 #endif #elif DBPP == 32 #define PSIZE 4 @@ -49,6 +67,12 @@ #define redMask 0xff0000 #define greenMask 0x00ff00 #define blueMask 0x0000ff +#define redBits 8 +#define greenBits 8 +#define blueBits 8 +#define redShift 16 +#define greenShift 8 +#define blueShift 0 #endif #define redblueMask (redMask | blueMask) @@ -104,6 +128,11 @@ #define SRCTYPE Bit32u #endif +// C0 C1 C2 D3 +// C3 C4 C5 D4 +// C6 C7 C8 D5 +// D0 D1 D2 D6 + #define C0 fc[-1 - SCALER_COMPLEXWIDTH] #define C1 fc[+0 - SCALER_COMPLEXWIDTH] #define C2 fc[+1 - SCALER_COMPLEXWIDTH] @@ -114,7 +143,24 @@ #define C7 fc[+0 + SCALER_COMPLEXWIDTH] #define C8 fc[+1 + SCALER_COMPLEXWIDTH] +#define D0 fc[-1 + 2*SCALER_COMPLEXWIDTH] +#define D1 fc[+0 + 2*SCALER_COMPLEXWIDTH] +#define D2 fc[+1 + 2*SCALER_COMPLEXWIDTH] +#define D3 fc[+2 - SCALER_COMPLEXWIDTH] +#define D4 fc[+2] +#define D5 fc[+2 + SCALER_COMPLEXWIDTH] +#define D6 fc[+2 + 2*SCALER_COMPLEXWIDTH] + + static void conc3d(Cache,SBPP,DBPP) (const void * s) { +#ifdef RENDER_NULL_INPUT + if (!s) { + render.scale.cacheRead += render.scale.cachePitch; + render.scale.inLine++; + render.scale.complexHandler(); + return; + } +#endif const SRCTYPE * src = (SRCTYPE*)s; PTYPE *fc= &FC[render.scale.inLine+1][1]; SRCTYPE *sc = (SRCTYPE*)(render.scale.cacheRead); @@ -129,7 +175,7 @@ static void conc3d(Cache,SBPP,DBPP) (const void * s) { if (pixel != fc[x]) { #else for (Bitu x=0;x 8) +#include "render_templates_hq.h" + +#define SCALERNAME HQ2x +#define SCALERWIDTH 2 +#define SCALERHEIGHT 2 +#include "render_templates_hq2x.h" +#define SCALERFUNC conc2d(Hq2x,SBPP)(line0, line1, fc) +#include "render_loops.h" +#undef SCALERNAME +#undef SCALERWIDTH +#undef SCALERHEIGHT +#undef SCALERFUNC + +#define SCALERNAME HQ3x +#define SCALERWIDTH 3 +#define SCALERHEIGHT 3 +#include "render_templates_hq3x.h" +#define SCALERFUNC conc2d(Hq3x,SBPP)(line0, line1, line2, fc) +#include "render_loops.h" +#undef SCALERNAME +#undef SCALERWIDTH +#undef SCALERHEIGHT +#undef SCALERFUNC + +#include "render_templates_sai.h" + +#define SCALERNAME Super2xSaI +#define SCALERWIDTH 2 +#define SCALERHEIGHT 2 +#define SCALERFUNC conc2d(Super2xSaI,SBPP)(line0, line1, fc) +#include "render_loops.h" +#undef SCALERNAME +#undef SCALERWIDTH +#undef SCALERHEIGHT +#undef SCALERFUNC + +#define SCALERNAME SuperEagle +#define SCALERWIDTH 2 +#define SCALERHEIGHT 2 +#define SCALERFUNC conc2d(SuperEagle,SBPP)(line0, line1, fc) +#include "render_loops.h" +#undef SCALERNAME +#undef SCALERWIDTH +#undef SCALERHEIGHT +#undef SCALERFUNC + +#define SCALERNAME _2xSaI +#define SCALERWIDTH 2 +#define SCALERHEIGHT 2 +#define SCALERFUNC conc2d(_2xSaI,SBPP)(line0, line1, fc) +#include "render_loops.h" +#undef SCALERNAME +#undef SCALERWIDTH +#undef SCALERHEIGHT +#undef SCALERFUNC + #define SCALERNAME AdvInterp2x #define SCALERWIDTH 2 #define SCALERHEIGHT 2 @@ -458,5 +560,10 @@ static void conc3d(Cache,SBPP,DBPP) (const void * s) { #undef greenMask #undef blueMask #undef redblueMask +#undef redBits +#undef greenBits +#undef blueBits +#undef redShift +#undef greenShift +#undef blueShift #undef SRCTYPE - diff --git a/src/gui/render_templates_hq.h b/src/gui/render_templates_hq.h new file mode 100644 index 0000000..fd9e14b --- /dev/null +++ b/src/gui/render_templates_hq.h @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* + * The HQ3x high quality 3x graphics filter. + * Original author Maxim Stepin (see http://www.hiend3d.com/hq3x.html). + * Adapted for DOSBox from ScummVM and HiEnd3D code by Kronuz. + */ + +#include + +#ifndef RENDER_TEMPLATES_HQNX_TABLE_H +#define RENDER_TEMPLATES_HQNX_TABLE_H + +static Bit32u *_RGBtoYUV = 0; +static inline bool diffYUV(Bit32u yuv1, Bit32u yuv2) +{ + static const Bit32u Ymask = 0x00FF0000; + static const Bit32u Umask = 0x0000FF00; + static const Bit32u Vmask = 0x000000FF; + static const Bit32u trY = 0x00300000; + static const Bit32u trU = 0x00000700; + static const Bit32u trV = 0x00000006; + + Bit32u diff; + Bit32u mask; + + diff = ((yuv1 & Ymask) - (yuv2 & Ymask)); + mask = diff >> 31; // -1 if value < 0, 0 otherwise + diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value + if (diff > trY) return true; + + diff = ((yuv1 & Umask) - (yuv2 & Umask)); + mask = diff >> 31; // -1 if value < 0, 0 otherwise + diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value + if (diff > trU) return true; + + diff = ((yuv1 & Vmask) - (yuv2 & Vmask)); + mask = diff >> 31; // -1 if value < 0, 0 otherwise + diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value + if (diff > trV) return true; + + return false; +} + +#endif + +static inline void conc2d(InitLUTs,SBPP)(void) +{ + int r, g, b; + int Y, u, v; + + _RGBtoYUV = (Bit32u *)malloc(65536 * sizeof(Bit32u)); + + for (int color = 0; color < 65536; ++color) { +#if SBPP == 32 + r = ((color & 0xF800) >> 11) << (8 - 5); + g = ((color & 0x07E0) >> 5) << (8 - 6); + b = ((color & 0x001F) >> 0) << (8 - 5); +#else + r = ((color & redMask) >> redShift) << (8 - redBits); + g = ((color & greenMask) >> greenShift) << (8 - greenBits); + b = ((color & blueMask) >> blueShift) << (8 - blueBits); +#endif + Y = (r + g + b) >> 2; + u = 128 + ((r - b) >> 2); + v = 128 + ((-r + 2 * g - b) >> 3); + _RGBtoYUV[color] = (Y << 16) | (u << 8) | v; + } +} diff --git a/src/gui/render_templates_hq2x.h b/src/gui/render_templates_hq2x.h new file mode 100644 index 0000000..c74d790 --- /dev/null +++ b/src/gui/render_templates_hq2x.h @@ -0,0 +1,1896 @@ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* + * The HQ2x high quality 2x graphics filter. + * Original author Maxim Stepin (see http://www.hiend3d.com/hq2x.html). + * Adapted for DOSBox from ScummVM and HiEnd3D code by Kronuz. + */ + +#ifndef RENDER_TEMPLATES_HQ2X_TABLE_H +#define RENDER_TEMPLATES_HQ2X_TABLE_H + +#define PIXEL00_0 line0[0] = C4; +#define PIXEL00_10 line0[0] = interp_w2(C4,C0,3U,1U); +#define PIXEL00_11 line0[0] = interp_w2(C4,C3,3U,1U); +#define PIXEL00_12 line0[0] = interp_w2(C4,C1,3U,1U); +#define PIXEL00_20 line0[0] = interp_w3(C4,C3,C1,2U,1U,1U); +#define PIXEL00_21 line0[0] = interp_w3(C4,C0,C1,2U,1U,1U); +#define PIXEL00_22 line0[0] = interp_w3(C4,C0,C3,2U,1U,1U); +#define PIXEL00_60 line0[0] = interp_w3(C4,C1,C3,5U,2U,1U); +#define PIXEL00_61 line0[0] = interp_w3(C4,C3,C1,5U,2U,1U); +#define PIXEL00_70 line0[0] = interp_w3(C4,C3,C1,6U,1U,1U); +#define PIXEL00_90 line0[0] = interp_w3(C4,C3,C1,2U,3U,3U); +#define PIXEL00_100 line0[0] = interp_w3(C4,C3,C1,14U,1U,1U); + +#define PIXEL01_0 line0[1] = C4; +#define PIXEL01_10 line0[1] = interp_w2(C4,C2,3U,1U); +#define PIXEL01_11 line0[1] = interp_w2(C4,C1,3U,1U); +#define PIXEL01_12 line0[1] = interp_w2(C4,C5,3U,1U); +#define PIXEL01_20 line0[1] = interp_w3(C4,C1,C5,2U,1U,1U); +#define PIXEL01_21 line0[1] = interp_w3(C4,C2,C5,2U,1U,1U); +#define PIXEL01_22 line0[1] = interp_w3(C4,C2,C1,2U,1U,1U); +#define PIXEL01_60 line0[1] = interp_w3(C4,C5,C1,5U,2U,1U); +#define PIXEL01_61 line0[1] = interp_w3(C4,C1,C5,5U,2U,1U); +#define PIXEL01_70 line0[1] = interp_w3(C4,C1,C5,6U,1U,1U); +#define PIXEL01_90 line0[1] = interp_w3(C4,C1,C5,2U,3U,3U); +#define PIXEL01_100 line0[1] = interp_w3(C4,C1,C5,14U,1U,1U); + +#define PIXEL10_0 line1[0] = C4; +#define PIXEL10_10 line1[0] = interp_w2(C4,C6,3U,1U); +#define PIXEL10_11 line1[0] = interp_w2(C4,C7,3U,1U); +#define PIXEL10_12 line1[0] = interp_w2(C4,C3,3U,1U); +#define PIXEL10_20 line1[0] = interp_w3(C4,C7,C3,2U,1U,1U); +#define PIXEL10_21 line1[0] = interp_w3(C4,C6,C3,2U,1U,1U); +#define PIXEL10_22 line1[0] = interp_w3(C4,C6,C7,2U,1U,1U); +#define PIXEL10_60 line1[0] = interp_w3(C4,C3,C7,5U,2U,1U); +#define PIXEL10_61 line1[0] = interp_w3(C4,C7,C3,5U,2U,1U); +#define PIXEL10_70 line1[0] = interp_w3(C4,C7,C3,6U,1U,1U); +#define PIXEL10_90 line1[0] = interp_w3(C4,C7,C3,2U,3U,3U); +#define PIXEL10_100 line1[0] = interp_w3(C4,C7,C3,14U,1U,1U); + +#define PIXEL11_0 line1[1] = C4; +#define PIXEL11_10 line1[1] = interp_w2(C4,C8,3U,1U); +#define PIXEL11_11 line1[1] = interp_w2(C4,C5,3U,1U); +#define PIXEL11_12 line1[1] = interp_w2(C4,C7,3U,1U); +#define PIXEL11_20 line1[1] = interp_w3(C4,C5,C7,2U,1U,1U); +#define PIXEL11_21 line1[1] = interp_w3(C4,C8,C7,2U,1U,1U); +#define PIXEL11_22 line1[1] = interp_w3(C4,C8,C5,2U,1U,1U); +#define PIXEL11_60 line1[1] = interp_w3(C4,C7,C5,5U,2U,1U); +#define PIXEL11_61 line1[1] = interp_w3(C4,C5,C7,5U,2U,1U); +#define PIXEL11_70 line1[1] = interp_w3(C4,C5,C7,6U,1U,1U); +#define PIXEL11_90 line1[1] = interp_w3(C4,C5,C7,2U,3U,3U); +#define PIXEL11_100 line1[1] = interp_w3(C4,C5,C7,14U,1U,1U); + +#endif + +#if SBPP == 32 +#define RGBtoYUV(c) _RGBtoYUV[((c & 0xf80000) >> 8) | ((c & 0x00fc00) >> 12) | ((c & 0x0000f8) >> 3)] +#else +#define RGBtoYUV(c) _RGBtoYUV[c] +#endif + +inline void conc2d(Hq2x,SBPP)(PTYPE * line0, PTYPE * line1, const PTYPE * fc) +{ + if (_RGBtoYUV == 0) conc2d(InitLUTs,SBPP)(); + + Bit32u pattern = 0; + const Bit32u YUV4 = RGBtoYUV(C4); + if (C4 != C0 && diffYUV(YUV4, RGBtoYUV(C0))) pattern |= 0x0001; + if (C4 != C1 && diffYUV(YUV4, RGBtoYUV(C1))) pattern |= 0x0002; + if (C4 != C2 && diffYUV(YUV4, RGBtoYUV(C2))) pattern |= 0x0004; + if (C4 != C3 && diffYUV(YUV4, RGBtoYUV(C3))) pattern |= 0x0008; + if (C4 != C5 && diffYUV(YUV4, RGBtoYUV(C5))) pattern |= 0x0010; + if (C4 != C6 && diffYUV(YUV4, RGBtoYUV(C6))) pattern |= 0x0020; + if (C4 != C7 && diffYUV(YUV4, RGBtoYUV(C7))) pattern |= 0x0040; + if (C4 != C8 && diffYUV(YUV4, RGBtoYUV(C8))) pattern |= 0x0080; + + switch (pattern) { + case 0: + case 1: + case 4: + case 32: + case 128: + case 5: + case 132: + case 160: + case 33: + case 129: + case 36: + case 133: + case 164: + case 161: + case 37: + case 165: + PIXEL00_20 + PIXEL01_20 + PIXEL10_20 + PIXEL11_20 + break; + case 2: + case 34: + case 130: + case 162: + PIXEL00_22 + PIXEL01_21 + PIXEL10_20 + PIXEL11_20 + break; + case 16: + case 17: + case 48: + case 49: + PIXEL00_20 + PIXEL01_22 + PIXEL10_20 + PIXEL11_21 + break; + case 64: + case 65: + case 68: + case 69: + PIXEL00_20 + PIXEL01_20 + PIXEL10_21 + PIXEL11_22 + break; + case 8: + case 12: + case 136: + case 140: + PIXEL00_21 + PIXEL01_20 + PIXEL10_22 + PIXEL11_20 + break; + case 3: + case 35: + case 131: + case 163: + PIXEL00_11 + PIXEL01_21 + PIXEL10_20 + PIXEL11_20 + break; + case 6: + case 38: + case 134: + case 166: + PIXEL00_22 + PIXEL01_12 + PIXEL10_20 + PIXEL11_20 + break; + case 20: + case 21: + case 52: + case 53: + PIXEL00_20 + PIXEL01_11 + PIXEL10_20 + PIXEL11_21 + break; + case 144: + case 145: + case 176: + case 177: + PIXEL00_20 + PIXEL01_22 + PIXEL10_20 + PIXEL11_12 + break; + case 192: + case 193: + case 196: + case 197: + PIXEL00_20 + PIXEL01_20 + PIXEL10_21 + PIXEL11_11 + break; + case 96: + case 97: + case 100: + case 101: + PIXEL00_20 + PIXEL01_20 + PIXEL10_12 + PIXEL11_22 + break; + case 40: + case 44: + case 168: + case 172: + PIXEL00_21 + PIXEL01_20 + PIXEL10_11 + PIXEL11_20 + break; + case 9: + case 13: + case 137: + case 141: + PIXEL00_12 + PIXEL01_20 + PIXEL10_22 + PIXEL11_20 + break; + case 18: + case 50: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_20 + } + PIXEL10_20 + PIXEL11_21 + break; + case 80: + case 81: + PIXEL00_20 + PIXEL01_22 + PIXEL10_21 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_20 + } + break; + case 72: + case 76: + PIXEL00_21 + PIXEL01_20 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_20 + } + PIXEL11_22 + break; + case 10: + case 138: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_22 + PIXEL11_20 + break; + case 66: + PIXEL00_22 + PIXEL01_21 + PIXEL10_21 + PIXEL11_22 + break; + case 24: + PIXEL00_21 + PIXEL01_22 + PIXEL10_22 + PIXEL11_21 + break; + case 7: + case 39: + case 135: + PIXEL00_11 + PIXEL01_12 + PIXEL10_20 + PIXEL11_20 + break; + case 148: + case 149: + case 180: + PIXEL00_20 + PIXEL01_11 + PIXEL10_20 + PIXEL11_12 + break; + case 224: + case 228: + case 225: + PIXEL00_20 + PIXEL01_20 + PIXEL10_12 + PIXEL11_11 + break; + case 41: + case 169: + case 45: + PIXEL00_12 + PIXEL01_20 + PIXEL10_11 + PIXEL11_20 + break; + case 22: + case 54: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_20 + PIXEL11_21 + break; + case 208: + case 209: + PIXEL00_20 + PIXEL01_22 + PIXEL10_21 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 104: + case 108: + PIXEL00_21 + PIXEL01_20 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_22 + break; + case 11: + case 139: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_22 + PIXEL11_20 + break; + case 19: + case 51: + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL00_11 + PIXEL01_10 + } else { + PIXEL00_60 + PIXEL01_90 + } + PIXEL10_20 + PIXEL11_21 + break; + case 146: + case 178: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + PIXEL11_12 + } else { + PIXEL01_90 + PIXEL11_61 + } + PIXEL10_20 + break; + case 84: + case 85: + PIXEL00_20 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL01_11 + PIXEL11_10 + } else { + PIXEL01_60 + PIXEL11_90 + } + PIXEL10_21 + break; + case 112: + case 113: + PIXEL00_20 + PIXEL01_22 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL10_12 + PIXEL11_10 + } else { + PIXEL10_61 + PIXEL11_90 + } + break; + case 200: + case 204: + PIXEL00_21 + PIXEL01_20 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + PIXEL11_11 + } else { + PIXEL10_90 + PIXEL11_60 + } + break; + case 73: + case 77: + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL00_12 + PIXEL10_10 + } else { + PIXEL00_61 + PIXEL10_90 + } + PIXEL01_20 + PIXEL11_22 + break; + case 42: + case 170: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + PIXEL10_11 + } else { + PIXEL00_90 + PIXEL10_60 + } + PIXEL01_21 + PIXEL11_20 + break; + case 14: + case 142: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + PIXEL01_12 + } else { + PIXEL00_90 + PIXEL01_61 + } + PIXEL10_22 + PIXEL11_20 + break; + case 67: + PIXEL00_11 + PIXEL01_21 + PIXEL10_21 + PIXEL11_22 + break; + case 70: + PIXEL00_22 + PIXEL01_12 + PIXEL10_21 + PIXEL11_22 + break; + case 28: + PIXEL00_21 + PIXEL01_11 + PIXEL10_22 + PIXEL11_21 + break; + case 152: + PIXEL00_21 + PIXEL01_22 + PIXEL10_22 + PIXEL11_12 + break; + case 194: + PIXEL00_22 + PIXEL01_21 + PIXEL10_21 + PIXEL11_11 + break; + case 98: + PIXEL00_22 + PIXEL01_21 + PIXEL10_12 + PIXEL11_22 + break; + case 56: + PIXEL00_21 + PIXEL01_22 + PIXEL10_11 + PIXEL11_21 + break; + case 25: + PIXEL00_12 + PIXEL01_22 + PIXEL10_22 + PIXEL11_21 + break; + case 26: + case 31: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_22 + PIXEL11_21 + break; + case 82: + case 214: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_21 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 88: + case 248: + PIXEL00_21 + PIXEL01_22 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 74: + case 107: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_21 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_22 + break; + case 27: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_10 + PIXEL10_22 + PIXEL11_21 + break; + case 86: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_21 + PIXEL11_10 + break; + case 216: + PIXEL00_21 + PIXEL01_22 + PIXEL10_10 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 106: + PIXEL00_10 + PIXEL01_21 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_22 + break; + case 30: + PIXEL00_10 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_22 + PIXEL11_21 + break; + case 210: + PIXEL00_22 + PIXEL01_10 + PIXEL10_21 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 120: + PIXEL00_21 + PIXEL01_22 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_10 + break; + case 75: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_10 + PIXEL11_22 + break; + case 29: + PIXEL00_12 + PIXEL01_11 + PIXEL10_22 + PIXEL11_21 + break; + case 198: + PIXEL00_22 + PIXEL01_12 + PIXEL10_21 + PIXEL11_11 + break; + case 184: + PIXEL00_21 + PIXEL01_22 + PIXEL10_11 + PIXEL11_12 + break; + case 99: + PIXEL00_11 + PIXEL01_21 + PIXEL10_12 + PIXEL11_22 + break; + case 57: + PIXEL00_12 + PIXEL01_22 + PIXEL10_11 + PIXEL11_21 + break; + case 71: + PIXEL00_11 + PIXEL01_12 + PIXEL10_21 + PIXEL11_22 + break; + case 156: + PIXEL00_21 + PIXEL01_11 + PIXEL10_22 + PIXEL11_12 + break; + case 226: + PIXEL00_22 + PIXEL01_21 + PIXEL10_12 + PIXEL11_11 + break; + case 60: + PIXEL00_21 + PIXEL01_11 + PIXEL10_11 + PIXEL11_21 + break; + case 195: + PIXEL00_11 + PIXEL01_21 + PIXEL10_21 + PIXEL11_11 + break; + case 102: + PIXEL00_22 + PIXEL01_12 + PIXEL10_12 + PIXEL11_22 + break; + case 153: + PIXEL00_12 + PIXEL01_22 + PIXEL10_22 + PIXEL11_12 + break; + case 58: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + PIXEL10_11 + PIXEL11_21 + break; + case 83: + PIXEL00_11 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + PIXEL10_21 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 92: + PIXEL00_21 + PIXEL01_11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 202: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + PIXEL01_21 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + PIXEL11_11 + break; + case 78: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + PIXEL01_12 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + PIXEL11_22 + break; + case 154: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + PIXEL10_22 + PIXEL11_12 + break; + case 114: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + PIXEL10_12 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 89: + PIXEL00_12 + PIXEL01_22 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 90: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 55: + case 23: + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL00_11 + PIXEL01_0 + } else { + PIXEL00_60 + PIXEL01_90 + } + PIXEL10_20 + PIXEL11_21 + break; + case 182: + case 150: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + PIXEL11_12 + } else { + PIXEL01_90 + PIXEL11_61 + } + PIXEL10_20 + break; + case 213: + case 212: + PIXEL00_20 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL01_11 + PIXEL11_0 + } else { + PIXEL01_60 + PIXEL11_90 + } + PIXEL10_21 + break; + case 241: + case 240: + PIXEL00_20 + PIXEL01_22 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL10_12 + PIXEL11_0 + } else { + PIXEL10_61 + PIXEL11_90 + } + break; + case 236: + case 232: + PIXEL00_21 + PIXEL01_20 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + PIXEL11_11 + } else { + PIXEL10_90 + PIXEL11_60 + } + break; + case 109: + case 105: + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL00_12 + PIXEL10_0 + } else { + PIXEL00_61 + PIXEL10_90 + } + PIXEL01_20 + PIXEL11_22 + break; + case 171: + case 43: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + PIXEL10_11 + } else { + PIXEL00_90 + PIXEL10_60 + } + PIXEL01_21 + PIXEL11_20 + break; + case 143: + case 15: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + PIXEL01_12 + } else { + PIXEL00_90 + PIXEL01_61 + } + PIXEL10_22 + PIXEL11_20 + break; + case 124: + PIXEL00_21 + PIXEL01_11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_10 + break; + case 203: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_21 + PIXEL10_10 + PIXEL11_11 + break; + case 62: + PIXEL00_10 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_11 + PIXEL11_21 + break; + case 211: + PIXEL00_11 + PIXEL01_10 + PIXEL10_21 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 118: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_12 + PIXEL11_10 + break; + case 217: + PIXEL00_12 + PIXEL01_22 + PIXEL10_10 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 110: + PIXEL00_10 + PIXEL01_12 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_22 + break; + case 155: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_10 + PIXEL10_22 + PIXEL11_12 + break; + case 188: + PIXEL00_21 + PIXEL01_11 + PIXEL10_11 + PIXEL11_12 + break; + case 185: + PIXEL00_12 + PIXEL01_22 + PIXEL10_11 + PIXEL11_12 + break; + case 61: + PIXEL00_12 + PIXEL01_11 + PIXEL10_11 + PIXEL11_21 + break; + case 157: + PIXEL00_12 + PIXEL01_11 + PIXEL10_22 + PIXEL11_12 + break; + case 103: + PIXEL00_11 + PIXEL01_12 + PIXEL10_12 + PIXEL11_22 + break; + case 227: + PIXEL00_11 + PIXEL01_21 + PIXEL10_12 + PIXEL11_11 + break; + case 230: + PIXEL00_22 + PIXEL01_12 + PIXEL10_12 + PIXEL11_11 + break; + case 199: + PIXEL00_11 + PIXEL01_12 + PIXEL10_21 + PIXEL11_11 + break; + case 220: + PIXEL00_21 + PIXEL01_11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 158: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_22 + PIXEL11_12 + break; + case 234: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + PIXEL01_21 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_11 + break; + case 242: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + PIXEL10_12 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 59: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + PIXEL10_11 + PIXEL11_21 + break; + case 121: + PIXEL00_12 + PIXEL01_22 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 87: + PIXEL00_11 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_21 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 79: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_12 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + PIXEL11_22 + break; + case 122: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 94: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 218: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 91: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 229: + PIXEL00_20 + PIXEL01_20 + PIXEL10_12 + PIXEL11_11 + break; + case 167: + PIXEL00_11 + PIXEL01_12 + PIXEL10_20 + PIXEL11_20 + break; + case 173: + PIXEL00_12 + PIXEL01_20 + PIXEL10_11 + PIXEL11_20 + break; + case 181: + PIXEL00_20 + PIXEL01_11 + PIXEL10_20 + PIXEL11_12 + break; + case 186: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + PIXEL10_11 + PIXEL11_12 + break; + case 115: + PIXEL00_11 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + PIXEL10_12 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 93: + PIXEL00_12 + PIXEL01_11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 206: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + PIXEL01_12 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + PIXEL11_11 + break; + case 205: + case 201: + PIXEL00_12 + PIXEL01_20 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_10 + } else { + PIXEL10_70 + } + PIXEL11_11 + break; + case 174: + case 46: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_10 + } else { + PIXEL00_70 + } + PIXEL01_12 + PIXEL10_11 + PIXEL11_20 + break; + case 179: + case 147: + PIXEL00_11 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_10 + } else { + PIXEL01_70 + } + PIXEL10_20 + PIXEL11_12 + break; + case 117: + case 116: + PIXEL00_20 + PIXEL01_11 + PIXEL10_12 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_10 + } else { + PIXEL11_70 + } + break; + case 189: + PIXEL00_12 + PIXEL01_11 + PIXEL10_11 + PIXEL11_12 + break; + case 231: + PIXEL00_11 + PIXEL01_12 + PIXEL10_12 + PIXEL11_11 + break; + case 126: + PIXEL00_10 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_10 + break; + case 219: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_10 + PIXEL10_10 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 125: + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL00_12 + PIXEL10_0 + } else { + PIXEL00_61 + PIXEL10_90 + } + PIXEL01_11 + PIXEL11_10 + break; + case 221: + PIXEL00_12 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL01_11 + PIXEL11_0 + } else { + PIXEL01_60 + PIXEL11_90 + } + PIXEL10_10 + break; + case 207: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + PIXEL01_12 + } else { + PIXEL00_90 + PIXEL01_61 + } + PIXEL10_10 + PIXEL11_11 + break; + case 238: + PIXEL00_10 + PIXEL01_12 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + PIXEL11_11 + } else { + PIXEL10_90 + PIXEL11_60 + } + break; + case 190: + PIXEL00_10 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + PIXEL11_12 + } else { + PIXEL01_90 + PIXEL11_61 + } + PIXEL10_11 + break; + case 187: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + PIXEL10_11 + } else { + PIXEL00_90 + PIXEL10_60 + } + PIXEL01_10 + PIXEL11_12 + break; + case 243: + PIXEL00_11 + PIXEL01_10 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL10_12 + PIXEL11_0 + } else { + PIXEL10_61 + PIXEL11_90 + } + break; + case 119: + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL00_11 + PIXEL01_0 + } else { + PIXEL00_60 + PIXEL01_90 + } + PIXEL10_12 + PIXEL11_10 + break; + case 237: + case 233: + PIXEL00_12 + PIXEL01_20 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_100 + } + PIXEL11_11 + break; + case 175: + case 47: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_100 + } + PIXEL01_12 + PIXEL10_11 + PIXEL11_20 + break; + case 183: + case 151: + PIXEL00_11 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_100 + } + PIXEL10_20 + PIXEL11_12 + break; + case 245: + case 244: + PIXEL00_20 + PIXEL01_11 + PIXEL10_12 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_100 + } + break; + case 250: + PIXEL00_10 + PIXEL01_10 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 123: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_10 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_10 + break; + case 95: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_10 + PIXEL11_10 + break; + case 222: + PIXEL00_10 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_10 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 252: + PIXEL00_21 + PIXEL01_11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_100 + } + break; + case 249: + PIXEL00_12 + PIXEL01_22 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_100 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 235: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_21 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_100 + } + PIXEL11_11 + break; + case 111: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_100 + } + PIXEL01_12 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_22 + break; + case 63: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_100 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_11 + PIXEL11_21 + break; + case 159: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_100 + } + PIXEL10_22 + PIXEL11_12 + break; + case 215: + PIXEL00_11 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_100 + } + PIXEL10_21 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 246: + PIXEL00_22 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + PIXEL10_12 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_100 + } + break; + case 254: + PIXEL00_10 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_100 + } + break; + case 253: + PIXEL00_12 + PIXEL01_11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_100 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_100 + } + break; + case 251: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + PIXEL01_10 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_100 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 239: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_100 + } + PIXEL01_12 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_100 + } + PIXEL11_11 + break; + case 127: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_100 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_20 + } + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_20 + } + PIXEL11_10 + break; + case 191: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_100 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_100 + } + PIXEL10_11 + PIXEL11_12 + break; + case 223: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_20 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_100 + } + PIXEL10_10 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_20 + } + break; + case 247: + PIXEL00_11 + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_100 + } + PIXEL10_12 + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_100 + } + break; + case 255: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_0 + } else { + PIXEL00_100 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_0 + } else { + PIXEL01_100 + } + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_0 + } else { + PIXEL10_100 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL11_0 + } else { + PIXEL11_100 + } + break; + } +} + +#undef RGBtoYUV diff --git a/src/gui/render_templates_hq3x.h b/src/gui/render_templates_hq3x.h new file mode 100644 index 0000000..c4c2a59 --- /dev/null +++ b/src/gui/render_templates_hq3x.h @@ -0,0 +1,2872 @@ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* + * The HQ3x high quality 3x graphics filter. + * Original author Maxim Stepin (see http://www.hiend3d.com/hq3x.html). + * Adapted for DOSBox from ScummVM and HiEnd3D code by Kronuz. + */ + +#ifndef RENDER_TEMPLATES_HQ3X_TABLE_H +#define RENDER_TEMPLATES_HQ3X_TABLE_H + +#define PIXEL00_1M line0[0] = interp_w2(C4,C0,3U,1U); +#define PIXEL00_1U line0[0] = interp_w2(C4,C1,3U,1U); +#define PIXEL00_1L line0[0] = interp_w2(C4,C3,3U,1U); +#define PIXEL00_2 line0[0] = interp_w3(C4,C3,C1,2U,1U,1U); +#define PIXEL00_4 line0[0] = interp_w3(C4,C3,C1,2U,7U,7U); +#define PIXEL00_5 line0[0] = interp_w2(C3,C1,1U,1U); +#define PIXEL00_C line0[0] = C4; + +#define PIXEL01_1 line0[1] = interp_w2(C4,C1,3U,1U); +#define PIXEL01_3 line0[1] = interp_w2(C4,C1,7U,1U); +#define PIXEL01_6 line0[1] = interp_w2(C1,C4,3U,1U); +#define PIXEL01_C line0[1] = C4; + +#define PIXEL02_1M line0[2] = interp_w2(C4,C2,3U,1U); +#define PIXEL02_1U line0[2] = interp_w2(C4,C1,3U,1U); +#define PIXEL02_1R line0[2] = interp_w2(C4,C5,3U,1U); +#define PIXEL02_2 line0[2] = interp_w3(C4,C1,C5,2U,1U,1U); +#define PIXEL02_4 line0[2] = interp_w3(C4,C1,C5,2U,7U,7U); +#define PIXEL02_5 line0[2] = interp_w2(C1,C5,1U,1U); +#define PIXEL02_C line0[2] = C4; + +#define PIXEL10_1 line1[0] = interp_w2(C4,C3,3U,1U); +#define PIXEL10_3 line1[0] = interp_w2(C4,C3,7U,1U); +#define PIXEL10_6 line1[0] = interp_w2(C3,C4,3U,1U); +#define PIXEL10_C line1[0] = C4; + +#define PIXEL11 line1[1] = C4; + +#define PIXEL12_1 line1[2] = interp_w2(C4,C5,3U,1U); +#define PIXEL12_3 line1[2] = interp_w2(C4,C5,7U,1U); +#define PIXEL12_6 line1[2] = interp_w2(C5,C4,3U,1U); +#define PIXEL12_C line1[2] = C4; + +#define PIXEL20_1M line2[0] = interp_w2(C4,C6,3U,1U); +#define PIXEL20_1D line2[0] = interp_w2(C4,C7,3U,1U); +#define PIXEL20_1L line2[0] = interp_w2(C4,C3,3U,1U); +#define PIXEL20_2 line2[0] = interp_w3(C4,C7,C3,2U,1U,1U); +#define PIXEL20_4 line2[0] = interp_w3(C4,C7,C3,2U,7U,7U); +#define PIXEL20_5 line2[0] = interp_w2(C7,C3,1U,1U); +#define PIXEL20_C line2[0] = C4; + +#define PIXEL21_1 line2[1] = interp_w2(C4,C7,3U,1U); +#define PIXEL21_3 line2[1] = interp_w2(C4,C7,7U,1U); +#define PIXEL21_6 line2[1] = interp_w2(C7,C4,3U,1U); +#define PIXEL21_C line2[1] = C4; + +#define PIXEL22_1M line2[2] = interp_w2(C4,C8,3U,1U); +#define PIXEL22_1D line2[2] = interp_w2(C4,C7,3U,1U); +#define PIXEL22_1R line2[2] = interp_w2(C4,C5,3U,1U); +#define PIXEL22_2 line2[2] = interp_w3(C4,C5,C7,2U,1U,1U); +#define PIXEL22_4 line2[2] = interp_w3(C4,C5,C7,2U,7U,7U); +#define PIXEL22_5 line2[2] = interp_w2(C5,C7,1U,1U); +#define PIXEL22_C line2[2] = C4; + +#endif + +#if SBPP == 32 +#define RGBtoYUV(c) _RGBtoYUV[((c & 0xf80000) >> 8) | ((c & 0x00fc00) >> 12) | ((c & 0x0000f8) >> 3)] +#else +#define RGBtoYUV(c) _RGBtoYUV[c] +#endif + +inline void conc2d(Hq3x,SBPP)(PTYPE * line0, PTYPE * line1, PTYPE * line2, const PTYPE * fc) +{ + if (_RGBtoYUV == 0) conc2d(InitLUTs,SBPP)(); + + Bit32u pattern = 0; + const Bit32u YUV4 = RGBtoYUV(C4); + + if (C4 != C0 && diffYUV(YUV4, RGBtoYUV(C0))) pattern |= 0x0001; + if (C4 != C1 && diffYUV(YUV4, RGBtoYUV(C1))) pattern |= 0x0002; + if (C4 != C2 && diffYUV(YUV4, RGBtoYUV(C2))) pattern |= 0x0004; + if (C4 != C3 && diffYUV(YUV4, RGBtoYUV(C3))) pattern |= 0x0008; + if (C4 != C5 && diffYUV(YUV4, RGBtoYUV(C5))) pattern |= 0x0010; + if (C4 != C6 && diffYUV(YUV4, RGBtoYUV(C6))) pattern |= 0x0020; + if (C4 != C7 && diffYUV(YUV4, RGBtoYUV(C7))) pattern |= 0x0040; + if (C4 != C8 && diffYUV(YUV4, RGBtoYUV(C8))) pattern |= 0x0080; + + switch (pattern) { + case 0: + case 1: + case 4: + case 32: + case 128: + case 5: + case 132: + case 160: + case 33: + case 129: + case 36: + case 133: + case 164: + case 161: + case 37: + case 165: + PIXEL00_2 + PIXEL01_1 + PIXEL02_2 + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_2 + PIXEL21_1 + PIXEL22_2 + break; + case 2: + case 34: + case 130: + case 162: + PIXEL00_1M + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_2 + PIXEL21_1 + PIXEL22_2 + break; + case 16: + case 17: + case 48: + case 49: + PIXEL00_2 + PIXEL01_1 + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_2 + PIXEL21_1 + PIXEL22_1M + break; + case 64: + case 65: + case 68: + case 69: + PIXEL00_2 + PIXEL01_1 + PIXEL02_2 + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1M + break; + case 8: + case 12: + case 136: + case 140: + PIXEL00_1M + PIXEL01_1 + PIXEL02_2 + PIXEL10_C + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_1 + PIXEL22_2 + break; + case 3: + case 35: + case 131: + case 163: + PIXEL00_1L + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_2 + PIXEL21_1 + PIXEL22_2 + break; + case 6: + case 38: + case 134: + case 166: + PIXEL00_1M + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_2 + PIXEL21_1 + PIXEL22_2 + break; + case 20: + case 21: + case 52: + case 53: + PIXEL00_2 + PIXEL01_1 + PIXEL02_1U + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_2 + PIXEL21_1 + PIXEL22_1M + break; + case 144: + case 145: + case 176: + case 177: + PIXEL00_2 + PIXEL01_1 + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_2 + PIXEL21_1 + PIXEL22_1D + break; + case 192: + case 193: + case 196: + case 197: + PIXEL00_2 + PIXEL01_1 + PIXEL02_2 + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1R + break; + case 96: + case 97: + case 100: + case 101: + PIXEL00_2 + PIXEL01_1 + PIXEL02_2 + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1M + break; + case 40: + case 44: + case 168: + case 172: + PIXEL00_1M + PIXEL01_1 + PIXEL02_2 + PIXEL10_C + PIXEL11 + PIXEL12_1 + PIXEL20_1D + PIXEL21_1 + PIXEL22_2 + break; + case 9: + case 13: + case 137: + case 141: + PIXEL00_1U + PIXEL01_1 + PIXEL02_2 + PIXEL10_C + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_1 + PIXEL22_2 + break; + case 18: + case 50: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_1M + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_1 + PIXEL11 + PIXEL20_2 + PIXEL21_1 + PIXEL22_1M + break; + case 80: + case 81: + PIXEL00_2 + PIXEL01_1 + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_1M + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 72: + case 76: + PIXEL00_1M + PIXEL01_1 + PIXEL02_2 + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_1M + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 10: + case 138: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + PIXEL02_1M + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_1 + PIXEL22_2 + break; + case 66: + PIXEL00_1M + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1M + break; + case 24: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1M + break; + case 7: + case 39: + case 135: + PIXEL00_1L + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_2 + PIXEL21_1 + PIXEL22_2 + break; + case 148: + case 149: + case 180: + PIXEL00_2 + PIXEL01_1 + PIXEL02_1U + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_2 + PIXEL21_1 + PIXEL22_1D + break; + case 224: + case 228: + case 225: + PIXEL00_2 + PIXEL01_1 + PIXEL02_2 + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1R + break; + case 41: + case 169: + case 45: + PIXEL00_1U + PIXEL01_1 + PIXEL02_2 + PIXEL10_C + PIXEL11 + PIXEL12_1 + PIXEL20_1D + PIXEL21_1 + PIXEL22_2 + break; + case 22: + case 54: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_1 + PIXEL11 + PIXEL20_2 + PIXEL21_1 + PIXEL22_1M + break; + case 208: + case 209: + PIXEL00_2 + PIXEL01_1 + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 104: + case 108: + PIXEL00_1M + PIXEL01_1 + PIXEL02_2 + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 11: + case 139: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + PIXEL02_1M + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_1 + PIXEL22_2 + break; + case 19: + case 51: + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL00_1L + PIXEL01_C + PIXEL02_1M + PIXEL12_C + } else { + PIXEL00_2 + PIXEL01_6 + PIXEL02_5 + PIXEL12_1 + } + PIXEL10_1 + PIXEL11 + PIXEL20_2 + PIXEL21_1 + PIXEL22_1M + break; + case 146: + case 178: + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_1M + PIXEL12_C + PIXEL22_1D + } else { + PIXEL01_1 + PIXEL02_5 + PIXEL12_6 + PIXEL22_2 + } + PIXEL00_1M + PIXEL10_1 + PIXEL11 + PIXEL20_2 + PIXEL21_1 + break; + case 84: + case 85: + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL02_1U + PIXEL12_C + PIXEL21_C + PIXEL22_1M + } else { + PIXEL02_2 + PIXEL12_6 + PIXEL21_1 + PIXEL22_5 + } + PIXEL00_2 + PIXEL01_1 + PIXEL10_1 + PIXEL11 + PIXEL20_1M + break; + case 112: + case 113: + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL20_1L + PIXEL21_C + PIXEL22_1M + } else { + PIXEL12_1 + PIXEL20_2 + PIXEL21_6 + PIXEL22_5 + } + PIXEL00_2 + PIXEL01_1 + PIXEL02_1M + PIXEL10_1 + PIXEL11 + break; + case 200: + case 204: + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_1M + PIXEL21_C + PIXEL22_1R + } else { + PIXEL10_1 + PIXEL20_5 + PIXEL21_6 + PIXEL22_2 + } + PIXEL00_1M + PIXEL01_1 + PIXEL02_2 + PIXEL11 + PIXEL12_1 + break; + case 73: + case 77: + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL00_1U + PIXEL10_C + PIXEL20_1M + PIXEL21_C + } else { + PIXEL00_2 + PIXEL10_6 + PIXEL20_5 + PIXEL21_1 + } + PIXEL01_1 + PIXEL02_2 + PIXEL11 + PIXEL12_1 + PIXEL22_1M + break; + case 42: + case 170: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + PIXEL01_C + PIXEL10_C + PIXEL20_1D + } else { + PIXEL00_5 + PIXEL01_1 + PIXEL10_6 + PIXEL20_2 + } + PIXEL02_1M + PIXEL11 + PIXEL12_1 + PIXEL21_1 + PIXEL22_2 + break; + case 14: + case 142: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + PIXEL01_C + PIXEL02_1R + PIXEL10_C + } else { + PIXEL00_5 + PIXEL01_6 + PIXEL02_2 + PIXEL10_1 + } + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_1 + PIXEL22_2 + break; + case 67: + PIXEL00_1L + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1M + break; + case 70: + PIXEL00_1M + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1M + break; + case 28: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1M + break; + case 152: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1D + break; + case 194: + PIXEL00_1M + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1R + break; + case 98: + PIXEL00_1M + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1M + break; + case 56: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1M + break; + case 25: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1M + break; + case 26: + case 31: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL10_3 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + PIXEL12_C + } else { + PIXEL02_4 + PIXEL12_3 + } + PIXEL11 + PIXEL20_1M + PIXEL21_1 + PIXEL22_1M + break; + case 82: + case 214: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + } else { + PIXEL01_3 + PIXEL02_4 + } + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL21_C + PIXEL22_C + } else { + PIXEL21_3 + PIXEL22_4 + } + break; + case 88: + case 248: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1M + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + } else { + PIXEL10_3 + PIXEL20_4 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL22_4 + } + break; + case 74: + case 107: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + } else { + PIXEL00_4 + PIXEL01_3 + } + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + PIXEL21_C + } else { + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 27: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + PIXEL02_1M + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1M + break; + case 86: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_1 + PIXEL11 + PIXEL20_1M + PIXEL21_C + PIXEL22_1M + break; + case 216: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 106: + PIXEL00_1M + PIXEL01_C + PIXEL02_1M + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 30: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_C + PIXEL11 + PIXEL20_1M + PIXEL21_1 + PIXEL22_1M + break; + case 210: + PIXEL00_1M + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 120: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1M + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 75: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + PIXEL02_1M + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1M + break; + case 29: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1M + break; + case 198: + PIXEL00_1M + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1R + break; + case 184: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1D + break; + case 99: + PIXEL00_1L + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1M + break; + case 57: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1M + break; + case 71: + PIXEL00_1L + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1M + break; + case 156: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1D + break; + case 226: + PIXEL00_1M + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1R + break; + case 60: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1M + break; + case 195: + PIXEL00_1L + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1R + break; + case 102: + PIXEL00_1M + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1M + break; + case 153: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1D + break; + case 58: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1M + break; + case 83: + PIXEL00_1L + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 92: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 202: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + PIXEL22_1R + break; + case 78: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + PIXEL02_1R + PIXEL10_C + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + PIXEL22_1M + break; + case 154: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1D + break; + case 114: + PIXEL00_1M + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_1L + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 89: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 90: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_C + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 55: + case 23: + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL00_1L + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL00_2 + PIXEL01_6 + PIXEL02_5 + PIXEL12_1 + } + PIXEL10_1 + PIXEL11 + PIXEL20_2 + PIXEL21_1 + PIXEL22_1M + break; + case 182: + case 150: + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + PIXEL22_1D + } else { + PIXEL01_1 + PIXEL02_5 + PIXEL12_6 + PIXEL22_2 + } + PIXEL00_1M + PIXEL10_1 + PIXEL11 + PIXEL20_2 + PIXEL21_1 + break; + case 213: + case 212: + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL02_1U + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL02_2 + PIXEL12_6 + PIXEL21_1 + PIXEL22_5 + } + PIXEL00_2 + PIXEL01_1 + PIXEL10_1 + PIXEL11 + PIXEL20_1M + break; + case 241: + case 240: + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL20_1L + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_1 + PIXEL20_2 + PIXEL21_6 + PIXEL22_5 + } + PIXEL00_2 + PIXEL01_1 + PIXEL02_1M + PIXEL10_1 + PIXEL11 + break; + case 236: + case 232: + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + PIXEL22_1R + } else { + PIXEL10_1 + PIXEL20_5 + PIXEL21_6 + PIXEL22_2 + } + PIXEL00_1M + PIXEL01_1 + PIXEL02_2 + PIXEL11 + PIXEL12_1 + break; + case 109: + case 105: + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL00_1U + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL00_2 + PIXEL10_6 + PIXEL20_5 + PIXEL21_1 + } + PIXEL01_1 + PIXEL02_2 + PIXEL11 + PIXEL12_1 + PIXEL22_1M + break; + case 171: + case 43: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + PIXEL20_1D + } else { + PIXEL00_5 + PIXEL01_1 + PIXEL10_6 + PIXEL20_2 + } + PIXEL02_1M + PIXEL11 + PIXEL12_1 + PIXEL21_1 + PIXEL22_2 + break; + case 143: + case 15: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL02_1R + PIXEL10_C + } else { + PIXEL00_5 + PIXEL01_6 + PIXEL02_2 + PIXEL10_1 + } + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_1 + PIXEL22_2 + break; + case 124: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1U + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 203: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + PIXEL02_1M + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1R + break; + case 62: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_C + PIXEL11 + PIXEL20_1D + PIXEL21_1 + PIXEL22_1M + break; + case 211: + PIXEL00_1L + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 118: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_1 + PIXEL11 + PIXEL20_1L + PIXEL21_C + PIXEL22_1M + break; + case 217: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 110: + PIXEL00_1M + PIXEL01_C + PIXEL02_1R + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 155: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + PIXEL02_1M + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1D + break; + case 188: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1D + break; + case 185: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1D + break; + case 61: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1M + break; + case 157: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1D + break; + case 103: + PIXEL00_1L + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1M + break; + case 227: + PIXEL00_1L + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1R + break; + case 230: + PIXEL00_1M + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1R + break; + case 199: + PIXEL00_1L + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1R + break; + case 220: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 158: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_C + PIXEL11 + PIXEL20_1M + PIXEL21_1 + PIXEL22_1D + break; + case 234: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + PIXEL02_1M + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1R + break; + case 242: + PIXEL00_1M + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_1 + PIXEL11 + PIXEL20_1L + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 59: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1M + break; + case 121: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1M + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 87: + PIXEL00_1L + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_1 + PIXEL11 + PIXEL20_1M + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 79: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + PIXEL02_1R + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + PIXEL22_1M + break; + case 122: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 94: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_C + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 218: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_C + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 91: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 229: + PIXEL00_2 + PIXEL01_1 + PIXEL02_2 + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1R + break; + case 167: + PIXEL00_1L + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_2 + PIXEL21_1 + PIXEL22_2 + break; + case 173: + PIXEL00_1U + PIXEL01_1 + PIXEL02_2 + PIXEL10_C + PIXEL11 + PIXEL12_1 + PIXEL20_1D + PIXEL21_1 + PIXEL22_2 + break; + case 181: + PIXEL00_2 + PIXEL01_1 + PIXEL02_1U + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_2 + PIXEL21_1 + PIXEL22_1D + break; + case 186: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1D + break; + case 115: + PIXEL00_1L + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_1L + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 93: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 206: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + PIXEL02_1R + PIXEL10_C + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + PIXEL22_1R + break; + case 205: + case 201: + PIXEL00_1U + PIXEL01_1 + PIXEL02_2 + PIXEL10_C + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_1M + } else { + PIXEL20_2 + } + PIXEL21_C + PIXEL22_1R + break; + case 174: + case 46: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_1M + } else { + PIXEL00_2 + } + PIXEL01_C + PIXEL02_1R + PIXEL10_C + PIXEL11 + PIXEL12_1 + PIXEL20_1D + PIXEL21_1 + PIXEL22_2 + break; + case 179: + case 147: + PIXEL00_1L + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_1M + } else { + PIXEL02_2 + } + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_2 + PIXEL21_1 + PIXEL22_1D + break; + case 117: + case 116: + PIXEL00_2 + PIXEL01_1 + PIXEL02_1U + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_1L + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_1M + } else { + PIXEL22_2 + } + break; + case 189: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1D + break; + case 231: + PIXEL00_1L + PIXEL01_C + PIXEL02_1R + PIXEL10_1 + PIXEL11 + PIXEL12_1 + PIXEL20_1L + PIXEL21_C + PIXEL22_1R + break; + case 126: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_4 + PIXEL12_3 + } + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 219: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL01_3 + PIXEL10_3 + } + PIXEL02_1M + PIXEL11 + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_4 + } + break; + case 125: + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL00_1U + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL00_2 + PIXEL10_6 + PIXEL20_5 + PIXEL21_1 + } + PIXEL01_1 + PIXEL02_1U + PIXEL11 + PIXEL12_C + PIXEL22_1M + break; + case 221: + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL02_1U + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL02_2 + PIXEL12_6 + PIXEL21_1 + PIXEL22_5 + } + PIXEL00_1U + PIXEL01_1 + PIXEL10_C + PIXEL11 + PIXEL20_1M + break; + case 207: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL02_1R + PIXEL10_C + } else { + PIXEL00_5 + PIXEL01_6 + PIXEL02_2 + PIXEL10_1 + } + PIXEL11 + PIXEL12_1 + PIXEL20_1M + PIXEL21_C + PIXEL22_1R + break; + case 238: + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + PIXEL22_1R + } else { + PIXEL10_1 + PIXEL20_5 + PIXEL21_6 + PIXEL22_2 + } + PIXEL00_1M + PIXEL01_C + PIXEL02_1R + PIXEL11 + PIXEL12_1 + break; + case 190: + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + PIXEL22_1D + } else { + PIXEL01_1 + PIXEL02_5 + PIXEL12_6 + PIXEL22_2 + } + PIXEL00_1M + PIXEL10_C + PIXEL11 + PIXEL20_1D + PIXEL21_1 + break; + case 187: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + PIXEL20_1D + } else { + PIXEL00_5 + PIXEL01_1 + PIXEL10_6 + PIXEL20_2 + } + PIXEL02_1M + PIXEL11 + PIXEL12_C + PIXEL21_1 + PIXEL22_1D + break; + case 243: + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL20_1L + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_1 + PIXEL20_2 + PIXEL21_6 + PIXEL22_5 + } + PIXEL00_1L + PIXEL01_C + PIXEL02_1M + PIXEL10_1 + PIXEL11 + break; + case 119: + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL00_1L + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL00_2 + PIXEL01_6 + PIXEL02_5 + PIXEL12_1 + } + PIXEL10_1 + PIXEL11 + PIXEL20_1L + PIXEL21_C + PIXEL22_1M + break; + case 237: + case 233: + PIXEL00_1U + PIXEL01_1 + PIXEL02_2 + PIXEL10_C + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + } else { + PIXEL20_2 + } + PIXEL21_C + PIXEL22_1R + break; + case 175: + case 47: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + } else { + PIXEL00_2 + } + PIXEL01_C + PIXEL02_1R + PIXEL10_C + PIXEL11 + PIXEL12_1 + PIXEL20_1D + PIXEL21_1 + PIXEL22_2 + break; + case 183: + case 151: + PIXEL00_1L + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + } else { + PIXEL02_2 + } + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_2 + PIXEL21_1 + PIXEL22_1D + break; + case 245: + case 244: + PIXEL00_2 + PIXEL01_1 + PIXEL02_1U + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_1L + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_C + } else { + PIXEL22_2 + } + break; + case 250: + PIXEL00_1M + PIXEL01_C + PIXEL02_1M + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + } else { + PIXEL10_3 + PIXEL20_4 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL22_4 + } + break; + case 123: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + } else { + PIXEL00_4 + PIXEL01_3 + } + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + PIXEL21_C + } else { + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 95: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL10_3 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + PIXEL12_C + } else { + PIXEL02_4 + PIXEL12_3 + } + PIXEL11 + PIXEL20_1M + PIXEL21_C + PIXEL22_1M + break; + case 222: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + } else { + PIXEL01_3 + PIXEL02_4 + } + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL21_C + PIXEL22_C + } else { + PIXEL21_3 + PIXEL22_4 + } + break; + case 252: + PIXEL00_1M + PIXEL01_1 + PIXEL02_1U + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + } else { + PIXEL10_3 + PIXEL20_4 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_C + } else { + PIXEL22_2 + } + break; + case 249: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1M + PIXEL10_C + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + } else { + PIXEL20_2 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL22_4 + } + break; + case 235: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + } else { + PIXEL00_4 + PIXEL01_3 + } + PIXEL02_1M + PIXEL10_C + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + } else { + PIXEL20_2 + } + PIXEL21_C + PIXEL22_1R + break; + case 111: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + } else { + PIXEL00_2 + } + PIXEL01_C + PIXEL02_1R + PIXEL10_C + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + PIXEL21_C + } else { + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 63: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + } else { + PIXEL00_2 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + PIXEL12_C + } else { + PIXEL02_4 + PIXEL12_3 + } + PIXEL10_C + PIXEL11 + PIXEL20_1D + PIXEL21_1 + PIXEL22_1M + break; + case 159: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL10_3 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + } else { + PIXEL02_2 + } + PIXEL11 + PIXEL12_C + PIXEL20_1M + PIXEL21_1 + PIXEL22_1D + break; + case 215: + PIXEL00_1L + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + } else { + PIXEL02_2 + } + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL21_C + PIXEL22_C + } else { + PIXEL21_3 + PIXEL22_4 + } + break; + case 246: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + } else { + PIXEL01_3 + PIXEL02_4 + } + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_1L + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_C + } else { + PIXEL22_2 + } + break; + case 254: + PIXEL00_1M + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + } else { + PIXEL01_3 + PIXEL02_4 + } + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + } else { + PIXEL10_3 + PIXEL20_4 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL21_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL21_3 + PIXEL22_2 + } + break; + case 253: + PIXEL00_1U + PIXEL01_1 + PIXEL02_1U + PIXEL10_C + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + } else { + PIXEL20_2 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_C + } else { + PIXEL22_2 + } + break; + case 251: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + } else { + PIXEL00_4 + PIXEL01_3 + } + PIXEL02_1M + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL10_C + PIXEL20_C + PIXEL21_C + } else { + PIXEL10_3 + PIXEL20_2 + PIXEL21_3 + } + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL12_C + PIXEL22_C + } else { + PIXEL12_3 + PIXEL22_4 + } + break; + case 239: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + } else { + PIXEL00_2 + } + PIXEL01_C + PIXEL02_1R + PIXEL10_C + PIXEL11 + PIXEL12_1 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + } else { + PIXEL20_2 + } + PIXEL21_C + PIXEL22_1R + break; + case 127: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL01_C + PIXEL10_C + } else { + PIXEL00_2 + PIXEL01_3 + PIXEL10_3 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + PIXEL12_C + } else { + PIXEL02_4 + PIXEL12_3 + } + PIXEL11 + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + PIXEL21_C + } else { + PIXEL20_4 + PIXEL21_3 + } + PIXEL22_1M + break; + case 191: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + } else { + PIXEL00_2 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + } else { + PIXEL02_2 + } + PIXEL10_C + PIXEL11 + PIXEL12_C + PIXEL20_1D + PIXEL21_1 + PIXEL22_1D + break; + case 223: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + PIXEL10_C + } else { + PIXEL00_4 + PIXEL10_3 + } + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL01_C + PIXEL02_C + PIXEL12_C + } else { + PIXEL01_3 + PIXEL02_2 + PIXEL12_3 + } + PIXEL11 + PIXEL20_1M + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL21_C + PIXEL22_C + } else { + PIXEL21_3 + PIXEL22_4 + } + break; + case 247: + PIXEL00_1L + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + } else { + PIXEL02_2 + } + PIXEL10_1 + PIXEL11 + PIXEL12_C + PIXEL20_1L + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_C + } else { + PIXEL22_2 + } + break; + case 255: + if (diffYUV(RGBtoYUV(C3), RGBtoYUV(C1))) { + PIXEL00_C + } else { + PIXEL00_2 + } + PIXEL01_C + if (diffYUV(RGBtoYUV(C1), RGBtoYUV(C5))) { + PIXEL02_C + } else { + PIXEL02_2 + } + PIXEL10_C + PIXEL11 + PIXEL12_C + if (diffYUV(RGBtoYUV(C7), RGBtoYUV(C3))) { + PIXEL20_C + } else { + PIXEL20_2 + } + PIXEL21_C + if (diffYUV(RGBtoYUV(C5), RGBtoYUV(C7))) { + PIXEL22_C + } else { + PIXEL22_2 + } + break; + } +} + +#undef RGBtoYUV diff --git a/src/gui/render_templates_sai.h b/src/gui/render_templates_sai.h new file mode 100644 index 0000000..4088a63 --- /dev/null +++ b/src/gui/render_templates_sai.h @@ -0,0 +1,229 @@ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +static inline int conc2d(GetResult,SBPP)(PTYPE A, PTYPE B, PTYPE C, PTYPE D) { + const bool ac = (A==C); + const bool bc = (B==C); + const int x1 = ac; + const int y1 = (bc & !ac); + const bool ad = (A==D); + const bool bd = (B==D); + const int x2 = ad; + const int y2 = (bd & !ad); + const int x = x1+x2; + const int y = y1+y2; + static const int rmap[3][3] = { + {0, 0, -1}, + {0, 0, -1}, + {1, 1, 0} + }; + return rmap[y][x]; +} + +inline void conc2d(Super2xSaI,SBPP)(PTYPE * line0, PTYPE * line1, const PTYPE * fc) +{ + //-------------------------------------- + if (C7 == C5 && C4 != C8) { + line1[1] = line0[1] = C7; + } else if (C4 == C8 && C7 != C5) { + line1[1] = line0[1] = C4; + } else if (C4 == C8 && C7 == C5) { + register int r = 0; + r += conc2d(GetResult,SBPP)(C5,C4,C6,D1); + r += conc2d(GetResult,SBPP)(C5,C4,C3,C1); + r += conc2d(GetResult,SBPP)(C5,C4,D2,D5); + r += conc2d(GetResult,SBPP)(C5,C4,C2,D4); + + if (r > 0) + line1[1] = line0[1] = C5; + else if (r < 0) + line1[1] = line0[1] = C4; + else { + line1[1] = line0[1] = interp_w2(C4,C5,1U,1U); + } + } else { + if (C5 == C8 && C8 == D1 && C7 != D2 && C8 != D0) + line1[1] = interp_w2(C8,C7,3U,1U); + else if (C4 == C7 && C7 == D2 && D1 != C8 && C7 != D6) + line1[1] = interp_w2(C7,C8,3U,1U); + else + line1[1] = interp_w2(C7,C8,1U,1U); + + if (C5 == C8 && C5 == C1 && C4 != C2 && C5 != C0) + line0[1] = interp_w2(C5,C4,3U,1U); + else if (C4 == C7 && C4 == C2 && C1 != C5 && C4 != D3) + line0[1] = interp_w2(C4,C5,3U,1U); + else + line0[1] = interp_w2(C4,C5,1U,1U); + } + + if (C4 == C8 && C7 != C5 && C3 == C4 && C4 != D2) + line1[0] = interp_w2(C7,C4,1U,1U); + else if (C4 == C6 && C5 == C4 && C3 != C7 && C4 != D0) + line1[0] = interp_w2(C7,C4,1U,1U); + else + line1[0] = C7; + + if (C7 == C5 && C4 != C8 && C6 == C7 && C7 != C2) + line0[0] = interp_w2(C7,C4,1U,1U); + else if (C3 == C7 && C8 == C7 && C6 != C4 && C7 != C0) + line0[0] = interp_w2(C7,C4,1U,1U); + else + line0[0] = C4; +} + +inline void conc2d(SuperEagle,SBPP)(PTYPE * line0, PTYPE * line1, const PTYPE * fc) +{ + // -------------------------------------- + if (C4 != C8) { + if (C7 == C5) { + line0[1] = line1[0] = C7; + if ((C6 == C7) || (C5 == C2)) { + line0[0] = interp_w2(C7,C4,3U,1U); + } else { + line0[0] = interp_w2(C4,C5,1U,1U); + } + + if ((C5 == D4) || (C7 == D1)) { + line1[1] = interp_w2(C7,C8,3U,1U); + } else { + line1[1] = interp_w2(C7,C8,1U,1U); + } + } else { + line1[1] = interp_w3(C8,C7,C5,6U,1U,1U); + line0[0] = interp_w3(C4,C7,C5,6U,1U,1U); + + line1[0] = interp_w3(C7,C4,C8,6U,1U,1U); + line0[1] = interp_w3(C5,C4,C8,6U,1U,1U); + } + } else { + if (C7 != C5) { + line1[1] = line0[0] = C4; + + if ((C1 == C4) || (C8 == D5)) { + line0[1] = interp_w2(C4,C5,3U,1U); + } else { + line0[1] = interp_w2(C4,C5,1U,1U); + } + + if ((C8 == D2) || (C3 == C4)) { + line1[0] = interp_w2(C4,C7,3U,1U); + } else { + line1[0] = interp_w2(C7,C8,1U,1U); + } + } else { + register int r = 0; + r += conc2d(GetResult,SBPP)(C5,C4,C6,D1); + r += conc2d(GetResult,SBPP)(C5,C4,C3,C1); + r += conc2d(GetResult,SBPP)(C5,C4,D2,D5); + r += conc2d(GetResult,SBPP)(C5,C4,C2,D4); + + if (r > 0) { + line0[1] = line1[0] = C7; + line0[0] = line1[1] = interp_w2(C4,C5,1U,1U); + } else if (r < 0) { + line1[1] = line0[0] = C4; + line0[1] = line1[0] = interp_w2(C4,C5,1U,1U); + } else { + line1[1] = line0[0] = C4; + line0[1] = line1[0] = C7; + } + } + } +} + +inline void conc2d(_2xSaI,SBPP)(PTYPE * line0, PTYPE * line1, const PTYPE * fc) +{ + if ((C4 == C8) && (C5 != C7)) { + if (((C4 == C1) && (C5 == D5)) || + ((C4 == C7) && (C4 == C2) && (C5 != C1) && (C5 == D3))) { + line0[1] = C4; + } else { + line0[1] = interp_w2(C4,C5,1U,1U); + } + + if (((C4 == C3) && (C7 == D2)) || + ((C4 == C5) && (C4 == C6) && (C3 != C7) && (C7 == D0))) { + line1[0] = C4; + } else { + line1[0] = interp_w2(C4,C7,1U,1U); + } + line1[1] = C4; + } else if ((C5 == C7) && (C4 != C8)) { + if (((C5 == C2) && (C4 == C6)) || + ((C5 == C1) && (C5 == C8) && (C4 != C2) && (C4 == C0))) { + line0[1] = C5; + } else { + line0[1] = interp_w2(C4,C5,1U,1U); + } + + if (((C7 == C6) && (C4 == C2)) || + ((C7 == C3) && (C7 == C8) && (C4 != C6) && (C4 == C0))) { + line1[0] = C7; + } else { + line1[0] = interp_w2(C4,C7,1U,1U); + } + line1[1] = C5; + } else if ((C4 == C8) && (C5 == C7)) { + if (C4 == C5) { + line0[1] = C4; + line1[0] = C4; + line1[1] = C4; + } else { + register int r = 0; + r += conc2d(GetResult,SBPP)(C4,C5,C3,C1); + r -= conc2d(GetResult,SBPP)(C5,C4,D4,C2); + r -= conc2d(GetResult,SBPP)(C5,C4,C6,D1); + r += conc2d(GetResult,SBPP)(C4,C5,D5,D2); + + if (r > 0) + line1[1] = C4; + else if (r < 0) + line1[1] = C5; + else { + line1[1] = interp_w4(C4,C5,C7,C8,1U,1U,1U,1U); + } + + line1[0] = interp_w2(C4,C7,1U,1U); + line0[1] = interp_w2(C4,C5,1U,1U); + } + } else { + line1[1] = interp_w4(C4,C5,C7,C8,1U,1U,1U,1U); + + if ((C4 == C7) && (C4 == C2) + && (C5 != C1) && (C5 == D3)) { + line0[1] = C4; + } else if ((C5 == C1) && (C5 == C8) + && (C4 != C2) && (C4 == C0)) { + line0[1] = C5; + } else { + line0[1] = interp_w2(C4,C5,1U,1U); + } + + if ((C4 == C5) && (C4 == C6) + && (C3 != C7) && (C7 == D0)) { + line1[0] = C4; + } else if ((C7 == C3) && (C7 == C8) + && (C4 != C6) && (C4 == C0)) { + line1[0] = C7; + } else { + line1[0] = interp_w2(C4,C7,1U,1U); + } + } + line0[0] = C4; +} diff --git a/src/gui/sdl_mapper.cpp b/src/gui/sdl_mapper.cpp index eacc3d4..f3d87d0 100644 --- a/src/gui/sdl_mapper.cpp +++ b/src/gui/sdl_mapper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,9 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: sdl_mapper.cpp,v 1.21 2006/02/16 20:18:59 c2woody Exp $ */ - -#define OLD_JOYSTICK 1 +/* $Id: sdl_mapper.cpp,v 1.33 2007/02/22 15:12:48 c2woody Exp $ */ #include #include @@ -47,8 +45,8 @@ enum { }; enum BB_Types { - BB_Next,BB_Prev,BB_Add,BB_Del, - BB_Save,BB_Reset,BB_Exit + BB_Next,BB_Add,BB_Del, + BB_Save,BB_Exit }; enum BC_Types { @@ -94,31 +92,94 @@ static CBindList holdlist; class CEvent { public: - CEvent(char * _entry) { + CEvent(char const * const _entry) { safe_strncpy(entry,_entry,16); events.push_back(this); bindlist.clear(); activity=0; + current_value=0; } void AddBind(CBind * bind); virtual ~CEvent() {} virtual void Active(bool yesno)=0; - INLINE void Activate(void) { - if (!activity) Active(true); - activity++; - } - INLINE void DeActivate(void) { - activity--; - if (!activity) Active(false); - } + virtual void Activate(bool ev_trigger)=0; + virtual void DeActivate(bool ev_trigger)=0; void DeActivateAll(void); void SetValue(Bits value){ - }; - char * GetName(void) { return entry;} + current_value=value; + } + Bits GetValue(void) { + return current_value; + } + char * GetName(void) { return entry; } + virtual bool IsTrigger(void)=0; CBindList bindlist; protected: Bitu activity; char entry[16]; + Bits current_value; +}; + +/* class for events which can be ON/OFF only: key presses, joystick buttons, joystick hat */ +class CTriggeredEvent : public CEvent { +public: + CTriggeredEvent(char const * const _entry) : CEvent(_entry) {} + virtual bool IsTrigger(void) { + return true; + } + void Activate(bool ev_trigger) { + if (current_value>25000) { + /* value exceeds boundary, trigger event if not active */ + if (!activity) Active(true); + if (activity<32767) activity++; + } else { + if (activity>0) { + /* untrigger event if it is fully inactive */ + DeActivate(ev_trigger); + activity=0; + } + } + } + void DeActivate(bool /*ev_trigger*/) { + activity--; + if (!activity) Active(false); + } +}; + +/* class for events which have a non-boolean state: joystick axis movement */ +class CContinuousEvent : public CEvent { +public: + CContinuousEvent(char const * const _entry) : CEvent(_entry) {} + virtual bool IsTrigger(void) { + return false; + } + void Activate(bool ev_trigger) { + if (ev_trigger) { + activity++; + Active(true); + } else { + /* test if no trigger-activity is present, this cares especially + about activity of the opposite-direction joystick axis for example */ + if (!GetActivityCount()) Active(true); + } + } + void DeActivate(bool ev_trigger) { + if (ev_trigger) { + if (activity>0) activity--; + if (activity==0) { + /* test if still some trigger-activity is present, + adjust the state in this case accordingly */ + if (GetActivityCount()) RepostActivity(); + else Active(false); + } + } else { + if (!GetActivityCount()) Active(false); + } + } + virtual Bitu GetActivityCount(void) { + return activity; + } + virtual void RepostActivity(void) {} }; class CBind { @@ -149,29 +210,50 @@ public: if (!strcasecmp(word,"hold")) flags|=BFLG_Hold; } } - void Activate(Bits value) { - event->SetValue(value); - if (active) return; - event->Activate(); - active=true; - } - void DeActivate(void) { - if (!active) return; - active=false; - if (flags & BFLG_Hold) { - if (!holding) { - holdlist.push_back(this); - holding=true; - return; + void Activate(Bits _value,bool ev_trigger) { + if (event->IsTrigger()) { + /* use value-boundary for on/off events */ + if (_value>25000) { + event->SetValue(_value); + if (active) return; + event->Activate(ev_trigger); + active=true; } else { - holdlist.remove(this); - holding=false; + if (active) { + event->DeActivate(ev_trigger); + active=false; + } } + } else { + /* store value for possible later use in the activated event */ + event->SetValue(_value); + event->Activate(ev_trigger); + } + } + void DeActivate(bool ev_trigger) { + if (event->IsTrigger()) { + if (!active) return; + active=false; + if (flags & BFLG_Hold) { + if (!holding) { + holdlist.push_back(this); + holding=true; + return; + } else { + holdlist.remove(this); + holding=false; + } + } + event->DeActivate(ev_trigger); + } else { + /* store value for possible later use in the activated event */ + event->SetValue(0); + event->DeActivate(ev_trigger); } - event->DeActivate(); } virtual void ConfigName(char * buf)=0; virtual void BindName(char * buf)=0; + Bitu mods,flags; Bit16s value; CEvent * event; @@ -186,7 +268,7 @@ void CEvent::AddBind(CBind * bind) { } void CEvent::DeActivateAll(void) { for (CBindList_it bit=bindlist.begin();bit!=bindlist.end();bit++) { - (*bit)->DeActivate(); + (*bit)->DeActivate(true); } } @@ -197,14 +279,16 @@ public: CBindGroup() { bindgroups.push_back(this); } - void ActivateBindList(CBindList * list,Bits value); - void DeactivateBindList(CBindList * list); + void ActivateBindList(CBindList * list,Bits value,bool ev_trigger); + void DeactivateBindList(CBindList * list,bool ev_trigger); virtual CBind * CreateConfigBind(char *&buf)=0; virtual CBind * CreateEventBind(SDL_Event * event)=0; virtual bool CheckEvent(SDL_Event * event)=0; - virtual char * ConfigStart(void)=0; - virtual char * BindStart(void)=0; + virtual const char * ConfigStart(void)=0; + virtual const char * BindStart(void)=0; + virtual ~CBindGroup (void) { } + protected: }; @@ -241,7 +325,7 @@ static SDLKey sdlkey_map[]={ /* Keypad (KP_EQUALS not supported, NUMLOCK used on what is CLEAR * in Mac OS X) */ - /*41-46*/ SDLK_KP_PERIOD, Z, SDLK_KP_MULTIPLY, Z, SDLK_PLUS, Z, + /*41-46*/ SDLK_KP_PERIOD, Z, SDLK_KP_MULTIPLY, Z, SDLK_KP_PLUS, Z, /*47-4A*/ SDLK_NUMLOCK /*==SDLK_CLEAR*/, Z, Z, Z, /*4B-4D*/ SDLK_KP_DIVIDE, SDLK_KP_ENTER, Z, /*4E-51*/ SDLK_KP_MINUS, Z, Z, SDLK_KP_EQUALS, @@ -250,14 +334,15 @@ static SDLKey sdlkey_map[]={ /*5D-5F*/ Z, Z, Z, - /* Function keys and cursor blocks (F13-F16 not supported, INSERT - * used on what is HELP in Mac OS X) */ + /* Function keys and cursor blocks (F13 not supported, F14 => + * PRINT[SCREEN], F15 => SCROLLOCK, F16 => PAUSE, HELP => INSERT) */ /*60-64*/ SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F3, SDLK_F8, - /*65-6A*/ SDLK_F9, Z, SDLK_F11, Z, SDLK_F13, (SDLKey)(SDLK_F15+1), - /*6B-71*/ SDLK_F14, Z, SDLK_F10, Z, SDLK_F12, Z, SDLK_F15, - /*72-74*/ SDLK_INSERT /*==SDLK_HELP*/, SDLK_HOME, SDLK_PAGEUP, - /*75-79*/ SDLK_DELETE, SDLK_F4, SDLK_END, SDLK_F2, SDLK_PAGEDOWN, - /*7A-7E*/ SDLK_F1, SDLK_LEFT, SDLK_RIGHT, SDLK_DOWN, SDLK_UP, + /*65-6A*/ SDLK_F9, Z, SDLK_F11, Z, SDLK_F13, SDLK_PAUSE /*==SDLK_F16*/, + /*6B-70*/ SDLK_PRINT /*==SDLK_F14*/, Z, SDLK_F10, Z, SDLK_F12, Z, + /*71-72*/ SDLK_SCROLLOCK /*==SDLK_F15*/, SDLK_INSERT /*==SDLK_HELP*/, + /*73-77*/ SDLK_HOME, SDLK_PAGEUP, SDLK_DELETE, SDLK_F4, SDLK_END, + /*78-7C*/ SDLK_F2, SDLK_PAGEDOWN, SDLK_F1, SDLK_LEFT, SDLK_RIGHT, + /*7D-7E*/ SDLK_DOWN, SDLK_UP, /*7F-7F*/ Z, @@ -326,9 +411,28 @@ Bitu GetKeyCode(SDL_keysym keysym) { /* try to retrieve key from symbolic key as scancode is zero */ if (keysym.symkey.keysym); // LOG_MSG("key type %i is %x [%x %x]",event->type,key,event->key.keysym.sym,event->key.keysym.scancode); assert(Bitu(event->key.keysym.sym)type==SDL_KEYDOWN) ActivateBindList(&lists[key],0x7fff); - else DeactivateBindList(&lists[key]); + if (event->type==SDL_KEYDOWN) ActivateBindList(&lists[key],0x7fff,true); + else DeactivateBindList(&lists[key],true); return 0; } CBind * CreateKeyBind(SDLKey _key) { @@ -397,18 +501,26 @@ public: return new CKeyBind(&lists[(Bitu)_key],_key); } private: - char * ConfigStart(void) { + const char * ConfigStart(void) { return configname; } - char * BindStart(void) { + const char * BindStart(void) { return "Key"; } protected: - char * configname; + const char * configname; CBindList * lists; Bitu keys; }; +#define MAX_VJOY_BUTTONS 8 + +static struct { + bool button_pressed[MAX_VJOY_BUTTONS]; + Bit16s axis_pos[8]; + bool hat_pressed[16]; +} virtual_joysticks[2]; + class CJAxisBind; class CJButtonBind; @@ -452,42 +564,81 @@ protected: class CJHatBind : public CBind { public: - CJHatBind(CBindList * _list,CBindGroup * _group,Bitu _hat) : CBind(_list) { + CJHatBind(CBindList * _list,CBindGroup * _group,Bitu _hat,Bit8u _dir) : CBind(_list) { group = _group; - hat=_hat; + hat = _hat; + dir = _dir; + /* allow only one hat position */ + if (dir&SDL_HAT_UP) dir=SDL_HAT_UP; + else if (dir&SDL_HAT_RIGHT) dir=SDL_HAT_RIGHT; + else if (dir&SDL_HAT_DOWN) dir=SDL_HAT_DOWN; + else if (dir&SDL_HAT_LEFT) dir=SDL_HAT_LEFT; + else E_Exit("MAPPER:JOYSTICK:Invalid hat position"); } void ConfigName(char * buf) { - sprintf(buf,"%s hat %d",group->ConfigStart(),hat); + sprintf(buf,"%s hat %d %d",group->ConfigStart(),hat,dir); } void BindName(char * buf) { - sprintf(buf,"%s hat %d",group->BindStart(),hat); + sprintf(buf,"%s Hat %d %s",group->BindStart(),hat,(dir==SDL_HAT_UP)?"up": + ((dir==SDL_HAT_RIGHT)?"right": + ((dir==SDL_HAT_DOWN)?"down":"left"))); } protected: CBindGroup * group; Bitu hat; - Bitu mask; + Bit8u dir; }; +bool autofire = false; + class CStickBindGroup : public CBindGroup { public: - CStickBindGroup(Bitu _stick) : CBindGroup (){ + CStickBindGroup(Bitu _stick,bool _dummy=false) : CBindGroup (){ stick=_stick; sprintf(configname,"stick_%d",stick); - sdl_joystick=SDL_JoystickOpen(stick); - assert(sdl_joystick); + is_dummy=_dummy; + if (_dummy) { + sdl_joystick=NULL; + axes=0; buttons=0; hats=0; + button_wrap=16; + return; + } + + // initialize emulated joystick state + emulated_axes=2; + emulated_buttons=2; + pos_axis_lists=new CBindList[4]; + neg_axis_lists=new CBindList[4]; + button_lists=new CBindList[16]; + hat_lists=new CBindList[4]; + Bitu i; + for (i=0; i<16; i++) { + button_autofire[i]=0; + old_button_state[i]=0; + old_hat_state[i]=0; + } + for (i=0; i<4; i++) { + old_pos_axis_state[i]=false; + old_neg_axis_state[i]=false; + } + + //if the first stick is set, we must be the second +// emustick=JOYSTICK_IsEnabled(0); + emustick=stick; + JOYSTICK_Enable(emustick,true); + + sdl_joystick=SDL_JoystickOpen(_stick); + if (sdl_joystick==NULL) { + axes=0; buttons=0; hats=0; + return; + } axes=SDL_JoystickNumAxes(sdl_joystick); buttons=SDL_JoystickNumButtons(sdl_joystick); hats=SDL_JoystickNumHats(sdl_joystick); - pos_axis_lists=new CBindList[axes]; - neg_axis_lists=new CBindList[axes]; - button_lists=new CBindList[buttons]; - hat_lists=new CBindList[hats]; -#if OLD_JOYSTICK + button_wrap=buttons; + if (button_wrapping_enabled) button_wrap=emulated_buttons; + if (button_wrap>16) button_wrap=16; LOG_MSG("Using joystick %s with %d axes and %d buttons",SDL_JoystickName(stick),axes,buttons); - //if the first stick is set, we must be the second - emustick=JOYSTICK_IsEnabled(0); - JOYSTICK_Enable(emustick,true); -#endif } ~CStickBindGroup() { SDL_JoystickClose(sdl_joystick); @@ -496,6 +647,7 @@ public: delete[] button_lists; delete[] hat_lists; } + CBind * CreateConfigBind(char *& buf) { if (strncasecmp(configname,buf,strlen(configname))) return 0; StripWord(buf);char * type=StripWord(buf); @@ -507,259 +659,503 @@ public: } else if (!strcasecmp(type,"button")) { Bitu but=ConvDecWord(StripWord(buf)); bind=CreateButtonBind(but); + } else if (!strcasecmp(type,"hat")) { + Bitu hat=ConvDecWord(StripWord(buf)); + Bit8u dir=(Bit8u)ConvDecWord(StripWord(buf)); + bind=CreateHatBind(hat,dir); } return bind; } CBind * CreateEventBind(SDL_Event * event) { if (event->type==SDL_JOYAXISMOTION) { - if (event->jaxis .which!=stick) return 0; + if (event->jaxis.which!=stick) return 0; +#if defined (REDUCE_JOYSTICK_POLLING) + if (event->jaxis.axis>=emulated_axes) return 0; +#endif if (abs(event->jaxis.value)<25000) return 0; return CreateAxisBind(event->jaxis.axis,event->jaxis.value>0); } else if (event->type==SDL_JOYBUTTONDOWN) { - if (event->jaxis .which!=stick) return 0; + if (event->button.which!=stick) return 0; +#if defined (REDUCE_JOYSTICK_POLLING) + return CreateButtonBind(event->jbutton.button%button_wrap); +#else return CreateButtonBind(event->jbutton.button); +#endif + } else if (event->type==SDL_JOYHATMOTION) { + if (event->jhat.which!=stick) return 0; + if (event->jhat.value==0) return 0; + if (event->jhat.value>(SDL_HAT_UP|SDL_HAT_RIGHT|SDL_HAT_DOWN|SDL_HAT_LEFT)) return 0; + return CreateHatBind(event->jhat.hat,event->jhat.value); } else return 0; } + virtual bool CheckEvent(SDL_Event * event) { -#if OLD_JOYSTICK SDL_JoyAxisEvent * jaxis = NULL; SDL_JoyButtonEvent * jbutton = NULL; + Bitu but = 0; - switch(event->type) { - case SDL_JOYAXISMOTION: - jaxis = &event->jaxis; - if(jaxis->which == stick) - if(jaxis->axis == 0) - JOYSTICK_Move_X(emustick,(float)(jaxis->value/32768.0)); - else if(jaxis->axis == 1) - JOYSTICK_Move_Y(emustick,(float)(jaxis->value/32768.0)); - break; - case SDL_JOYBUTTONDOWN: - case SDL_JOYBUTTONUP: - jbutton = &event->jbutton; - bool state; - state=jbutton->type==SDL_JOYBUTTONDOWN; - if ((jbutton->which == stick) && (jbutton->button<2)) { - JOYSTICK_Button(emustick,jbutton->button,state); - } - break; - } -#endif + switch(event->type) { + case SDL_JOYAXISMOTION: + jaxis = &event->jaxis; + if(jaxis->which == stick) { + if(jaxis->axis == 0) + JOYSTICK_Move_X(emustick,(float)(jaxis->value/32768.0)); + else if(jaxis->axis == 1) + JOYSTICK_Move_Y(emustick,(float)(jaxis->value/32768.0)); + } + break; + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + jbutton = &event->jbutton; + bool state; + state=jbutton->type==SDL_JOYBUTTONDOWN; + but = jbutton->button % emulated_buttons; + if (jbutton->which == stick) { + JOYSTICK_Button(emustick,but,state); + } + break; + } return false; } + + virtual void UpdateJoystick() { + if (is_dummy) return; + /* query SDL joystick and activate bindings */ + ActivateJoystickBoundEvents(); + + bool button_pressed[16]; + Bitu i; + for (i=0; i<16; i++) button_pressed[i]=false; + for (i=0; i0) ActivateBindList(&pos_axis_lists[i],caxis_pos,false); + else if (caxis_pos<0) { + if (caxis_pos!=-32768) caxis_pos=(Sint16)abs(caxis_pos); + else caxis_pos=32767; + ActivateBindList(&neg_axis_lists[i],caxis_pos,false); + } + } + + for (i=0; itype) { - case SDL_JOYAXISMOTION: - jaxis = &event->jaxis; - if(jaxis->which == stick && jaxis->axis < 4) - if(jaxis->axis & 1) - JOYSTICK_Move_Y(jaxis->axis>>1 & 1,(float)(jaxis->value/32768.0)); - else - JOYSTICK_Move_X(jaxis->axis>>1 & 1,(float)(jaxis->value/32768.0)); - break; - case SDL_JOYBUTTONDOWN: - case SDL_JOYBUTTONUP: - jbutton = &event->jbutton; - bool state; - state=jbutton->type==SDL_JOYBUTTONDOWN; - if ((jbutton->which == stick) && (jbutton->button<4)) { - JOYSTICK_Button((jbutton->button >> 1), - (jbutton->button & 1),state); - } - break; - } -#endif + bool CheckEvent(SDL_Event * event) { + SDL_JoyAxisEvent * jaxis = NULL; + SDL_JoyButtonEvent * jbutton = NULL; + Bitu but = 0; + + switch(event->type) { + case SDL_JOYAXISMOTION: + jaxis = &event->jaxis; + if(jaxis->which == stick && jaxis->axis < 4) { + if(jaxis->axis & 1) + JOYSTICK_Move_Y(jaxis->axis>>1 & 1,(float)(jaxis->value/32768.0)); + else + JOYSTICK_Move_X(jaxis->axis>>1 & 1,(float)(jaxis->value/32768.0)); + } + break; + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + jbutton = &event->jbutton; + bool state; + state=jbutton->type==SDL_JOYBUTTONDOWN; + but = jbutton->button % emulated_buttons; + if (jbutton->which == stick) { + JOYSTICK_Button((but >> 1),(but & 1),state); + } + break; + } return false; } + + virtual void UpdateJoystick() { + /* query SDL joystick and activate bindings */ + ActivateJoystickBoundEvents(); + + bool button_pressed[16]; + Bitu i; + for (i=0; i<16; i++) button_pressed[i]=false; + for (i=0; i>1,i&1,(++button_autofire[i])&1); + else + JOYSTICK_Button(i>>1,i&1,button_pressed[i]); + } + + JOYSTICK_Move_X(0,((float)virtual_joysticks[0].axis_pos[0])/32768.0f); + JOYSTICK_Move_Y(0,((float)virtual_joysticks[0].axis_pos[1])/32768.0f); + JOYSTICK_Move_X(1,((float)virtual_joysticks[0].axis_pos[2])/32768.0f); + JOYSTICK_Move_Y(1,((float)virtual_joysticks[0].axis_pos[3])/32768.0f); + } }; class CFCSBindGroup : public CStickBindGroup { public: CFCSBindGroup(Bitu _stick) : CStickBindGroup (_stick){ -#if OLD_JOYSTICK + emulated_axes=4; + emulated_buttons=4; + old_hat_position=0; + if (button_wrapping_enabled) button_wrap=emulated_buttons; JOYSTICK_Enable(1,true); JOYSTICK_Move_Y(1,1.0); -#endif } - bool CheckEvent(SDL_Event * event) { -#if OLD_JOYSTICK - SDL_JoyAxisEvent * jaxis = NULL; + + bool CheckEvent(SDL_Event * event) { + SDL_JoyAxisEvent * jaxis = NULL; SDL_JoyButtonEvent * jbutton = NULL; SDL_JoyHatEvent * jhat = NULL; + Bitu but = 0; - switch(event->type) { - case SDL_JOYAXISMOTION: - jaxis = &event->jaxis; - if(jaxis->which == stick) - if(jaxis->axis == 0) - JOYSTICK_Move_X(0,(float)(jaxis->value/32768.0)); - else if(jaxis->axis == 1) - JOYSTICK_Move_Y(0,(float)(jaxis->value/32768.0)); - else if(jaxis->axis == 2) - JOYSTICK_Move_X(1,(float)(jaxis->value/32768.0)); - break; - case SDL_JOYHATMOTION: - jhat = &event->jhat; - if(jhat->which == stick) { - switch(jhat->value) { - case SDL_HAT_CENTERED: - JOYSTICK_Move_Y(1,1.0); - break; - case SDL_HAT_UP: - JOYSTICK_Move_Y(1,-1.0); - break; - case SDL_HAT_RIGHT: - JOYSTICK_Move_Y(1,-0.5); - break; - case SDL_HAT_DOWN: - JOYSTICK_Move_Y(1,0.0); - break; - case SDL_HAT_LEFT: - JOYSTICK_Move_Y(1,0.5); - break; - case SDL_HAT_LEFTUP: - if(JOYSTICK_GetMove_Y(1) < 0) - JOYSTICK_Move_Y(1,0.5); - else - JOYSTICK_Move_Y(1,-1.0); - break; - case SDL_HAT_RIGHTUP: - if(JOYSTICK_GetMove_Y(1) < -0.7) - JOYSTICK_Move_Y(1,-0.5); - else - JOYSTICK_Move_Y(1,-1.0); - break; - case SDL_HAT_RIGHTDOWN: - if(JOYSTICK_GetMove_Y(1) < -0.2) - JOYSTICK_Move_Y(1,0.0); - else - JOYSTICK_Move_Y(1,-0.5); - break; - case SDL_HAT_LEFTDOWN: - if(JOYSTICK_GetMove_Y(1) > 0.2) - JOYSTICK_Move_Y(1,0.0); - else - JOYSTICK_Move_Y(1,0.5); - break; + switch(event->type) { + case SDL_JOYAXISMOTION: + jaxis = &event->jaxis; + if(jaxis->which == stick) { + if(jaxis->axis == 0) + JOYSTICK_Move_X(0,(float)(jaxis->value/32768.0)); + else if(jaxis->axis == 1) + JOYSTICK_Move_Y(0,(float)(jaxis->value/32768.0)); + else if(jaxis->axis == 2) + JOYSTICK_Move_X(1,(float)(jaxis->value/32768.0)); } - } - - case SDL_JOYBUTTONDOWN: - case SDL_JOYBUTTONUP: - jbutton = &event->jbutton; - bool state; - state=jbutton->type==SDL_JOYBUTTONDOWN; - if ((jbutton->which == stick) && (jbutton->button<4)) { - JOYSTICK_Button((jbutton->button >> 1), - (jbutton->button & 1),state); - } - break; - } -#endif + break; + case SDL_JOYHATMOTION: + jhat = &event->jhat; + if(jhat->which == stick) DecodeHatPosition(jhat->value); + break; + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + jbutton = &event->jbutton; + bool state; + state=jbutton->type==SDL_JOYBUTTONDOWN; + but = jbutton->button % emulated_buttons; + if (jbutton->which == stick) { + JOYSTICK_Button((but >> 1),(but & 1),state); + } + break; + } return false; } + + virtual void UpdateJoystick() { + /* query SDL joystick and activate bindings */ + ActivateJoystickBoundEvents(); + + bool button_pressed[16]; + Bitu i; + for (i=0; i<16; i++) button_pressed[i]=false; + for (i=0; i>1,i&1,(++button_autofire[i])&1); + else + JOYSTICK_Button(i>>1,i&1,button_pressed[i]); + } + + JOYSTICK_Move_X(0,((float)virtual_joysticks[0].axis_pos[0])/32768.0f); + JOYSTICK_Move_Y(0,((float)virtual_joysticks[0].axis_pos[1])/32768.0f); + JOYSTICK_Move_X(1,((float)virtual_joysticks[0].axis_pos[2])/32768.0f); + + Uint8 hat_pos=0; + if (virtual_joysticks[0].hat_pressed[0]) hat_pos|=SDL_HAT_UP; + else if (virtual_joysticks[0].hat_pressed[2]) hat_pos|=SDL_HAT_DOWN; + if (virtual_joysticks[0].hat_pressed[3]) hat_pos|=SDL_HAT_LEFT; + else if (virtual_joysticks[0].hat_pressed[1]) hat_pos|=SDL_HAT_RIGHT; + + if (hat_pos!=old_hat_position) { + DecodeHatPosition(hat_pos); + old_hat_position=hat_pos; + } + } + +private: + Uint8 old_hat_position; + + void DecodeHatPosition(Uint8 hat_pos) { + switch(hat_pos) { + case SDL_HAT_CENTERED: + JOYSTICK_Move_Y(1,1.0); + break; + case SDL_HAT_UP: + JOYSTICK_Move_Y(1,-1.0); + break; + case SDL_HAT_RIGHT: + JOYSTICK_Move_Y(1,-0.5); + break; + case SDL_HAT_DOWN: + JOYSTICK_Move_Y(1,0.0); + break; + case SDL_HAT_LEFT: + JOYSTICK_Move_Y(1,0.5); + break; + case SDL_HAT_LEFTUP: + if(JOYSTICK_GetMove_Y(1) < 0) + JOYSTICK_Move_Y(1,0.5); + else + JOYSTICK_Move_Y(1,-1.0); + break; + case SDL_HAT_RIGHTUP: + if(JOYSTICK_GetMove_Y(1) < -0.7) + JOYSTICK_Move_Y(1,-0.5); + else + JOYSTICK_Move_Y(1,-1.0); + break; + case SDL_HAT_RIGHTDOWN: + if(JOYSTICK_GetMove_Y(1) < -0.2) + JOYSTICK_Move_Y(1,0.0); + else + JOYSTICK_Move_Y(1,-0.5); + break; + case SDL_HAT_LEFTDOWN: + if(JOYSTICK_GetMove_Y(1) > 0.2) + JOYSTICK_Move_Y(1,0.0); + else + JOYSTICK_Move_Y(1,0.5); + break; + } + } }; class CCHBindGroup : public CStickBindGroup { public: CCHBindGroup(Bitu _stick) : CStickBindGroup (_stick){ -#if OLD_JOYSTICK + emulated_axes=4; + emulated_buttons=6; + if (button_wrapping_enabled) button_wrap=emulated_buttons; JOYSTICK_Enable(1,true); button_state=0; -#endif } - bool CheckEvent(SDL_Event * event) { -#if OLD_JOYSTICK - SDL_JoyAxisEvent * jaxis = NULL; + + bool CheckEvent(SDL_Event * event) { + SDL_JoyAxisEvent * jaxis = NULL; SDL_JoyButtonEvent * jbutton = NULL; SDL_JoyHatEvent * jhat = NULL; + Bitu but = 0; static unsigned const button_magic[6]={0x02,0x04,0x10,0x100,0x20,0x200}; static unsigned const hat_magic[2][5]={{0x8888,0x8000,0x800,0x80,0x08}, - {0x5440,0x4000,0x400,0x40,0x1000}}; - switch(event->type) { - case SDL_JOYAXISMOTION: - jaxis = &event->jaxis; - if(jaxis->which == stick && jaxis->axis < 4) - if(jaxis->axis & 1) - JOYSTICK_Move_Y(jaxis->axis>>1 & 1,(float)(jaxis->value/32768.0)); - else - JOYSTICK_Move_X(jaxis->axis>>1 & 1,(float)(jaxis->value/32768.0)); - break; - case SDL_JOYHATMOTION: - jhat = &event->jhat; - if(jhat->which == stick && jhat->hat < 2) { - if(jhat->value == SDL_HAT_CENTERED) - button_state&=~hat_magic[jhat->hat][0]; - if(jhat->value & SDL_HAT_UP) - button_state|=hat_magic[jhat->hat][1]; - if(jhat->value & SDL_HAT_RIGHT) - button_state|=hat_magic[jhat->hat][2]; - if(jhat->value & SDL_HAT_DOWN) - button_state|=hat_magic[jhat->hat][3]; - if(jhat->value & SDL_HAT_LEFT) - button_state|=hat_magic[jhat->hat][4]; - } - break; - case SDL_JOYBUTTONDOWN: - jbutton = &event->jbutton; - if ((jbutton->which == stick) && (jbutton->button<6)) - button_state|=button_magic[jbutton->button]; - break; - case SDL_JOYBUTTONUP: - jbutton = &event->jbutton; - if ((jbutton->which == stick) && (jbutton->button<6)) - button_state&=~button_magic[jbutton->button]; - break; - } + {0x5440,0x4000,0x400,0x40,0x1000}}; + switch(event->type) { + case SDL_JOYAXISMOTION: + jaxis = &event->jaxis; + if(jaxis->which == stick && jaxis->axis < 4) { + if(jaxis->axis & 1) + JOYSTICK_Move_Y(jaxis->axis>>1 & 1,(float)(jaxis->value/32768.0)); + else + JOYSTICK_Move_X(jaxis->axis>>1 & 1,(float)(jaxis->value/32768.0)); + } + break; + case SDL_JOYHATMOTION: + jhat = &event->jhat; + if(jhat->which == stick && jhat->hat < 2) { + if(jhat->value == SDL_HAT_CENTERED) + button_state&=~hat_magic[jhat->hat][0]; + if(jhat->value & SDL_HAT_UP) + button_state|=hat_magic[jhat->hat][1]; + if(jhat->value & SDL_HAT_RIGHT) + button_state|=hat_magic[jhat->hat][2]; + if(jhat->value & SDL_HAT_DOWN) + button_state|=hat_magic[jhat->hat][3]; + if(jhat->value & SDL_HAT_LEFT) + button_state|=hat_magic[jhat->hat][4]; + } + break; + case SDL_JOYBUTTONDOWN: + jbutton = &event->jbutton; + but = jbutton->button % emulated_buttons; + if (jbutton->which == stick) + button_state|=button_magic[but]; + break; + case SDL_JOYBUTTONUP: + jbutton = &event->jbutton; + but = jbutton->button % emulated_buttons; + if (jbutton->which == stick) + button_state&=~button_magic[but]; + break; + } + unsigned i; Bit16u j; j=button_state; for(i=0;i<16;i++) if (j & 1) break; else j>>=1; - JOYSTICK_Button(0,0,i&0x01); - JOYSTICK_Button(0,1,i>>1&0x01); - JOYSTICK_Button(1,0,i>>2&0x01); - JOYSTICK_Button(1,1,i>>3&0x01); -#endif - + JOYSTICK_Button(0,0,i&1); + JOYSTICK_Button(0,1,(i>>1)&1); + JOYSTICK_Button(1,0,(i>>2)&1); + JOYSTICK_Button(1,1,(i>>3)&1); return false; } + + void UpdateJoystick() { + static unsigned const button_priority[6]={7,11,13,14,5,6}; + static unsigned const hat_priority[2][4]={{0,1,2,3},{8,9,10,12}}; + + /* query SDL joystick and activate bindings */ + ActivateJoystickBoundEvents(); + + JOYSTICK_Move_X(0,((float)virtual_joysticks[0].axis_pos[0])/32768.0f); + JOYSTICK_Move_Y(0,((float)virtual_joysticks[0].axis_pos[1])/32768.0f); + JOYSTICK_Move_X(1,((float)virtual_joysticks[0].axis_pos[2])/32768.0f); + JOYSTICK_Move_Y(1,((float)virtual_joysticks[0].axis_pos[3])/32768.0f); + + Bitu bt_state=15; + + Bitu i; + for (i=0; i<(hats<2?hats:2); i++) { + Uint8 hat_pos=0; + if (virtual_joysticks[0].hat_pressed[(i<<2)+0]) hat_pos|=SDL_HAT_UP; + else if (virtual_joysticks[0].hat_pressed[(i<<2)+2]) hat_pos|=SDL_HAT_DOWN; + if (virtual_joysticks[0].hat_pressed[(i<<2)+3]) hat_pos|=SDL_HAT_LEFT; + else if (virtual_joysticks[0].hat_pressed[(i<<2)+1]) hat_pos|=SDL_HAT_RIGHT; + + if (hat_pos & SDL_HAT_UP) + if (bt_state>hat_priority[i][0]) bt_state=hat_priority[i][0]; + if (hat_pos & SDL_HAT_DOWN) + if (bt_state>hat_priority[i][1]) bt_state=hat_priority[i][1]; + if (hat_pos & SDL_HAT_RIGHT) + if (bt_state>hat_priority[i][2]) bt_state=hat_priority[i][2]; + if (hat_pos & SDL_HAT_LEFT) + if (bt_state>hat_priority[i][3]) bt_state=hat_priority[i][3]; + } + + bool button_pressed[6]; + for (i=0; i<6; i++) button_pressed[i]=false; + for (i=0; ibutton_priority[i])) + bt_state=button_priority[i]; + } + + if (bt_state>15) bt_state=15; + JOYSTICK_Button(0,0,(bt_state&8)==0); + JOYSTICK_Button(0,1,(bt_state&4)==0); + JOYSTICK_Button(1,0,(bt_state&2)==0); + JOYSTICK_Button(1,1,(bt_state&1)==0); + } + protected: Bit16u button_state; }; @@ -775,17 +1171,13 @@ static struct { bool addbind; Bitu mods; struct { - CKeyBindGroup * keys; + Bitu num_groups,num; CStickBindGroup * stick[MAXSTICKS]; - } grp; - struct { - Bitu num; - SDL_Joystick * opened[MAXSTICKS]; } sticks; const char * filename; } mapper; -void CBindGroup::ActivateBindList(CBindList * list,Bits value) { +void CBindGroup::ActivateBindList(CBindList * list,Bits value,bool ev_trigger) { Bitu validmod=0; CBindList_it it; for (it=list->begin();it!=list->end();it++) { @@ -795,15 +1187,14 @@ void CBindGroup::ActivateBindList(CBindList * list,Bits value) { } for (it=list->begin();it!=list->end();it++) { /*BUG:CRASH if keymapper key is removed*/ - if (validmod==(*it)->mods) (*it)->Activate(value); + if (validmod==(*it)->mods) (*it)->Activate(value,ev_trigger); } } -void CBindGroup::DeactivateBindList(CBindList * list) { - Bitu validmod=0; +void CBindGroup::DeactivateBindList(CBindList * list,bool ev_trigger) { CBindList_it it; for (it=list->begin();it!=list->end();it++) { - (*it)->DeActivate(); + (*it)->DeActivate(ev_trigger); } } @@ -891,13 +1282,8 @@ public: CCaptionButton(Bitu _x,Bitu _y,Bitu _dx,Bitu _dy) : CButton(_x,_y,_dx,_dy){ caption[0]=0; } - void Change(char * format,...) { - va_list msg; - va_start(msg,format); - vsprintf(caption,format,msg); - va_end(msg); - mapper.redraw=true; - } + void Change(const char * format,...) GCC_ATTRIBUTE(__format__(__printf__,2,3)); + void Draw(void) { if (!enabled) return; DrawText(x+2,y+2,caption,color); @@ -906,6 +1292,14 @@ protected: char caption[128]; }; +void CCaptionButton::Change(const char * format,...) { + va_list msg; + va_start(msg,format); + vsprintf(caption,format,msg); + va_end(msg); + mapper.redraw=true; +} + static void MAPPER_SaveBinds(void); class CBindButton : public CTextButton { public: @@ -956,7 +1350,7 @@ public: } void Draw(void) { if (!enabled) return; - bool checked; + bool checked=false; switch (type) { case BC_Mod1: checked=(mapper.abind->mods&BMOD_Mod1)>0; @@ -1001,9 +1395,9 @@ protected: BC_Types type; }; -class CKeyEvent : public CEvent { +class CKeyEvent : public CTriggeredEvent { public: - CKeyEvent(char * _entry,KBD_KEYS _key) : CEvent(_entry) { + CKeyEvent(char const * const _entry,KBD_KEYS _key) : CTriggeredEvent(_entry) { key=_key; } void Active(bool yesno) { @@ -1012,34 +1406,67 @@ public: KBD_KEYS key; }; -class CJAxisEvent : public CEvent { +class CJAxisEvent : public CContinuousEvent { public: - CJAxisEvent(char * _entry,Bitu _stick,bool _yaxis,bool _positive) : CEvent(_entry) { + CJAxisEvent(char const * const _entry,Bitu _stick,Bitu _axis,bool _positive,CJAxisEvent * _opposite_axis) : CContinuousEvent(_entry) { stick=_stick; - yaxis=_yaxis; + axis=_axis; positive=_positive; + opposite_axis=_opposite_axis; + if (_opposite_axis) { + _opposite_axis->SetOppositeAxis(this); + } } - void Active(bool yesno) { - }; - Bitu stick; - bool yaxis,positive; + void Active(bool /*moved*/) { + virtual_joysticks[stick].axis_pos[axis]=(Bit16s)(GetValue()*(positive?1:-1)); + } + virtual Bitu GetActivityCount(void) { + return activity|opposite_axis->activity; + } + virtual void RepostActivity(void) { + /* caring for joystick movement into the opposite direction */ + opposite_axis->Active(true); + } +protected: + void SetOppositeAxis(CJAxisEvent * _opposite_axis) { + opposite_axis=_opposite_axis; + } + Bitu stick,axis; + bool positive; + CJAxisEvent * opposite_axis; }; -class CJButtonEvent : public CEvent { +class CJButtonEvent : public CTriggeredEvent { public: - CJButtonEvent(char * _entry,Bitu _stick,Bitu _button) : CEvent(_entry) { + CJButtonEvent(char const * const _entry,Bitu _stick,Bitu _button) : CTriggeredEvent(_entry) { stick=_stick; button=_button; } - void Active(bool yesno) { - }; + void Active(bool pressed) { + virtual_joysticks[stick].button_pressed[button]=pressed; + } +protected: Bitu stick,button; }; - -class CModEvent : public CEvent { +class CJHatEvent : public CTriggeredEvent { public: - CModEvent(char * _entry,Bitu _wmod) : CEvent(_entry) { + CJHatEvent(char const * const _entry,Bitu _stick,Bitu _hat,Bitu _dir) : CTriggeredEvent(_entry) { + stick=_stick; + hat=_hat; + dir=_dir; + } + void Active(bool pressed) { + virtual_joysticks[stick].hat_pressed[(hat<<2)+dir]=pressed; + } +protected: + Bitu stick,hat,dir; +}; + + +class CModEvent : public CTriggeredEvent { +public: + CModEvent(char const * const _entry,Bitu _wmod) : CTriggeredEvent(_entry) { wmod=_wmod; } void Active(bool yesno) { @@ -1050,9 +1477,9 @@ protected: Bitu wmod; }; -class CHandlerEvent : public CEvent { +class CHandlerEvent : public CTriggeredEvent { public: - CHandlerEvent(char * _entry,MAPPER_Handler * _handler,MapKeys _key,Bitu _mod,char * _buttonname) : CEvent(_entry) { + CHandlerEvent(char const * const _entry,MAPPER_Handler * _handler,MapKeys _key,Bitu _mod,char const * const _buttonname) : CTriggeredEvent(_entry) { handler=_handler; defmod=_mod; defkey=_key; @@ -1062,7 +1489,7 @@ public: void Active(bool yesno) { (*handler)(yesno); }; - char * ButtonName(void) { + const char * ButtonName(void) { return buttonname; } void MakeDefaultBind(char * buf) { @@ -1102,7 +1529,7 @@ protected: Bitu defmod; MAPPER_Handler * handler; public: - char * buttonname; + const char * buttonname; }; @@ -1116,7 +1543,6 @@ static struct { CBindButton * add; CBindButton * del; CBindButton * next; - CBindButton * prev; CCheckButton * mod1,* mod2,* mod3,* hold; } bind_but; @@ -1135,7 +1561,6 @@ static void SetActiveBind(CBind * _bind) { } else { bind_but.bind_title->Enable(false); bind_but.del->Enable(false); - bind_but.prev->Enable(false); bind_but.next->Enable(false); bind_but.mod1->Enable(false); bind_but.mod2->Enable(false); @@ -1172,34 +1597,51 @@ static void DrawButtons(void) { SDL_Flip(mapper.surface); } -static void AddKeyButtonEvent(Bitu x,Bitu y,Bitu dx,Bitu dy,const char * title,const char * entry,KBD_KEYS key) { +static void AddKeyButtonEvent(Bitu x,Bitu y,Bitu dx,Bitu dy,char const * const title,char const * const entry,KBD_KEYS key) { char buf[64]; strcpy(buf,"key_"); strcat(buf,entry); CKeyEvent * event=new CKeyEvent(buf,key); - CButton * button=new CEventButton(x,y,dx,dy,title,event); + new CEventButton(x,y,dx,dy,title,event); } -static void AddJAxisButton(Bitu x,Bitu y,Bitu dx,Bitu dy,const char * title,Bitu stick,bool yaxis,bool positive) { +static CJAxisEvent * AddJAxisButton(Bitu x,Bitu y,Bitu dx,Bitu dy,char const * const title,Bitu stick,Bitu axis,bool positive,CJAxisEvent * opposite_axis) { char buf[64]; - sprintf(buf,"jaxis_%d%s%s",stick,yaxis ? "Y":"X",positive ? "+" : "-"); - CJAxisEvent * event=new CJAxisEvent(buf,stick,yaxis,positive); - CButton * button=new CEventButton(x,y,dx,dy,title,event); + sprintf(buf,"jaxis_%d_%d%s",stick,axis,positive ? "+" : "-"); + CJAxisEvent * event=new CJAxisEvent(buf,stick,axis,positive,opposite_axis); + new CEventButton(x,y,dx,dy,title,event); + return event; } - -static void AddJButtonButton(Bitu x,Bitu y,Bitu dx,Bitu dy,const char * title,Bitu _stick,Bitu _button) { +static CJAxisEvent * AddJAxisButton_hidden(Bitu stick,Bitu axis,bool positive,CJAxisEvent * opposite_axis) { char buf[64]; - sprintf(buf,"jbutton_%d_%d",_stick,_button); - CJButtonEvent * event=new CJButtonEvent(buf,_stick,_button); - CButton * button=new CEventButton(x,y,dx,dy,title,event); + sprintf(buf,"jaxis_%d_%d%s",stick,axis,positive ? "+" : "-"); + return new CJAxisEvent(buf,stick,axis,positive,opposite_axis); } +static void AddJButtonButton(Bitu x,Bitu y,Bitu dx,Bitu dy,char const * const title,Bitu stick,Bitu button) { + char buf[64]; + sprintf(buf,"jbutton_%d_%d",stick,button); + CJButtonEvent * event=new CJButtonEvent(buf,stick,button); + new CEventButton(x,y,dx,dy,title,event); +} +static void AddJButtonButton_hidden(Bitu stick,Bitu button) { + char buf[64]; + sprintf(buf,"jbutton_%d_%d",stick,button); + new CJButtonEvent(buf,stick,button); +} -static void AddModButton(Bitu x,Bitu y,Bitu dx,Bitu dy,const char * title,Bitu _mod) { +static void AddJHatButton(Bitu x,Bitu y,Bitu dx,Bitu dy,char const * const title,Bitu _stick,Bitu _hat,Bitu _dir) { + char buf[64]; + sprintf(buf,"jhat_%d_%d_%d",_stick,_hat,_dir); + CJHatEvent * event=new CJHatEvent(buf,_stick,_hat,_dir); + new CEventButton(x,y,dx,dy,title,event); +} + +static void AddModButton(Bitu x,Bitu y,Bitu dx,Bitu dy,char const * const title,Bitu _mod) { char buf[64]; sprintf(buf,"mod_%d",_mod); CModEvent * event=new CModEvent(buf,_mod); - CButton * button=new CEventButton(x,y,dx,dy,title,event); + new CEventButton(x,y,dx,dy,title,event); } struct KeyBlock { @@ -1312,28 +1754,76 @@ static void CreateLayout(void) { AddKeyButtonEvent(PX(4),PY(11),BW*2,BH,"0","kp_0",KBD_kp0); AddKeyButtonEvent(PX(6),PY(11),BW,BH,".","kp_period",KBD_kpperiod); -#if (!OLD_JOYSTICK) /* Joystick Buttons/Texts */ - AddJButtonButton(PX(17),PY(0),BW,BH,"1" ,0,0); - AddJAxisButton (PX(18),PY(0),BW,BH,"Y-",0,true,false); - AddJButtonButton(PX(19),PY(0),BW,BH,"2" ,0,1); - AddJAxisButton (PX(17),PY(1),BW,BH,"X-",0,false,false); - AddJAxisButton (PX(18),PY(1),BW,BH,"Y+",0,true,true); - AddJAxisButton (PX(19),PY(1),BW,BH,"X+",0,false,true); + /* Buttons 1+2 of 1st Joystick */ + AddJButtonButton(PX(18),PY(0),BW,BH,"1" ,0,0); + AddJButtonButton(PX(20),PY(0),BW,BH,"2" ,0,1); + /* Axes 1+2 (X+Y) of 1st Joystick */ + CJAxisEvent * cjaxis=AddJAxisButton(PX(19),PY(0),BW,BH,"Y-",0,1,false,NULL); + AddJAxisButton (PX(19),PY(1),BW,BH,"Y+",0,1,true,cjaxis); + cjaxis=AddJAxisButton (PX(18),PY(1),BW,BH,"X-",0,0,false,NULL); + AddJAxisButton (PX(20),PY(1),BW,BH,"X+",0,0,true,cjaxis); + + if (joytype==JOY_2AXIS) { + /* Buttons 1+2 of 2nd Joystick */ + AddJButtonButton(PX(18),PY(3),BW,BH,"1" ,1,0); + AddJButtonButton(PX(20),PY(3),BW,BH,"2" ,1,1); + /* Buttons 3+4 of 1st Joystick, not accessible */ + AddJButtonButton_hidden(0,2); + AddJButtonButton_hidden(0,3); + + /* Axes 1+2 (X+Y) of 2nd Joystick */ + cjaxis= AddJAxisButton(PX(18),PY(4),BW,BH,"X-",1,0,false,NULL); + AddJAxisButton(PX(20),PY(4),BW,BH,"X+",1,0,true,cjaxis); + cjaxis= AddJAxisButton(PX(19),PY(3),BW,BH,"Y-",1,1,false,NULL); + AddJAxisButton(PX(19),PY(4),BW,BH,"Y+",1,1,true,cjaxis); + /* Axes 3+4 (X+Y) of 1st Joystick, not accessible */ + cjaxis= AddJAxisButton_hidden(0,2,false,NULL); + AddJAxisButton_hidden(0,2,true,cjaxis); + cjaxis= AddJAxisButton_hidden(0,3,false,NULL); + AddJAxisButton_hidden(0,3,true,cjaxis); + } else { + /* Buttons 3+4 of 1st Joystick */ + AddJButtonButton(PX(18),PY(3),BW,BH,"3" ,0,2); + AddJButtonButton(PX(20),PY(3),BW,BH,"4" ,0,3); + /* Buttons 1+2 of 2nd Joystick, not accessible */ + AddJButtonButton_hidden(1,0); + AddJButtonButton_hidden(1,1); + + /* Axes 3+4 (X+Y) of 1st Joystick */ + cjaxis= AddJAxisButton(PX(18),PY(4),BW,BH,"X-",0,2,false,NULL); + AddJAxisButton(PX(20),PY(4),BW,BH,"X+",0,2,true,cjaxis); + cjaxis= AddJAxisButton(PX(19),PY(3),BW,BH,"Y-",0,3,false,NULL); + AddJAxisButton(PX(19),PY(4),BW,BH,"Y+",0,3,true,cjaxis); + /* Axes 1+2 (X+Y) of 2nd Joystick , not accessible*/ + cjaxis= AddJAxisButton_hidden(1,0,false,NULL); + AddJAxisButton_hidden(1,0,true,cjaxis); + cjaxis= AddJAxisButton_hidden(1,1,false,NULL); + AddJAxisButton_hidden(1,1,true,cjaxis); + } + + if (joytype==JOY_CH) { + /* Buttons 5+6 of 1st Joystick */ + AddJButtonButton(PX(18),PY(6),BW,BH,"5" ,0,4); + AddJButtonButton(PX(20),PY(6),BW,BH,"6" ,0,5); + } else { + /* Buttons 5+6 of 1st Joystick, not accessible */ + AddJButtonButton_hidden(0,4); + AddJButtonButton_hidden(0,5); + } + + /* Hat directions up, left, down, right */ + AddJHatButton(PX(19),PY(6),BW,BH,"UP",0,0,0); + AddJHatButton(PX(18),PY(7),BW,BH,"LFT",0,0,3); + AddJHatButton(PX(19),PY(7),BW,BH,"DWN",0,0,2); + AddJHatButton(PX(20),PY(7),BW,BH,"RGT",0,0,1); - AddJButtonButton(PX(17),PY(3),BW,BH,"1" ,1,0); - AddJAxisButton (PX(18),PY(3),BW,BH,"Y-",1,true,false); - AddJButtonButton(PX(19),PY(3),BW,BH,"2" ,1,1); - AddJAxisButton (PX(17),PY(4),BW,BH,"X-",1,false,false); - AddJAxisButton (PX(18),PY(4),BW,BH,"Y+",1,true,true); - AddJAxisButton (PX(19),PY(4),BW,BH,"X+",1,false,true); -#endif /* The modifier buttons */ AddModButton(PX(0),PY(13),50,20,"Mod1",1); AddModButton(PX(2),PY(13),50,20,"Mod2",2); AddModButton(PX(4),PY(13),50,20,"Mod3",3); /* Create Handler buttons */ - Bitu xpos=3;Bitu ypos=7; + Bitu xpos=3;Bitu ypos=10; for (CHandlerEventVector_it hit=handlergroup.begin();hit!=handlergroup.end();hit++) { new CEventButton(PX(xpos*3),PY(ypos),BW*3,BH,(*hit)->ButtonName(),(*hit)); xpos++; @@ -1343,9 +1833,8 @@ static void CreateLayout(void) { } /* Create some text buttons */ new CTextButton(PX(6),00,124,20,"Keyboard Layout"); -#if (!OLD_JOYSTICK) - new CTextButton(PX(16),00,124,20,"Joystick Layout"); -#endif + new CTextButton(PX(17),00,124,20,"Joystick Layout"); + bind_but.action=new CCaptionButton(200,330,0,0); bind_but.event_title=new CCaptionButton(0,350,0,0); @@ -1358,7 +1847,6 @@ static void CreateLayout(void) { bind_but.mod3=new CCheckButton(20,454,60,20, "mod3",BC_Mod3); bind_but.hold=new CCheckButton(100,410,60,20,"hold",BC_Hold); - bind_but.prev=new CBindButton(200,400,50,20,"Prev",BB_Prev); bind_but.next=new CBindButton(250,400,50,20,"Next",BB_Next); bind_but.add=new CBindButton(250,380,50,20,"Add",BB_Add); @@ -1403,7 +1891,7 @@ foundevent: } static struct { - char * eventend; + const char * eventend; Bitu key; } DefaultKeys[]={ {"f1",SDLK_F1}, {"f2",SDLK_F2}, {"f3",SDLK_F3}, {"f4",SDLK_F4}, @@ -1466,14 +1954,41 @@ static void CreateDefaultBinds(void) { (*hit)->MakeDefaultBind(buffer); CreateStringBind(buffer); } - /* JOYSTICK */ - if (SDL_NumJoysticks()>0) { -// default mapping - } - + + /* joystick1, buttons 1-6 */ + sprintf(buffer,"jbutton_0_0 \"stick_0 button 0\" ");CreateStringBind(buffer); + sprintf(buffer,"jbutton_0_1 \"stick_0 button 1\" ");CreateStringBind(buffer); + sprintf(buffer,"jbutton_0_2 \"stick_0 button 2\" ");CreateStringBind(buffer); + sprintf(buffer,"jbutton_0_3 \"stick_0 button 3\" ");CreateStringBind(buffer); + sprintf(buffer,"jbutton_0_4 \"stick_0 button 4\" ");CreateStringBind(buffer); + sprintf(buffer,"jbutton_0_5 \"stick_0 button 5\" ");CreateStringBind(buffer); + /* joystick2, buttons 1-2 */ + sprintf(buffer,"jbutton_1_0 \"stick_1 button 0\" ");CreateStringBind(buffer); + sprintf(buffer,"jbutton_1_1 \"stick_1 button 1\" ");CreateStringBind(buffer); + + /* joystick1, axes 1-4 */ + sprintf(buffer,"jaxis_0_0- \"stick_0 axis 0 0\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_0_0+ \"stick_0 axis 0 1\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_0_1- \"stick_0 axis 1 0\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_0_1+ \"stick_0 axis 1 1\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_0_2- \"stick_0 axis 2 0\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_0_2+ \"stick_0 axis 2 1\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_0_3- \"stick_0 axis 3 0\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_0_3+ \"stick_0 axis 3 1\" ");CreateStringBind(buffer); + /* joystick2, axes 1-2 */ + sprintf(buffer,"jaxis_1_0- \"stick_1 axis 0 0\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_1_0+ \"stick_1 axis 0 1\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_1_1- \"stick_1 axis 1 0\" ");CreateStringBind(buffer); + sprintf(buffer,"jaxis_1_1+ \"stick_1 axis 1 1\" ");CreateStringBind(buffer); + + /* joystick1, hat */ + sprintf(buffer,"jhat_0_0_0 \"stick_0 hat 0 1\" ");CreateStringBind(buffer); + sprintf(buffer,"jhat_0_0_1 \"stick_0 hat 0 2\" ");CreateStringBind(buffer); + sprintf(buffer,"jhat_0_0_2 \"stick_0 hat 0 4\" ");CreateStringBind(buffer); + sprintf(buffer,"jhat_0_0_3 \"stick_0 hat 0 8\" ");CreateStringBind(buffer); } -void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char * eventname,char * buttonname) { +void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char const * const eventname,char const * const buttonname) { //Check if it allready exists=> if so return. for(CHandlerEventVector_it it=handlergroup.begin();it!=handlergroup.end();it++) if(strcmp((*it)->buttonname,buttonname) == 0) return; @@ -1554,33 +2069,57 @@ void BIND_MappingEvents(void) { static void CreateBindGroups(void) { bindgroups.clear(); new CKeyBindGroup(SDLK_LAST); + mapper.sticks.num=0; + mapper.sticks.num_groups=0; if (joytype != JOY_NONE) { - Bitu numsticks=SDL_NumJoysticks(); + mapper.sticks.num=SDL_NumJoysticks(); +#if defined (REDUCE_JOYSTICK_POLLING) + // direct access to the SDL joystick, thus removed from the event handling + if (mapper.sticks.num) SDL_JoystickEventState(SDL_DISABLE); +#else + // enable joystick event handling if (numsticks) SDL_JoystickEventState(SDL_ENABLE); -#if OLD_JOYSTICK else return; #endif Bit8u joyno=0; + if (joytype==JOY_AUTO) { + if (mapper.sticks.num>1) joytype=JOY_2AXIS; + else if (mapper.sticks.num) joytype=JOY_4AXIS; + else joytype=JOY_NONE; + } switch (joytype) { + case JOY_NONE: + break; case JOY_4AXIS: - new C4AxisBindGroup(joyno); + mapper.sticks.stick[mapper.sticks.num_groups++]=new C4AxisBindGroup(joyno); + new CStickBindGroup(joyno+1U); break; case JOY_FCS: - new CFCSBindGroup(joyno); + mapper.sticks.stick[mapper.sticks.num_groups++]=new CFCSBindGroup(joyno); + new CStickBindGroup(joyno+1U); break; case JOY_CH: - new CCHBindGroup(joyno); + mapper.sticks.stick[mapper.sticks.num_groups++]=new CCHBindGroup(joyno); + new CStickBindGroup(joyno+1U); break; case JOY_2AXIS: default: - new CStickBindGroup(joyno); - if((joyno+1U) < numsticks) - new CStickBindGroup(joyno+1U); + mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(joyno); + if((joyno+1U) < mapper.sticks.num) + mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(joyno+1U); break; } } } +#if defined (REDUCE_JOYSTICK_POLLING) +void MAPPER_UpdateJoysticks(void) { + for (Bitu i=0; iUpdateJoystick(); + } +} +#endif + void MAPPER_LosingFocus(void) { for (CEventVector_it evit=events.begin();evit!=events.end();evit++) { (*evit)->DeActivateAll(); @@ -1612,6 +2151,9 @@ void MAPPER_Run(bool pressed) { mapper.exit=false; mapper.redraw=true; SetActiveEvent(0); +#if defined (REDUCE_JOYSTICK_POLLING) + SDL_JoystickEventState(SDL_ENABLE); +#endif while (!mapper.exit) { if (mapper.redraw) { mapper.redraw=false; @@ -1620,6 +2162,9 @@ void MAPPER_Run(bool pressed) { BIND_MappingEvents(); SDL_Delay(1); } +#if defined (REDUCE_JOYSTICK_POLLING) + SDL_JoystickEventState(SDL_DISABLE); +#endif if(mousetoggle) GFX_CaptureMouse(); GFX_ResetScreen(); } @@ -1632,6 +2177,20 @@ void MAPPER_Init(void) { void MAPPER_StartUp(Section * sec) { Section_prop * section=static_cast(sec); + mapper.sticks.num=0; + mapper.sticks.num_groups=0; + Bitu i; + for (i=0; i<16; i++) { + virtual_joysticks[0].button_pressed[i]=false; + virtual_joysticks[1].button_pressed[i]=false; + virtual_joysticks[0].hat_pressed[i]=false; + virtual_joysticks[1].hat_pressed[i]=false; + } + for (i=0; i<8; i++) { + virtual_joysticks[0].axis_pos[i]=0; + virtual_joysticks[0].axis_pos[i]=0; + } + usescancodes=false; if (section->Get_bool("usescancodes")) { @@ -1640,6 +2199,25 @@ void MAPPER_StartUp(Section * sec) { /* Note: table has to be tested/updated for various OSs */ #if defined (MACOSX) /* nothing */ +#elif defined(OS2) + sdlkey_map[0x61]=SDLK_UP; + sdlkey_map[0x66]=SDLK_DOWN; + sdlkey_map[0x63]=SDLK_LEFT; + sdlkey_map[0x64]=SDLK_RIGHT; + sdlkey_map[0x60]=SDLK_HOME; + sdlkey_map[0x65]=SDLK_END; + sdlkey_map[0x62]=SDLK_PAGEUP; + sdlkey_map[0x67]=SDLK_PAGEDOWN; + sdlkey_map[0x68]=SDLK_INSERT; + sdlkey_map[0x69]=SDLK_DELETE; + sdlkey_map[0x5C]=SDLK_KP_DIVIDE; + sdlkey_map[0x5A]=SDLK_KP_ENTER; + sdlkey_map[0x5B]=SDLK_RCTRL; + sdlkey_map[0x5F]=SDLK_PAUSE; +// sdlkey_map[0x00]=SDLK_PRINT; + sdlkey_map[0x5E]=SDLK_RALT; + sdlkey_map[0x40]=SDLK_KP5; + sdlkey_map[0x41]=SDLK_KP6; #elif !defined (WIN32) /* => Linux */ sdlkey_map[0x5a]=SDLK_UP; sdlkey_map[0x60]=SDLK_DOWN; @@ -1680,7 +2258,7 @@ void MAPPER_StartUp(Section * sec) { for (i=0; i=100) + sprintf(title,"DOSBox %s, Cpu Cycles: max, Frameskip %2d, Program: %8s",VERSION,internal_frameskip,RunningProgram); + else + sprintf(title,"DOSBox %s, Cpu Cycles: [%3d%%], Frameskip %2d, Program: %8s",VERSION,internal_cycles,internal_frameskip,RunningProgram); + } else { sprintf(title,"DOSBox %s, Cpu Cycles: %8d, Frameskip %2d, Program: %8s",VERSION,internal_cycles,internal_frameskip,RunningProgram); + } if(paused) strcat(title," PAUSED"); SDL_WM_SetCaption(title,VERSION); @@ -240,6 +249,7 @@ static void PauseDOSBox(bool pressed) { while (paused) { SDL_WaitEvent(&event); // since we're not polling, cpu usage drops to 0. switch (event.type) { + case SDL_QUIT: throw(0); break; case SDL_KEYDOWN: // Must use Pause/Break Key to resume. case SDL_KEYUP: if(event.key.keysym.sym==SDLK_PAUSE){ @@ -250,7 +260,12 @@ static void PauseDOSBox(bool pressed) { } } } - + +#if defined (WIN32) +bool GFX_SDLUsingWinDIB(void) { + return sdl.using_windib; +} +#endif /* Reset the screen with current values in the sdl structure */ Bitu GFX_GetBestMode(Bitu flags) { @@ -313,7 +328,8 @@ check_gotbpp: void GFX_ResetScreen(void) { GFX_Stop(); - if (sdl.draw.callback) (sdl.draw.callback)( GFX_CallBackReset ); + if (sdl.draw.callback) + (sdl.draw.callback)( GFX_CallBackReset ); GFX_Start(); } @@ -380,7 +396,7 @@ Bitu GFX_SetSize(Bitu width,Bitu height,Bitu flags,double scalex,double scaley,G sdl.draw.scaley=scaley; Bitu bpp; - Bitu retFlags; + Bitu retFlags = 0; if (sdl.blit.surface) { SDL_FreeSurface(sdl.blit.surface); @@ -421,6 +437,7 @@ dosurface: SDL_QuitSubSystem(SDL_INIT_VIDEO); putenv("SDL_VIDEODRIVER=windib"); SDL_InitSubSystem(SDL_INIT_VIDEO); + sdl.using_windib=true; sdl.surface = SDL_SetVideoMode(width,height,bpp,SDL_HWSURFACE); } #endif @@ -523,6 +540,9 @@ dosurface: goto dosurface; } SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); +#if defined (WIN32) && SDL_VERSION_ATLEAST(1, 2, 11) + SDL_GL_SetAttribute( SDL_GL_SWAP_CONTROL, 0 ); +#endif GFX_SetupSurfaceScaled(SDL_OPENGL,0); if (!sdl.surface || sdl.surface->format->BitsPerPixel<15) { LOG_MSG("SDL:OPENGL:Can't open drawing surface, are you running in 16bpp(or higher) mode?"); @@ -642,7 +662,8 @@ static void SwitchFullScreen(bool pressed) { bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch) { - if (!sdl.active || sdl.updating) return false; + if (!sdl.active || sdl.updating) + return false; switch (sdl.desktop.type) { case SCREEN_SURFACE: if (sdl.blit.surface) { @@ -691,7 +712,8 @@ bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch) { void GFX_EndUpdate( const Bit16u *changedLines ) { int ret; - if (!sdl.updating) return; + if (!sdl.updating) + return; sdl.updating=false; switch (sdl.desktop.type) { case SCREEN_SURFACE: @@ -726,15 +748,11 @@ void GFX_EndUpdate( const Bit16u *changedLines ) { } if (rectCount) SDL_UpdateRects( sdl.surface, rectCount, sdl.updateRects ); - } else { - SDL_Flip(sdl.surface); } break; #if (HAVE_DDRAW_H) && defined(WIN32) case SCREEN_SURFACE_DDRAW: - if (SDL_MUSTLOCK(sdl.blit.surface)) { - SDL_UnlockSurface(sdl.blit.surface); - } + SDL_UnlockSurface(sdl.blit.surface); ret=IDirectDrawSurface3_Blt( sdl.surface->hwdata->dd_writebuf,&sdl.blit.rect, sdl.blit.surface->hwdata->dd_surface,0, @@ -866,6 +884,7 @@ static void SetPriority(PRIORITY_LEVELS level) { #endif switch (level) { #ifdef WIN32 + case PRIORITY_LEVEL_PAUSE: // if DOSBox is paused, assume idle priority case PRIORITY_LEVEL_LOWEST: SetPriorityClass(GetCurrentProcess(),IDLE_PRIORITY_CLASS); break; @@ -883,6 +902,7 @@ static void SetPriority(PRIORITY_LEVELS level) { break; #elif C_SET_PRIORITY /* Linux use group as dosbox has mulitple threads under linux */ + case PRIORITY_LEVEL_PAUSE: // if DOSBox is paused, assume idle priority case PRIORITY_LEVEL_LOWEST: setpriority (PRIO_PGRP, 0,PRIO_MAX); break; @@ -953,6 +973,11 @@ static void GUI_StartUp(Section * sec) { sdl.priority.nofocus=PRIORITY_LEVEL_HIGHER; } else if (!strncasecmp(priority,"highest",7)) { sdl.priority.nofocus=PRIORITY_LEVEL_HIGHEST; + } else if (!strncasecmp(priority,"pause",5)) { + /* we only check for pause here, because it makes no sense + * for DOSBox to be paused while it has focus + */ + sdl.priority.nofocus=PRIORITY_LEVEL_PAUSE; } else { sdl.priority.nofocus=PRIORITY_LEVEL_NORMAL; } @@ -1156,13 +1181,22 @@ static Bit8u raltstate = SDL_KEYUP; void GFX_Events() { SDL_Event event; +#if defined (REDUCE_JOYSTICK_POLLING) + static int poll_delay=0; + int time=SDL_GetTicks(); + if (time-poll_delay>20) { + poll_delay=time; + if (sdl.num_joysticks>0) SDL_JoystickUpdate(); + MAPPER_UpdateJoysticks(); + } +#endif while (SDL_PollEvent(&event)) { - switch (event.type) { + switch (event.type) { case SDL_ACTIVEEVENT: if (event.active.state & SDL_APPINPUTFOCUS) { if (event.active.gain) { if (sdl.desktop.fullscreen && !sdl.mouse.locked) - GFX_CaptureMouse(); + GFX_CaptureMouse(); SetPriority(sdl.priority.focus); } else { if (sdl.mouse.locked) { @@ -1179,6 +1213,53 @@ void GFX_Events() { MAPPER_LosingFocus(); } } + + /* Non-focus priority is set to pause; check to see if we've lost window or input focus + * i.e. has the window been minimised or made inactive? + */ + if (sdl.priority.nofocus == PRIORITY_LEVEL_PAUSE) { + if ((event.active.state & (SDL_APPINPUTFOCUS | SDL_APPACTIVE)) && (!event.active.gain)) { + /* Window has lost focus, pause the emulator. + * This is similar to what PauseDOSBox() does, but the exit criteria is different. + * Instead of waiting for the user to hit Alt-Break, we wait for the window to + * regain window or input focus. + */ + bool paused = true; + SDL_Event ev; + + GFX_SetTitle(-1,-1,true); + KEYBOARD_ClrBuffer(); + SDL_Delay(500); + while (SDL_PollEvent(&ev)) { + // flush event queue. + } + + while (paused) { + // WaitEvent waits for an event rather than polling, so CPU usage drops to zero + SDL_WaitEvent(&ev); + + switch (ev.type) { + case SDL_QUIT: throw(0); break; // a bit redundant at linux at least as the active events gets before the quit event. + case SDL_ACTIVEEVENT: // wait until we get window focus back + if (ev.active.state & (SDL_APPINPUTFOCUS | SDL_APPACTIVE)) { + // We've got focus back, so unpause and break out of the loop + if (ev.active.gain) { + paused = false; + GFX_SetTitle(-1,-1,false); + } + + /* Now poke a "release ALT" command into the keyboard buffer + * we have to do this, otherwise ALT will 'stick' and cause + * problems with the app running in the DOSBox. + */ + KEYBOARD_AddKey(KBD_leftalt, false); + KEYBOARD_AddKey(KBD_rightalt, false); + } + break; + } + } + } + } break; case SDL_MOUSEMOTION: HandleMouseMotion(&event.motion); @@ -1209,14 +1290,14 @@ void GFX_Events() { void MAPPER_CheckEvent(SDL_Event * event); MAPPER_CheckEvent(&event); } - } + } } /* static variable to show wether there is not a valid stdout. * Fixes some bugs when -noconsole is used in a read only directory */ static bool no_stdout = false; -void GFX_ShowMsg(char * format,...) { +void GFX_ShowMsg(char const* format,...) { char buf[512]; va_list msg; va_start(msg,format); @@ -1275,10 +1356,40 @@ int main(int argc, char* argv[]) { if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM |SDL_INIT_NOPARACHUTE -#ifndef DISABLE_JOYSTICK - |SDL_INIT_JOYSTICK -#endif ) < 0 ) E_Exit("Can't init SDL %s",SDL_GetError()); + +#ifndef DISABLE_JOYSTICK + //Initialise Joystick seperately. This way we can warn when it fails instead + //of exiting the application + if( SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0 ) LOG_MSG("Failed to init joystick support"); +#endif + +#if defined (WIN32) +#if SDL_VERSION_ATLEAST(1, 2, 10) + sdl.using_windib=true; +#else + sdl.using_windib=false; +#endif + char sdl_drv_name[128]; + if (getenv("SDL_VIDEODRIVER")==NULL) { + if (SDL_VideoDriverName(sdl_drv_name,128)!=NULL) { + if (strcmp(sdl_drv_name,"directx")!=0) { + SDL_QuitSubSystem(SDL_INIT_VIDEO); + putenv("SDL_VIDEODRIVER=directx"); + SDL_InitSubSystem(SDL_INIT_VIDEO); + } + sdl.using_windib=false; + } + } else { + char* sdl_videodrv = getenv("SDL_VIDEODRIVER"); + if (strcmp(sdl_videodrv,"directx")==0) sdl.using_windib = false; + else if (strcmp(sdl_videodrv,"windib")==0) sdl.using_windib = true; + } + if (SDL_VideoDriverName(sdl_drv_name,128)!=NULL) { + if (strcmp(sdl_drv_name,"windib")==0) LOG_MSG("SDL_Init: Starting up with SDL windib video driver.\n Try to update your video card and directx drivers!"); + } +#endif + sdl.num_joysticks=SDL_NumJoysticks(); Section_prop * sdl_sec=control->AddSection_prop("sdl",&GUI_StartUp); sdl_sec->AddInitFunction(&MAPPER_StartUp); sdl_sec->Add_bool("fullscreen",false); @@ -1309,7 +1420,7 @@ int main(int argc, char* argv[]) { "autolock -- Mouse will automatically lock, if you click on the screen.\n" "sensitiviy -- Mouse sensitivity.\n" "waitonerror -- Wait before closing the console if dosbox has an error.\n" - "priority -- Priority levels for dosbox: lowest,lower,normal,higher,highest.\n" + "priority -- Priority levels for dosbox: lowest,lower,normal,higher,highest,pause (when not focussed).\n" " Second entry behind the comma is for when dosbox is not focused/minimized.\n" "mapperfile -- File used to load/save the key/event mappings from.\n" "usescancodes -- Avoid usage of symkeys, might not work on all operating systems.\n" @@ -1317,24 +1428,22 @@ int main(int argc, char* argv[]) { /* Init all the dosbox subsystems */ DOSBOX_Init(); std::string config_file; - if (control->cmdline->FindString("-conf",config_file,true)) { - - } else { - config_file="dosbox.conf"; - } - /* Parse the config file - * try open config file in $HOME if can't open dosbox.conf or specified file - */ - if (control->ParseConfigFile(config_file.c_str()) == false) { - if ((getenv("HOME") != NULL)) { - config_file = (std::string)getenv("HOME") + - (std::string)DEFAULT_CONFIG_FILE; - if (control->ParseConfigFile(config_file.c_str()) == false) { - LOG_MSG("CONFIG: Using default settings. Create a configfile to change them"); - } - - } + bool parsed_anyconfigfile = false; + // First parse the configfile in the $HOME directory + if ((getenv("HOME") != NULL)) { + config_file = (std::string)getenv("HOME") + + (std::string)DEFAULT_CONFIG_FILE; + if (control->ParseConfigFile(config_file.c_str())) parsed_anyconfigfile = true; } + // Add extra settings from dosbox.conf in the local directory if there is no configfile specified at the commandline + if (!control->cmdline->FindString("-conf",config_file,true)) config_file="dosbox.conf"; + if (control->ParseConfigFile(config_file.c_str())) parsed_anyconfigfile = true; + // Add extra settings from additional configfiles at the commandline + while(control->cmdline->FindString("-conf",config_file,true)) + if (control->ParseConfigFile(config_file.c_str())) parsed_anyconfigfile = true; + // Give a message if no configfile whatsoever was found. + if(!parsed_anyconfigfile) LOG_MSG("CONFIG: Using default settings. Create a configfile to change them"); + #if (ENVIRON_LINKED) control->ParseEnv(environ); #endif diff --git a/src/hardware/Makefile.in b/src/hardware/Makefile.in index a1d0f27..9b7e670 100644 --- a/src/hardware/Makefile.in +++ b/src/hardware/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libhardware_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,56 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/hardware -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libhardware_a_AR = $(AR) $(ARFLAGS) -libhardware_a_LIBADD = -am_libhardware_a_OBJECTS = adlib.$(OBJEXT) dma.$(OBJEXT) \ - gameblaster.$(OBJEXT) hardware.$(OBJEXT) iohandler.$(OBJEXT) \ - joystick.$(OBJEXT) keyboard.$(OBJEXT) memory.$(OBJEXT) \ - mixer.$(OBJEXT) pcspeaker.$(OBJEXT) pic.$(OBJEXT) \ - sblaster.$(OBJEXT) tandy_sound.$(OBJEXT) timer.$(OBJEXT) \ - vga.$(OBJEXT) vga_attr.$(OBJEXT) vga_crtc.$(OBJEXT) \ - vga_dac.$(OBJEXT) vga_draw.$(OBJEXT) vga_gfx.$(OBJEXT) \ - vga_other.$(OBJEXT) vga_memory.$(OBJEXT) vga_misc.$(OBJEXT) \ - vga_seq.$(OBJEXT) vga_xga.$(OBJEXT) vga_s3.$(OBJEXT) \ - cmos.$(OBJEXT) disney.$(OBJEXT) gus.$(OBJEXT) mpu401.$(OBJEXT) \ - ipx.$(OBJEXT) ipxserver.$(OBJEXT) -libhardware_a_OBJECTS = $(am_libhardware_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -SOURCES = $(libhardware_a_SOURCES) -DIST_SOURCES = $(libhardware_a_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -112,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -142,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -152,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -161,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -187,48 +139,87 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + SUBDIRS = serialport + EXTRA_DIST = fmopl.c fmopl.h ymf262.h ymf262.c + noinst_LIBRARIES = libhardware.a + libhardware_a_SOURCES = adlib.cpp dma.cpp gameblaster.cpp hardware.cpp iohandler.cpp joystick.cpp keyboard.cpp \ memory.cpp mixer.cpp pcspeaker.cpp pic.cpp sblaster.cpp tandy_sound.cpp timer.cpp \ vga.cpp vga_attr.cpp vga_crtc.cpp vga_dac.cpp vga_draw.cpp vga_gfx.cpp vga_other.cpp \ vga_memory.cpp vga_misc.cpp vga_seq.cpp vga_xga.cpp vga_s3.cpp \ cmos.cpp disney.cpp gus.cpp mpu401.cpp ipx.cpp ipxserver.cpp +subdir = src/hardware +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libhardware_a_AR = $(AR) cru +libhardware_a_LIBADD = +am_libhardware_a_OBJECTS = adlib.$(OBJEXT) dma.$(OBJEXT) \ + gameblaster.$(OBJEXT) hardware.$(OBJEXT) iohandler.$(OBJEXT) \ + joystick.$(OBJEXT) keyboard.$(OBJEXT) memory.$(OBJEXT) \ + mixer.$(OBJEXT) pcspeaker.$(OBJEXT) pic.$(OBJEXT) \ + sblaster.$(OBJEXT) tandy_sound.$(OBJEXT) timer.$(OBJEXT) \ + vga.$(OBJEXT) vga_attr.$(OBJEXT) vga_crtc.$(OBJEXT) \ + vga_dac.$(OBJEXT) vga_draw.$(OBJEXT) vga_gfx.$(OBJEXT) \ + vga_other.$(OBJEXT) vga_memory.$(OBJEXT) vga_misc.$(OBJEXT) \ + vga_seq.$(OBJEXT) vga_xga.$(OBJEXT) vga_s3.$(OBJEXT) \ + cmos.$(OBJEXT) disney.$(OBJEXT) gus.$(OBJEXT) mpu401.$(OBJEXT) \ + ipx.$(OBJEXT) ipxserver.$(OBJEXT) +libhardware_a_OBJECTS = $(am_libhardware_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/adlib.Po ./$(DEPDIR)/cmos.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/disney.Po ./$(DEPDIR)/dma.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/gameblaster.Po ./$(DEPDIR)/gus.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/hardware.Po ./$(DEPDIR)/iohandler.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ipx.Po ./$(DEPDIR)/ipxserver.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/joystick.Po ./$(DEPDIR)/keyboard.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/memory.Po ./$(DEPDIR)/mixer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/mpu401.Po ./$(DEPDIR)/pcspeaker.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/pic.Po ./$(DEPDIR)/sblaster.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/tandy_sound.Po ./$(DEPDIR)/timer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/vga.Po ./$(DEPDIR)/vga_attr.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/vga_crtc.Po ./$(DEPDIR)/vga_dac.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/vga_draw.Po ./$(DEPDIR)/vga_gfx.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/vga_memory.Po ./$(DEPDIR)/vga_misc.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/vga_other.Po ./$(DEPDIR)/vga_s3.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/vga_seq.Po ./$(DEPDIR)/vga_xga.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +DIST_SOURCES = $(libhardware_a_SOURCES) + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +DIST_SUBDIRS = $(SUBDIRS) +SOURCES = $(libhardware_a_SOURCES) + all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/hardware/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/hardware/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/hardware/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -238,7 +229,7 @@ libhardware.a: $(libhardware_a_OBJECTS) $(libhardware_a_DEPENDENCIES) $(RANLIB) libhardware.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -277,18 +268,26 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vga_xga.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd @@ -298,13 +297,7 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -316,7 +309,7 @@ $(RECURSIVE_TARGETS): local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -324,13 +317,7 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -351,7 +338,7 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -362,6 +349,14 @@ ctags-recursive: test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -370,22 +365,19 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ - empty_fix=.; \ else \ include_option=--include; \ - empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ + test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -395,11 +387,10 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -422,6 +413,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -435,7 +430,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -450,17 +445,15 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ @@ -470,6 +463,7 @@ check: check-recursive all-am: Makefile $(LIBRARIES) installdirs: installdirs-recursive installdirs-am: + install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -489,7 +483,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -508,8 +502,6 @@ dvi: dvi-recursive dvi-am: -html: html-recursive - info: info-recursive info-am: @@ -545,18 +537,22 @@ uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-noinstLIBRARIES clean-recursive \ - ctags ctags-recursive distclean distclean-compile \ - distclean-generic distclean-recursive distclean-tags distdir \ - dvi dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-strip \ - installcheck installcheck-am installdirs installdirs-am \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-noinstLIBRARIES clean-recursive ctags \ + ctags-recursive distclean distclean-compile distclean-generic \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am uninstall-info-am + mostlyclean-generic mostlyclean-recursive pdf pdf-am \ + pdf-recursive ps ps-am ps-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/hardware/adlib.cpp b/src/hardware/adlib.cpp index 9cdba65..113039b 100644 --- a/src/hardware/adlib.cpp +++ b/src/hardware/adlib.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/hardware/cmos.cpp b/src/hardware/cmos.cpp index 0596ec2..f5ff406 100644 --- a/src/hardware/cmos.cpp +++ b/src/hardware/cmos.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ static struct { bool enabled; Bit8u div; float delay; + bool acknowledged; } timer; struct { double timer; @@ -45,7 +46,10 @@ static struct { } cmos; static void cmos_timerevent(Bitu val) { - PIC_ActivateIRQ(8); + if (cmos.timer.acknowledged) { + cmos.timer.acknowledged=false; + PIC_ActivateIRQ(8); + } if (cmos.timer.enabled) { PIC_AddEvent(cmos_timerevent,cmos.timer.delay); cmos.regs[0xc] = 0xC0;//Contraption Zack (music) @@ -155,6 +159,7 @@ static Bitu cmos_readreg(Bitu port,Bitu iolen) { return (cmos.regs[0x0a]&0x7f); } case 0x0c: /* Status register C */ + cmos.timer.acknowledged=true; if (cmos.timer.enabled) { /* In periodic interrupt mode only care for those flags */ Bit8u val=cmos.regs[0xc]; @@ -286,6 +291,7 @@ public: WriteHandler[1].Install(0x71,cmos_writereg,IO_MB); ReadHandler[0].Install(0x71,cmos_readreg,IO_MB); cmos.timer.enabled=false; + cmos.timer.acknowledged=true; cmos.reg=0xa; cmos_writereg(0x71,0x26,1); cmos.reg=0xb; diff --git a/src/hardware/disney.cpp b/src/hardware/disney.cpp index e33e46e..896faa5 100644 --- a/src/hardware/disney.cpp +++ b/src/hardware/disney.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,17 +44,15 @@ static void disney_write(Bitu port,Bitu val,Bitu iolen) { switch (port-DISNEY_BASE) { case 0: /* Data Port */ disney.data=val; + if (disney.used +#include +#include #include "dosbox.h" #include "inout.h" #include "mixer.h" @@ -26,6 +28,7 @@ #include "shell.h" #include "math.h" #include "regs.h" +using namespace std; //Extra bits of precision over normal gus #define WAVE_BITS 2 @@ -82,12 +85,12 @@ struct GFGus { float delay; } timers[2]; Bit32u rate; - Bit16u portbase; - Bit8u dma1; - Bit8u dma2; + Bitu portbase; + Bitu dma1; + Bitu dma2; - Bit16u irq1; - Bit16u irq2; + Bitu irq1; + Bitu irq2; char ultradir[512]; bool irqenabled; @@ -738,7 +741,7 @@ static void GUS_DMA_Callback(DmaChannel * chan,DMAEvent event) { for(i=dmaaddr;i<(dmaaddr+read);i++) GUSRam[i] ^= 0x80; } else { // 16-bit data - for(i=dmaaddr+1;i<(dmaaddr+read-1);i+=2) GUSRam[i] ^= 0x80; + for(i=dmaaddr+1;i<(dmaaddr+read);i+=2) GUSRam[i] ^= 0x80; } } } else { @@ -861,10 +864,15 @@ public: myGUS.gRegData=0x0; int portat = 0x200+GUS_BASE; // ULTRASND=Port,DMA1,DMA2,IRQ1,IRQ2 - autoexecline[0].Install("SET ULTRASND=%3X,%d,%d,%d,%d",portat,myGUS.dma1,myGUS.dma2,myGUS.irq1,myGUS.irq2); - autoexecline[1].Install("SET ULTRADIR=%s", myGUS.ultradir); + // Create autoexec.bat lines + ostringstream temp; + temp << "SET ULTRASND=" << hex << setw(3) << portat << "," + << dec << myGUS.dma1 << "," << myGUS.dma2 << "," + << myGUS.irq1 << "," << myGUS.irq2 << ends; + autoexecline[0].Install(temp.str()); + autoexecline[1].Install(std::string("SET ULTRADIR=")+ myGUS.ultradir); } - + ~GUS() { if(machine!=MCH_VGA) return; diff --git a/src/hardware/hardware.cpp b/src/hardware/hardware.cpp index 00cd395..133ea35 100644 --- a/src/hardware/hardware.cpp +++ b/src/hardware/hardware.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: hardware.cpp,v 1.16 2006/03/29 13:51:58 harekiet Exp $ */ +/* $Id: hardware.cpp,v 1.18 2007/01/08 19:45:40 qbix79 Exp $ */ #include #include @@ -37,7 +37,7 @@ #endif static char * capturedir; -extern char * RunningProgram; +extern const char* RunningProgram; Bitu CaptureState; #define WAVE_BUF 16*1024 diff --git a/src/hardware/iohandler.cpp b/src/hardware/iohandler.cpp index 0c0a5d3..c170d8c 100644 --- a/src/hardware/iohandler.cpp +++ b/src/hardware/iohandler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: iohandler.cpp,v 1.20 2006/02/09 11:47:49 qbix79 Exp $ */ +/* $Id: iohandler.cpp,v 1.26 2007/02/22 08:32:21 qbix79 Exp $ */ #include #include "dosbox.h" @@ -29,10 +29,10 @@ IO_WriteHandler * io_writehandlers[3][IO_MAX]; IO_ReadHandler * io_readhandlers[3][IO_MAX]; -static Bitu IO_ReadBlocked(Bitu port,Bitu iolen) { +static Bitu IO_ReadBlocked(Bitu /*port*/,Bitu /*iolen*/) { return ~0; } -static void IO_WriteBlocked(Bitu port,Bitu val,Bitu iolen) { +static void IO_WriteBlocked(Bitu /*port*/,Bitu /*val*/,Bitu /*iolen*/) { } static Bitu IO_ReadDefault(Bitu port,Bitu iolen) { @@ -150,7 +150,7 @@ static struct { static Bits IOFaultCore(void) { CPU_CycleLeft+=CPU_Cycles; CPU_Cycles=1; - Bitu ret=CPU_Core_Full_Run(); + Bits ret=CPU_Core_Full_Run(); CPU_CycleLeft+=CPU_Cycles; if (ret<0) E_Exit("Got a dosbox close machine in IO-fault core?"); if (ret) @@ -162,10 +162,54 @@ static Bits IOFaultCore(void) { return 0; } -Bitu DEBUG_EnableDebugger(); + +/* Some code to make io operations take some virtual time. Helps certain + * games with their timing of certain operations + */ + + +#define IODELAY_READ_MICROS 1.0 +#define IODELAY_WRITE_MICROS 0.75 + +inline void IO_USEC_read_delay_old() { + if(CPU_CycleMax > static_cast((IODELAY_READ_MICROS*1000.0))) { + // this could be calculated whenever CPU_CycleMax changes + Bitu delaycyc = static_cast((CPU_CycleMax/1000)*IODELAY_READ_MICROS); + if(CPU_Cycles > delaycyc) CPU_Cycles -= delaycyc; + else CPU_Cycles = 0; + } +} + +inline void IO_USEC_write_delay_old() { + if(CPU_CycleMax > static_cast((IODELAY_WRITE_MICROS*1000.0))) { + // this could be calculated whenever CPU_CycleMax changes + Bitu delaycyc = static_cast((CPU_CycleMax/1000)*IODELAY_WRITE_MICROS); + if(CPU_Cycles > delaycyc) CPU_Cycles -= delaycyc; + else CPU_Cycles = 0; + } +} + + +#define IODELAY_READ_MICROSk (Bit32u)(1024/1.0) +#define IODELAY_WRITE_MICROSk (Bit32u)(1024/0.75) + +inline void IO_USEC_read_delay() { + Bitu delaycyc = CPU_CycleMax/IODELAY_READ_MICROSk; + if(GCC_UNLIKELY(CPU_Cycles < 3*delaycyc)) delaycyc = 0; //Else port acces will set cycles to 0. which might trigger problem with games which read 16 bit values + CPU_Cycles -= delaycyc; + CPU_IODelayRemoved += delaycyc; +} + +inline void IO_USEC_write_delay() { + Bitu delaycyc = CPU_CycleMax/IODELAY_WRITE_MICROSk; + if(GCC_UNLIKELY(CPU_Cycles < 3*delaycyc)) delaycyc=0; + CPU_Cycles -= delaycyc; + CPU_IODelayRemoved += delaycyc; +} + void IO_WriteB(Bitu port,Bitu val) { - if (GETFLAG(VM) && (CPU_IO_Exception(port,1))) { + if (GCC_UNLIKELY(GETFLAG(VM) && (CPU_IO_Exception(port,1)))) { LazyFlags old_lflags; memcpy(&old_lflags,&lflags,sizeof(LazyFlags)); CPU_Decoder * old_cpudecoder; @@ -194,11 +238,14 @@ void IO_WriteB(Bitu port,Bitu val) { memcpy(&lflags,&old_lflags,sizeof(LazyFlags)); cpudecoder=old_cpudecoder; } - else io_writehandlers[0][port](port,val,1); + else { + IO_USEC_write_delay(); + io_writehandlers[0][port](port,val,1); + } }; void IO_WriteW(Bitu port,Bitu val) { - if (GETFLAG(VM) && (CPU_IO_Exception(port,2))) { + if (GCC_UNLIKELY(GETFLAG(VM) && (CPU_IO_Exception(port,2)))) { LazyFlags old_lflags; memcpy(&old_lflags,&lflags,sizeof(LazyFlags)); CPU_Decoder * old_cpudecoder; @@ -227,11 +274,14 @@ void IO_WriteW(Bitu port,Bitu val) { memcpy(&lflags,&old_lflags,sizeof(LazyFlags)); cpudecoder=old_cpudecoder; } - else io_writehandlers[1][port](port,val,2); + else { + IO_USEC_write_delay(); + io_writehandlers[1][port](port,val,2); + } }; void IO_WriteD(Bitu port,Bitu val) { - if (GETFLAG(VM) && (CPU_IO_Exception(port,4))) { + if (GCC_UNLIKELY(GETFLAG(VM) && (CPU_IO_Exception(port,4)))) { LazyFlags old_lflags; memcpy(&old_lflags,&lflags,sizeof(LazyFlags)); CPU_Decoder * old_cpudecoder; @@ -264,7 +314,7 @@ void IO_WriteD(Bitu port,Bitu val) { }; Bitu IO_ReadB(Bitu port) { - if (GETFLAG(VM) && (CPU_IO_Exception(port,1))) { + if (GCC_UNLIKELY(GETFLAG(VM) && (CPU_IO_Exception(port,1)))) { LazyFlags old_lflags; memcpy(&old_lflags,&lflags,sizeof(LazyFlags)); CPU_Decoder * old_cpudecoder; @@ -293,11 +343,14 @@ Bitu IO_ReadB(Bitu port) { cpudecoder=old_cpudecoder; return retval; } - else return io_readhandlers[0][port](port,1); + else { + IO_USEC_read_delay(); + return io_readhandlers[0][port](port,1); + } }; Bitu IO_ReadW(Bitu port) { - if (GETFLAG(VM) && (CPU_IO_Exception(port,2))) { + if (GCC_UNLIKELY(GETFLAG(VM) && (CPU_IO_Exception(port,2)))) { LazyFlags old_lflags; memcpy(&old_lflags,&lflags,sizeof(LazyFlags)); CPU_Decoder * old_cpudecoder; @@ -326,11 +379,14 @@ Bitu IO_ReadW(Bitu port) { cpudecoder=old_cpudecoder; return retval; } - else return io_readhandlers[1][port](port,2); + else { + IO_USEC_read_delay(); + return io_readhandlers[1][port](port,2); + } }; Bitu IO_ReadD(Bitu port) { - if (GETFLAG(VM) && (CPU_IO_Exception(port,4))) { + if (GCC_UNLIKELY(GETFLAG(VM) && (CPU_IO_Exception(port,4)))) { LazyFlags old_lflags; memcpy(&old_lflags,&lflags,sizeof(LazyFlags)); CPU_Decoder * old_cpudecoder; @@ -377,7 +433,7 @@ public: static IO* test; -void IO_Destroy(Section* sec) { +void IO_Destroy(Section*) { delete test; } diff --git a/src/hardware/ipx.cpp b/src/hardware/ipx.cpp index 1cc3ae2..f2c0cef 100644 --- a/src/hardware/ipx.cpp +++ b/src/hardware/ipx.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: ipx.cpp,v 1.10 2006/02/26 13:46:31 qbix79 Exp $ */ +/* $Id: ipx.cpp,v 1.13 2007/02/22 08:30:47 qbix79 Exp $ */ #include "dosbox.h" @@ -49,14 +49,13 @@ struct ipxnetaddr { Uint8 netnode[6]; } localIpxAddr; -Bit32u tcpPort; +Bit32u udpPort; bool isIpxServer; bool isIpxConnected; -IPaddress ipxClientIp; // IPAddress for client connection to server -IPaddress ipxServConnIp; // IPAddress for client connection to server +IPaddress ipxServConnIp; // IPAddress for client connection to server UDPsocket ipxClientSocket; -int UDPChannel; // Channel used by UDP connection -Bit8u recvBuffer[IPXBUFFERSIZE]; // Incoming packet buffer +int UDPChannel; // Channel used by UDP connection +Bit8u recvBuffer[IPXBUFFERSIZE]; // Incoming packet buffer static RealPt ipx_callback; @@ -92,13 +91,14 @@ Bitu ECBAmount = 0; ECBClass::ECBClass(Bit16u segment, Bit16u offset) { ECBAddr = RealMake(segment, offset); + databuffer = 0; #ifdef IPX_DEBUGMSG SerialNumber = ECBSerialNumber; ECBSerialNumber++; ECBAmount++; - LOG_MSG("ECB: SN%7d created. Number of ECBs: %3d, ESR %4x:%4x, ECB %4x:%4x", + LOG_IPX("ECB: SN%7d created. Number of ECBs: %3d, ESR %4x:%4x, ECB %4x:%4x", SerialNumber,ECBAmount, real_readw(RealSeg(ECBAddr), RealOff(ECBAddr)+6), @@ -121,6 +121,41 @@ ECBClass::ECBClass(Bit16u segment, Bit16u offset) { useECB->nextECB = this; this->prevECB = useECB; } + + iuflag = getInUseFlag(); + mysocket = getSocket(); +} +void ECBClass::writeDataBuffer(Bit8u* buffer, Bit16u length) { + if(databuffer!=0) delete [] databuffer; + databuffer = new Bit8u[length]; + memcpy(databuffer,buffer,length); + buflen=length; + +} +bool ECBClass::writeData() { + Bitu length=buflen; + Bit8u* buffer = databuffer; + fragmentDescriptor tmpFrag; + setInUseFlag(USEFLAG_AVAILABLE); + Bitu fragCount = getFragCount(); + Bitu bufoffset = 0; + for(Bitu i = 0;i < fragCount;i++) { + getFragDesc(i,&tmpFrag); + for(Bitu t = 0;t < tmpFrag.size;t++) { + real_writeb(tmpFrag.segment, tmpFrag.offset + t, buffer[bufoffset]); + bufoffset++; + if(bufoffset >= length) { + setCompletionFlag(COMP_SUCCESS); + setImmAddress(&buffer[22]); // Write in source node + return true; + } + } + } + if(bufoffset < length) { + setCompletionFlag(COMP_MALFORMED); + return false; + } + return false; } Bit16u ECBClass::getSocket(void) { @@ -162,10 +197,8 @@ RealPt ECBClass::getESRAddr(void) { void ECBClass::NotifyESR(void) { Bit32u ESRval = real_readd(RealSeg(ECBAddr), RealOff(ECBAddr)+4); - if(ESRval) { -#ifdef IPX_DEBUGMSG - LOG_MSG("ECB: SN%7d to be notified.", SerialNumber); -#endif + if(ESRval || databuffer) { // databuffer: write data at realmode/v86 time + // LOG_IPX("ECB: SN%7d to be notified.", SerialNumber); // take the ECB out of the current list if(prevECB == NULL) { // was the first in the list ECBList = nextECB; @@ -190,7 +223,6 @@ void ECBClass::NotifyESR(void) { prevECB = useECB; } isInESRList = true; - //LOG_MSG("ECB put to notification list"); PIC_ActivateIRQ(11); } // this one does not want to be notified, delete it right away @@ -210,7 +242,7 @@ void ECBClass::getImmAddress(Bit8u* immAddr) { ECBClass::~ECBClass() { #ifdef IPX_DEBUGMSG ECBAmount--; - LOG_MSG("ECB: SN%7d destroyed. Remaining ECBs: %3d", SerialNumber,ECBAmount); + LOG_IPX("ECB: SN%7d destroyed. Remaining ECBs: %3d", SerialNumber,ECBAmount); #endif if(isInESRList) { @@ -225,6 +257,7 @@ ECBClass::~ECBClass() { if(nextECB != NULL) nextECB->prevECB = prevECB; } } + if(databuffer!=0) delete [] databuffer; } @@ -238,7 +271,6 @@ static bool sockInUse(Bit16u sockNum) { static void OpenSocket(void) { Bit16u sockNum, sockAlloc; - //LOG_MSG("IPX: DOSINT used."); sockNum = swapByte(reg_dx); if(socketCount >= SOCKTABLESIZE) { @@ -251,7 +283,8 @@ static void OpenSocket(void) { sockAlloc = 0x4002; while(sockInUse(sockAlloc) && (sockAlloc < 0x7fff)) sockAlloc++; if(sockAlloc > 0x7fff) { - // I have no idea how this could happen if the IPX driver is limited to 150 open sockets at a time + // I have no idea how this could happen if the IPX driver + // is limited to 150 open sockets at a time LOG_MSG("IPX: Out of dynamic sockets"); } sockNum = sockAlloc; @@ -311,46 +344,59 @@ static bool IPX_Multiplex(void) { return true; } +static void IPX_AES_EventHandler(Bitu param) +{ + ECBClass* tmpECB = ECBList; + ECBClass* tmp2ECB; + while(tmpECB!=0) { + tmp2ECB = tmpECB->nextECB; + if(tmpECB->iuflag==USEFLAG_AESCOUNT && param==(Bitu)tmpECB->ECBAddr) { + tmpECB->setCompletionFlag(COMP_SUCCESS); + tmpECB->setInUseFlag(USEFLAG_AVAILABLE); + tmpECB->NotifyESR(); + // LOG_IPX("AES Notification: ECB S/N %d",tmpECB->SerialNumber); + return; + } + tmpECB = tmp2ECB; + } + LOG_MSG("!!!! Rouge AES !!!!" ); +} + static void sendPacket(ECBClass* sendecb); static void handleIpxRequest(void) { ECBClass *tmpECB; switch (reg_bx) { - case 0x0000: // Open socket + case 0x0000: // Open socket OpenSocket(); -#ifdef IPX_DEBUGMSG - LOG_MSG("IPX: Open socket %4x", swapByte(reg_dx)); -#endif + LOG_IPX("IPX: Open socket %4x", swapByte(reg_dx)); break; - case 0x0001: // Close socket -#ifdef IPX_DEBUGMSG - LOG_MSG("IPX: Close socket %4x", swapByte(reg_dx)); -#endif + case 0x0001: // Close socket + LOG_IPX("IPX: Close socket %4x", swapByte(reg_dx)); CloseSocket(); break; case 0x0002: // get local target - // es:si - // Currently no support for multiple networks + // es:si + // Currently no support for multiple networks for(Bitu i = 0; i < 6; i++) real_writeb(SegValue(es),reg_di+i,real_readb(SegValue(es),reg_si+i+4)); - reg_cx=1; // time ticks expected - reg_al=0x00;//success + reg_cx=1; // time ticks expected + reg_al=0x00; //success break; - case 0x0003: // Send packet + case 0x0003: // Send packet + tmpECB = new ECBClass(SegValue(es),reg_si); if(!incomingPacket.connected) { - tmpECB = new ECBClass(SegValue(es),reg_si); tmpECB->setInUseFlag(USEFLAG_AVAILABLE); tmpECB->setCompletionFlag(COMP_UNDELIVERABLE); delete tmpECB; // not notify? reg_al = 0xff; // Failure } else { - tmpECB = new ECBClass(SegValue(es),reg_si); tmpECB->setInUseFlag(USEFLAG_SENDING); - //LOG_MSG("IPX: Sending packet on %4x", tmpECB->getSocket()); + //LOG_IPX("IPX: Sending packet on %4x", tmpECB->getSocket()); reg_al = 0x00; // Success sendPacket(tmpECB); } @@ -358,6 +404,7 @@ static void handleIpxRequest(void) { break; case 0x0004: // Listen for packet tmpECB = new ECBClass(SegValue(es),reg_si); + // LOG_IPX("ECB: SN%7d RECEIVE.", tmpECB->SerialNumber); if(!sockInUse(tmpECB->getSocket())) { // Socket is not open reg_al = 0xff; tmpECB->setInUseFlag(USEFLAG_AVAILABLE); @@ -366,73 +413,86 @@ static void handleIpxRequest(void) { } else { reg_al = 0x00; // Success tmpECB->setInUseFlag(USEFLAG_LISTENING); - /*LOG_MSG("IPX: Listen for packet on 0x%4x - ESR address %4x:%4x", + /*LOG_IPX("IPX: Listen for packet on 0x%4x - ESR address %4x:%4x", tmpECB->getSocket(), RealSeg(tmpECB->getESRAddr()), RealOff(tmpECB->getESRAddr()));*/ } - - break; - case 0x0006: // cancel operation - { - RealPt ecbaddress = RealMake(SegValue(es),reg_si); - ECBClass* tmpECB= ECBList; - ECBClass* tmp2ECB; - while(tmpECB) { - tmp2ECB=tmpECB->nextECB; - if(tmpECB->ECBAddr == ecbaddress) { - tmpECB->setInUseFlag(USEFLAG_AVAILABLE); - tmpECB->setCompletionFlag(COMP_CANCELLED); - delete tmpECB; - reg_al=0; // Success -#ifdef IPX_DEBUGMSG - LOG_MSG("IPX: ECB canceled."); -#endif - return; - } - tmpECB=tmp2ECB; - } - reg_al=0xff; // Fail - break; - } - case 0x0008: // Get interval marker - // ???? - break; - case 0x0009: // Get internetwork address - { -#ifdef IPX_DEBUGMSG - LOG_MSG("IPX: Get internetwork address %2x:%2x:%2x:%2x:%2x:%2x", localIpxAddr.netnode[5], localIpxAddr.netnode[4], localIpxAddr.netnode[3], localIpxAddr.netnode[2], localIpxAddr.netnode[1], localIpxAddr.netnode[0]); -#endif - Bit8u * addrptr = (Bit8u *)&localIpxAddr; - for(Bit16u i=0;i<10;i++) { - real_writeb(SegValue(es),reg_si+i,addrptr[i]); - } - break; - } - case 0x000a: // Relinquish control - // Idle thingy - break; - case 0x000b: // Disconnect from Target - // We don't even connect - break; - case 0x0010: // SPX install check - { - reg_al=0; // SPX not installed - break; - } - case 0x001a: // get driver maximum packet size - { - reg_cx=0; // retry count - reg_ax=IPXBUFFERSIZE; // max packet size - break; + case 0x0005: // SCHEDULE IPX EVENT + case 0x0007: // SCHEDULE SPECIAL IPX EVENT + { + tmpECB = new ECBClass(SegValue(es),reg_si); + // LOG_IPX("ECB: SN%7d AES. T=%fms.", tmpECB->SerialNumber, + // (1000.0f/(1193182.0f/65536.0f))*(float)reg_ax); + PIC_AddEvent(IPX_AES_EventHandler, + (1000.0f/(1193182.0f/65536.0f))*(float)reg_ax,(Bitu)tmpECB->ECBAddr); + tmpECB->setInUseFlag(USEFLAG_AESCOUNT); + break; + } + case 0x0006: // cancel operation + { + RealPt ecbaddress = RealMake(SegValue(es),reg_si); + ECBClass* tmpECB= ECBList; + ECBClass* tmp2ECB; + while(tmpECB) { + tmp2ECB=tmpECB->nextECB; + if(tmpECB->ECBAddr == ecbaddress) { + if(tmpECB->getInUseFlag()==USEFLAG_AESCOUNT) + PIC_RemoveSpecificEvents(IPX_AES_EventHandler,(Bitu)ecbaddress); + tmpECB->setInUseFlag(USEFLAG_AVAILABLE); + tmpECB->setCompletionFlag(COMP_CANCELLED); + delete tmpECB; + reg_al=0; // Success + LOG_IPX("IPX: ECB canceled."); + return; + } + tmpECB=tmp2ECB; } + reg_al=0xff; // Fail + break; + } + case 0x0008: // Get interval marker + reg_ax = mem_readw(0x46c); // BIOS_TIMER + break; + case 0x0009: // Get internetwork address + { + LOG_IPX("IPX: Get internetwork address %2x:%2x:%2x:%2x:%2x:%2x", + localIpxAddr.netnode[5], localIpxAddr.netnode[4], + localIpxAddr.netnode[3], localIpxAddr.netnode[2], + localIpxAddr.netnode[1], localIpxAddr.netnode[0]); + + Bit8u * addrptr = (Bit8u *)&localIpxAddr; + for(Bit16u i=0;i<10;i++) + real_writeb(SegValue(es),reg_si+i,addrptr[i]); + break; + } + case 0x000a: // Relinquish control + break; // Idle thingy + + case 0x000b: // Disconnect from Target + break; // We don't even connect + + case 0x000d: // get packet size + reg_cx=0; // retry count + reg_ax=1024; // real implementation returns 1024 + break; + + case 0x0010: // SPX install check + reg_al=0; // SPX not installed + break; + + case 0x001a: // get driver maximum packet size + reg_cx=0; // retry count + reg_ax=IPXBUFFERSIZE; // max packet size: something near the + // ethernet packet size + break; + default: LOG_MSG("Unhandled IPX function: %4x", reg_bx); break; } - } // Entrypoint handler @@ -460,7 +520,7 @@ static void pingAck(IPaddress retAddr) { SDLNet_Write16(0x2, regHeader.dest.socket); SDLNet_Write32(0, regHeader.src.network); - memcpy(regHeader.src.addr.byNode.node, localIpxAddr.netnode, sizeof(localIpxAddr)); + memcpy(regHeader.src.addr.byNode.node, localIpxAddr.netnode, sizeof(regHeader.src.addr.byNode.node)); SDLNet_Write16(0x2, regHeader.src.socket); regHeader.transControl = 0; regHeader.pType = 0x0; @@ -487,7 +547,7 @@ static void pingSend(void) { SDLNet_Write16(0x2, regHeader.dest.socket); SDLNet_Write32(0, regHeader.src.network); - memcpy(regHeader.src.addr.byNode.node, localIpxAddr.netnode, sizeof(localIpxAddr)); + memcpy(regHeader.src.addr.byNode.node, localIpxAddr.netnode, sizeof(regHeader.src.addr.byNode.node)); SDLNet_Write16(0x2, regHeader.src.socket); regHeader.transControl = 0; regHeader.pType = 0x0; @@ -506,19 +566,16 @@ static void pingSend(void) { static void receivePacket(Bit8u *buffer, Bit16s bufSize) { ECBClass *useECB; ECBClass *nextECB; - fragmentDescriptor tmpFrag; - Bit16u i, fragCount,t; - Bit16s bufoffset; Bit16u *bufword = (Bit16u *)buffer; Bit16u useSocket = swapByte(bufword[8]); - Bit32u hostaddr; IPXHeader * tmpHeader; tmpHeader = (IPXHeader *)buffer; // Check to see if ping packet if(useSocket == 0x2) { // Is this a broadcast? - if((tmpHeader->dest.addr.byIP.host == 0xffffffff) && (tmpHeader->dest.addr.byIP.port == 0xffff)) { + if((tmpHeader->dest.addr.byIP.host == 0xffffffff) && + (tmpHeader->dest.addr.byIP.port == 0xffff)) { // Yes. We should return the ping back to the sender IPaddress tmpAddr; UnpackIP(tmpHeader->src.addr.byIP, &tmpAddr); @@ -531,40 +588,14 @@ static void receivePacket(Bit8u *buffer, Bit16s bufSize) { while(useECB != NULL) { nextECB = useECB->nextECB; - if(useECB->getInUseFlag() == USEFLAG_LISTENING) { - if(useECB->getSocket() == useSocket) { - useECB->setInUseFlag(USEFLAG_AVAILABLE); - fragCount = useECB->getFragCount(); - bufoffset = 0; - for(i=0;igetFragDesc(i,&tmpFrag); - for(t=0;t=bufSize) { - useECB->setCompletionFlag(COMP_SUCCESS); - useECB->setImmAddress(&buffer[22]); // Write in source node - hostaddr = *((Bit32u *)&buffer[24]); -#ifdef IPX_DEBUGMSG - LOG_MSG("IPX: Received packet of %d bytes from %d.%d.%d.%d (%x CRC)", bufSize, CONVIP(hostaddr), packetCRC(&buffer[30], bufSize-30)); -#endif - useECB->NotifyESR(); - return; - } - } - } - if(bufoffset < bufSize) { - useECB->setCompletionFlag(COMP_MALFORMED); - useECB->NotifyESR(); - return; - } - } + if(useECB->iuflag == USEFLAG_LISTENING && useECB->mysocket == useSocket) { + useECB->writeDataBuffer(buffer, bufSize); + useECB->NotifyESR(); + return; } useECB = nextECB; } -#ifdef IPX_DEBUGMSG - LOG_MSG("IPX: RX Packet loss!"); -#endif + LOG_IPX("IPX: RX Packet loss!"); } static void IPX_ClientLoop(void) { @@ -608,15 +639,23 @@ static void sendPacket(ECBClass* sendecb) { // Must put source address into header Bit8u * addrptr; + // source netnum addrptr = (Bit8u *)&localIpxAddr.netnum; for(Bit16u m=0;m<4;m++) { real_writeb(tmpFrag.segment,tmpFrag.offset+m+18,addrptr[m]); } + // source node number addrptr = (Bit8u *)&localIpxAddr.netnode; for(Bit16u m=0;m<6;m++) { real_writeb(tmpFrag.segment,tmpFrag.offset+m+22,addrptr[m]); } + // Source socket + real_writew(tmpFrag.segment,tmpFrag.offset+28, swapByte(sendecb->getSocket())); + + // blank checksum + real_writew(tmpFrag.segment,tmpFrag.offset, 0xffff); } + for(t=0;tgetSocket()); + //wordptr[14] = swapByte(sendecb->getSocket()); + + sendecb->getFragDesc(0,&tmpFrag); + real_writew(tmpFrag.segment,tmpFrag.offset+2, swapByte(packetsize)); + Bit8u immedAddr[6]; sendecb->getImmAddress(immedAddr); @@ -657,7 +700,7 @@ static void sendPacket(ECBClass* sendecb) { if(addrptr[m]!=outbuffer[m+0xa])isloopback=false; if(immedAddr[m]!=0xff) islocalbroadcast=false; } - + LOG_IPX("SEND crc:%2x",packetCRC(&outbuffer[0], packetsize)); if(!isloopback) { outPacket.channel = UDPChannel; outPacket.data = (Uint8 *)&outbuffer[0]; @@ -674,16 +717,15 @@ static void sendPacket(ECBClass* sendecb) { return; } else { sendecb->setCompletionFlag(COMP_SUCCESS); -#ifdef IPX_DEBUGMSG - LOG_MSG("Packet sent: size: %d",packetsize); -#endif + LOG_IPX("Packet sent: size: %d",packetsize); } } + else sendecb->setCompletionFlag(COMP_SUCCESS); + if(isloopback||islocalbroadcast) { + // Send packet back to ourselves. receivePacket(&outbuffer[0],packetsize); -#ifdef IPX_DEBUGMSG - LOG_MSG("Packet back: loopback:%d, broadcast:%d",isloopback,isbroadcast); -#endif + LOG_IPX("Packet back: loopback:%d, broadcast:%d",isloopback,islocalbroadcast); } sendecb->NotifyESR(); } @@ -710,14 +752,13 @@ bool ConnectToServer(char *strAddr) { int numsent; UDPpacket regPacket; IPXHeader regHeader; + if(!SDLNet_ResolveHost(&ipxServConnIp, strAddr, (Bit16u)udpPort)) { - if(!SDLNet_ResolveHost(&ipxServConnIp, strAddr, (Bit16u)tcpPort)) { // Generate the MAC address. This is made by zeroing out the first two // octets and then using the actual IP address for the last 4 octets. // This idea is from the IPX over IP implementation as specified in RFC 1234: // http://www.faqs.org/rfcs/rfc1234.html - // Select an anonymous UDP port ipxClientSocket = SDLNet_UDP_Open(0); if(ipxClientSocket) { @@ -743,7 +784,8 @@ bool ConnectToServer(char *strAddr) { regPacket.len = sizeof(regHeader); regPacket.maxlen = sizeof(regHeader); regPacket.channel = UDPChannel; - // Send registration string to server. If server doesn't get this, client will not be registered + // Send registration string to server. If server doesn't get + // this, client will not be registered numsent = SDLNet_UDP_Send(ipxClientSocket, regPacket.channel, ®Packet); if(!numsent) { @@ -751,7 +793,8 @@ bool ConnectToServer(char *strAddr) { SDLNet_UDP_Close(ipxClientSocket); return false; } else { - // Wait for return packet from server. This will contain our IPX address and port num + // Wait for return packet from server. + // This will contain our IPX address and port num Bits result; Bit32u ticks, elapsed; ticks = GetTicks(); @@ -898,11 +941,11 @@ public: } bool startsuccess; if(!cmd->FindCommand(2, temp_line)) { - tcpPort = 213; + udpPort = 213; } else { - tcpPort = strtol(temp_line.c_str(), NULL, 10); + udpPort = strtol(temp_line.c_str(), NULL, 10); } - startsuccess = IPX_StartServer((Bit16u)tcpPort); + startsuccess = IPX_StartServer((Bit16u)udpPort); if(startsuccess) { WriteOut("IPX Tunneling Server started\n"); isIpxServer = true; @@ -923,7 +966,6 @@ public: DisconnectFromServer(false); IPX_StopServer(); WriteOut("IPX Tunneling Server stopped."); - // Don't know how to stop the timer just yet. } return; } @@ -940,9 +982,9 @@ public: strcpy(strHost, temp_line.c_str()); if(!cmd->FindCommand(3, temp_line)) { - tcpPort = 213; + udpPort = 213; } else { - tcpPort = strtol(temp_line.c_str(), NULL, 10); + udpPort = strtol(temp_line.c_str(), NULL, 10); } if(ConnectToServer(strHost)) { @@ -959,7 +1001,6 @@ public: return; } // TODO: Send a packet to the server notifying of disconnect - WriteOut("IPX Tunneling Client disconnected from server.\n"); DisconnectFromServer(false); return; @@ -971,7 +1012,7 @@ public: if(isIpxServer) WriteOut("ACTIVE\n"); else WriteOut("INACTIVE\n"); WriteOut("Client status: "); if(incomingPacket.connected) { - WriteOut("CONNECTED -- Server at %d.%d.%d.%d port %d\n", CONVIP(ipxServConnIp.host), tcpPort); + WriteOut("CONNECTED -- Server at %d.%d.%d.%d port %d\n", CONVIP(ipxServConnIp.host), udpPort); } else { WriteOut("DISCONNECTED\n"); } @@ -1017,30 +1058,25 @@ static void IPXNET_ProgramStart(Program * * make) { *make=new IPXNET; } -Bitu IPX_ESRHandler1(void) { -#ifdef IPX_DEBUGMSG - LOG_MSG("ESRhandler entered" ); -#endif +Bitu IPX_ESRHandler(void) { + LOG_IPX("ESR: >>>>>>>>>>>>>>>" ); while(ESRList!=NULL) { -#ifdef IPX_DEBUGMSG - LOG_MSG("ECB: SN%7d notified.", ESRList->SerialNumber); -#endif - - // setup registers - SegSet16(es, RealSeg(ESRList->ECBAddr)); - reg_si = RealOff(ESRList->ECBAddr); - reg_al = 0xff; - CALLBACK_RunRealFar(RealSeg(ESRList->getESRAddr()), RealOff(ESRList->getESRAddr())); + // LOG_IPX("ECB: SN%7d notified.", ESRList->SerialNumber); + if(ESRList->databuffer) ESRList->writeData(); + if(ESRList->getESRAddr()) { + // setup registers + SegSet16(es, RealSeg(ESRList->ECBAddr)); + reg_si = RealOff(ESRList->ECBAddr); + reg_al = 0xff; + CALLBACK_RunRealFar(RealSeg(ESRList->getESRAddr()), + RealOff(ESRList->getESRAddr())); + } delete ESRList; } // while IO_WriteB(0xa0,0x63); //EOI11 IO_WriteB(0x20,0x62); //EOI2 - -#ifdef IPX_DEBUGMSG - LOG_MSG("ESR loop done."); -#endif - + LOG_IPX("ESR: <<<<<<<<<<<<<<<"); return CBRET_NONE; } @@ -1079,17 +1115,15 @@ public: callback_ipxint.Install(&IPX_IntHandler,CB_IRET,"IPX (int 7a)"); callback_ipxint.Set_RealVec(0x7a); - callback_esr.Allocate(&IPX_ESRHandler1,"IPX_ESR"); + callback_esr.Allocate(&IPX_ESRHandler,"IPX_ESR"); Bit16u call_ipxesr1 = callback_esr.Get_callback(); if(!dospage) dospage = DOS_GetMemory(2); // can not be freed yet PhysPt phyDospage = PhysMake(dospage,0); -#ifdef IPX_DEBUGMSG - LOG_MSG("IPX INT address: %x", ipx_intcallback); - LOG_MSG("ESR callback address: %x, HandlerID %d", phyDospage,call_ipxesr1); -#endif + LOG_IPX("ESR callback address: %x, HandlerID %d", phyDospage,call_ipxesr1); + //save registers phys_writeb(phyDospage+0,(Bit8u)0xFA); // CLI phys_writeb(phyDospage+1,(Bit8u)0x60); // PUSHA @@ -1127,6 +1161,7 @@ public: ~IPX() { Section_prop * section = static_cast(m_configuration); + PIC_RemoveEvents(IPX_AES_EventHandler); if(!section->Get_bool("ipx")) return; if(isIpxServer) { diff --git a/src/hardware/ipxserver.cpp b/src/hardware/ipxserver.cpp index 7a002d9..e35b619 100644 --- a/src/hardware/ipxserver.cpp +++ b/src/hardware/ipxserver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: ipxserver.cpp,v 1.7 2006/02/09 11:47:49 qbix79 Exp $ */ +/* $Id: ipxserver.cpp,v 1.9 2007/01/08 19:45:40 qbix79 Exp $ */ #include "dosbox.h" @@ -135,7 +135,7 @@ static void ackClient(IPaddress clientAddr) { PackIP(clientAddr, ®Header.dest.addr.byIP); SDLNet_Write16(0x2, regHeader.dest.socket); - SDLNet_Write32(0, regHeader.src.network); + SDLNet_Write32(1, regHeader.src.network); PackIP(ipxServerIp, ®Header.src.addr.byIP); SDLNet_Write16(0x2, regHeader.src.socket); regHeader.transControl = 0; diff --git a/src/hardware/joystick.cpp b/src/hardware/joystick.cpp index 7be693c..a4d49be 100644 --- a/src/hardware/joystick.cpp +++ b/src/hardware/joystick.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: joystick.cpp,v 1.14 2006/02/09 11:47:49 qbix79 Exp $ */ +/* $Id: joystick.cpp,v 1.18 2007/02/22 08:44:07 qbix79 Exp $ */ #include #include "dosbox.h" @@ -29,9 +29,14 @@ #define RANGE 64 #define TIMEOUT 10 +#define OHMS 120000/2 +#define JOY_S_CONSTANT 0.0000242 +#define S_PER_OHM 0.000000011 + struct JoyStick { bool enabled; float xpos,ypos; + double xtick,ytick; Bitu xcount,ycount; bool button[2]; }; @@ -41,6 +46,10 @@ static JoyStick stick[2]; static Bit32u last_write = 0; static bool write_active = false; +static bool swap34 = false; +bool button_wrapping_enabled = true; + +extern bool autofire; //sdl_mapper.cpp static Bitu read_p201(Bitu port,Bitu iolen) { /* Reset Joystick to 0 after TIMEOUT ms */ @@ -78,6 +87,29 @@ static Bitu read_p201(Bitu port,Bitu iolen) { return ret; } +static Bitu read_p201_timed(Bitu port,Bitu iolen) { + Bit8u ret=0xff; + double currentTick = PIC_FullIndex(); + if( stick[0].enabled ){ + if( stick[0].xtick < currentTick ) ret &=~1; + if( stick[0].ytick < currentTick ) ret &=~2; + } + if( stick[1].enabled ){ + if( stick[1].xtick < currentTick ) ret &=~4; + if( stick[1].ytick < currentTick ) ret &=~8; + } + + if (stick[0].enabled) { + if (stick[0].button[0]) ret&=~16; + if (stick[0].button[1]) ret&=~32; + } + if (stick[1].enabled) { + if (stick[1].button[0]) ret&=~64; + if (stick[1].button[1]) ret&=~128; + } + return ret; +} + static void write_p201(Bitu port,Bitu val,Bitu iolen) { /* Store writetime index */ write_active = true; @@ -87,11 +119,30 @@ static void write_p201(Bitu port,Bitu val,Bitu iolen) { stick[0].ycount=(Bitu)((stick[0].ypos*RANGE)+RANGE); } if (stick[1].enabled) { - stick[1].xcount=(Bitu)((stick[1].xpos*RANGE)+RANGE); - stick[1].ycount=(Bitu)((stick[1].ypos*RANGE)+RANGE); + stick[1].xcount=(Bitu)(((swap34? stick[1].ypos : stick[1].xpos)*RANGE)+RANGE); + stick[1].ycount=(Bitu)(((swap34? stick[1].xpos : stick[1].ypos)*RANGE)+RANGE); } } +static void write_p201_timed(Bitu port,Bitu val,Bitu iolen) { + // Store writetime index + // Axes take time = 24.2 microseconds + ( 0.011 microsecons/ohm * resistance ) + // to reset to 0 + // Precalculate the time at which each axis hits 0 here + double currentTick = PIC_FullIndex(); + if (stick[0].enabled) { + stick[0].xtick = currentTick + 1000.0*( JOY_S_CONSTANT + S_PER_OHM * + (double)(((stick[0].xpos+1.0)* OHMS)) ); + stick[0].ytick = currentTick + 1000.0*( JOY_S_CONSTANT + S_PER_OHM * + (double)(((stick[0].ypos+1.0)* OHMS)) ); + } + if (stick[1].enabled) { + stick[1].xtick = currentTick + 1000.0*( JOY_S_CONSTANT + S_PER_OHM * + (double)((swap34? stick[1].ypos : stick[1].xpos)+1.0) * OHMS); + stick[1].ytick = currentTick + 1000.0*( JOY_S_CONSTANT + S_PER_OHM * + (double)((swap34? stick[1].xpos : stick[1].ypos)+1.0) * OHMS); + } +} void JOYSTICK_Enable(Bitu which,bool enabled) { if (which<2) stick[which].enabled=enabled; @@ -145,16 +196,30 @@ public: JOYSTICK(Section* configuration):Module_base(configuration){ Section_prop * section=static_cast(configuration); const char * type=section->Get_string("joysticktype"); - if (!strcasecmp(type,"none")) joytype=JOY_NONE; - else if (!strcasecmp(type,"2axis")) joytype=JOY_2AXIS; - else if (!strcasecmp(type,"4axis")) joytype=JOY_4AXIS; - else if (!strcasecmp(type,"fcs")) joytype=JOY_FCS; - else if (!strcasecmp(type,"ch")) joytype=JOY_CH; - else joytype=JOY_2AXIS; - ReadHandler.Install(0x201,read_p201,IO_MB); - WriteHandler.Install(0x201,write_p201,IO_MB); - stick[0].enabled=false; - stick[1].enabled=false; + if (!strcasecmp(type,"none")) joytype = JOY_NONE; + else if (!strcasecmp(type,"false")) joytype = JOY_NONE; + else if (!strcasecmp(type,"auto")) joytype = JOY_AUTO; + else if (!strcasecmp(type,"2axis")) joytype = JOY_2AXIS; + else if (!strcasecmp(type,"4axis")) joytype = JOY_4AXIS; + else if (!strcasecmp(type,"fcs")) joytype = JOY_FCS; + else if (!strcasecmp(type,"ch")) joytype = JOY_CH; + else joytype = JOY_AUTO; + + bool timed = section->Get_bool("timed"); + if(timed) { + ReadHandler.Install(0x201,read_p201_timed,IO_MB); + WriteHandler.Install(0x201,write_p201_timed,IO_MB); + } else { + ReadHandler.Install(0x201,read_p201,IO_MB); + WriteHandler.Install(0x201,write_p201,IO_MB); + } + autofire = section->Get_bool("autofire"); + swap34 = section->Get_bool("swap34"); + button_wrapping_enabled = section->Get_bool("buttonwrap"); + stick[0].enabled = false; + stick[1].enabled = false; + stick[0].xtick = stick[0].ytick = stick[1].xtick = + stick[1].ytick = PIC_FullIndex(); } }; static JOYSTICK* test; diff --git a/src/hardware/keyboard.cpp b/src/hardware/keyboard.cpp index 3ff84c0..5bd1dbb 100644 --- a/src/hardware/keyboard.cpp +++ b/src/hardware/keyboard.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: keyboard.cpp,v 1.35 2006/02/09 11:47:49 qbix79 Exp $ */ +/* $Id: keyboard.cpp,v 1.37 2007/01/21 11:01:54 qbix79 Exp $ */ #include "dosbox.h" #include "keyboard.h" @@ -150,6 +150,7 @@ static void write_p60(Bitu port,Bitu val,Bitu iolen) { return; case CMD_SETOUTPORT: MEM_A20_Enable((val & 2)>0); + keyb.command = CMD_NONE; break; case CMD_SETTYPERATE: { diff --git a/src/hardware/memory.cpp b/src/hardware/memory.cpp index c97ab9c..4dee16b 100644 --- a/src/hardware/memory.cpp +++ b/src/hardware/memory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: memory.cpp,v 1.44 2006/02/09 11:47:49 qbix79 Exp $ */ +/* $Id: memory.cpp,v 1.48 2007/01/14 18:44:01 c2woody Exp $ */ #include "dosbox.h" #include "mem.h" @@ -291,6 +291,10 @@ MemHandle MEM_AllocatePages(Bitu pages,bool sequence) { return ret; } +MemHandle MEM_GetNextFreePage(void) { + return (MemHandle)BestMatch(1); +} + void MEM_ReleasePages(MemHandle handle) { while (handle>0) { MemHandle next=memory.mhandles[handle]; @@ -300,7 +304,7 @@ void MEM_ReleasePages(MemHandle handle) { } bool MEM_ReAllocatePages(MemHandle & handle,Bitu pages,bool sequence) { - if (handle<0) { + if (handle<=0) { if (!pages) return true; handle=MEM_AllocatePages(pages,sequence); return (handle>0); @@ -494,6 +498,13 @@ static Bitu read_p92(Bitu port,Bitu iolen) { return memory.a20.controlport | (memory.a20.enabled ? 0x02 : 0); } +void PreparePCJRCartRom(void) { + /* Setup rom at 0xd0000-0xe0000 */ + for (Bitu ct=0xd0;ct<0xe0;ct++) { + memory.phandlers[ct] = &rom_page_handler; + } +} + HostPt GetMemBase(void) { return MemBase; } class MEMORY:public Module_base{ diff --git a/src/hardware/mixer.cpp b/src/hardware/mixer.cpp index 3934388..926e043 100644 --- a/src/hardware/mixer.cpp +++ b/src/hardware/mixer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: mixer.cpp,v 1.39 2006/03/27 19:41:55 qbix79 Exp $ */ +/* $Id: mixer.cpp,v 1.44 2007/01/08 19:45:40 qbix79 Exp $ */ /* Remove the sdl code from here and have it handeld in the sdlmain. @@ -174,11 +174,13 @@ void MixerChannel::AddSilence(void) { } } -template +template INLINE void MixerChannel::AddSamples(Bitu len,void * data) { Bits diff[2]; Bit8u * data8=(Bit8u*)data; + Bit8s * data8s=(Bit8s*)data; Bit16s * data16=(Bit16s*)data; + Bit16u * data16u=(Bit16u*)data; Bitu mixpos=mixer.pos+done; freq_index&=MIXER_REMAIN; Bitu pos=0;Bitu new_pos; @@ -193,18 +195,36 @@ INLINE void MixerChannel::AddSamples(Bitu len,void * data) { thestart: if (pos>=len) return; if (_8bits) { - if (stereo) { - diff[0]=(((Bit8s)(data8[pos*2+0] ^ 0x80)) << 8)-last[0]; - diff[1]=(((Bit8s)(data8[pos*2+1] ^ 0x80)) << 8)-last[1]; + if (!signeddata) { + if (stereo) { + diff[0]=(((Bit8s)(data8[pos*2+0] ^ 0x80)) << 8)-last[0]; + diff[1]=(((Bit8s)(data8[pos*2+1] ^ 0x80)) << 8)-last[1]; + } else { + diff[0]=(((Bit8s)(data8[pos] ^ 0x80)) << 8)-last[0]; + } } else { - diff[0]=(((Bit8s)(data8[pos] ^ 0x80)) << 8)-last[0]; + if (stereo) { + diff[0]=(data8s[pos*2+0] << 8)-last[0]; + diff[1]=(data8s[pos*2+1] << 8)-last[1]; + } else { + diff[0]=(data8s[pos] << 8)-last[0]; + } } } else { - if (stereo) { - diff[0]=data16[pos*2+0]-last[0]; - diff[1]=data16[pos*2+1]-last[1]; + if (signeddata) { + if (stereo) { + diff[0]=data16[pos*2+0]-last[0]; + diff[1]=data16[pos*2+1]-last[1]; + } else { + diff[0]=data16[pos]-last[0]; + } } else { - diff[0]=data16[pos]-last[0]; + if (stereo) { + diff[0]=(Bits)data16u[pos*2+0]-32768-last[0]; + diff[1]=(Bits)data16u[pos*2+1]-32768-last[1]; + } else { + diff[0]=(Bits)data16u[pos]-32768-last[0]; + } } } } @@ -248,16 +268,28 @@ void MixerChannel::AddStretched(Bitu len,Bit16s * data) { }; void MixerChannel::AddSamples_m8(Bitu len,Bit8u * data) { - AddSamples(len,data); + AddSamples(len,data); } void MixerChannel::AddSamples_s8(Bitu len,Bit8u * data) { - AddSamples(len,data); + AddSamples(len,data); +} +void MixerChannel::AddSamples_m8s(Bitu len,Bit8s * data) { + AddSamples(len,data); +} +void MixerChannel::AddSamples_s8s(Bitu len,Bit8s * data) { + AddSamples(len,data); } void MixerChannel::AddSamples_m16(Bitu len,Bit16s * data) { - AddSamples(len,data); + AddSamples(len,data); } void MixerChannel::AddSamples_s16(Bitu len,Bit16s * data) { - AddSamples(len,data); + AddSamples(len,data); +} +void MixerChannel::AddSamples_m16u(Bitu len,Bit16u * data) { + AddSamples(len,data); +} +void MixerChannel::AddSamples_s16u(Bitu len,Bit16u * data) { + AddSamples(len,data); } void MixerChannel::FillUp(void) { diff --git a/src/hardware/mpu401.cpp b/src/hardware/mpu401.cpp index ab1c5df..b71c3fd 100644 --- a/src/hardware/mpu401.cpp +++ b/src/hardware/mpu401.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: mpu401.cpp,v 1.20 2006/03/19 10:24:59 qbix79 Exp $ */ +/* $Id: mpu401.cpp,v 1.26 2007/02/03 14:11:38 qbix79 Exp $ */ #include #include "dosbox.h" @@ -39,7 +39,9 @@ static void MPU401_EOIHandler(void); #define MPU401_TIMECONSTANT (60000000/1000.0f) enum MpuMode { M_UART,M_INTELLIGENT }; -enum MpuDataType {OVERFLOW,MARK,MIDI_SYS,MIDI_NORM,COMMAND}; +enum MpuDataType {T_OVERFLOW,T_MARK,T_MIDI_SYS,T_MIDI_NORM,T_COMMAND}; + +static void MPU401_WriteData(Bitu port,Bitu val,Bitu iolen); /* Messages sent to MPU-401 from host */ #define MSG_EOX 0xf7 @@ -66,7 +68,7 @@ static struct { MpuDataType type; } playbuf[8],condbuf; struct { - bool conductor,cond_req,cond_set; + bool conductor,cond_req,cond_set, block_ack; bool playing,reset; bool wsd,wsm,wsd_start; bool run_irq,irq_pending; @@ -90,6 +92,7 @@ static struct { static void QueueByte(Bit8u data) { + if (mpu.state.block_ack) {mpu.state.block_ack=false;return;} if (mpu.queue_used==0 && mpu.intelligent) { mpu.state.irq_pending=true; PIC_ActivateIRQ(mpu.irq); @@ -116,7 +119,7 @@ static Bitu MPU401_ReadStatus(Bitu port,Bitu iolen) { static void MPU401_WriteCommand(Bitu port,Bitu val,Bitu iolen) { mpu.state.reset=0; - if (val && val<=0x2f) { + if (val<=0x2f) { switch (val&3) { /* MIDI stop, start, continue */ case 1: {MIDI_RawOutByte(0xfc);break;} case 2: {MIDI_RawOutByte(0xfa);break;} @@ -226,10 +229,10 @@ static void MPU401_WriteCommand(Bitu port,Bitu val,Bitu iolen) { } for (Bitu i=0;i<8;i++) { mpu.playbuf[i].counter=0; - mpu.playbuf[i].type=OVERFLOW; + mpu.playbuf[i].type=T_OVERFLOW; } mpu.condbuf.counter=0; - mpu.condbuf.type=OVERFLOW; + mpu.condbuf.type=T_OVERFLOW; if (!(mpu.state.conductor=mpu.state.cond_set)) mpu.state.cond_req=0; mpu.state.amask=mpu.state.tmask; mpu.state.req_mask=0; @@ -238,6 +241,10 @@ static void MPU401_WriteCommand(Bitu port,Bitu val,Bitu iolen) { case 0xff: /* Reset MPU-401 */ LOG(LOG_MISC,LOG_NORMAL)("MPU-401:Reset %X",val); mpu.state.reset=1; + if (CPU_Cycles > 5) { //It came from the desert wants a fast irq + CPU_CycleLeft += CPU_Cycles; + CPU_Cycles = 5; + } MPU401_Reset(); break; case 0x3f: /* UART mode */ @@ -253,8 +260,8 @@ static void MPU401_WriteCommand(Bitu port,Bitu val,Bitu iolen) { static Bitu MPU401_ReadData(Bitu port,Bitu iolen) { Bit8u ret=MSG_MPU_ACK; if (mpu.queue_used) { - ret=mpu.queue[mpu.queue_pos]; if (mpu.queue_pos>=MPU401_QUEUE) mpu.queue_pos-=MPU401_QUEUE; + ret=mpu.queue[mpu.queue_pos]; mpu.queue_pos++;mpu.queue_used--; } if (!mpu.intelligent) return ret; @@ -269,6 +276,12 @@ static Bitu MPU401_ReadData(Bitu port,Bitu iolen) { if (ret==MSG_MPU_COMMAND_REQ) { mpu.state.data_onoff=0; mpu.state.cond_req=true; + if (mpu.condbuf.type!=T_OVERFLOW) { + mpu.state.block_ack=true; + MPU401_WriteCommand(0x331,mpu.condbuf.value[0],1); + if (mpu.state.command_byte) MPU401_WriteData(0x330,mpu.condbuf.value[1],1); + } + mpu.condbuf.type=T_OVERFLOW; } if (ret==MSG_MPU_END || ret==MSG_MPU_CLOCK || ret==MSG_MPU_ACK) { mpu.state.data_onoff=-1; @@ -288,7 +301,8 @@ static void MPU401_WriteData(Bitu port,Bitu val,Bitu iolen) { return; case 0xe1: /* Set relative tempo */ mpu.state.command_byte=0; - LOG(LOG_MISC,LOG_ERROR)("MPU-401:Relative tempo not implemented"); + if (val!=0x40) //default value + LOG(LOG_MISC,LOG_ERROR)("MPU-401:Relative tempo change not implemented"); return; case 0xe7: /* Set internal clock to host interval */ mpu.state.command_byte=0; @@ -385,8 +399,8 @@ static void MPU401_WriteData(Bitu port,Bitu val,Bitu iolen) { mpu.condbuf.counter=val; break; case 1: /* Command byte #1 */ - mpu.condbuf.type=COMMAND; - if (val==0xf8 || val==0xf9) mpu.condbuf.type=OVERFLOW; + mpu.condbuf.type=T_COMMAND; + if (val==0xf8 || val==0xf9) mpu.condbuf.type=T_OVERFLOW; mpu.condbuf.value[mpu.condbuf.vlength]=val; mpu.condbuf.vlength++; if ((val&0xf0)!=0xe0) MPU401_EOIHandler(); @@ -421,28 +435,28 @@ static void MPU401_WriteData(Bitu port,Bitu val,Bitu iolen) { switch (val&0xf0) { case 0xf0: /* System message or mark */ if (val>0xf7) { - mpu.playbuf[mpu.state.channel].type=MARK; + mpu.playbuf[mpu.state.channel].type=T_MARK; mpu.playbuf[mpu.state.channel].sys_val=val; length=1; } else { LOG(LOG_MISC,LOG_ERROR)("MPU-401:Illegal message"); - mpu.playbuf[mpu.state.channel].type=MIDI_SYS; + mpu.playbuf[mpu.state.channel].type=T_MIDI_SYS; mpu.playbuf[mpu.state.channel].sys_val=val; length=1; } break; case 0xc0: case 0xd0: /* MIDI Message */ - mpu.playbuf[mpu.state.channel].type=MIDI_NORM; + mpu.playbuf[mpu.state.channel].type=T_MIDI_NORM; length=mpu.playbuf[mpu.state.channel].length=2; break; case 0x80: case 0x90: case 0xa0: case 0xb0: case 0xe0: - mpu.playbuf[mpu.state.channel].type=MIDI_NORM; + mpu.playbuf[mpu.state.channel].type=T_MIDI_NORM; length=mpu.playbuf[mpu.state.channel].length=3; break; default: /* MIDI data with running status */ posd++; mpu.playbuf[mpu.state.channel].vlength++; - mpu.playbuf[mpu.state.channel].type=MIDI_NORM; + mpu.playbuf[mpu.state.channel].type=T_MIDI_NORM; length=mpu.playbuf[mpu.state.channel].length; break; } @@ -455,9 +469,9 @@ static void MPU401_WriteData(Bitu port,Bitu val,Bitu iolen) { static void MPU401_IntelligentOut(Bit8u chan) { Bitu val; switch (mpu.playbuf[chan].type) { - case OVERFLOW: + case T_OVERFLOW: break; - case MARK: + case T_MARK: val=mpu.playbuf[chan].sys_val; if (val==0xfc) { MIDI_RawOutByte(val); @@ -465,7 +479,7 @@ static void MPU401_IntelligentOut(Bit8u chan) { mpu.state.req_mask&=~(1< #include "dosbox.h" diff --git a/src/hardware/pic.cpp b/src/hardware/pic.cpp index 3adebb7..04d8275 100644 --- a/src/hardware/pic.cpp +++ b/src/hardware/pic.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: pic.cpp,v 1.34 2006/03/12 21:14:45 qbix79 Exp $ */ +/* $Id: pic.cpp,v 1.39 2007/01/18 14:57:59 c2woody Exp $ */ #include @@ -282,6 +282,7 @@ static inline bool PIC_startIRQ(Bitu i) { void PIC_runIRQs(void) { if (!GETFLAG(IF)) return; if (!PIC_IRQCheck) return; + if (cpudecoder==CPU_Core_Normal_Trap_Run) return; static Bitu IRQ_priority_order[16] = { 0,1,2,8,9,10,11,12,13,14,15,3,4,5,6,7 }; @@ -393,6 +394,30 @@ void PIC_AddEvent(PIC_EventHandler handler,float delay,Bitu val) { AddEntry(entry); } +void PIC_RemoveSpecificEvents(PIC_EventHandler handler, Bitu val) { + PICEntry * entry=pic.next_entry; + PICEntry * prev_entry; + prev_entry = 0; + while (entry) { + if ((entry->event == handler) && (entry->value == val)) { + if (prev_entry) { + prev_entry->next=entry->next; + entry->next=pic.free_entry; + pic.free_entry=entry; + entry=prev_entry->next; + continue; + } else { + pic.next_entry=entry->next; + entry->next=pic.free_entry; + pic.free_entry=entry; + entry=pic.next_entry; + continue; + } + } + prev_entry=entry; + entry=entry->next; + } +} void PIC_RemoveEvents(PIC_EventHandler handler) { PICEntry * entry=pic.next_entry; @@ -428,8 +453,8 @@ bool PIC_RunQueue(void) { return false; } /* Check the queue for an entry */ - double index=PIC_TickIndex(); - while (pic.next_entry && pic.next_entry->index<=index) { + Bits index_nd=PIC_TickIndexND(); + while (pic.next_entry && (pic.next_entry->index*CPU_CycleMax<=index_nd)) { PICEntry * entry=pic.next_entry; pic.next_entry=entry->next; (entry->event)(entry->value); @@ -439,7 +464,7 @@ bool PIC_RunQueue(void) { } /* Check when to set the new cycle end */ if (pic.next_entry) { - Bits cycles=PIC_MakeCycles(pic.next_entry->index-index); + Bits cycles=(Bits)(pic.next_entry->index*CPU_CycleMax-index_nd); if (!cycles) cycles=1; if (cycles +#include #include #include #include "dosbox.h" @@ -29,6 +31,7 @@ #include "setup.h" #include "support.h" #include "shell.h" +using namespace std; void MIDI_RawOutByte(Bit8u data); bool MIDI_Available(void); @@ -141,8 +144,8 @@ struct SB_INFO { } adpcm; struct { Bitu base; - Bit8u irq; - Bit8u dma8,dma16; + Bitu irq; + Bitu dma8,dma16; } hw; struct { Bits value; @@ -158,7 +161,8 @@ static SB_INFO sb; static char * copyright_string="COPYRIGHT (C) CREATIVE TECHNOLOGY LTD, 1992."; static Bit8u DSP_cmd_len[256] = { - 0,0,0,0, 0,2,0,0, 0,0,0,0, 0,0,0,0, // 0x00 +// 0,0,0,0, 1,2,0,0, 0,0,0,0, 0,0,2,1, // 0x00 for SB16. but breaks sbpro + 0,0,0,0, 0,2,0,0, 0,0,0,0, 0,0,2,1, // 0x00 1,0,0,0, 2,0,2,2, 0,0,0,0, 0,0,0,0, // 0x10 0,0,0,0, 2,0,0,0, 0,0,0,0, 0,0,0,0, // 0x20 0,0,0,0, 0,0,0,0, 1,0,0,0, 0,0,0,0, // 0x30 @@ -404,36 +408,41 @@ static void GenerateDMASound(Bitu size) { if (sb.dma.stereo) { read=sb.dma.chan->Read(size,&sb.dma.buf.b8[sb.dma.remain_size]); Bitu total=read+sb.dma.remain_size; - sb.chan->AddSamples_s8(total>>1,sb.dma.buf.b8); + if (!sb.dma.sign) sb.chan->AddSamples_s8(total>>1,sb.dma.buf.b8); + else sb.chan->AddSamples_s8s(total>>1,(Bit8s*)sb.dma.buf.b8); if (total&1) { sb.dma.remain_size=1; sb.dma.buf.b8[0]=sb.dma.buf.b8[total-1]; } else sb.dma.remain_size=0; } else { read=sb.dma.chan->Read(size,sb.dma.buf.b8); - sb.chan->AddSamples_m8(read,sb.dma.buf.b8); + if (!sb.dma.sign) sb.chan->AddSamples_m8(read,sb.dma.buf.b8); + else sb.chan->AddSamples_m8s(read,(Bit8s *)sb.dma.buf.b8); } break; case DSP_DMA_16: + case DSP_DMA_16_ALIASED: if (sb.dma.stereo) { - read=sb.dma.chan->Read(size,(Bit8u *)&sb.dma.buf.b16[sb.dma.remain_size]); + /* In DSP_DMA_16_ALIASED mode temporarily divide by 2 to get number of 16-bit + samples, because 8-bit DMA Read returns byte size, while in DSP_DMA_16 mode + 16-bit DMA Read returns word size */ + read=sb.dma.chan->Read(size,(Bit8u *)&sb.dma.buf.b16[sb.dma.remain_size]) + >> (sb.dma.mode==DSP_DMA_16_ALIASED ? 1:0); Bitu total=read+sb.dma.remain_size; - sb.chan->AddSamples_s16(total>>1,sb.dma.buf.b16); + if (sb.dma.sign) sb.chan->AddSamples_s16(total>>1,sb.dma.buf.b16); + else sb.chan->AddSamples_s16u(total>>1,(Bit16u *)sb.dma.buf.b16); if (total&1) { sb.dma.remain_size=1; sb.dma.buf.b16[0]=sb.dma.buf.b16[total-1]; } else sb.dma.remain_size=0; } else { - read=sb.dma.chan->Read(size,sb.dma.buf.b8); - sb.chan->AddSamples_m16(read,sb.dma.buf.b16); - } - break; - case DSP_DMA_16_ALIASED: - if (sb.dma.stereo) { - sb.chan->AddSamples_s16(read>>2,sb.dma.buf.b16); - } else { - sb.chan->AddSamples_m16(read>>1,sb.dma.buf.b16); + read=sb.dma.chan->Read(size,(Bit8u *)sb.dma.buf.b16) + >> (sb.dma.mode==DSP_DMA_16_ALIASED ? 1:0); + if (sb.dma.sign) sb.chan->AddSamples_m16(read,sb.dma.buf.b16); + else sb.chan->AddSamples_m16u(read,(Bit16u *)sb.dma.buf.b16); } + //restore buffer length value to byte size in aliased mode + if (sb.dma.mode==DSP_DMA_16_ALIASED) read=read<<1; break; default: LOG_MSG("Unhandled dma mode %d",sb.dma.mode); @@ -588,14 +597,24 @@ static void DSP_PrepareDMA_Old(DMA_MODES mode,bool autoinit) { static void DSP_PrepareDMA_New(DMA_MODES mode,Bitu length,bool autoinit,bool stereo) { Bitu freq=sb.freq; + //equal length if data format and dma channel are both 16-bit or 8-bit sb.dma.total=length; sb.dma.autoinit=autoinit; if (mode==DSP_DMA_16) { - if (sb.hw.dma16!=0xff) sb.dma.chan=GetDMAChannel(sb.hw.dma16); - else { + if (sb.hw.dma16!=0xff) { + sb.dma.chan=GetDMAChannel(sb.hw.dma16); + if (sb.dma.chan==NULL) { + sb.dma.chan=GetDMAChannel(sb.hw.dma8); + mode=DSP_DMA_16_ALIASED; + sb.dma.total<<=1; + } + } else { sb.dma.chan=GetDMAChannel(sb.hw.dma8); mode=DSP_DMA_16_ALIASED; - freq/=2; + //UNDOCUMENTED: + //In aliased mode sample length is written to DSP as number of + //16-bit samples so we need double 8-bit DMA buffer length + sb.dma.total<<=1; } } else sb.dma.chan=GetDMAChannel(sb.hw.dma8); DSP_DoDMATransfer(mode,freq,stereo); @@ -624,6 +643,7 @@ static void DSP_Reset(void) { sb.dma.left=0; sb.dma.total=0; sb.dma.stereo=false; + sb.dma.sign=false; sb.dma.autoinit=false; sb.dma.mode=DSP_DMA_NONE; sb.dma.remain_size=0; @@ -666,7 +686,7 @@ static void DSP_ADC_CallBack(DmaChannel * chan, DMAEvent event) { if (event!=DMA_UNMASKED) return; Bit8u val=128; DmaChannel * ch=GetDMAChannel(sb.hw.dma8); - while (sb.dma.left--) { + while (sb.dma.left--) { ch->Write(1,&val); } SB_RaiseIRQ(SB_IRQ_8); @@ -681,7 +701,7 @@ Bitu DEBUG_EnableDebugger(void); static void DSP_DoCommand(void) { // LOG_MSG("DSP Command %X",sb.dsp.cmd); switch (sb.dsp.cmd) { - case 0x04: /* DSP Status SB 2.0/pro version */ + case 0x04: /* DSP Status SB 2.0/pro version. NOT SB16. */ DSP_FlushData(); DSP_AddData(0xff); //Everthing enabled break; @@ -863,6 +883,12 @@ static void DSP_DoCommand(void) { case 0xa0: case 0xa8: /* Documented only for DSP 3.x */ LOG(LOG_SB,LOG_ERROR)("DSP:Unimplemented input command %2X",sb.dsp.cmd); break; + case 0x0f: /* SB16 ASP get register */ + DSP_AddData(0xff); //Fall through + case 0x0e: /* SB16 ASP Command ? */ + case 0x05: /* SB16 ASP set register */ + LOG(LOG_SB,LOG_NORMAL)("DSP Unhandled SB16ASP command %X",sb.dsp.cmd); + break; default: LOG(LOG_SB,LOG_ERROR)("DSP:Unhandled (undocumented) command %2X",sb.dsp.cmd); break; @@ -904,10 +930,13 @@ static Bit8u DSP_ReadData(void) { static void CTMIXER_UpdateVolumes(void) { if (!sb.mixer.enabled) return; MixerChannel * chan; + //adjust to get linear master volume slider in trackers chan=MIXER_FindChannel("SB"); - if (chan) chan->SetVolume(CALCVOL(sb.mixer.dac[0]),CALCVOL(sb.mixer.dac[1])); + if (chan) chan->SetVolume(float(sb.mixer.master[0])/31.0f*CALCVOL(sb.mixer.dac[0]), + float(sb.mixer.master[1])/31.0f*CALCVOL(sb.mixer.dac[1])); chan=MIXER_FindChannel("FM"); - if (chan) chan->SetVolume(CALCVOL(sb.mixer.fm[0]),CALCVOL(sb.mixer.fm[1])); + if (chan) chan->SetVolume(float(sb.mixer.master[0])/31.0f*CALCVOL(sb.mixer.fm[0]), + float(sb.mixer.master[1])/31.0f*CALCVOL(sb.mixer.fm[1])); } static void CTMIXER_Reset(void) { @@ -915,12 +944,32 @@ static void CTMIXER_Reset(void) { sb.mixer.fm[1]= sb.mixer.dac[0]= sb.mixer.dac[1]=31; + sb.mixer.master[0]= + sb.mixer.master[1]=31; CTMIXER_UpdateVolumes(); } -#define SETPROVOL(_WHICH_,_VAL_) \ - _WHICH_[0]= 0x1 | ((_VAL_ & 0xf0) >> 3); \ - _WHICH_[1]= 0x1 | ((_VAL_ & 0x0f) << 1); +#define SETPROVOL(_WHICH_,_VAL_) \ + _WHICH_[0]= ((((_VAL_) & 0xf0) >> 3)|(sb.type==SBT_16 ? 1:3)); \ + _WHICH_[1]= ((((_VAL_) & 0x0f) << 1)|(sb.type==SBT_16 ? 1:3)); \ + +#define MAKEPROVOL(_WHICH_) \ + ((((_WHICH_[0] & 0x1e) << 3) | ((_WHICH_[1] & 0x1e) >> 1)) & (sb.type==SBT_16 ? 0xff:0xee)) + +static void DSP_ChangeStereo(bool stereo) { + if (!sb.dma.stereo && stereo) { + sb.chan->SetFreq(sb.freq/2); + sb.dma.mul*=2; + sb.dma.rate=(sb.freq*sb.dma.mul) >> SB_SH; + sb.dma.min=(sb.dma.rate*3)/1000; + } else if (sb.dma.stereo && !stereo) { + sb.chan->SetFreq(sb.freq); + sb.dma.mul/=2; + sb.dma.rate=(sb.freq*sb.dma.mul) >> SB_SH; + sb.dma.min=(sb.dma.rate*3)/1000; + } + sb.dma.stereo=stereo; +} static void CTMIXER_Write(Bit8u val) { switch (sb.mixer.index) { @@ -928,40 +977,101 @@ static void CTMIXER_Write(Bit8u val) { CTMIXER_Reset(); LOG(LOG_SB,LOG_WARN)("Mixer reset value %x",val); break; - case 0x02: /* Master Voulme (SBPRO) Obsolete? */ - case 0x22: /* Master Volume (SBPRO) */ - SETPROVOL(sb.mixer.master,val); + case 0x02: /* Master Volume (SB2 Only) */ + SETPROVOL(sb.mixer.master,(val&0xf)|(val<<4)); + CTMIXER_UpdateVolumes(); break; case 0x04: /* DAC Volume (SBPRO) */ SETPROVOL(sb.mixer.dac,val); CTMIXER_UpdateVolumes(); break; - case 0x06: /* FM output selection, Somewhat obsolete with dual OPL SBpro */ - //SETPROVOL(sb.mixer.fm,val); + case 0x06: /* FM output selection, Somewhat obsolete with dual OPL SBpro + FM volume (SB2 Only) */ //volume controls both channels - sb.mixer.fm[0]=sb.mixer.fm[1] = 0x1| ((val&0x0f)<<1); + SETPROVOL(sb.mixer.fm,(val&0xf)|(val<<4)); CTMIXER_UpdateVolumes(); if(val&0x60) LOG(LOG_SB,LOG_WARN)("Turned FM one channel off. not implemented %X",val); //TODO Change FM Mode if only 1 fm channel is selected break; - case 0x0a: /* Mic Level */ - sb.mixer.mic=(val & 0xf) << 1; + case 0x08: /* CDA Volume (SB2 Only) */ + SETPROVOL(sb.mixer.cda,(val&0xf)|(val<<4)); + break; + case 0x0a: /* Mic Level (SBPRO) or DAC Volume (SB2): 2-bit, 3-bit on SB16 */ + if (sb.type==SBT_2) sb.mixer.dac[0]=sb.mixer.dac[1]=((val & 0x6) << 2)|3; + else sb.mixer.mic=((val & 0x7) << 2)|(sb.type==SBT_16?1:3); break; case 0x0e: /* Output/Stereo Select */ sb.mixer.stereo=(val & 0x2) > 0; sb.mixer.filtered=(val & 0x20) > 0; + DSP_ChangeStereo(sb.mixer.stereo); LOG(LOG_SB,LOG_WARN)("Mixer set to %s",sb.dma.stereo ? "STEREO" : "MONO"); break; + case 0x22: /* Master Volume (SBPRO) */ + SETPROVOL(sb.mixer.master,val); + CTMIXER_UpdateVolumes(); + break; case 0x26: /* FM Volume (SBPRO) */ SETPROVOL(sb.mixer.fm,val); - CTMIXER_UpdateVolumes(); + CTMIXER_UpdateVolumes(); break; case 0x28: /* CD Audio Volume (SBPRO) */ SETPROVOL(sb.mixer.cda,val); break; - case 0x2e: /* Line-IN Volume (SBPRO) */ + case 0x2e: /* Line-in Volume (SBPRO) */ SETPROVOL(sb.mixer.lin,val); break; + //case 0x20: /* Master Volume Left (SBPRO) ? */ + case 0x30: /* Master Volume Left (SB16) */ + if (sb.type==SBT_16) { + sb.mixer.master[0]=val>>3; + CTMIXER_UpdateVolumes(); + } + break; + //case 0x21: /* Master Volume Right (SBPRO) ? */ + case 0x31: /* Master Volume Right (SB16) */ + if (sb.type==SBT_16) { + sb.mixer.master[1]=val>>3; + CTMIXER_UpdateVolumes(); + } + break; + case 0x32: /* DAC Volume Left (SB16) */ + if (sb.type==SBT_16) { + sb.mixer.dac[0]=val>>3; + CTMIXER_UpdateVolumes(); + } + break; + case 0x33: /* DAC Volume Right (SB16) */ + if (sb.type==SBT_16) { + sb.mixer.dac[1]=val>>3; + CTMIXER_UpdateVolumes(); + } + break; + case 0x34: /* FM Volume Left (SB16) */ + if (sb.type==SBT_16) { + sb.mixer.fm[0]=val>>3; + CTMIXER_UpdateVolumes(); + } + break; + case 0x35: /* FM Volume Right (SB16) */ + if (sb.type==SBT_16) { + sb.mixer.fm[1]=val>>3; + CTMIXER_UpdateVolumes(); + } + break; + case 0x36: /* CD Volume Left (SB16) */ + if (sb.type==SBT_16) sb.mixer.cda[0]=val>>3; + break; + case 0x37: /* CD Volume Right (SB16) */ + if (sb.type==SBT_16) sb.mixer.cda[1]=val>>3; + break; + case 0x38: /* Line-in Volume Left (SB16) */ + if (sb.type==SBT_16) sb.mixer.lin[0]=val>>3; + break; + case 0x39: /* Line-in Volume Right (SB16) */ + if (sb.type==SBT_16) sb.mixer.lin[1]=val>>3; + break; + case 0x3a: + if (sb.type==SBT_16) sb.mixer.mic=val>>3; + break; case 0x80: /* IRQ Select */ sb.hw.irq=0xff; if (val & 0x1) sb.hw.irq=2; @@ -981,31 +1091,33 @@ static void CTMIXER_Write(Bit8u val) { LOG(LOG_SB,LOG_NORMAL)("Mixer select dma8:%x dma16:%x",sb.hw.dma8,sb.hw.dma16); break; default: - if ((sb.type == SBT_2 && sb.mixer.index==0x08) || /* CD volume on SB2 */ - ((sb.type == SBT_PRO1 || sb.type == SBT_PRO2) && sb.mixer.index==0x0c) || /* Input control on SBPro */ - (sb.type == SBT_16 && sb.mixer.index >= 0x30 && sb.mixer.index <= 0x47)) /* New SB16 registers */ + + if( ((sb.type == SBT_PRO1 || sb.type == SBT_PRO2) && sb.mixer.index==0x0c) || /* Input control on SBPro */ + (sb.type == SBT_16 && sb.mixer.index >= 0x3b && sb.mixer.index <= 0x47)) /* New SB16 registers */ sb.mixer.unhandled[sb.mixer.index] = val; LOG(LOG_SB,LOG_WARN)("MIXER:Write %X to unhandled index %X",val,sb.mixer.index); } } -#define MAKEPROVOL(_WHICH_) \ - (((_WHICH_[0] & 0x1e) << 3) | ((_WHICH_[1] & 0x1e) >> 1)) - static Bit8u CTMIXER_Read(void) { Bit8u ret; // if ( sb.mixer.index< 0x80) LOG_MSG("Read mixer %x",sb.mixer.index); switch (sb.mixer.index) { case 0x00: /* RESET */ return 0x00; - case 0x02: /* Master Voulme (SBPRO) Obsolete? */ + case 0x02: /* Master Volume (SB2 Only) */ + return ((sb.mixer.master[1]>>1) & 0xe); case 0x22: /* Master Volume (SBPRO) */ return MAKEPROVOL(sb.mixer.master); case 0x04: /* DAC Volume (SBPRO) */ return MAKEPROVOL(sb.mixer.dac); -// case 0x06: /* FM output selection, Somewhat obsolete with dual OPL SBpro */ - case 0x0a: /* Mic Level (SBPRO) */ - return (sb.mixer.mic >> 1); + case 0x06: /* FM Volume (SB2 Only) + FM output selection */ + return ((sb.mixer.fm[1]>>1) & 0xe); + case 0x08: /* CD Volume (SB2 Only) */ + return ((sb.mixer.cda[1]>>1) & 0xe); + case 0x0a: /* Mic Level (SBPRO) or Voice (SB2 Only) */ + if (sb.type==SBT_2) return (sb.mixer.dac[0]>>2); + else return ((sb.mixer.mic >> 2) & (sb.type==SBT_16 ? 7:6)); case 0x0e: /* Output/Stereo Select */ return 0x11|(sb.mixer.stereo ? 0x02 : 0x00)|(sb.mixer.filtered ? 0x20 : 0x00); case 0x26: /* FM Volume (SBPRO) */ @@ -1014,6 +1126,50 @@ static Bit8u CTMIXER_Read(void) { return MAKEPROVOL(sb.mixer.cda); case 0x2e: /* Line-IN Volume (SBPRO) */ return MAKEPROVOL(sb.mixer.lin); + case 0x30: /* Master Volume Left (SB16) */ + if (sb.type==SBT_16) return sb.mixer.master[0]<<3; + ret=0xa; + break; + case 0x31: /* Master Volume Right (S16) */ + if (sb.type==SBT_16) return sb.mixer.master[1]<<3; + ret=0xa; + break; + case 0x32: /* DAC Volume Left (SB16) */ + if (sb.type==SBT_16) return sb.mixer.dac[0]<<3; + ret=0xa; + break; + case 0x33: /* DAC Volume Right (SB16) */ + if (sb.type==SBT_16) return sb.mixer.dac[1]<<3; + ret=0xa; + break; + case 0x34: /* FM Volume Left (SB16) */ + if (sb.type==SBT_16) return sb.mixer.fm[0]<<3; + ret=0xa; + break; + case 0x35: /* FM Volume Right (SB16) */ + if (sb.type==SBT_16) return sb.mixer.fm[1]<<3; + ret=0xa; + break; + case 0x36: /* CD Volume Left (SB16) */ + if (sb.type==SBT_16) return sb.mixer.cda[0]<<3; + ret=0xa; + break; + case 0x37: /* CD Volume Right (SB16) */ + if (sb.type==SBT_16) return sb.mixer.cda[1]<<3; + ret=0xa; + break; + case 0x38: /* Line-in Volume Left (SB16) */ + if (sb.type==SBT_16) return sb.mixer.lin[0]<<3; + ret=0xa; + break; + case 0x39: /* Line-in Volume Right (SB16) */ + if (sb.type==SBT_16) return sb.mixer.lin[1]<<3; + ret=0xa; + break; + case 0x3a: /* Mic Volume (SB16) */ + if (sb.type==SBT_16) return sb.mixer.mic<<3; + ret=0xa; + break; case 0x80: /* IRQ Select */ switch (sb.hw.irq) { case 2: return 0x1; @@ -1034,13 +1190,12 @@ static Bit8u CTMIXER_Read(void) { case 7:ret|=0x80;break; } return ret; - case 0x82: + case 0x82: /* IRQ Status */ return (sb.irq.pending_8bit ? 0x1 : 0) | (sb.irq.pending_16bit ? 0x2 : 0); - default: /* IRQ Status */ - if ((sb.type == SBT_2 && sb.mixer.index==0x08) || /* CD volume on SB2 */ - ((sb.type == SBT_PRO1 || sb.type == SBT_PRO2) && sb.mixer.index==0x0c) || /* Input control on SBPro */ - (sb.type == SBT_16 && sb.mixer.index >= 0x30 && sb.mixer.index <= 0x47)) /* New SB16 registers */ + default: + if ( ((sb.type == SBT_PRO1 || sb.type == SBT_PRO2) && sb.mixer.index==0x0c) || /* Input control on SBPro */ + (sb.type == SBT_16 && sb.mixer.index >= 0x3b && sb.mixer.index <= 0x47)) /* New SB16 registers */ ret = sb.mixer.unhandled[sb.mixer.index]; else ret=0xa; @@ -1189,7 +1344,7 @@ public: sb.mixer.enabled=section->Get_bool("mixer"); Bitu oplrate=section->Get_int("oplrate"); sb.mixer.stereo=false; - OPL_Mode opl_mode; + OPL_Mode opl_mode = OPL_none; Find_Type_And_Opl(section,sb.type,opl_mode); switch (opl_mode) { @@ -1227,11 +1382,14 @@ public: if (sb.type == SBT_16) sb.chan->Enable(true); else sb.chan->Enable(false); - char hdma[8]=""; - if (sb.type==SBT_16) { - sprintf(hdma,"H%d ",sb.hw.dma16); - } - autoexecline.Install("SET BLASTER=A%3X I%d D%d %sT%d",sb.hw.base,sb.hw.irq,sb.hw.dma8,hdma,sb.type); + // Create set blaster line + ostringstream temp; + temp << "SET BLASTER=A" << setw(3)<< hex << sb.hw.base + << " I" << dec << sb.hw.irq << " D"<< sb.hw.dma8; + if (sb.type==SBT_16) temp << " H" << sb.hw.dma16; + temp << " T" << static_cast(sb.type) << ends; + + autoexecline.Install(temp.str()); /* Soundblaster midi interface */ if (!MIDI_Available()) sb.midi = false; @@ -1240,7 +1398,7 @@ public: ~SBLASTER() { Section_prop * section=static_cast(m_configuration); - OPL_Mode opl_mode; + OPL_Mode opl_mode = OPL_none; Find_Type_And_Opl(section,sb.type,opl_mode); switch (opl_mode) { diff --git a/src/hardware/serialport/Makefile.am b/src/hardware/serialport/Makefile.am index 4ae53b2..af7b803 100644 --- a/src/hardware/serialport/Makefile.am +++ b/src/hardware/serialport/Makefile.am @@ -4,5 +4,7 @@ noinst_LIBRARIES = libserial.a libserial_a_SOURCES = directserial_win32.cpp directserial_win32.h \ serialdummy.cpp serialdummy.h serialport.cpp \ - softmodem.cpp softmodem.h \ - directserial_os2.h directserial_os2.cpp + softmodem.cpp softmodem.h misc_util.cpp misc_util.h \ + directserial_os2.h directserial_os2.cpp \ + directserial_posix.h directserial_posix.cpp \ + nullmodem.cpp nullmodem.h diff --git a/src/hardware/serialport/Makefile.in b/src/hardware/serialport/Makefile.in index 4f23a8f..c14eb43 100644 --- a/src/hardware/serialport/Makefile.in +++ b/src/hardware/serialport/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libserial_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,45 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/hardware/serialport -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libserial_a_AR = $(AR) $(ARFLAGS) -libserial_a_LIBADD = -am_libserial_a_OBJECTS = directserial_win32.$(OBJEXT) \ - serialdummy.$(OBJEXT) serialport.$(OBJEXT) softmodem.$(OBJEXT) \ - directserial_os2.$(OBJEXT) -libserial_a_OBJECTS = $(am_libserial_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libserial_a_SOURCES) -DIST_SOURCES = $(libserial_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -101,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -131,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -141,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -150,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -176,45 +139,64 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + noinst_LIBRARIES = libserial.a + libserial_a_SOURCES = directserial_win32.cpp directserial_win32.h \ serialdummy.cpp serialdummy.h serialport.cpp \ - softmodem.cpp softmodem.h \ - directserial_os2.h directserial_os2.cpp + softmodem.cpp softmodem.h misc_util.cpp misc_util.h \ + directserial_os2.h directserial_os2.cpp \ + directserial_posix.h directserial_posix.cpp \ + nullmodem.cpp nullmodem.h + +subdir = src/hardware/serialport +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libserial_a_AR = $(AR) cru +libserial_a_LIBADD = +am_libserial_a_OBJECTS = directserial_win32.$(OBJEXT) \ + serialdummy.$(OBJEXT) serialport.$(OBJEXT) softmodem.$(OBJEXT) \ + misc_util.$(OBJEXT) directserial_os2.$(OBJEXT) \ + directserial_posix.$(OBJEXT) nullmodem.$(OBJEXT) +libserial_a_OBJECTS = $(am_libserial_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/directserial_os2.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/directserial_posix.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/directserial_win32.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/misc_util.Po ./$(DEPDIR)/nullmodem.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/serialdummy.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/serialport.Po ./$(DEPDIR)/softmodem.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libserial_a_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libserial_a_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/hardware/serialport/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/hardware/serialport/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/hardware/serialport/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -224,32 +206,51 @@ libserial.a: $(libserial_a_OBJECTS) $(libserial_a_DEPENDENCIES) $(RANLIB) libserial.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directserial_os2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directserial_posix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/directserial_win32.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc_util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nullmodem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serialdummy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serialport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/softmodem.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -258,7 +259,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -270,11 +270,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -297,6 +296,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -310,7 +313,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -328,6 +331,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) + installdirs: install: install-am install-exec: install-exec-am @@ -348,7 +352,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -367,8 +371,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -404,14 +406,13 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/hardware/serialport/directserial_os2.cpp b/src/hardware/serialport/directserial_os2.cpp index 7c47ec6..bab540c 100644 --- a/src/hardware/serialport/directserial_os2.cpp +++ b/src/hardware/serialport/directserial_os2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: directserial_os2.cpp,v 1.2 2006/02/09 11:47:54 qbix79 Exp $ */ +/* $Id: directserial_os2.cpp,v 1.4 2007/02/22 08:41:16 qbix79 Exp $ */ #include "dosbox.h" @@ -26,6 +26,8 @@ #if defined(OS2) #include "serialport.h" #include "directserial_os2.h" +#include "misc_util.h" +#include "pic.h" // OS/2 related headers #define INCL_DOSFILEMGR @@ -38,24 +40,46 @@ /* This is a serial passthrough class. Its amazingly simple to */ /* write now that the serial ports themselves were abstracted out */ -CDirectSerial::CDirectSerial (IO_ReadHandler * rh, IO_WriteHandler * wh, - TIMER_TickHandler th, Bit16u baseAddr, Bit8u initIrq, - Bit32u initBps, Bit8u bytesize, const char *parity, - Bit8u stopbits,const char *realPort) - :CSerial (rh, wh, th,baseAddr,initIrq, initBps, - bytesize, parity,stopbits) { +CDirectSerial::CDirectSerial (Bitu id, CommandLine *cmd) + : CSerial(id, cmd) { InstallationSuccessful = false; - InstallTimerHandler(th); - lastChance = 0; - LOG_MSG ("OS/2 Serial port at %x: Opening %s", base, realPort); - LOG_MSG("Opening OS2 serial port"); + + + rx_retry = 0; + rx_retry_max = 0; + + std::string tmpstring; + + if (!cmd->FindStringBegin("realport:", tmpstring, false)) + { + return; + } +#if SERIAL_DEBUG + if (dbg_modemcontrol) + { + fprintf(debugfp, "%12.3f Port type directserial realport %s\r\n", PIC_FullIndex(), tmpstring.c_str()); + } +#endif + + + // rxdelay: How many milliseconds to wait before causing an + // overflow when the application is unresponsive. + if(getBituSubstring("rxdelay:", &rx_retry_max, cmd)) { + if(!(rx_retry_max<=10000)) { + rx_retry_max=0; + } + } + + const char* tmpchar=tmpstring.c_str(); + + LOG_MSG ("Serial%d: Opening %s", COMNUMBER, tmpstring.c_str()); ULONG ulAction = 0; - APIRET rc = DosOpen((unsigned char*)realPort, &hCom, &ulAction, 0L, FILE_NORMAL, FILE_OPEN, + APIRET rc = DosOpen((unsigned char*)tmpstring.c_str(), &hCom, &ulAction, 0L, FILE_NORMAL, FILE_OPEN, OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE | OPEN_FLAGS_SEQUENTIAL, 0L); if (rc != NO_ERROR) { - LOG_MSG ("Serial port \"%s\" could not be opened.", realPort); + LOG_MSG ("Serial%d: Serial port \"%s\" could not be opened.", COMNUMBER, tmpstring.c_str()); if (rc == 2) { LOG_MSG ("The specified port does not exist."); } else if (rc == 99) { @@ -73,135 +97,125 @@ CDirectSerial::CDirectSerial (IO_ReadHandler * rh, IO_WriteHandler * wh, rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETDCBINFO, 0, 0, 0, &dcb, ulParmLen, &ulParmLen); if ( rc != NO_ERROR) { - DosClose(hCom); - hCom = 0; - return; - } - dcb.usWriteTimeout = 0; - dcb.usReadTimeout = 0; //65535; - dcb.fbTimeout |= 6; - rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_SETDCBINFO, &dcb, ulParmLen, &ulParmLen, 0, 0, 0); - if ( rc != NO_ERROR) - { + LOG_MSG("GetCommState failed with error %d.\n", rc); DosClose(hCom); hCom = 0; return; } - CSerial::Init_Registers (initBps, bytesize, parity, stopbits); - InstallationSuccessful = true; - //LOG_MSG("InstSuccess"); + dcb.usWriteTimeout = 0; + dcb.usReadTimeout = 0; //65535; + dcb.fbCtlHndShake = dcb.fbFlowReplace = 0; + dcb.fbTimeout = 6; + rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_SETDCBINFO, &dcb, ulParmLen, &ulParmLen, 0, 0, 0); + if ( rc != NO_ERROR) + { + LOG_MSG("SetDCBInfo failed with error %d.\n", rc); + DosClose(hCom); + hCom = 0; + return; + } + + + struct { + ULONG baud; + BYTE fraction; + } setbaud; + setbaud.baud = 9600; + setbaud.fraction = 0; + ulParmLen = sizeof(setbaud); + rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_EXTSETBAUDRATE, &setbaud, ulParmLen, &ulParmLen, 0, 0, 0); + if (rc != NO_ERROR) + { + LOG_MSG("ExtSetBaudrate failed with error %d.\n", rc); + DosClose (hCom); + hCom = 0; + return; } + struct { + UCHAR data; + UCHAR parity; + UCHAR stop; + } paramline; + + // byte length + paramline.data = 8; + paramline.parity = 0; + paramline.stop = 0; + ulParmLen = sizeof(paramline); + rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_SETLINECTRL, ¶mline, ulParmLen, &ulParmLen, 0, 0, 0); + if ( rc != NO_ERROR) + { + LOG_MSG ("SetLineCtrl failed with error %d.\n", rc); + } + + CSerial::Init_Registers(); + InstallationSuccessful = true; + receiveblock = false; + + // Clears comm errors + USHORT errors = 0; + ulParmLen = sizeof(errors); + DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETCOMMERROR, 0, 0, 0, &errors, ulParmLen, &ulParmLen); + setEvent(SERIAL_POLLING_EVENT, 1); + } + CDirectSerial::~CDirectSerial () { if (hCom != 0) DosClose (hCom); } -Bitu lastChance; -void CDirectSerial::RXBufferEmpty () { - ULONG dwRead; - Bit8u chRead; - USHORT errors = 0; - ULONG ulParmLen = sizeof(errors); - - if (lastChance > 0) { - receiveByte (ChanceChar); - lastChance = 0; - } else { - // update RX - if (DosRead (hCom, &chRead, 1, &dwRead) != NO_ERROR) { - if (dwRead != 0) { - //LOG_MSG("UART 0x%x: RX 0x%x", base,chRead); - receiveByte (chRead); - } - } - } - // check for errors - Bit8u errreg = 0; - APIRET rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETCOMMERROR, 0, 0, 0, &errors, ulParmLen, &ulParmLen); - if (rc != NO_ERROR && errors) - { - if (errors & 8) { - LOG_MSG ("Serial port at 0x%x: line error: framing error.", base); - errreg |= LSR_FRAMING_ERROR_MASK; - } - if (errors & 4) { - LOG_MSG ("Serial port at 0x%x: line error: parity error.", base); - errreg |= LSR_PARITY_ERROR_MASK; - } - } - errors = 0; - rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETCOMMEVENT, 0, 0, 0, &errors, ulParmLen, &ulParmLen); - if (rc != NO_ERROR && errors) - { - if (errors & 6) { - LOG_MSG ("Serial port at 0x%x: line error: break received.", base); - errreg |= LSR_RX_BREAK_MASK; - } - } - if (errreg != 0) - { - receiveError (errreg); - } - -} /*****************************************************************************/ /* updatePortConfig is called when emulated app changes the serial port **/ /* parameters baudrate, stopbits, number of databits, parity. **/ /*****************************************************************************/ -void CDirectSerial::updatePortConfig (Bit8u dll, Bit8u dlm, Bit8u lcr) { +void CDirectSerial::updatePortConfig (Bit16u divider, Bit8u lcr) { Bit8u parity = 0; Bit8u bytelength = 0; - Bit16u baudrate = 0, baud = 0; - - // baud - baudrate = dlm; - baudrate = baudrate << 8; - baudrate |= dll; - if (baudrate <= 0x1) - baud = 115200; - else if (baudrate <= 0x2) - baud = 57600; - else if (baudrate <= 0x3) - baud = 38400; - else if (baudrate <= 0x6) - baud = 19200; - else if (baudrate <= 0xc) - baud = 9600; - else if (baudrate <= 0x18) - baud = 4800; - else if (baudrate <= 0x30) - baud = 2400; - else if (baudrate <= 0x60) - baud = 1200; - else if (baudrate <= 0xc0) - baud = 600; - else if (baudrate <= 0x180) - baud = 300; - else if (baudrate <= 0x417) - baud = 110; - - // I read that windows can handle nonstandard baudrates: - else - baud = 115200 / baudrate; - -#ifdef SERIALPORT_DEBUGMSG - LOG_MSG ("Serial port at %x: new baud rate: %d", base, dcb.BaudRate); -#endif - struct { ULONG baud; BYTE fraction; } setbaud; - setbaud.baud = baud; + + // baud + if (divider <= 0x1) + setbaud.baud = 115200; + else if (divider <= 0x2) + setbaud.baud = 57600; + else if (divider <= 0x3) + setbaud.baud = 38400; + else if (divider <= 0x6) + setbaud.baud = 19200; + else if (divider <= 0xc) + setbaud.baud = 9600; + else if (divider <= 0x18) + setbaud.baud = 4800; + else if (divider <= 0x30) + setbaud.baud = 2400; + else if (divider <= 0x60) + setbaud.baud = 1200; + else if (divider <= 0xc0) + setbaud.baud = 600; + else if (divider <= 0x180) + setbaud.baud = 300; + else if (divider <= 0x417) + setbaud.baud = 110; + + // I read that windows can handle nonstandard baudrates: + else + setbaud.baud = 115200 / divider; + + setbaud.fraction = 0; ULONG ulParmLen = sizeof(setbaud); APIRET rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_EXTSETBAUDRATE, &setbaud, ulParmLen, &ulParmLen, 0, 0, 0); if (rc != NO_ERROR) { + LOG_MSG("Serial%d: Desired serial mode not supported (Baud: %d, %d, Error: %d)", + COMNUMBER, setbaud.baud, divider, rc); } @@ -248,12 +262,28 @@ void CDirectSerial::updatePortConfig (Bit8u dll, Bit8u dlm, Bit8u lcr) { } +#ifdef SERIAL_DEBUG + LOG_MSG("_____________________________________________________"); + LOG_MSG("Serial%d, new baud rate: %d", COMNUMBER, setbaud.baud); + LOG_MSG("Serial%d: new bytelen: %d", COMNUMBER, paramline.data); + LOG_MSG("Serial%d: new parity: %d", COMNUMBER, paramline.parity); + LOG_MSG("Serial%d: new stopbits: %d", COMNUMBER, paramline.stop); +#endif + ulParmLen = sizeof(paramline); rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_SETLINECTRL, ¶mline, ulParmLen, &ulParmLen, 0, 0, 0); if ( rc != NO_ERROR) { - LOG_MSG ("Serial port at 0x%x: API did not like the new values.", base); +#ifdef SERIAL_DEBUG + if (dbg_modemcontrol) + { + fprintf(debugfp, "%12.3f serial mode not supported: rate=%d, LCR=%x.\r\n", PIC_FullIndex(), setbaud.baud, lcr); } +#endif + LOG_MSG("Serial%d: Desired serial mode not supported (%d,%d,%d,%d)", + COMNUMBER, setbaud.baud, paramline.data, paramline.parity, lcr); + } + } @@ -262,33 +292,29 @@ void CDirectSerial::updateMSR () { UCHAR dptr = 0; ULONG ulParmLen = sizeof(dptr); - APIRET rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETMODEMINPUT, &dptr, ulParmLen, &ulParmLen, 0, 0, 0); + APIRET rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETMODEMINPUT, 0, 0, 0, &dptr, ulParmLen, &ulParmLen); if (rc != NO_ERROR) { -#ifdef SERIALPORT_DEBUGMSG -// LOG_MSG ("Serial port at %x: GetCommModemStatus failed!", base); -#endif - //return; + LOG_MSG ("Serial port at %x: GetModemInput failed with %d !", idnumber, dptr); } - if (dptr & 16) - newmsr |= MSR_CTS_MASK; - if (dptr & 32) - newmsr |= MSR_DSR_MASK; - if (dptr & 64) - newmsr |= MSR_RI_MASK; - if (dptr & 128) - newmsr |= MSR_CD_MASK; - changeMSR (newmsr); + setCTS( (dptr & 16) != 0); + setDSR( (dptr & 32) != 0); + setRI( (dptr & 64) != 0); + setCD( (dptr & 128) != 0); } -void CDirectSerial::transmitByte (Bit8u val) { - // mean bug: with break = 1, WriteFile will never return. +void CDirectSerial::transmitByte (Bit8u val, bool first) { ULONG bytesWritten = 0; APIRET rc = DosWrite (hCom, &val, 1, &bytesWritten); if (rc == NO_ERROR && bytesWritten > 0) { - ByteTransmitted (); //LOG_MSG("UART 0x%x: TX 0x%x", base,val); } else { - LOG_MSG ("UART 0x%x: NO BYTE WRITTEN!", base); + LOG_MSG ("Serial%d: NO BYTE WRITTEN!", idnumber); + } + if (first) + { + setEvent(SERIAL_THR_EVENT, bytetime / 8); + } else { + setEvent(SERIAL_TX_EVENT, bytetime); } } @@ -297,9 +323,6 @@ void CDirectSerial::transmitByte (Bit8u val) { /*****************************************************************************/ void CDirectSerial::setBreak (bool value) { - //#ifdef SERIALPORT_DEBUGMSG - //LOG_MSG("UART 0x%x: Break toggeled: %d", base, value); - //#endif USHORT error; ULONG ulParmLen = sizeof(error); if (value) @@ -311,7 +334,8 @@ void CDirectSerial::setBreak (bool value) { /*****************************************************************************/ /* updateModemControlLines(mcr) sets DTR and RTS. **/ /*****************************************************************************/ -void CDirectSerial::updateModemControlLines ( /*Bit8u mcr */ ) { +void CDirectSerial::setRTSDTR(bool rts, bool dtr) +{ bool change = false; DCBINFO dcb; ULONG ulParmLen = sizeof(dcb); @@ -319,7 +343,7 @@ void CDirectSerial::updateModemControlLines ( /*Bit8u mcr */ ) { DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETDCBINFO, 0, 0, 0, &dcb, ulParmLen, &ulParmLen); /*** DTR ***/ - if (CSerial::getDTR ()) { // DTR on + if (dtr) { // DTR on if (dcb.fbCtlHndShake && 3 == 0) { // DTR disabled dcb.fbCtlHndShake |= 1; change = true; @@ -331,7 +355,7 @@ void CDirectSerial::updateModemControlLines ( /*Bit8u mcr */ ) { } } /*** RTS ***/ - if (CSerial::getRTS ()) { // RTS on + if (rts) { // RTS on if (dcb.fbFlowReplace && 192 == 0) { //RTS disabled dcb.fbFlowReplace |= 64; change = true; @@ -346,72 +370,145 @@ void CDirectSerial::updateModemControlLines ( /*Bit8u mcr */ ) { DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_SETDCBINFO, &dcb, ulParmLen, &ulParmLen, 0, 0, 0); } -void CDirectSerial::Timer2(void) { - ULONG dwRead = 0; - USHORT errors = 0; - Bit8u chRead = 0; - ULONG ulParmLen = sizeof(errors); +void CDirectSerial::setRTS(bool val) +{ + bool change = false; + DCBINFO dcb; + ULONG ulParmLen = sizeof(dcb); + DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETDCBINFO, 0, 0, 0, &dcb, ulParmLen, &ulParmLen); - if (lastChance == 0) { // lastChance = 0 - if (CanReceiveByte ()) { - if (DosRead (hCom, &chRead, 1, &dwRead)) { - if (dwRead) - receiveByte (chRead); + /*** RTS ***/ + if (val) { // RTS on + if (dcb.fbFlowReplace && 192 == 0) { //RTS disabled + dcb.fbFlowReplace |= 64; + change = true; } } else { - if (DosRead (hCom, &chRead, 1, &dwRead)) { - if (dwRead) { - ChanceChar = chRead; - lastChance++; + if (dcb.fbFlowReplace && 192 == 1) { // RTS enabled + dcb.fbFlowReplace &= ~192; + change = true; } } + if (change) + DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_SETDCBINFO, &dcb, ulParmLen, &ulParmLen, 0, 0, 0); } - } else if (lastChance > 10) { - receiveByte (0); // this causes RX Overrun now - lastChance = 0; - // empty serial buffer - dwRead = 1; - while (dwRead > 0) { // throw away bytes in buffer - DosRead (hCom, &chRead, 1, &dwRead); + +void CDirectSerial::setDTR(bool val) +{ + bool change = false; + DCBINFO dcb; + ULONG ulParmLen = sizeof(dcb); + + DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETDCBINFO, 0, 0, 0, &dcb, ulParmLen, &ulParmLen); + + /*** DTR ***/ + if (val) { // DTR on + if (dcb.fbCtlHndShake && 3 == 0) { // DTR disabled + dcb.fbCtlHndShake |= 1; + change = true; } - } else { // lastChance>0 // already one waiting - if (CanReceiveByte ()) { // chance used - receiveByte (ChanceChar); - lastChance = 0; - } else - lastChance++; + } else { + if (dcb.fbCtlHndShake && 3 == 1) { // DTR enabled + dcb.fbCtlHndShake &= ~3; + change = true; + } + } + if (change) + DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_SETDCBINFO, &dcb, ulParmLen, &ulParmLen, 0, 0, 0); } - // check for errors - Bit8u errreg = 0; - APIRET rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETCOMMERROR, 0, 0, 0, &errors, ulParmLen, &ulParmLen); - if (rc != NO_ERROR && errors) + +void CDirectSerial::handleUpperEvent(Bit16u type) { - if (errors & 8) { - LOG_MSG ("Serial port at 0x%x: line error: framing error.", base); - errreg |= LSR_FRAMING_ERROR_MASK; + switch(type) { + case SERIAL_POLLING_EVENT: { + ULONG dwRead = 0; + ULONG errors = 0; + Bit8u chRead = 0; + + setEvent(SERIAL_POLLING_EVENT, 1); + if(!receiveblock) { + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max )) + { + rx_retry=0; + if (DosRead (hCom, &chRead, 1, &dwRead) == NO_ERROR) { + if (dwRead) { + receiveByte (chRead); + setEvent(40, bytetime-0.03f); // receive timing + receiveblock=true; } - if (errors & 4) { - LOG_MSG ("Serial port at 0x%x: line error: parity error.", base); - errreg |= LSR_PARITY_ERROR_MASK; + } + } else rx_retry++; + } + // check for errors + CheckErrors(); + // update Modem input line states + updateMSR (); + break; + } + case 40: { + // receive time is up + ULONG dwRead = 0; + Bit8u chRead = 0; + receiveblock=false; + // check if there is something to receive + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max )) + { + rx_retry=0; + if (DosRead (hCom, &chRead, 1, &dwRead) == NO_ERROR) { + if (dwRead) { + receiveByte (chRead); + setEvent(40, bytetime-0.03f); // receive timing + receiveblock=true; + } + } + } else rx_retry++; + break; + } + case SERIAL_TX_EVENT: { + ULONG dwRead = 0; + Bit8u chRead = 0; + if(!receiveblock) { + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max )) + { + rx_retry=0; + if (DosRead (hCom, &chRead, 1, &dwRead) == NO_ERROR) { + if (dwRead) { + receiveByte (chRead); + setEvent(40, bytetime-0.03f); // receive timing + receiveblock=true; + } + } + } else rx_retry++; + } + ByteTransmitted(); + break; + } + case SERIAL_THR_EVENT: { + ByteTransmitting(); + setEvent(SERIAL_TX_EVENT,bytetime+0.03f); + break; } } - errors = 0; - rc = DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETCOMMEVENT, 0, 0, 0, &errors, ulParmLen, &ulParmLen); - if (rc != NO_ERROR && errors) - { - if (errors & 6) { - LOG_MSG ("Serial port at 0x%x: line error: break received.", base); - errreg |= LSR_RX_BREAK_MASK; + +} + +void CDirectSerial::CheckErrors() { + + USHORT errors = 0, event = 0; + ULONG ulParmLen = sizeof(errors); + DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETCOMMEVENT, 0, 0, 0, &event, ulParmLen, &ulParmLen); + if (event & (64 + 128) ) { // Break (Bit 6) or Frame or Parity (Bit 7) error + Bit8u errreg = 0; + if (event & 64) errreg |= LSR_RX_BREAK_MASK; + if (event & 128) { + DosDevIOCtl(hCom, IOCTL_ASYNC, ASYNC_GETCOMMERROR, 0, 0, 0, &errors, ulParmLen, &ulParmLen); + if (errors & 8) errreg |= LSR_FRAMING_ERROR_MASK; + if (errors & 4) errreg |= LSR_PARITY_ERROR_MASK; } - } - if (errreg != 0) - { receiveError (errreg); } - // update Modem input line states - updateMSR (); } #endif diff --git a/src/hardware/serialport/directserial_os2.h b/src/hardware/serialport/directserial_os2.h index 9dbf785..a054d2f 100644 --- a/src/hardware/serialport/directserial_os2.h +++ b/src/hardware/serialport/directserial_os2.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: directserial_os2.h,v 1.2 2006/02/09 11:47:54 qbix79 Exp $ */ +/* $Id: directserial_os2.h,v 1.4 2007/02/22 08:41:16 qbix79 Exp $ */ // include guard #ifndef DOSBOX_DIRECTSERIAL_OS2_H @@ -40,42 +40,38 @@ public: HFILE hCom; BOOL fSuccess; - CDirectSerial( - IO_ReadHandler* rh, - IO_WriteHandler* wh, - TIMER_TickHandler th, - Bit16u baseAddr, - Bit8u initIrq, - Bit32u initBps, - Bit8u bytesize, - const char *parity, - Bit8u stopbits, - const char * realPort - ); - - + CDirectSerial(Bitu id, CommandLine* cmd); ~CDirectSerial(); - Bitu lastChance; // If there is no space for new + //Bitu lastChance; // If there is no space for new // received data, it gets a little chance - Bit8u ChanceChar; + //Bit8u ChanceChar; - bool CanRecv(void); - bool CanSend(void); + //bool CanRecv(void); + //bool CanSend(void); - bool InstallationSuccessful; // check after constructing. If - // something was wrong, delete it right away. - void RXBufferEmpty(); + //void RXBufferEmpty(); + bool receiveblock; + Bitu rx_retry; + Bitu rx_retry_max; + void CheckErrors(); - void updatePortConfig(Bit8u dll, Bit8u dlm, Bit8u lcr); + void updatePortConfig(Bit16u divider, Bit8u lcr); void updateMSR(); - void transmitByte(Bit8u val); + void transmitByte(Bit8u val, bool first); void setBreak(bool value); - void updateModemControlLines(/*Bit8u mcr*/); - void Timer2(void); + + void setRTSDTR(bool rts, bool dtr); + void setRTS(bool val); + void setDTR(bool val); + void handleUpperEvent(Bit16u type); + + + //void updateModemControlLines(/*Bit8u mcr*/); + //void Timer2(void); }; diff --git a/src/hardware/serialport/directserial_posix.cpp b/src/hardware/serialport/directserial_posix.cpp new file mode 100644 index 0000000..2453a11 --- /dev/null +++ b/src/hardware/serialport/directserial_posix.cpp @@ -0,0 +1,361 @@ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* $Id: directserial_posix.cpp,v 1.1 2007/01/13 08:35:49 qbix79 Exp $ */ + +#include "dosbox.h" + +#if C_DIRECTSERIAL + +// Posix version +#if defined (LINUX) + +#include "serialport.h" +#include "directserial_posix.h" +#include "pic.h" + +#include +#include +#include + +#include +#include + +/* This is a serial passthrough class. Its amazingly simple to */ +/* write now that the serial ports themselves were abstracted out */ + +CDirectSerial::CDirectSerial (Bitu id, CommandLine* cmd) + :CSerial (id, cmd) { + InstallationSuccessful = false; + + rx_retry = 0; + rx_retry_max = 0; + + std::string prefix="/dev/"; + std::string tmpstring; + if(!cmd->FindStringBegin("realport:",tmpstring,false)) return; + +#if SERIAL_DEBUG + if(dbg_modemcontrol) + fprintf(debugfp,"%12.3f Port type directserial realport %s\r\n", + PIC_FullIndex(),tmpstring.c_str()); +#endif + + prefix.append(tmpstring); + + // rxdelay: How many milliseconds to wait before causing an + // overflow when the application is unresponsive. + if(getBituSubstring("rxdelay:", &rx_retry_max, cmd)) { + if(!(rx_retry_max<=10000)) rx_retry_max=0; + } + + const char* tmpchar=prefix.c_str(); + + LOG_MSG ("Serial%d: Opening %s", COMNUMBER, tmpchar); + + fileHandle = open (tmpchar, O_RDWR | O_NOCTTY | O_NONBLOCK); + + if (fileHandle < 0) { + LOG_MSG ("Serial%d: Serial Port \"%s\" could not be opened.", + COMNUMBER, tmpchar); + if (errno == 2) { + LOG_MSG ("The specified port does not exist."); + } else if (errno == EBUSY) { + LOG_MSG ("The specified port is already in use."); + } else { + LOG_MSG ("Errno %d occurred.", errno); + } + return; + } + + int result = tcgetattr(fileHandle, &termInfo); + + + if (result==-1) { + // Handle the error. + LOG_MSG ("tcgetattr failed with error %d.\n", errno); + return; + } + + // save it here to restore in destructor + tcgetattr(fileHandle,&backup); + + // initialize the port + termInfo.c_cflag = CS8 | CREAD | CLOCAL; // noparity, 1 stopbit + termInfo.c_iflag = PARMRK | INPCK; + termInfo.c_oflag = 0; + termInfo.c_lflag = 0; + + cfsetospeed (&termInfo, B9600); + cfsetispeed (&termInfo, B9600); + + termInfo.c_cc[VMIN] = 0; + termInfo.c_cc[VTIME] = 0; + + tcflush (fileHandle, TCIFLUSH); + tcsetattr (fileHandle, TCSANOW, &termInfo); + + //initialise base class + CSerial::Init_Registers(); + InstallationSuccessful = true; + receiveblock=false; + + setEvent(SERIAL_POLLING_EVENT, 1); // millisecond tick +} + +CDirectSerial::~CDirectSerial () { + if (fileHandle >= 0) + { + tcsetattr(fileHandle, TCSANOW, &backup); + close(fileHandle); + } + // We do not use own events so we don't have to clear them. +} + +void CDirectSerial::handleUpperEvent(Bit16u type) { + + switch(type) { + case SERIAL_POLLING_EVENT: { + setEvent(SERIAL_POLLING_EVENT, 1); + if(!receiveblock) { + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max )) + { + ReadCharacter(); + } else rx_retry++; + } + // check for errors + CheckErrors(); + // update Modem input line states + updateMSR (); + break; + } + case 40: { + // receive time is up + receiveblock=false; + // check if there is something to receive + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max )) + { + ReadCharacter(); + } else rx_retry++; + break; + } + case SERIAL_TX_EVENT: { + if(!receiveblock) { + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max )) + { + ReadCharacter(); + } else rx_retry++; + } + ByteTransmitted(); + break; + } + case SERIAL_THR_EVENT: { + ByteTransmitting(); + setEvent(SERIAL_TX_EVENT,bytetime+0.03f); + break; + } + } +} + +void CDirectSerial::ReadCharacter() +{ + Bit8u chRead = 0; + int dwRead = 0; + rx_retry=0; + + dwRead=read(fileHandle,&chRead,1); + if (dwRead==1) { + if(chRead==0xff) // error escape + { + dwRead=read(fileHandle,&chRead,1); + if(chRead==0x00) // an error + { + dwRead=read(fileHandle,&chRead,1); + if(chRead==0x0)receiveError(LSR_RX_BREAK_MASK); + else receiveError(LSR_PARITY_ERROR_MASK); + } + } + receiveByte (chRead); + setEvent(40, bytetime-0.03f); // receive timing + receiveblock=true; + } +} + +void CDirectSerial::CheckErrors() { + +} + +/*****************************************************************************/ +/* updatePortConfig is called when emulated app changes the serial port **/ +/* parameters baudrate, stopbits, number of databits, parity. **/ +/*****************************************************************************/ +void CDirectSerial::updatePortConfig (Bit16u divider, Bit8u lcr) { + Bit8u parity = 0; + Bit8u bytelength = 0; + int baudrate=0; + + // baud + termInfo.c_cflag = CREAD | CLOCAL; + + if (divider == 0x1) baudrate = B115200; + else if (divider == 0x2) baudrate = B57600; + else if (divider == 0x3) baudrate = B38400; + else if (divider == 0x6) baudrate = B19200; + else if (divider == 0xc) baudrate = B9600; + else if (divider == 0x18) baudrate = B4800; + else if (divider == 0x30) baudrate = B2400; + else if (divider == 0x60) baudrate = B1200; + else if (divider == 0xc0) baudrate = B600; + else if (divider == 0x180) baudrate = B300; + else if (divider == 0x417) baudrate = B110; + + // Don't think termios supports nonstandard baudrates + else baudrate = B9600; + + // byte length + bytelength = lcr & 0x3; + bytelength += 5; + + switch (bytelength) { + case 5: + termInfo.c_cflag |= CS5; + break; + + case 6: + termInfo.c_cflag |= CS6; + break; + + case 7: + termInfo.c_cflag |= CS7; + break; + + case 8: + default: + termInfo.c_cflag |= CS8; + break; + } + + // parity + parity = lcr & 0x38; + parity >>= 3; + switch (parity) { + case 0x1: + termInfo.c_cflag |= PARODD; + termInfo.c_cflag |= PARENB; + break; + case 0x3: + termInfo.c_cflag |= PARENB; + break; + case 0x5: + +// "works on many systems" +#define CMSPAR 010000000000 + + termInfo.c_cflag |= PARODD; + termInfo.c_cflag |= PARENB; + termInfo.c_cflag |= CMSPAR; + //LOG_MSG("Serial%d: Mark parity not supported.", COMNUMBER); + break; + case 0x7: + termInfo.c_cflag |= PARENB; + termInfo.c_cflag |= CMSPAR; + //LOG_MSG("Serial%d: Space parity not supported.", COMNUMBER); + break; + default: // no parity + break; + } + + // stopbits + if (lcr & 0x4) termInfo.c_cflag |= CSTOPB; + + cfsetospeed (&termInfo, baudrate); + cfsetispeed (&termInfo, baudrate); + + int retval = tcsetattr(fileHandle, TCSANOW, &termInfo); + + if(retval==-1) + LOG_MSG ("Serial%d: Desired serial mode not supported", COMNUMBER); + +} + +void CDirectSerial::updateMSR () { + long flags = 0; + ioctl (fileHandle, TIOCMGET, &flags); + + if (flags & TIOCM_CTS) setCTS(true); + else setCTS(false); + + if (flags & TIOCM_DSR) setDSR(true); + else setDSR(false); + + if (flags & TIOCM_RI) setRI(true); + else setRI(false); + + if (flags & TIOCM_CD) setCD(true); + else setCD(false); +} + +void CDirectSerial::transmitByte (Bit8u val, bool first) { + if((LCR&LCR_BREAK_MASK) == 0) { + + int bytesWritten = write(fileHandle, &val, 1); + if (bytesWritten != 1) + LOG_MSG ("Serial%d: COM port error: write failed!", idnumber); + } + if(first) setEvent(SERIAL_THR_EVENT, bytetime/8); + else setEvent(SERIAL_TX_EVENT, bytetime); +} + +/*****************************************************************************/ +/* setBreak(val) switches break on or off **/ +/*****************************************************************************/ +void CDirectSerial::setBreak (bool value) { + if (value) ioctl (fileHandle, TIOCSBRK); + else ioctl (fileHandle, TIOCCBRK); +} + +/*****************************************************************************/ +/* updateModemControlLines(mcr) sets DTR and RTS. **/ +/*****************************************************************************/ +void CDirectSerial::setRTSDTR(bool rts, bool dtr) { + + long setflags = 0; + long clearflags = 0; + + if(rts) setflags |= TIOCM_RTS; + else clearflags |= TIOCM_RTS; + + if(dtr) setflags |= TIOCM_DTR; + else clearflags |= TIOCM_DTR; + + if(setflags) ioctl (fileHandle, TIOCMBIS, &setflags); + if(clearflags) ioctl (fileHandle, TIOCMBIC, &clearflags); +} +void CDirectSerial::setRTS(bool val) { + long flag = TIOCM_RTS; + if(val) ioctl(fileHandle, TIOCMBIS, &flag); + else ioctl(fileHandle, TIOCMBIC, &flag); +} +void CDirectSerial::setDTR(bool val) { + long flag = TIOCM_DTR; + if(val) ioctl(fileHandle, TIOCMBIS, &flag); + else ioctl(fileHandle, TIOCMBIC, &flag); +} + +#endif +#endif diff --git a/src/hardware/serialport/directserial_posix.h b/src/hardware/serialport/directserial_posix.h new file mode 100644 index 0000000..8c99c20 --- /dev/null +++ b/src/hardware/serialport/directserial_posix.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* $Id: directserial_posix.h,v 1.1 2007/01/13 08:35:49 qbix79 Exp $ */ + +// include guard +#ifndef DOSBOX_DIRECTSERIAL_POSIX_H +#define DOSBOX_DIRECTSERIAL_POSIX_H + +#include "dosbox.h" + +#if C_DIRECTSERIAL +#ifdef LINUX + + + +#define DIRECTSERIAL_AVAILIBLE +#include "serialport.h" +#include +#include + +class CDirectSerial : public CSerial { +public: + termios termInfo; + termios backup; + int fileHandle; + + CDirectSerial(Bitu id, CommandLine* cmd); + ~CDirectSerial(); + bool receiveblock; // It's not a block of data it rather blocks + + Bitu rx_retry; // counter of retries + + Bitu rx_retry_max; // how many POLL_EVENTS to wait before causing + // a overrun error. + + void ReadCharacter(); + void CheckErrors(); + + void updatePortConfig(Bit16u divider, Bit8u lcr); + void updateMSR(); + void transmitByte(Bit8u val, bool first); + void setBreak(bool value); + + void setRTSDTR(bool rts, bool dtr); + void setRTS(bool val); + void setDTR(bool val); + void handleUpperEvent(Bit16u type); + +}; + +#endif // WIN32 +#endif // C_DIRECTSERIAL +#endif // include guard diff --git a/src/hardware/serialport/directserial_win32.cpp b/src/hardware/serialport/directserial_win32.cpp index 7464d4e..93cf5b5 100644 --- a/src/hardware/serialport/directserial_win32.cpp +++ b/src/hardware/serialport/directserial_win32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: directserial_win32.cpp,v 1.3 2006/02/09 11:47:54 qbix79 Exp $ */ +/* $Id: directserial_win32.cpp,v 1.5 2007/01/13 08:35:49 qbix79 Exp $ */ #include "dosbox.h" @@ -27,6 +27,8 @@ #include "serialport.h" #include "directserial_win32.h" +#include "misc_util.h" +#include "pic.h" // Win32 related headers #include @@ -34,17 +36,41 @@ /* This is a serial passthrough class. Its amazingly simple to */ /* write now that the serial ports themselves were abstracted out */ -CDirectSerial::CDirectSerial (IO_ReadHandler * rh, IO_WriteHandler * wh, - TIMER_TickHandler th, Bit16u baseAddr, Bit8u initIrq, - Bit32u initBps, Bit8u bytesize, const char *parity, - Bit8u stopbits,const char *realPort) - :CSerial (rh, wh, th,baseAddr,initIrq, initBps, - bytesize, parity,stopbits) { +CDirectSerial::CDirectSerial (Bitu id, CommandLine* cmd) + :CSerial (id, cmd) { InstallationSuccessful = false; - InstallTimerHandler(th); - lastChance = 0; - LOG_MSG ("Serial port at %x: Opening %s", base, realPort); - hCom = CreateFile (realPort, GENERIC_READ | GENERIC_WRITE, 0, // must be opened with exclusive-access + + rx_retry = 0; + rx_retry_max = 0; + + // open the port in NT object space (recommended by Microsoft) + // allows the user to open COM10+ and custom port names. + std::string prefix="\\\\.\\"; + std::string tmpstring; + if(!cmd->FindStringBegin("realport:",tmpstring,false)) return; + +#if SERIAL_DEBUG + if(dbg_modemcontrol) + fprintf(debugfp,"%12.3f Port type directserial realport %s\r\n", + PIC_FullIndex(),tmpstring.c_str()); +#endif + + prefix.append(tmpstring); + + // rxdelay: How many milliseconds to wait before causing an + // overflow when the application is unresponsive. + if(getBituSubstring("rxdelay:", &rx_retry_max, cmd)) { + if(!(rx_retry_max<=10000)) { + rx_retry_max=0; + } + } + + const char* tmpchar=prefix.c_str(); + + LOG_MSG ("Serial%d: Opening %s", COMNUMBER, tmpstring.c_str()); + hCom = CreateFile (tmpchar, + GENERIC_READ | GENERIC_WRITE, 0, + // must be opened with exclusive-access NULL, // no security attributes OPEN_EXISTING, // must use OPEN_EXISTING 0, // non overlapped I/O @@ -53,7 +79,8 @@ CDirectSerial::CDirectSerial (IO_ReadHandler * rh, IO_WriteHandler * wh, if (hCom == INVALID_HANDLE_VALUE) { int error = GetLastError (); - LOG_MSG ("Serial port \"%s\" could not be opened.", realPort); + LOG_MSG ("Serial%d: Serial Port \"%s\" could not be opened.", + COMNUMBER, tmpstring.c_str()); if (error == 2) { LOG_MSG ("The specified port does not exist."); } else if (error == 5) { @@ -61,19 +88,48 @@ CDirectSerial::CDirectSerial (IO_ReadHandler * rh, IO_WriteHandler * wh, } else { LOG_MSG ("Windows error %d occurred.", error); } - - hCom = 0; return; } + dcb.DCBlength=sizeof(dcb); fSuccess = GetCommState (hCom, &dcb); if (!fSuccess) { // Handle the error. LOG_MSG ("GetCommState failed with error %d.\n", GetLastError ()); - hCom = 0; + hCom = INVALID_HANDLE_VALUE; return; } + + // initialize the port + dcb.BaudRate=CBR_9600; + dcb.fBinary=true; + dcb.fParity=true; + dcb.fOutxCtsFlow=false; + dcb.fOutxDsrFlow=false; + dcb.fDtrControl=DTR_CONTROL_DISABLE; + dcb.fDsrSensitivity=false; + + dcb.fOutX=false; + dcb.fInX=false; + dcb.fErrorChar=0; + dcb.fNull=false; + dcb.fRtsControl=RTS_CONTROL_DISABLE; + dcb.fAbortOnError=false; + + dcb.ByteSize=8; + dcb.Parity=NOPARITY; + dcb.StopBits=ONESTOPBIT; + + fSuccess = SetCommState (hCom, &dcb); + + if (!fSuccess) { + // Handle the error. + LOG_MSG ("SetCommState failed with error %d.\n", GetLastError ()); + hCom = INVALID_HANDLE_VALUE; + return; + } + // Configure timeouts to effectively use polling COMMTIMEOUTS ct; ct.ReadIntervalTimeout = MAXDWORD; @@ -83,50 +139,103 @@ CDirectSerial::CDirectSerial (IO_ReadHandler * rh, IO_WriteHandler * wh, ct.WriteTotalTimeoutMultiplier = 0; SetCommTimeouts (hCom, &ct); - CSerial::Init_Registers (initBps, bytesize, parity, stopbits); + CSerial::Init_Registers(); InstallationSuccessful = true; - //LOG_MSG("InstSuccess"); + receiveblock=false; + + ClearCommBreak (hCom); + setEvent(SERIAL_POLLING_EVENT, 1); // millisecond tick } CDirectSerial::~CDirectSerial () { - if (hCom != INVALID_HANDLE_VALUE) - CloseHandle (hCom); + if (hCom != INVALID_HANDLE_VALUE) CloseHandle (hCom); + // We do not use own events so we don't have to clear them. } -Bitu lastChance; - -void CDirectSerial::RXBufferEmpty () { - DWORD dwRead; - DWORD errors; - Bit8u chRead; - if (lastChance > 0) { - receiveByte (ChanceChar); - lastChance = 0; - } else { - // update RX - if (ReadFile (hCom, &chRead, 1, &dwRead, NULL)) { - if (dwRead != 0) { - //LOG_MSG("UART 0x%x: RX 0x%x", base,chRead); - receiveByte (chRead); +void CDirectSerial::handleUpperEvent(Bit16u type) { + + switch(type) { + case SERIAL_POLLING_EVENT: { + DWORD dwRead = 0; + DWORD errors = 0; + Bit8u chRead = 0; + + setEvent(SERIAL_POLLING_EVENT, 1); + if(!receiveblock) { + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max )) + { + rx_retry=0; + if (ReadFile (hCom, &chRead, 1, &dwRead, NULL)) { + if (dwRead) { + receiveByte (chRead); + setEvent(40, bytetime-0.03f); // receive timing + receiveblock=true; + } + } + } else rx_retry++; } + // check for errors + CheckErrors(); + // update Modem input line states + updateMSR (); + break; + } + case 40: { + // receive time is up + DWORD dwRead = 0; + Bit8u chRead = 0; + receiveblock=false; + // check if there is something to receive + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max )) + { + rx_retry=0; + if (ReadFile (hCom, &chRead, 1, &dwRead, NULL)) { + if (dwRead) { + receiveByte (chRead); + setEvent(40, bytetime-0.03f); // receive timing + receiveblock=true; + } + } + } else rx_retry++; + break; + } + case SERIAL_TX_EVENT: { + DWORD dwRead = 0; + Bit8u chRead = 0; + if(!receiveblock) { + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max )) + { + rx_retry=0; + if (ReadFile (hCom, &chRead, 1, &dwRead, NULL)) { + if (dwRead) { + receiveByte (chRead); + setEvent(40, bytetime-0.03f); // receive timing + receiveblock=true; + } + } + } else rx_retry++; + } + ByteTransmitted(); + break; + } + case SERIAL_THR_EVENT: { + ByteTransmitting(); + setEvent(SERIAL_TX_EVENT,bytetime+0.03f); + break; } } +} + +void CDirectSerial::CheckErrors() { + + DWORD errors=0; // check for errors if (ClearCommError (hCom, &errors, NULL)) if (errors & (CE_BREAK | CE_FRAME | CE_RXPARITY)) { Bit8u errreg = 0; - if (errors & CE_BREAK) { - LOG_MSG ("Serial port at 0x%x: line error: break received.", base); - errreg |= LSR_RX_BREAK_MASK; - } - if (errors & CE_FRAME) { - LOG_MSG ("Serial port at 0x%x: line error: framing error.", base); - errreg |= LSR_FRAMING_ERROR_MASK; - } - if (errors & CE_RXPARITY) { - LOG_MSG ("Serial port at 0x%x: line error: parity error.", base); - errreg |= LSR_PARITY_ERROR_MASK; - } + if (errors & CE_BREAK) errreg |= LSR_RX_BREAK_MASK; + if (errors & CE_FRAME) errreg |= LSR_FRAMING_ERROR_MASK; + if (errors & CE_RXPARITY) errreg |= LSR_PARITY_ERROR_MASK; receiveError (errreg); } } @@ -135,45 +244,37 @@ void CDirectSerial::RXBufferEmpty () { /* updatePortConfig is called when emulated app changes the serial port **/ /* parameters baudrate, stopbits, number of databits, parity. **/ /*****************************************************************************/ -void CDirectSerial::updatePortConfig (Bit8u dll, Bit8u dlm, Bit8u lcr) { +void CDirectSerial::updatePortConfig (Bit16u divider, Bit8u lcr) { Bit8u parity = 0; Bit8u bytelength = 0; - Bit16u baudrate = 0; // baud - baudrate = dlm; - baudrate = baudrate << 8; - baudrate |= dll; - if (baudrate <= 0x1) + if (divider == 0x1) dcb.BaudRate = CBR_115200; - else if (baudrate <= 0x2) + else if (divider == 0x2) dcb.BaudRate = CBR_57600; - else if (baudrate <= 0x3) + else if (divider == 0x3) dcb.BaudRate = CBR_38400; - else if (baudrate <= 0x6) + else if (divider == 0x6) dcb.BaudRate = CBR_19200; - else if (baudrate <= 0xc) + else if (divider == 0xc) dcb.BaudRate = CBR_9600; - else if (baudrate <= 0x18) + else if (divider == 0x18) dcb.BaudRate = CBR_4800; - else if (baudrate <= 0x30) + else if (divider == 0x30) dcb.BaudRate = CBR_2400; - else if (baudrate <= 0x60) + else if (divider == 0x60) dcb.BaudRate = CBR_1200; - else if (baudrate <= 0xc0) + else if (divider == 0xc0) dcb.BaudRate = CBR_600; - else if (baudrate <= 0x180) + else if (divider == 0x180) dcb.BaudRate = CBR_300; - else if (baudrate <= 0x417) + else if (divider == 0x417) dcb.BaudRate = CBR_110; // I read that windows can handle nonstandard baudrates: else - dcb.BaudRate = 115200 / baudrate; - -#ifdef SERIALPORT_DEBUGMSG - LOG_MSG ("Serial port at %x: new baud rate: %d", base, dcb.BaudRate); -#endif + dcb.BaudRate = 115200 / divider; // byte length bytelength = lcr & 0x3; @@ -211,9 +312,25 @@ void CDirectSerial::updatePortConfig (Bit8u dll, Bit8u dlm, Bit8u lcr) { dcb.StopBits = ONESTOPBIT; } - if (!SetCommState (hCom, &dcb)) - LOG_MSG ("Serial port at 0x%x: API did not like the new values.", base); - //LOG_MSG("Serial port at 0x%x: Port params changed: %d Baud", base,dcb.BaudRate); +#ifdef SERIALPORT_DEBUGMSG + LOG_MSG ("__________________________"); + LOG_MSG ("Serial%d: new baud rate: %d", COMNUMBER, dcb.BaudRate); + LOG_MSG ("Serial%d: new bytelen: %d", COMNUMBER, dcb.ByteSize); + LOG_MSG ("Serial%d: new parity: %d", COMNUMBER, dcb.Parity); + LOG_MSG ("Serial%d: new stopbits: %d", COMNUMBER, dcb.StopBits); +#endif + + if (!SetCommState (hCom, &dcb)) { + +#if SERIAL_DEBUG + if(dbg_modemcontrol) + fprintf(debugfp,"%12.3f serial mode not supported: rate=%d,LCR=%x.\r\n", + PIC_FullIndex(),dcb.BaudRate,lcr); +#endif + + LOG_MSG ("Serial%d: Desired serial mode not supported (%d,%d,%d,%d", + dcb.BaudRate,dcb.ByteSize,dcb.Parity,dcb.StopBits, COMNUMBER); + } } void CDirectSerial::updateMSR () { @@ -226,153 +343,53 @@ void CDirectSerial::updateMSR () { #endif //return; } - if (dptr & MS_CTS_ON) - newmsr |= MSR_CTS_MASK; - if (dptr & MS_DSR_ON) - newmsr |= MSR_DSR_MASK; - if (dptr & MS_RING_ON) - newmsr |= MSR_RI_MASK; - if (dptr & MS_RLSD_ON) - newmsr |= MSR_CD_MASK; - changeMSR (newmsr); + setCTS((dptr & MS_CTS_ON)!=0); + setDSR((dptr & MS_DSR_ON)!=0); + setRI ((dptr & MS_RING_ON)!=0); + setCD((dptr & MS_RLSD_ON)!=0); } -void CDirectSerial::transmitByte (Bit8u val) { +void CDirectSerial::transmitByte (Bit8u val, bool first) { // mean bug: with break = 1, WriteFile will never return. if((LCR&LCR_BREAK_MASK) == 0) { - DWORD bytesWritten = 0; WriteFile (hCom, &val, 1, &bytesWritten, NULL); - if (bytesWritten > 0) { - ByteTransmitted (); - //LOG_MSG("UART 0x%x: TX 0x%x", base,val); - } else { - LOG_MSG ("UART 0x%x: NO BYTE WRITTEN! PORT HANGS NOW!", base); - } - } else { - // have a delay here, it's the only sense of sending - // data with break=1 - Bitu ticks; - Bitu elapsed = 0; - ticks = GetTicks(); - - while(elapsed < 10) { - elapsed = GetTicks() - ticks; - } - ByteTransmitted(); + if (bytesWritten != 1) + LOG_MSG ("Serial%d: COM port error: write failed!", idnumber); } + if(first) setEvent(SERIAL_THR_EVENT, bytetime/8); + else setEvent(SERIAL_TX_EVENT, bytetime); } /*****************************************************************************/ /* setBreak(val) switches break on or off **/ /*****************************************************************************/ - void CDirectSerial::setBreak (bool value) { - //#ifdef SERIALPORT_DEBUGMSG - //LOG_MSG("UART 0x%x: Break toggeled: %d", base, value); - //#endif - if (value) - SetCommBreak (hCom); - else - ClearCommBreak (hCom); + if (value) SetCommBreak (hCom); + else ClearCommBreak (hCom); } /*****************************************************************************/ /* updateModemControlLines(mcr) sets DTR and RTS. **/ /*****************************************************************************/ -void CDirectSerial::updateModemControlLines ( /*Bit8u mcr */ ) { - bool change = false; +void CDirectSerial::setRTSDTR(bool rts, bool dtr) { + if(rts) dcb.fRtsControl = RTS_CONTROL_ENABLE; + else dcb.fRtsControl = RTS_CONTROL_DISABLE; + if(dtr) dcb.fDtrControl = DTR_CONTROL_ENABLE; + else dcb.fDtrControl = DTR_CONTROL_DISABLE; + SetCommState (hCom, &dcb); - /*** DTR ***/ - if (CSerial::getDTR ()) { // DTR on - if (dcb.fDtrControl == DTR_CONTROL_DISABLE) { - dcb.fDtrControl = DTR_CONTROL_ENABLE; - change = true; - } - } else { - if (dcb.fDtrControl == DTR_CONTROL_ENABLE) { - dcb.fDtrControl = DTR_CONTROL_DISABLE; - change = true; - } - } - /*** RTS ***/ - if (CSerial::getRTS ()) { // RTS on - if (dcb.fRtsControl == RTS_CONTROL_DISABLE) { - dcb.fRtsControl = RTS_CONTROL_ENABLE; - change = true; - } - } else { - if (dcb.fRtsControl == RTS_CONTROL_ENABLE) { - dcb.fRtsControl = RTS_CONTROL_DISABLE; - change = true; - } - } - if (change) - SetCommState (hCom, &dcb); } - -void CDirectSerial::Timer2(void) { - DWORD dwRead = 0; - DWORD errors = 0; - Bit8u chRead = 0; - - - if (lastChance == 0) { // lastChance = 0 - if (CanReceiveByte ()) { - if (ReadFile (hCom, &chRead, 1, &dwRead, NULL)) { - if (dwRead) - receiveByte (chRead); - } - } else { - if (ReadFile (hCom, &chRead, 1, &dwRead, NULL)) { - if (dwRead) { - ChanceChar = chRead; - lastChance++; - } - } - } - } else if (lastChance > 10) { - receiveByte (0); // this causes RX Overrun now - lastChance = 0; - // empty serial buffer - dwRead = 1; - while (dwRead > 0) { // throw away bytes in buffer - ReadFile (hCom, &chRead, 1, &dwRead, NULL); - } - } else { // lastChance>0 // already one waiting - if (CanReceiveByte ()) { // chance used - receiveByte (ChanceChar); - lastChance = 0; - } else - lastChance++; - } - - // check for errors - if (ClearCommError (hCom, &errors, NULL)) - if (errors & (CE_BREAK | CE_FRAME | CE_RXPARITY)) { - Bit8u errreg = 0; - - if (errors & CE_BREAK) { - LOG_MSG ("Serial port at 0x%x: line error: break received.", base); - errreg |= LSR_RX_BREAK_MASK; - } - if (errors & CE_FRAME) { - LOG_MSG ("Serial port at 0x%x: line error: framing error.", base); - errreg |= LSR_FRAMING_ERROR_MASK; - } - if (errors & CE_RXPARITY) { - LOG_MSG ("Serial port at 0x%x: line error: parity error.", base); - errreg |= LSR_PARITY_ERROR_MASK; - } - - receiveError (errreg); - } - // update Modem input line states - updateMSR (); +void CDirectSerial::setRTS(bool val) { + if(val) dcb.fRtsControl = RTS_CONTROL_ENABLE; + else dcb.fRtsControl = RTS_CONTROL_DISABLE; + SetCommState (hCom, &dcb); +} +void CDirectSerial::setDTR(bool val) { + if(val) dcb.fDtrControl = DTR_CONTROL_ENABLE; + else dcb.fDtrControl = DTR_CONTROL_DISABLE; + SetCommState (hCom, &dcb); } - - -#else /*linux and others oneday maybe */ #endif #endif diff --git a/src/hardware/serialport/directserial_win32.h b/src/hardware/serialport/directserial_win32.h index 6025f92..9f1eaac 100644 --- a/src/hardware/serialport/directserial_win32.h +++ b/src/hardware/serialport/directserial_win32.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: directserial_win32.h,v 1.2 2006/02/09 11:47:54 qbix79 Exp $ */ +/* $Id: directserial_win32.h,v 1.4 2007/01/13 08:35:49 qbix79 Exp $ */ // include guard #ifndef DOSBOX_DIRECTSERIAL_WIN32_H @@ -39,43 +39,27 @@ public: DCB dcb; BOOL fSuccess; - CDirectSerial( - IO_ReadHandler* rh, - IO_WriteHandler* wh, - TIMER_TickHandler th, - Bit16u baseAddr, - Bit8u initIrq, - Bit32u initBps, - Bit8u bytesize, - const char *parity, - Bit8u stopbits, - const char * realPort - ); - - + CDirectSerial(Bitu id, CommandLine* cmd/*const char* configstring*/); ~CDirectSerial(); + bool receiveblock; // It's not a block of data it rather blocks + + Bitu rx_retry; // counter of retries + + Bitu rx_retry_max; // how many POLL_EVENTS to wait before causing + // a overrun error. + + + void CheckErrors(); - - Bitu lastChance; // If there is no space for new - // received data, it gets a little chance - Bit8u ChanceChar; - - bool CanRecv(void); - bool CanSend(void); - - bool InstallationSuccessful; // check after constructing. If - // something was wrong, delete it right away. - - void RXBufferEmpty(); - - - void updatePortConfig(Bit8u dll, Bit8u dlm, Bit8u lcr); + void updatePortConfig(Bit16u divider, Bit8u lcr); void updateMSR(); - void transmitByte(Bit8u val); + void transmitByte(Bit8u val, bool first); void setBreak(bool value); - void updateModemControlLines(/*Bit8u mcr*/); - void Timer2(void); + void setRTSDTR(bool rts, bool dtr); + void setRTS(bool val); + void setDTR(bool val); + void handleUpperEvent(Bit16u type); }; diff --git a/src/hardware/serialport/misc_util.cpp b/src/hardware/serialport/misc_util.cpp new file mode 100644 index 0000000..5b99971 --- /dev/null +++ b/src/hardware/serialport/misc_util.cpp @@ -0,0 +1,329 @@ +#include "config.h" + +#if C_MODEM + +/*****************************************************************************/ +// C++ SDLnet wrapper + +// Socket inheritance +#if defined LINUX || defined OS2 +#define CAPWORD (NETWRAPPER_TCP|NETWRAPPER_TCP_NATIVESOCKET) +#ifdef OS2 +typedef int socklen_t; +#endif +#include +#include +#include +#define SOCKET int + +#elif defined WIN32 +#define CAPWORD (NETWRAPPER_TCP|NETWRAPPER_TCP_NATIVESOCKET) +#include +typedef int socklen_t; + +#elif defined __APPLE__ +#define CAPWORD (NETWRAPPER_TCP|NETWRAPPER_TCP_NATIVESOCKET) +#include +#include +#include +#define SOCKET socklen_t + +#else +#define CAPWORD NETWRAPPER_TCP +#endif + +#include "misc_util.h" + + +struct _TCPsocketX { + int ready; + SOCKET channel; + IPaddress remoteAddress; + IPaddress localAddress; + int sflag; +}; + +Bit32u Netwrapper_GetCapabilities() +{ + Bit32u retval=0; + retval = CAPWORD; + return retval; +} + +#ifdef NATIVESOCKETS +TCPClientSocket::TCPClientSocket(int platformsocket) { + sendbuffer=0; + nativetcpstruct = new Bit8u[sizeof(struct _TCPsocketX)]; + + mysock = (TCPsocket)nativetcpstruct; + isopen = false; + if(!SDLNetInited) { + if(SDLNet_Init()==-1) { + LOG_MSG("SDLNet_Init failed: %s\n", SDLNet_GetError()); + return; + } + SDLNetInited = true; + } + // fill the SDL socket manually + ((struct _TCPsocketX*)nativetcpstruct)->ready=0; + ((struct _TCPsocketX*)nativetcpstruct)->sflag=0; + ((struct _TCPsocketX*)nativetcpstruct)->channel=platformsocket; + sockaddr_in sa; + socklen_t sz; + sz=sizeof(sa); + if(getpeername(platformsocket, (sockaddr *)(&sa), &sz)==0) { + ((struct _TCPsocketX*)nativetcpstruct)-> + remoteAddress.host=/*ntohl(*/sa.sin_addr.s_addr;//); + ((struct _TCPsocketX*)nativetcpstruct)-> + remoteAddress.port=/*ntohs(*/sa.sin_port;//); + } + else { + mysock=0; + return; + } + sz=sizeof(sa); + if(getsockname(platformsocket, (sockaddr *)(&sa), &sz)==0) { + ((struct _TCPsocketX*)nativetcpstruct)-> + localAddress.host=/*ntohl(*/sa.sin_addr.s_addr;//); + ((struct _TCPsocketX*)nativetcpstruct)-> + localAddress.port=/*ntohs(*/sa.sin_port;//); + } + else { + mysock=0; + return; + } + if(mysock!=0) { + listensocketset = SDLNet_AllocSocketSet(1); + if(!listensocketset) return; + SDLNet_TCP_AddSocket(listensocketset, mysock); + isopen=true; + return; + } + mysock=0; + return; +} +#endif // NATIVESOCKETS + +TCPClientSocket::TCPClientSocket(TCPsocket source) { +#ifdef NATIVESOCKETS + nativetcpstruct=0; +#endif + sendbuffer=0; + isopen = false; + if(!SDLNetInited) { + if(SDLNet_Init()==-1) { + LOG_MSG("SDLNet_Init failed: %s\n", SDLNet_GetError()); + return; + } + SDLNetInited = true; + } + + mysock=0; + listensocketset=0; + if(source!=0) { + mysock = source; + listensocketset = SDLNet_AllocSocketSet(1); + if(!listensocketset) return; + SDLNet_TCP_AddSocket(listensocketset, source); + + isopen=true; + } +} +TCPClientSocket::TCPClientSocket(const char* destination, Bit16u port) { +#ifdef NATIVESOCKETS + nativetcpstruct=0; +#endif + sendbuffer=0; + isopen = false; + if(!SDLNetInited) { + if(SDLNet_Init()==-1) { + LOG_MSG("SDLNet_Init failed: %s\n", SDLNet_GetError()); + return; + } + SDLNetInited = true; + } + mysock=0; + listensocketset=0; + + IPaddress openip; + if (!SDLNet_ResolveHost(&openip,destination,port)) { + listensocketset = SDLNet_AllocSocketSet(1); + if(!listensocketset) return; + mysock = SDLNet_TCP_Open(&openip); + if(!mysock) return; + SDLNet_TCP_AddSocket(listensocketset, mysock); + isopen=true; + } +} + +TCPClientSocket::~TCPClientSocket() { + + if(sendbuffer) delete [] sendbuffer; +#ifdef NATIVESOCKETS + if(nativetcpstruct) delete [] nativetcpstruct; + else +#endif + if(mysock) { + if(listensocketset) SDLNet_TCP_DelSocket(listensocketset,mysock); + SDLNet_TCP_Close(mysock); + } + + if(listensocketset) SDLNet_FreeSocketSet(listensocketset); +} +bool TCPClientSocket::GetRemoteAddressString(Bit8u* buffer) { + IPaddress* remote_ip; + Bit8u b1, b2, b3, b4; + remote_ip=SDLNet_TCP_GetPeerAddress(mysock); + if(!remote_ip) return false; + b4=remote_ip->host>>24; + b3=(remote_ip->host>>16)&0xff; + b2=(remote_ip->host>>8)&0xff; + b1=remote_ip->host&0xff; + sprintf((char*)buffer,"%u.%u.%u.%u",b1,b2,b3,b4); + return true; +} + +bool TCPClientSocket::ReceiveArray(Bit8u* data, Bitu* size) { + if(SDLNet_CheckSockets(listensocketset,0)) + { + Bitu retval = SDLNet_TCP_Recv(mysock, data, *size); + if(retval<1) { + isopen=false; + *size=0; + return false; + } else { + *size=retval; + return true; + } + } + else { + *size=0; + return true; + } +} + + +Bits TCPClientSocket::GetcharNonBlock() { +// return: +// -1: no data +// -2: socket closed +// 0..255: data + if(SDLNet_CheckSockets(listensocketset,0)) + { + Bitu retval =0; + if(SDLNet_TCP_Recv(mysock, &retval, 1)!=1) { + isopen=false; + return -2; + } else return retval; + } + else return -1; +} +bool TCPClientSocket::Putchar(Bit8u data) { + if(SDLNet_TCP_Send(mysock, &data, 1)!=1) { + isopen=false; + return false; + } + return true; +} + +bool TCPClientSocket::SendArray(Bit8u* data, Bitu bufsize) { + if(SDLNet_TCP_Send(mysock, data, bufsize)!=bufsize) { + isopen=false; + return false; + } + return true; +} + +bool TCPClientSocket::SendByteBuffered(Bit8u data) { + + if(sendbufferindex==(sendbuffersize-1)) { + // buffer is full, get rid of it + sendbuffer[sendbufferindex]=data; + sendbufferindex=0; + + if(SDLNet_TCP_Send(mysock, sendbuffer, sendbuffersize)!=sendbuffersize) { + isopen=false; + return false; + } + } else { + sendbuffer[sendbufferindex]=data; + sendbufferindex++; + } + return true; +} +/* +bool TCPClientSocket::SendArrayBuffered(Bit8u* data, Bitu bufsize) { + + Bitu bytes + while( + + // first case, buffer already full + /*if(sendbufferindex==(sendbuffersize-1)) { + // buffer is full, get rid of it + sendbuffer[sendbufferindex]=data; + sendbufferindex=0; + + if(SDLNet_TCP_Send(mysock, sendbuffer, sendbuffersize)!=sendbuffersize) { + isopen=false; + return false; + } + }*/ +//} + +void TCPClientSocket::FlushBuffer() { + if(sendbufferindex) { + if(SDLNet_TCP_Send(mysock, sendbuffer, + sendbufferindex)!=sendbufferindex) { + isopen=false; + return; + } + sendbufferindex=0; + } +} + +void TCPClientSocket::SetSendBufferSize(Bitu bufsize) { + if(sendbuffer) delete [] sendbuffer; + sendbuffer = new Bit8u[bufsize]; + sendbuffersize=bufsize; + sendbufferindex=0; +} + + +TCPServerSocket::TCPServerSocket(Bit16u port) +{ + isopen = false; + mysock = 0; + if(!SDLNetInited) { + if(SDLNet_Init()==-1) { + LOG_MSG("SDLNet_Init failed: %s\n", SDLNet_GetError()); + return; + } + SDLNetInited = true; + } + if (port) { + IPaddress listen_ip; + SDLNet_ResolveHost(&listen_ip, NULL, port); + mysock=SDLNet_TCP_Open(&listen_ip); + if(!mysock) return; + } + else return; + isopen = true; +} + +TCPServerSocket::~TCPServerSocket() { + if(mysock) SDLNet_TCP_Close(mysock); +} + +TCPClientSocket* TCPServerSocket::Accept() { + + TCPsocket new_tcpsock; + + new_tcpsock=SDLNet_TCP_Accept(mysock); + if(!new_tcpsock) { + //printf("SDLNet_TCP_Accept: %s\n", SDLNet_GetError()); + return 0; + } + + return new TCPClientSocket(new_tcpsock); +} +#endif // #if C_MODEM diff --git a/src/hardware/serialport/misc_util.h b/src/hardware/serialport/misc_util.h new file mode 100644 index 0000000..9b89ac1 --- /dev/null +++ b/src/hardware/serialport/misc_util.h @@ -0,0 +1,79 @@ +#ifndef SDLNETWRAPPER_H +#define SDLNETWRAPPER_H + +#if C_MODEM + +#include "SDL_net.h" +#include "support.h" + +#if defined LINUX || defined OS2 +#define NATIVESOCKETS + +#elif defined WIN32 +#define NATIVESOCKETS + +#else +#endif + +// Netwrapper Capabilities +#define NETWRAPPER_TCP 1 +#define NETWRAPPER_TCP_NATIVESOCKET 2 + +Bit32u Netwrapper_GetCapabilities(); + + +class TCPClientSocket { + public: + TCPClientSocket(TCPsocket source); + TCPClientSocket(const char* destination, Bit16u port); +#ifdef NATIVESOCKETS + Bit8u* nativetcpstruct; + TCPClientSocket(int platformsocket); +#endif + ~TCPClientSocket(); + + // return: + // -1: no data + // -2: socket closed + // >0: data char + Bits GetcharNonBlock(); + + + bool Putchar(Bit8u data); + bool SendArray(Bit8u* data, Bitu bufsize); + bool ReceiveArray(Bit8u* data, Bitu* size); + bool isopen; + + bool GetRemoteAddressString(Bit8u* buffer); + + void FlushBuffer(); + void SetSendBufferSize(Bitu bufsize); + + // buffered send functions + bool SendByteBuffered(Bit8u data); + bool SendArrayBuffered(Bit8u* data, Bitu bufsize); + + private: + TCPsocket mysock; + SDLNet_SocketSet listensocketset; + + // Items for send buffering + Bitu sendbuffersize; + Bitu sendbufferindex; + + Bit8u* sendbuffer; +}; + +class TCPServerSocket { + public: + bool isopen; + TCPsocket mysock; + TCPServerSocket(Bit16u port); + ~TCPServerSocket(); + TCPClientSocket* Accept(); +}; + + +#endif + +#endif //#if C_MODEM diff --git a/src/hardware/serialport/nullmodem.cpp b/src/hardware/serialport/nullmodem.cpp new file mode 100644 index 0000000..c0ca3f3 --- /dev/null +++ b/src/hardware/serialport/nullmodem.cpp @@ -0,0 +1,496 @@ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "dosbox.h" + +#if C_MODEM + +#include "setup.h" // CommandLine +#include "serialport.h" +#include "nullmodem.h" + +CNullModem::CNullModem(Bitu id, CommandLine* cmd):CSerial (id, cmd) { + Bitu temptcpport=23; + memset(&telClient, 0, sizeof(telClient)); + InstallationSuccessful = false; + serversocket = 0; + clientsocket = 0; + serverport = 0; + clientport = 0; + + rx_retry = 0; + rx_retry_max = 100; + + tx_gather = 12; + + dtrrespect=false; + tx_block=false; + receiveblock=false; + transparent=false; + telnet=false; + + Bitu bool_temp=0; + + // usedtr: The nullmodem will + // 1) when it is client connect to the server not immediately but + // as soon as a modem-aware application is started (DTR is switched on). + // 2) only transfer data when DTR is on. + if(getBituSubstring("usedtr:", &bool_temp, cmd)) { + if(bool_temp==1) { + dtrrespect=true; + transparent=true; + } + } + // transparent: don't add additional handshake control. + if(getBituSubstring("transparent:", &bool_temp, cmd)) { + if(bool_temp==1) transparent=true; + else transparent=false; + } + // telnet: interpret telnet commands. + if(getBituSubstring("telnet:", &bool_temp, cmd)) { + if(bool_temp==1) { + transparent=true; + telnet=true; + } + } + // rxdelay: How many milliseconds to wait before causing an + // overflow when the application is unresponsive. + if(getBituSubstring("rxdelay:", &rx_retry_max, cmd)) { + if(!(rx_retry_max<=10000)) { + rx_retry_max=50; + } + } + // txdelay: How many milliseconds to wait before sending data. + // This reduces network overhead quite a lot. + if(getBituSubstring("txdelay:", &tx_gather, cmd)) { + if(!(tx_gather<=500)) { + tx_gather=12; + } + } + // port is for both server and client + if(getBituSubstring("port:", &temptcpport, cmd)) { + if(!(temptcpport>0&&temptcpport<65536)) { + temptcpport=23; + } + } + // socket inheritance + if(getBituSubstring("inhsocket:", &bool_temp, cmd)) { + if(Netwrapper_GetCapabilities()&NETWRAPPER_TCP_NATIVESOCKET) { + if(bool_temp==1) { + int sock; + if (control->cmdline->FindInt("-socket",sock,true)) { + dtrrespect=false; + transparent=true; + // custom connect + Bit8u peernamebuf[16]; + LOG_MSG("inheritance port: %d",sock); + clientsocket = new TCPClientSocket(sock); + if(!clientsocket->isopen) { + LOG_MSG("Serial%d: Connection failed.",COMNUMBER); + delete clientsocket; + clientsocket=0; + return; + } + clientsocket->SetSendBufferSize(256); + clientsocket->GetRemoteAddressString(peernamebuf); + // transmit the line status + if(!transparent) setRTSDTR(getRTS(), getDTR()); + + LOG_MSG("Serial%d: Connected to %s",COMNUMBER,peernamebuf); + setEvent(SERIAL_POLLING_EVENT, 1); + + CSerial::Init_Registers (); + InstallationSuccessful = true; + + setCTS(true); + setDSR(true); + setRI (false); + setCD (true); + return; + } else { + LOG_MSG("Serial%d: -socket start parameter missing.",COMNUMBER); + return; + } + } + } else { + LOG_MSG("Serial%d: socket inheritance not supported on this platform.", + COMNUMBER); + return; + } + } + std::string tmpstring; + if(cmd->FindStringBegin("server:",tmpstring,false)) { + // we are a client + const char* hostnamechar=tmpstring.c_str(); + Bitu hostlen=strlen(hostnamechar)+1; + if(hostlen>sizeof(hostnamebuffer)) { + hostlen=sizeof(hostnamebuffer); + hostnamebuffer[sizeof(hostnamebuffer)-1]=0; + } + memcpy(hostnamebuffer,hostnamechar,hostlen); + clientport=temptcpport; + if(dtrrespect) { + // we connect as soon as DTR is switched on + setEvent(SERIAL_NULLMODEM_DTR_EVENT, 50); + LOG_MSG("Serial%d: Waiting for DTR...",COMNUMBER); + } else ClientConnect(); + } else { + // we are a server + serverport = (Bit16u)temptcpport; + serversocket = new TCPServerSocket(serverport); + if(!serversocket->isopen) return; + LOG_MSG("Serial%d: Nullmodem server waiting for connection on port %d...", + COMNUMBER,serverport); + setEvent(SERIAL_SERVER_POLLING_EVENT, 50); + } + + // .... + + CSerial::Init_Registers (); + InstallationSuccessful = true; + + setCTS(dtrrespect||transparent); + setDSR(dtrrespect||transparent); + setRI (false); + setCD (dtrrespect); +} + +CNullModem::~CNullModem () { + if(serversocket) delete serversocket; + if(clientsocket) delete clientsocket; + // remove events + for(Bitu i = SERIAL_BASE_EVENT_COUNT+1; + i <= SERIAL_NULLMODEM_EVENT_COUNT; i++) + removeEvent(i); +} + +void CNullModem::WriteChar(Bit8u data) { + + if(clientsocket)clientsocket->SendByteBuffered(data); + if(!tx_block) { + //LOG_MSG("setevreduct"); + setEvent(SERIAL_TX_REDUCTION, (float)tx_gather); + tx_block=true; + } +} + +Bits CNullModem::readChar() { + + Bits rxchar = clientsocket->GetcharNonBlock(); + if(telnet && rxchar>=0) return TelnetEmulation(rxchar); + else if(rxchar==0xff && !transparent) {// escape char + // get the next char + Bits rxchar = clientsocket->GetcharNonBlock(); + if(rxchar==0xff) return rxchar; // 0xff 0xff -> 0xff was meant + rxchar&0x1? setCTS(true) : setCTS(false); + rxchar&0x2? setDSR(true) : setDSR(false); + if(rxchar&0x4) receiveError(0x10); + return -1; // no "payload" received + } else return rxchar; +} + +void CNullModem::ClientConnect(){ + Bit8u peernamebuf[16]; + clientsocket = new TCPClientSocket((char*)hostnamebuffer, + (Bit16u)clientport); + if(!clientsocket->isopen) { + LOG_MSG("Serial%d: Connection failed.",idnumber+1); + delete clientsocket; + clientsocket=0; + return; + } + clientsocket->SetSendBufferSize(256); + clientsocket->GetRemoteAddressString(peernamebuf); + // transmit the line status + if(!transparent) setRTSDTR(getRTS(), getDTR()); + + LOG_MSG("Serial%d: Connected to %s",idnumber+1,peernamebuf); + setEvent(SERIAL_POLLING_EVENT, 1); +} + +void CNullModem::Disconnect() { + // it was disconnected; free the socket and restart the server socket + LOG_MSG("Serial%d: Disconnected.",idnumber+1); + delete clientsocket; + clientsocket=0; + setDTR(false); + setCTS(false); + if(serverport) { + serversocket = new TCPServerSocket(serverport); + if(serversocket->isopen) + setEvent(SERIAL_SERVER_POLLING_EVENT, 50); + else delete serversocket; + } +} + +void CNullModem::handleUpperEvent(Bit16u type) { + + switch(type) { + case SERIAL_POLLING_EVENT: { + // periodically check if new data arrived, disconnect + // if required. Add it back. + if(!receiveblock && clientsocket) { + if(((!(LSR&LSR_RX_DATA_READY_MASK)) || rx_retry>=rx_retry_max ) + &&(!dtrrespect | (dtrrespect&& getDTR()) )) { + rx_retry=0; + Bits rxchar = readChar(); + if(rxchar>=0) { + receiveblock=true; + setEvent(SERIAL_RX_EVENT, bytetime-0.01f); + receiveByte((Bit8u)rxchar); + } + else if(rxchar==-2) Disconnect(); + else setEvent(SERIAL_POLLING_EVENT, 1); + } else { + rx_retry++; + setEvent(SERIAL_POLLING_EVENT, 1); + } + } + break; + } + case SERIAL_RX_EVENT: { + // receive time is up, try to receive another byte. + receiveblock=false; + + if((!(LSR&LSR_RX_DATA_READY_MASK) || rx_retry>=rx_retry_max) + &&(!dtrrespect | (dtrrespect&& getDTR()) ) + ) { + rx_retry=0; + Bits rxchar = readChar(); + if(rxchar>=0) { + receiveblock=true; + setEvent(SERIAL_RX_EVENT, bytetime-0.01f); + receiveByte((Bit8u)rxchar); + } + else if(rxchar==-2) Disconnect(); + else setEvent(SERIAL_POLLING_EVENT, 1); + } else { + setEvent(SERIAL_POLLING_EVENT, 1); + rx_retry++; + } + break; + } + case SERIAL_TX_EVENT: { + ByteTransmitted(); + break; + } + case SERIAL_THR_EVENT: { + ByteTransmitting(); + // actually send it + setEvent(SERIAL_TX_EVENT,bytetime+0.01f); + break; + } + case SERIAL_SERVER_POLLING_EVENT: { + // As long as nothing is connected to out server poll the + // connection. + if((clientsocket=serversocket->Accept())) { + Bit8u peeripbuf[16]; + clientsocket->GetRemoteAddressString(peeripbuf); + LOG_MSG("Serial%d: A client (%s) has connected.",idnumber+1,peeripbuf); + // new socket found... + clientsocket->SetSendBufferSize(256); + setEvent(SERIAL_POLLING_EVENT, 1); + + // we don't accept further connections + delete serversocket; + serversocket=0; + + // transmit the line status + setRTSDTR(getRTS(), getDTR()); + } else { + // continue looking + setEvent(SERIAL_SERVER_POLLING_EVENT, 50); + } + break; + } + case SERIAL_TX_REDUCTION: { + // Flush the data in the transmitting buffer. + if(clientsocket) clientsocket->FlushBuffer(); + tx_block=false; + break; + } + case SERIAL_NULLMODEM_DTR_EVENT: { + if(getDTR()) ClientConnect(); + else setEvent(SERIAL_NULLMODEM_DTR_EVENT,50); + break; + } + } +} + +/*****************************************************************************/ +/* updatePortConfig is called when emulated app changes the serial port **/ +/* parameters baudrate, stopbits, number of databits, parity. **/ +/*****************************************************************************/ +void CNullModem::updatePortConfig (Bit16u divider, Bit8u lcr) { + +} + +void CNullModem::updateMSR () { + +} + +void CNullModem::transmitByte (Bit8u val, bool first) { + + // transmit it later in THR_Event + if(first) { + setEvent(SERIAL_THR_EVENT, bytetime/8); + } + else { + //if(clientsocket) clientsocket->Putchar(val); + setEvent(SERIAL_TX_EVENT, bytetime); + } + /*****************************/ + if(val==0xff) WriteChar(0xff); + + WriteChar(val); +} + +Bits CNullModem::TelnetEmulation(Bit8u data) { + Bit8u response[3]; + if(telClient.inIAC) { + if(telClient.recCommand) { + if((data != 0) && (data != 1) && (data != 3)) { + LOG_MSG("Serial%d: Unrecognized telnet option %d",COMNUMBER, data); + if(telClient.command>250) { + /* Reject anything we don't recognize */ + response[0]=0xff; + response[1]=252; + response[2]=data; /* We won't do crap! */ + if(clientsocket) clientsocket->SendArray(response, 3); + } + } + switch(telClient.command) { + case 251: /* Will */ + if(data == 0) telClient.binary[TEL_SERVER] = true; + if(data == 1) telClient.echo[TEL_SERVER] = true; + if(data == 3) telClient.supressGA[TEL_SERVER] = true; + break; + case 252: /* Won't */ + if(data == 0) telClient.binary[TEL_SERVER] = false; + if(data == 1) telClient.echo[TEL_SERVER] = false; + if(data == 3) telClient.supressGA[TEL_SERVER] = false; + break; + case 253: /* Do */ + if(data == 0) { + telClient.binary[TEL_CLIENT] = true; + response[0]=0xff; + response[1]=251; + response[2]=0; /* Will do binary transfer */ + if(clientsocket) clientsocket->SendArray(response, 3); + } + if(data == 1) { + telClient.echo[TEL_CLIENT] = false; + response[0]=0xff; + response[1]=252; + response[2]=1; /* Won't echo (too lazy) */ + if(clientsocket) clientsocket->SendArray(response, 3); + } + if(data == 3) { + telClient.supressGA[TEL_CLIENT] = true; + response[0]=0xff; + response[1]=251; + response[2]=3; /* Will Suppress GA */ + if(clientsocket) clientsocket->SendArray(response, 3); + } + break; + case 254: /* Don't */ + if(data == 0) { + telClient.binary[TEL_CLIENT] = false; + response[0]=0xff; + response[1]=252; + response[2]=0; /* Won't do binary transfer */ + if(clientsocket) clientsocket->SendArray(response, 3); + } + if(data == 1) { + telClient.echo[TEL_CLIENT] = false; + response[0]=0xff; + response[1]=252; + response[2]=1; /* Won't echo (fine by me) */ + if(clientsocket) clientsocket->SendArray(response, 3); + } + if(data == 3) { + telClient.supressGA[TEL_CLIENT] = true; + response[0]=0xff; + response[1]=251; + response[2]=3; /* Will Suppress GA (too lazy) */ + if(clientsocket) clientsocket->SendArray(response, 3); + } + break; + default: + LOG_MSG("MODEM: Telnet client sent IAC %d", telClient.command); + break; + } + telClient.inIAC = false; + telClient.recCommand = false; + return -1; //continue; + } else { + if(data==249) { + /* Go Ahead received */ + telClient.inIAC = false; + return -1; //continue; + } + telClient.command = data; + telClient.recCommand = true; + + if((telClient.binary[TEL_SERVER]) && (data == 0xff)) { + /* Binary data with value of 255 */ + telClient.inIAC = false; + telClient.recCommand = false; + return 0xff; + } + } + } else { + if(data == 0xff) { + telClient.inIAC = true; + return -1; + } + return data; + } + return -1; // ??? +} + + +/*****************************************************************************/ +/* setBreak(val) switches break on or off **/ +/*****************************************************************************/ + +void CNullModem::setBreak (bool value) { + CNullModem::setRTSDTR(getRTS(), getDTR()); +} + +/*****************************************************************************/ +/* updateModemControlLines(mcr) sets DTR and RTS. **/ +/*****************************************************************************/ +void CNullModem::setRTSDTR(bool xrts, bool xdtr) { + if(!transparent) { + Bit8u control[2]; + control[0]=0xff; + control[1]=0x0; + if(xrts) control[1]|=1; + if(xdtr) control[1]|=2; + if(LCR&LCR_BREAK_MASK) control[1]|=4; + if(clientsocket) clientsocket->SendArray(control, 2); + } +} +void CNullModem::setRTS(bool val) { + setRTSDTR(val, getDTR()); +} +void CNullModem::setDTR(bool val) { + setRTSDTR(getRTS(), val); +} +#endif diff --git a/src/hardware/serialport/nullmodem.h b/src/hardware/serialport/nullmodem.h new file mode 100644 index 0000000..91b1d13 --- /dev/null +++ b/src/hardware/serialport/nullmodem.h @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2002-2007 The DOSBox Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* $Id: nullmodem.h,v 1.2 2007/02/22 08:41:16 qbix79 Exp $ */ + +// include guard +#ifndef DOSBOX_NULLMODEM_WIN32_H +#define DOSBOX_NULLMODEM_WIN32_H + +#include "dosbox.h" + +#if C_MODEM + +#include "misc_util.h" +#include "serialport.h" + +#define SERIAL_SERVER_POLLING_EVENT SERIAL_BASE_EVENT_COUNT+1 +#define SERIAL_TX_REDUCTION SERIAL_BASE_EVENT_COUNT+2 +#define SERIAL_NULLMODEM_DTR_EVENT SERIAL_BASE_EVENT_COUNT+3 +#define SERIAL_NULLMODEM_EVENT_COUNT SERIAL_BASE_EVENT_COUNT+3 + +class CNullModem : public CSerial { +public: + TCPServerSocket* serversocket; + TCPClientSocket* clientsocket; + + CNullModem(Bitu id, CommandLine* cmd); + ~CNullModem(); + bool receiveblock; // It's not a block of data it rather blocks + Bit16u serverport; // we are a server if this is nonzero + Bit16u clientport; + + Bit8u hostnamebuffer[128]; // the name passed to us by the user + + void updatePortConfig(Bit16u divider, Bit8u lcr); + void updateMSR(); + void transmitByte(Bit8u val, bool first); + void setBreak(bool value); + + void setRTSDTR(bool rts, bool dtr); + void setRTS(bool val); + void setDTR(bool val); + void handleUpperEvent(Bit16u type); + + void ClientConnect(); + void Disconnect(); + Bits readChar(); + void WriteChar(Bit8u data); + + bool tx_block; // true while the SERIAL_TX_REDUCTION event + // is pending + + Bitu rx_retry; // counter of retries + + Bitu rx_retry_max; // how many POLL_EVENTS to wait before causing + // a overrun error. + + Bitu tx_gather; // how long to gather tx data before + // sending all of them [milliseconds] + + + bool dtrrespect; // dtr behavior - only send data to the serial + // port when DTR is on + + bool transparent; // if true, don't send 0xff 0xXX to toggle + // DSR/CTS. + + bool telnet; // Do Telnet parsing. + + // Telnet's brain +#define TEL_CLIENT 0 +#define TEL_SERVER 1 + + Bits TelnetEmulation(Bit8u data); + + // Telnet's memory + struct { + bool binary[2]; + bool echo[2]; + bool supressGA[2]; + bool timingMark[2]; + + bool inIAC; + bool recCommand; + Bit8u command; + } telClient; +}; + +#endif // C_MODEM +#endif // include guard diff --git a/src/hardware/serialport/serialdummy.cpp b/src/hardware/serialport/serialdummy.cpp index 75636bb..8082bf2 100644 --- a/src/hardware/serialport/serialdummy.cpp +++ b/src/hardware/serialport/serialdummy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: serialdummy.cpp,v 1.2 2006/02/09 11:47:54 qbix79 Exp $ */ +/* $Id: serialdummy.cpp,v 1.4 2007/01/13 08:35:49 qbix79 Exp $ */ #include "dosbox.h" @@ -24,46 +24,54 @@ #include "serialdummy.h" #include "serialport.h" - -CSerialDummy::CSerialDummy( - IO_ReadHandler* rh, - IO_WriteHandler* wh, - TIMER_TickHandler th, - Bit16u baseAddr, - Bit8u initIrq, - Bit32u initBps, - Bit8u bytesize, - const char* parity, - Bit8u stopbits - ) : CSerial( - rh, wh, th, - baseAddr,initIrq,initBps,bytesize,parity,stopbits) - { - CSerial::Init_Registers(initBps,bytesize,parity,stopbits); - } - -CSerialDummy::~CSerialDummy() { +CSerialDummy::CSerialDummy(Bitu id, CommandLine* cmd):CSerial(id, cmd) { + CSerial::Init_Registers(); + setRI(false); + setDSR(false); + setCD(false); + setCTS(false); + InstallationSuccessful=true; } -void CSerialDummy::RXBufferEmpty() { -// no external buffer, not used here +CSerialDummy::~CSerialDummy() { + // clear events + removeEvent(SERIAL_TX_EVENT); +} + +void CSerialDummy::handleUpperEvent(Bit16u type) { + if(type==SERIAL_TX_EVENT) { + //LOG_MSG("SERIAL_TX_EVENT"); +#ifdef CHECKIT_TESTPLUG + receiveByte(loopbackdata); +#endif + ByteTransmitted(); // tx timeout + } + else if(type==SERIAL_THR_EVENT){ + //LOG_MSG("SERIAL_THR_EVENT"); + ByteTransmitting(); + setEvent(SERIAL_TX_EVENT,bytetime); + } + } /*****************************************************************************/ /* updatePortConfig is called when emulated app changes the serial port **/ /* parameters baudrate, stopbits, number of databits, parity. **/ /*****************************************************************************/ -void CSerialDummy::updatePortConfig(Bit8u dll, Bit8u dlm, Bit8u lcr) { +void CSerialDummy::updatePortConfig(Bit16u divider, Bit8u lcr) { //LOG_MSG("Serial port at 0x%x: Port params changed: %d Baud", base,dcb.BaudRate); } void CSerialDummy::updateMSR() { - changeMSR(0); } +void CSerialDummy::transmitByte(Bit8u val, bool first) { -void CSerialDummy::transmitByte(Bit8u val) { - ByteTransmitted(); - //LOG_MSG("UART 0x%x: TX 0x%x", base,val); + if(first) setEvent(SERIAL_THR_EVENT, bytetime/10); + else setEvent(SERIAL_TX_EVENT, bytetime); + +#ifdef CHECKIT_TESTPLUG + loopbackdata=val; +#endif } /*****************************************************************************/ @@ -75,11 +83,21 @@ void CSerialDummy::setBreak(bool value) { } /*****************************************************************************/ -/* updateModemControlLines(mcr) sets DTR and RTS. **/ +/* setRTSDTR sets the modem control lines **/ /*****************************************************************************/ -void CSerialDummy::updateModemControlLines(/*Bit8u mcr*/) { +void CSerialDummy::setRTSDTR(bool rts, bool dtr) { + setRTS(rts); + setDTR(dtr); +} +void CSerialDummy::setRTS(bool val) { +#ifdef CHECKIT_TESTPLUG + setCTS(val); +#endif +} +void CSerialDummy::setDTR(bool val) { +#ifdef CHECKIT_TESTPLUG + setDSR(val); + setRI(val); + setCD(val); +#endif } - -void CSerialDummy::Timer2(void) { -} - diff --git a/src/hardware/serialport/serialdummy.h b/src/hardware/serialport/serialdummy.h index 78e9a8c..1fbeb57 100644 --- a/src/hardware/serialport/serialdummy.h +++ b/src/hardware/serialport/serialdummy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,39 +16,34 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: serialdummy.h,v 1.2 2006/02/09 11:47:55 qbix79 Exp $ */ +/* $Id: serialdummy.h,v 1.4 2007/01/13 08:35:49 qbix79 Exp $ */ #ifndef INCLUDEGUARD_SERIALDUMMY_H #define INCLUDEGUARD_SERIALDUMMY_H #include "serialport.h" +//#define CHECKIT_TESTPLUG + class CSerialDummy : public CSerial { public: - - CSerialDummy( - IO_ReadHandler* rh, - IO_WriteHandler* wh, - TIMER_TickHandler th, - Bit16u baseAddr, - Bit8u initIrq, - Bit32u initBps, - Bit8u bytesize, - const char* parity, - Bit8u stopbits - ); - - + CSerialDummy(Bitu id, CommandLine* cmd); ~CSerialDummy(); - bool CanRecv(void); - bool CanSend(void); - void RXBufferEmpty(); - void updatePortConfig(Bit8u dll, Bit8u dlm, Bit8u lcr); + + void setRTSDTR(bool rts, bool dtr); + void setRTS(bool val); + void setDTR(bool val); + + void updatePortConfig(Bit16u, Bit8u lcr); void updateMSR(); - void transmitByte(Bit8u val); + void transmitByte(Bit8u val, bool first); void setBreak(bool value); - void updateModemControlLines(/*Bit8u mcr*/); - void Timer2(void); + void handleUpperEvent(Bit16u type); + +#ifdef CHECKIT_TESTPLUG + Bit8u loopbackdata; +#endif + }; #endif // INCLUDEGUARD diff --git a/src/hardware/serialport/serialport.cpp b/src/hardware/serialport/serialport.cpp index ed4694f..cef4643 100644 --- a/src/hardware/serialport/serialport.cpp +++ b/src/hardware/serialport/serialport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,270 +16,312 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: serialport.cpp,v 1.4 2006/02/09 11:47:55 qbix79 Exp $ */ - +/* $Id: serialport.cpp,v 1.7 2007/02/22 08:41:16 qbix79 Exp $ */ #include #include #include "dosbox.h" -#include "support.h" #include "inout.h" #include "pic.h" #include "setup.h" -#include "timer.h" +#include "bios.h" // SetComPorts(..) +#include "callback.h" // CALLBACK_Idle #include "serialport.h" #include "directserial_win32.h" +#include "directserial_posix.h" #include "directserial_os2.h" #include "serialdummy.h" #include "softmodem.h" +#include "nullmodem.h" + +#include "cpu.h" + + +bool device_COM::Read(Bit8u * data,Bit16u * size) { + // DTR + RTS on + sclass->Write_MCR(0x03); + for (Bit16u i=0; i<*size; i++) + { + if(!(sclass->Getchar(&data[i],true,1000))) { + *size=i; + return true; + } + } + return true; +} + + +bool device_COM::Write(Bit8u * data,Bit16u * size) { + // DTR + RTS on + sclass->Write_MCR(0x03); + for (Bit16u i=0; i<*size; i++) + { + if(!(sclass->Putchar(data[i],true,true,1000))) { + *size=i; + sclass->Write_MCR(0x01); + return false; + } + } + // RTS off + sclass->Write_MCR(0x01); + return true; +} + +bool device_COM::Seek(Bit32u * pos,Bit32u type) { + *pos = 0; + return true; +} + +bool device_COM::Close() { + return false; +} + +Bit16u device_COM::GetInformation(void) { + return 0x80A0; +}; + +device_COM::device_COM(class CSerial* sc) { + sclass = sc; + SetName(serial_comname[sclass->idnumber]); +} + +device_COM::~device_COM() { +} -#define LOG_UART LOG_MSG // COM1 - COM4 objects -static CSerial *serial1 = 0; -static CSerial *serial2 = 0; -static CSerial *serial3 = 0; -static CSerial *serial4 = 0; -//static CSerial** serialPortObjects[] = {NULL, &serial1,&serial2,&serial3,&serial4}; +CSerial* serialports[4] ={0,0,0,0}; -Bit8u serialGetComnumberByBaseAddress (Bit16u base) { - if (base == COM1_BASE) - return 1; - else if (base == COM2_BASE) - return 2; - else if (base == COM3_BASE) - return 3; - else if (base == COM4_BASE) - return 4; - else - return 255; // send thispointer to nirwana ;) -} +static Bitu SERIAL_Read (Bitu port, Bitu iolen) { + for(Bitu i = 0; i < 4; i++) { + if(serial_baseaddr[i]==(port&0xfff8) && (serialports[i]!=0)) { + Bitu retval=0xff; + switch (port & 0x7) { + case RHR_OFFSET: + retval = serialports[i]->Read_RHR(); + break; + case IER_OFFSET: + retval = serialports[i]->Read_IER(); + break; + case ISR_OFFSET: + retval = serialports[i]->Read_ISR(); + break; + case LCR_OFFSET: + retval = serialports[i]->Read_LCR(); + break; + case MCR_OFFSET: + retval = serialports[i]->Read_MCR(); + break; + case LSR_OFFSET: + retval = serialports[i]->Read_LSR(); + break; + case MSR_OFFSET: + retval = serialports[i]->Read_MSR(); + break; + case SPR_OFFSET: + retval = serialports[i]->Read_SPR(); + break; + } -// Usage of FastDelegates (http://www.codeproject.com/cpp/FastDelegate.asp) -// as I/O-Array would make many of these unneccessary. (member function pointer) - -//Some defines for repeated functions - -#define SERIAL_UPDATE(number) \ -void SERIAL##number##_Update(void) { \ - serial##number->Timer (); \ -} - -#define SERIAL_WRITE_TREE(number) \ -static void SERIAL##number##_Write (Bitu port, Bitu val, Bitu iolen) { \ - switch (port & 0x7) { \ - case THR_OFFSET: \ - serial##number ->Write_THR (val); \ - return; \ - case IER_OFFSET: \ - serial##number ->Write_IER (val); \ - return; \ - case LCR_OFFSET: \ - serial##number ->Write_LCR (val); \ - return; \ - case MCR_OFFSET: \ - serial##number ->Write_MCR (val); \ - return; \ - case MSR_OFFSET: \ - serial##number ->Write_MSR (val); \ - return; \ - case SPR_OFFSET: \ - serial##number ->Write_SPR (val); \ - return; \ - default: \ - serial##number ->Write_reserved (val, port & 0x7); \ - } \ -} - -#define SERIAL_READ_TREE(number) \ -static Bitu SERIAL##number##_Read (Bitu port, Bitu iolen) { \ - switch (port & 0x7) { \ - case RHR_OFFSET: \ - return serial##number ->Read_RHR (); \ - case IER_OFFSET: \ - return serial##number ->Read_IER (); \ - case ISR_OFFSET: \ - return serial##number ->Read_ISR (); \ - case LCR_OFFSET: \ - return serial##number ->Read_LCR (); \ - case MCR_OFFSET: \ - return serial##number ->Read_MCR (); \ - case LSR_OFFSET: \ - return serial##number ->Read_LSR (); \ - case MSR_OFFSET: \ - return serial##number ->Read_MSR (); \ - case SPR_OFFSET: \ - return serial##number ->Read_SPR (); \ - } \ - return 0; \ -} - -//The Functions - -SERIAL_UPDATE(1); -SERIAL_UPDATE(2); -SERIAL_UPDATE(3); -SERIAL_UPDATE(4); - -SERIAL_WRITE_TREE(1); -SERIAL_WRITE_TREE(2); -SERIAL_WRITE_TREE(3); -SERIAL_WRITE_TREE(4); - -SERIAL_READ_TREE(1); -SERIAL_READ_TREE(2); -SERIAL_READ_TREE(3); -SERIAL_READ_TREE(4); - -#undef SERIAL_UPDATE -#undef SERIAL_WRITE_TREE -#undef SERIAL_READ_TREE - -void CSerial::Timer (void) { - //LOG_UART("Serial port at %x: Timer", base); - if (loopback_pending) { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Loopback sent back", base); +#if SERIAL_DEBUG + const char* const dbgtext[]= + {"RHR","IER","ISR","LCR","MCR","LSR","MSR","SPR"}; + if(serialports[i]->dbg_register) + fprintf(serialports[i]->debugfp,"%12.3f read 0x%x from %s.\r\n", + PIC_FullIndex(),retval,dbgtext[port&0x7]); #endif - loopback_pending = false; - receiveByte (loopback_data); - ByteTransmitted (); + + return retval; + } + } + return 0xff; +} +static void SERIAL_Write (Bitu port, Bitu val, Bitu) { + + for(Bitu i = 0; i < 4; i++) { + if(serial_baseaddr[i]==(port&0xfff8) && serialports[i]) { + +#if SERIAL_DEBUG + const char* const dbgtext[]={"THR","IER","FCR","LCR","MCR","!LSR","MSR","SPR"}; + if(serialports[i]->dbg_register) + fprintf(serialports[i]->debugfp,"%12.3f write 0x%x to %s.\r\n", + PIC_FullIndex(),val,dbgtext[port&0x7]); +#endif + + switch (port & 0x7) { + case THR_OFFSET: + serialports[i]->Write_THR (val); + return; + case IER_OFFSET: + serialports[i]->Write_IER (val); + return; + case FCR_OFFSET: + serialports[i]->Write_FCR (val); + return; + case LCR_OFFSET: + serialports[i]->Write_LCR (val); + return; + case MCR_OFFSET: + serialports[i]->Write_MCR (val); + return; + case MSR_OFFSET: + serialports[i]->Write_MSR (val); + return; + case SPR_OFFSET: + serialports[i]->Write_SPR (val); + return; + default: + serialports[i]->Write_reserved (val, port & 0x7); + } + } + } +} + +void CSerial::changeLineProperties() { + // update the event wait time + + float bitlen = (1000.0f/115200.0f)*(float)baud_divider; + bytetime=bitlen*(float)(1+5+1); // startbit + minimum length + stopbit + bytetime+= bitlen*(float)(LCR&0x3); // databits + if(LCR&0x4) bytetime+=bitlen; // stopbit + updatePortConfig (baud_divider, LCR); +} + +static void Serial_EventHandler(Bitu val) { + Bitu serclassid=val&0x3; + if(serialports[serclassid]!=0) + serialports[serclassid]->handleEvent(val>>2); +} + +void CSerial::setEvent(Bit16u type, float duration) { + PIC_AddEvent(Serial_EventHandler,duration,(type<<2)|idnumber); +} + +void CSerial::removeEvent(Bit16u type) { + // TODO + PIC_RemoveSpecificEvents(Serial_EventHandler,(type<<2)|idnumber); +} + +void CSerial::handleEvent(Bit16u type) { + switch(type) { + case SERIAL_TX_LOOPBACK_EVENT: { + +#if SERIAL_DEBUG + if(dbg_serialtraffic) + fprintf(debugfp,loopback_data<0x10? "%12.3f tx 0x%02x (%u) (loopback)\r\n": + "%12.3f tx 0x%02x (%c) (loopback)\r\n", + PIC_FullIndex(),loopback_data, + loopback_data); +#endif + + receiveByte (loopback_data); + ByteTransmitted (); + break; + } + case SERIAL_THR_LOOPBACK_EVENT: { + ByteTransmitting(); + loopback_data=THR; + setEvent(SERIAL_TX_LOOPBACK_EVENT,bytetime); + break; + } + case SERIAL_ERRMSG_EVENT: { + LOG_MSG("Serial%d: Errors occured: "\ + "Framing %d, Parity %d, Overrun %d (IF0:%d), Break %d", COMNUMBER, + framingErrors, parityErrors, overrunErrors, overrunIF0, breakErrors); + errormsg_pending=false; + framingErrors=0; + parityErrors=0; + overrunErrors=0; + overrunIF0=0; + breakErrors=0; + break; + } + default: handleUpperEvent(type); } - Timer2 (); } /*****************************************************************************/ /* Interrupt control routines **/ /*****************************************************************************/ void CSerial::rise (Bit8u priority) { - //LOG_UART("Serial port at %x: Rise priority 0x%x", base, priority); +#if SERIAL_DEBUG + if(dbg_interrupt) + { + if(priority&TX_PRIORITY && !(waiting_interrupts&TX_PRIORITY)) + fprintf(debugfp,"%12.3f tx interrupt on.\r\n",PIC_FullIndex()); + + if(priority&RX_PRIORITY && !(waiting_interrupts&RX_PRIORITY)) + fprintf(debugfp,"%12.3f rx interrupt on.\r\n",PIC_FullIndex()); + + if(priority&MSR_PRIORITY && !(waiting_interrupts&MSR_PRIORITY)) + fprintf(debugfp,"%12.3f msr interrupt on.\r\n",PIC_FullIndex()); + + if(priority&ERROR_PRIORITY && !(waiting_interrupts&ERROR_PRIORITY)) + fprintf(debugfp,"%12.3f error interrupt on.\r\n",PIC_FullIndex()); + } +#endif + waiting_interrupts |= priority; - WriteRealIER (IER); + ComputeInterrupts(); } // clears the pending interrupt, triggers other waiting interrupt void CSerial::clear (Bit8u priority) { - //LOG_UART("Serial port at %x: cleared priority 0x%x", base, priority); + +#if SERIAL_DEBUG + if(dbg_interrupt) + { + if(priority&TX_PRIORITY && (waiting_interrupts&TX_PRIORITY)) + fprintf(debugfp,"%12.3f tx interrupt off.\r\n",PIC_FullIndex()); + + if(priority&RX_PRIORITY && (waiting_interrupts&RX_PRIORITY)) + fprintf(debugfp,"%12.3f rx interrupt off.\r\n",PIC_FullIndex()); + + if(priority&MSR_PRIORITY && (waiting_interrupts&MSR_PRIORITY)) + fprintf(debugfp,"%12.3f msr interrupt off.\r\n",PIC_FullIndex()); + + if(priority&ERROR_PRIORITY && (waiting_interrupts&ERROR_PRIORITY)) + fprintf(debugfp,"%12.3f error interrupt off.\r\n",PIC_FullIndex()); + } +#endif + + waiting_interrupts &= (~priority); - WriteRealIER (IER); + ComputeInterrupts(); } -void CSerial::WriteRealIER (Bit8u data) { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: write IER, value 0x%x", base, data); +void CSerial::ComputeInterrupts () { + + Bitu val = IER & waiting_interrupts; + + if (val & ERROR_PRIORITY) ISR = ISR_ERROR_VAL; + else if (val & RX_PRIORITY) ISR = ISR_RX_VAL; + else if (val & TX_PRIORITY) ISR = ISR_TX_VAL; + else if (val & MSR_PRIORITY) ISR = ISR_MSR_VAL; + else ISR = ISR_CLEAR_VAL; + + if(val && !irq_active) { + irq_active=true; + PIC_ActivateIRQ(irq); + +#if SERIAL_DEBUG + if(dbg_interrupt) + fprintf(debugfp,"%12.3f IRQ%d on.\r\n",PIC_FullIndex(),irq); #endif - data = data & 0xF; // THE UPPER ONES ALWAYS READ 0! NOTHIN' ELSE! - Bit8u old_pending_interrupts = pending_interrupts; - Bit8u difference_pending_interrupts; + } - // rise TX AGAIN when present and is being enabled - if ((data & TX_PRIORITY) && (!(IER & TX_PRIORITY))) - if (LSR & LSR_TX_HOLDING_EMPTY_MASK) - waiting_interrupts |= TX_PRIORITY; + if(!val && irq_active) { + irq_active=false; + PIC_DeActivateIRQ(irq); - pending_interrupts = waiting_interrupts & data; - if ((difference_pending_interrupts = (pending_interrupts ^ old_pending_interrupts))) { // something in pending interrupts has changed - if (difference_pending_interrupts & pending_interrupts) { // some new bits were set - if (!current_priority) { // activate interrupt.. - if (pending_interrupts & ERROR_PRIORITY) { - current_priority = ERROR_PRIORITY; - ISR = ISR_ERROR_VAL; - } else if (pending_interrupts & RX_PRIORITY) { - current_priority = RX_PRIORITY; - ISR = ISR_RX_VAL; - } else if (pending_interrupts & TX_PRIORITY) { - current_priority = TX_PRIORITY; - ISR = ISR_TX_VAL; - } else if (pending_interrupts & MSR_PRIORITY) { - current_priority = MSR_PRIORITY; - ISR = ISR_MSR_VAL; - } -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Interrupt activated: priority %d", base, current_priority); +#if SERIAL_DEBUG + if(dbg_interrupt) + fprintf(debugfp,"%12.3f IRQ%d off.\r\n",PIC_FullIndex(),irq); #endif - PIC_ActivateIRQ (irq); - }// else the new interrupts were already - // written into pending_interrupts - }// else no new bits were set - - if (difference_pending_interrupts & (~pending_interrupts)) { // some bits were reset - if (pending_interrupts) { // some more are waiting - if (!(current_priority & pending_interrupts)) { // the current interrupt has been cleared - // choose the next one - if (pending_interrupts & ERROR_PRIORITY) { - current_priority = ERROR_PRIORITY; - ISR = ISR_ERROR_VAL; - } else if (pending_interrupts & RX_PRIORITY) { - current_priority = RX_PRIORITY; - ISR = ISR_RX_VAL; - } else if (pending_interrupts & TX_PRIORITY) { - current_priority = TX_PRIORITY; - ISR = ISR_TX_VAL; - } else if (pending_interrupts & MSR_PRIORITY) { - current_priority = MSR_PRIORITY; - ISR = ISR_MSR_VAL; - } - } - } else { - current_priority = NONE_PRIORITY; - ISR = ISR_CLEAR_VAL; - PIC_DeActivateIRQ (irq); -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Interrupt deactivated.", base); -#endif - } - } } - IER = data; -} - - - -/*****************************************************************************/ -/* Internal register modification **/ -/*****************************************************************************/ -void CSerial::changeMSR (Bit8u data) { - if (!(MCR & MCR_LOOPBACK_Enable_MASK)) { - // see if something changed - if ((MSR & MSR_LINE_MASK) != data) { - Bit8u change = (MSR & MSR_LINE_MASK) ^ data; - // set new deltas - MSR |= (change >> 4); - // set new line states - MSR &= MSR_delta_MASK; - MSR |= data; - rise (MSR_PRIORITY); - } - } -} - -void CSerial::changeMSR_Loopback (Bit8u data) { - // see if something changed - if ((MSR & MSR_LINE_MASK) != data) { - Bit8u change = (MSR & MSR_LINE_MASK) ^ data; - // set new deltas - MSR |= (change >> 4); - // set new line states - MSR &= MSR_delta_MASK; - MSR |= data; - rise (MSR_PRIORITY); - } - -/* - Bit8u temp=MSR; - // look for signal changes - if(temp|=((data&MSR_LINE_MASK)^(MSR&MSR_LINE_MASK))>>4) - { // some signals changed - temp&=MSR_delta_MASK;// clear line states - temp|=(data&MSR_LINE_MASK); // set new line states - - MSR=temp; - rise(MSR_PRIORITY); - } - // else nothing happened*/ } /*****************************************************************************/ @@ -293,12 +335,29 @@ bool CSerial::CanReceiveByte() { /* A byte was received **/ /*****************************************************************************/ void CSerial::receiveByte (Bit8u data) { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: byte received: %d", base, data); + +#if SERIAL_DEBUG + if(dbg_serialtraffic) + fprintf(debugfp,loopback_data<0x10? "%12.3f rx 0x%02x (%u)\r\n": + "%12.3f rx 0x%02x (%c)\r\n", + PIC_FullIndex(), data, data); #endif if (LSR & LSR_RX_DATA_READY_MASK) { // Overrun error ;o - LOG_UART ("Serial port at %x: RX Overrun!", base, data); + if(!errormsg_pending) { + errormsg_pending=true; + setEvent(SERIAL_ERRMSG_EVENT,1000); + } + overrunErrors++; + Bitu iflag= GETFLAG(IF); + if(!iflag)overrunIF0++; + +#if SERIAL_DEBUG + if(dbg_serialtraffic) + fprintf(debugfp, "%12.3f rx overrun (IF=%d)\r\n", + PIC_FullIndex(), iflag); +#endif + LSR |= LSR_OVERRUN_ERROR_MASK; rise (ERROR_PRIORITY); } else { @@ -312,67 +371,166 @@ void CSerial::receiveByte (Bit8u data) { /* A line error was received **/ /*****************************************************************************/ void CSerial::receiveError (Bit8u errorword) { + + if(!errormsg_pending) { + errormsg_pending=true; + setEvent(SERIAL_ERRMSG_EVENT,1000); + } + if(errorword&LSR_PARITY_ERROR_MASK) { + parityErrors++; + +#if SERIAL_DEBUG + if(dbg_serialtraffic) + fprintf(debugfp, "%12.3f parity error\r\n", + PIC_FullIndex()); +#endif + + } + if(errorword&LSR_FRAMING_ERROR_MASK) { + framingErrors++; + +#if SERIAL_DEBUG + if(dbg_serialtraffic) + fprintf(debugfp, "%12.3f framing error\r\n", + PIC_FullIndex()); +#endif + + } + if(errorword&LSR_RX_BREAK_MASK) { + breakErrors++; + +#if SERIAL_DEBUG + if(dbg_serialtraffic) + fprintf(debugfp, "%12.3f break received\r\n", + PIC_FullIndex()); +#endif + + } LSR |= errorword; rise (ERROR_PRIORITY); } +/*****************************************************************************/ +/* ByteTransmitting: Byte has made it from THR to TX. **/ +/*****************************************************************************/ +void CSerial::ByteTransmitting() { + switch(LSR&(LSR_TX_HOLDING_EMPTY_MASK|LSR_TX_EMPTY_MASK)) + { + case LSR_TX_HOLDING_EMPTY_MASK|LSR_TX_EMPTY_MASK: + // bad case there must have been one + case LSR_TX_HOLDING_EMPTY_MASK: + case LSR_TX_EMPTY_MASK: // holding full but workreg empty impossible + LOG_MSG("Internal error in serial port(1)(0x%x).",LSR); + break; + case 0: // THR is empty now. + LSR |= LSR_TX_HOLDING_EMPTY_MASK; + + // trigger interrupt + rise (TX_PRIORITY); + break; + } +} + + /*****************************************************************************/ /* ByteTransmitted: When a byte was sent, notify here. **/ /*****************************************************************************/ void CSerial::ByteTransmitted () { - if (LSR & LSR_TX_HOLDING_EMPTY_MASK) { // one space was empty - // now both are - LSR |= LSR_TX_EMPTY_MASK; - } else { // both were full, now 1 is empty - if (MCR & MCR_LOOPBACK_Enable_MASK) { // loopback mode - transmitLoopbackByte (THR); - } else { // direct "real" mode - transmitByte (THR); - } - LSR |= LSR_TX_HOLDING_EMPTY_MASK; + switch(LSR&(LSR_TX_HOLDING_EMPTY_MASK|LSR_TX_EMPTY_MASK)) + { + case LSR_TX_HOLDING_EMPTY_MASK|LSR_TX_EMPTY_MASK: + // bad case there must have been one + case LSR_TX_EMPTY_MASK: // holding full but workreg empty impossible + LOG_MSG("Internal error in serial port(2)."); + break; + + case LSR_TX_HOLDING_EMPTY_MASK: // now both are empty + LSR |= LSR_TX_EMPTY_MASK; + break; + + case 0: // now one is empty, send the other one + LSR |= LSR_TX_HOLDING_EMPTY_MASK; + if (loopback) { + loopback_data=THR; + setEvent(SERIAL_TX_LOOPBACK_EVENT, bytetime); + } + else { + + #if SERIAL_DEBUG + if(dbg_serialtraffic) + fprintf(debugfp,THR<0x10? "%12.3f tx 0x%02x (%u) (from THR)\r\n": + "%12.3f tx 0x%02x (%c) (from THR)\r\n", + PIC_FullIndex(),THR, + THR); + #endif + + transmitByte(THR,false); + } + // It's ok here. + rise (TX_PRIORITY); + break; } - rise (TX_PRIORITY); } /*****************************************************************************/ /* Transmit Holding Register, also LSB of Divisor Latch (r/w) **/ /*****************************************************************************/ void CSerial::Write_THR (Bit8u data) { + // 0-7 transmit data + if ((LCR & LCR_DIVISOR_Enable_MASK)) { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Write to DLL value 0x%x", base, data); -#endif // write to DLL - DLL = data; - updatePortConfig (DLL, DLM, LCR); + baud_divider&=0xFF00; + baud_divider |= data; + changeLineProperties(); } else { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Write to THR value 0x%x", base, data); -#endif - // write to THR clear (TX_PRIORITY); - if (LSR & LSR_TX_HOLDING_EMPTY_MASK) { // one is empty - if (LSR & LSR_TX_EMPTY_MASK) { // both are empty - LSR &= (~LSR_TX_EMPTY_MASK); - - if (MCR & MCR_LOOPBACK_Enable_MASK) { // loopback mode - transmitLoopbackByte (data); - } else { // direct "real" mode - transmitByte (data); - } - rise (TX_PRIORITY); - } else { // only THR is empty; add byte and clear holding bit + switch(LSR&(LSR_TX_HOLDING_EMPTY_MASK|LSR_TX_EMPTY_MASK)) + { + case 0: // both full - overflow +#if SERIAL_DEBUG + if(dbg_serialtraffic) fprintf(debugfp, "%12.3f tx overflow\r\n", + PIC_FullIndex()); +#endif + // overwrite THR + THR = data; + break; + + case LSR_TX_EMPTY_MASK: // holding full but workreg empty impossible + LOG_MSG("Internal error in serial port(3)."); + break; + + case LSR_TX_HOLDING_EMPTY_MASK: // now both are full LSR &= (~LSR_TX_HOLDING_EMPTY_MASK); THR = data; - } - } else { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: TX Overflow!", base); -#endif - // TX overflow; how does real hardware respond to that... I do nothing + break; + + case LSR_TX_HOLDING_EMPTY_MASK|LSR_TX_EMPTY_MASK: + // both are full until the first delay has passed + THR=data; + LSR &= (~LSR_TX_EMPTY_MASK); + LSR &= (~LSR_TX_HOLDING_EMPTY_MASK); + if(loopback) setEvent(SERIAL_THR_LOOPBACK_EVENT, bytetime/10); + else { + +#if SERIAL_DEBUG + if(dbg_serialtraffic) + fprintf(debugfp,data<0x10? "%12.3f tx 0x%02x (%u)\r\n": + "%12.3f tx 0x%02x (%c)\r\n", + PIC_FullIndex(),data, + data); +#endif + + transmitByte (data,true); + } + + // triggered + // when holding gets empty + // rise (TX_PRIORITY); + break; } } } @@ -382,23 +540,12 @@ void CSerial::Write_THR (Bit8u data) { /* Receive Holding Register, also LSB of Divisor Latch (r/w) **/ /*****************************************************************************/ Bitu CSerial::Read_RHR () { - Bit8u retval; - if ((LCR & LCR_DIVISOR_Enable_MASK)) { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from DLL value 0x%x", base, DLL); -#endif - return DLL; - } else { + // 0-7 received data + if ((LCR & LCR_DIVISOR_Enable_MASK)) return baud_divider&0xff; + else { clear (RX_PRIORITY); LSR &= (~LSR_RX_DATA_READY_MASK); - retval = RHR; - RXBufferEmpty (); // <--- this one changes RHR - -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from RHR value 0x%x", base, retval); -#endif - - return retval; + return RHR; } } @@ -408,32 +555,28 @@ Bitu CSerial::Read_RHR () { // Modified by: // - writing to it. Bitu CSerial::Read_IER () { - if ((LCR & LCR_DIVISOR_Enable_MASK)) { // IER or MSB? -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from DLM value 0x%x", base, DLM); -#endif - return DLM; - } else { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from IER value 0x%x", base, IER); -#endif - return IER; - } + // 0 receive holding register (byte received) + // 1 transmit holding register (byte sent) + // 2 receive line status (overrun, parity error, frame error, break) + // 3 modem status + // 4-7 0 + + if (LCR & LCR_DIVISOR_Enable_MASK) return baud_divider>>8; + else return IER; } void CSerial::Write_IER (Bit8u data) { if ((LCR & LCR_DIVISOR_Enable_MASK)) { // write to DLM -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Write to DLM value 0x%x", base, data); -#endif - - DLM = data; - updatePortConfig (DLL, DLM, LCR); + baud_divider&=0xff; + baud_divider |= ((Bit16u)data)<<8; + changeLineProperties(); } else { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Write to IER value 0x%x", base, data); -#endif - WriteRealIER (data); + + IER = data&0xF; + if ((LSR & LSR_TX_HOLDING_EMPTY_MASK) && (IER&TX_PRIORITY)) + waiting_interrupts |= TX_PRIORITY; + + ComputeInterrupts(); } } @@ -444,16 +587,29 @@ void CSerial::Write_IER (Bit8u data) { // - incoming interrupts // - loopback mode Bitu CSerial::Read_ISR () { + // 0 0:interrupt pending 1: no interrupt + // 1-3 identification + // 011 LSR + // 010 RXRDY + // 001 TXRDY + // 000 MSR + // 4-7 0 + + if(IER&Modem_Status_INT_Enable_MASK) updateMSR(); Bit8u retval = ISR; // clear changes ISR!! mean.. - clear (TX_PRIORITY); -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from ISR value 0x%x", base, retval); -#endif + if(ISR==ISR_TX_VAL) clear (TX_PRIORITY); return retval; } +void CSerial::Write_FCR (Bit8u data) { + if((!fifo_warn) && (data&0x1)) { + fifo_warn=true; + LOG_MSG("Serial%d: Warning: Tried to activate FIFO.",COMNUMBER); + } +} + /*****************************************************************************/ /* Line Control Register (r/w) **/ /*****************************************************************************/ @@ -464,39 +620,31 @@ Bitu CSerial::Read_ISR () { // Modified by: // - writing to it. Bitu CSerial::Read_LCR () { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from LCR value 0x%x", base, LCR); -#endif + // 0-1 word length + // 2 stop bits + // 3 parity enable + // 4-5 parity type + // 6 set break + // 7 divisor latch enable return LCR; } void CSerial::Write_LCR (Bit8u data) { Bit8u lcr_old = LCR; LCR = data; -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Write to LCR value 0x%x", base, data); - - // for debug output - if (((data ^ lcr_old) & LCR_DIVISOR_Enable_MASK) != 0) { - if ((data & LCR_DIVISOR_Enable_MASK) != 0) - LOG_UART ("Serial port at %x: Divisor-mode entered", base); - - else - LOG_UART ("Serial port at %x: Divisor-mode exited", base); - } -#endif if (((data ^ lcr_old) & LCR_PORTCONFIG_MASK) != 0) { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: comm parameters changed", base); -#endif - updatePortConfig (DLL, DLM, LCR); + changeLineProperties(); } if (((data ^ lcr_old) & LCR_BREAK_MASK) != 0) { - setBreak ((LCR & LCR_BREAK_MASK) != 0); - -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: break toggled: %d", base, - (LCR & LCR_BREAK_MASK) != 0); + if(!loopback) setBreak ((LCR & LCR_BREAK_MASK)!=0); + else { + // TODO: set loopback break event to reveiveError after + } +#if SERIAL_DEBUG + if(dbg_serialtraffic) + fprintf(debugfp,((LCR & LCR_BREAK_MASK)!=0)? + "%12.3f break on.\r\n": + "%12.3f break off.\r\n", PIC_FullIndex()); #endif } } @@ -508,66 +656,99 @@ void CSerial::Write_LCR (Bit8u data) { // Modified by: // - writing to it. Bitu CSerial::Read_MCR () { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from MCR value 0x%x", base, MCR); -#endif - return MCR; + // 0 -DTR + // 1 -RTS + // 2 -OP1 + // 3 -OP2 + // 4 loopback enable + // 5-7 0 + Bit8u retval=0; + if(dtr) retval|=MCR_DTR_MASK; + if(rts) retval|=MCR_RTS_MASK; + if(op1) retval|=MCR_OP1_MASK; + if(op2) retval|=MCR_OP2_MASK; + if(loopback) retval|=MCR_LOOPBACK_Enable_MASK; + return retval; } void CSerial::Write_MCR (Bit8u data) { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Write to MCR value 0x%x", base, data); -#endif - data &= 0x1F; // UPPER BITS ALWAYS 0!!! + // WARNING: At the time setRTSDTR is called rts and dsr members are still wrong. - if (MCR & MCR_LOOPBACK_Enable_MASK) - if (data & MCR_LOOPBACK_Enable_MASK) { // was on, is now on - Bit8u param = 0; + bool temp_dtr = data & MCR_DTR_MASK? true:false; + bool temp_rts = data & MCR_RTS_MASK? true:false; + bool temp_op1 = data & MCR_OP1_MASK? true:false; + bool temp_op2 = data & MCR_OP2_MASK? true:false; + bool temp_loopback = data & MCR_LOOPBACK_Enable_MASK? true:false; + if(loopback!=temp_loopback) { + if(temp_loopback) setRTSDTR(false,false); + else setRTSDTR(temp_rts,temp_dtr); + } - // RTS->CD - // DTR->RI - // OP1->DSR - // OP2->CTS - - if (data & MCR_RTS_MASK) - param |= MSR_CD_MASK; - if (data & MCR_DTR_MASK) - param |= MSR_RI_MASK; - if (data & MCR_OP1_MASK) - param |= MSR_DSR_MASK; - if (data & MCR_OP2_MASK) - param |= MSR_CTS_MASK; - - changeMSR_Loopback (param); - - } else { - MCR = data; - updateModemControlLines (); - // is switched off now + if (temp_loopback) { // is on: + // DTR->DSR + // RTS->CTS + // OP1->RI + // OP2->CD + if(temp_dtr!=dtr && !d_dsr) { + d_dsr=true; + rise (MSR_PRIORITY); + } + if(temp_rts!=rts && !d_cts) { + d_cts=true; + rise (MSR_PRIORITY); + } + if(temp_op1!=op1 && !d_ri) { + // interrupt only at trailing edge + if(!temp_op1) { + d_ri=true; + rise (MSR_PRIORITY); + } + } + if(temp_op2!=op2 && !d_cd) { + d_cd=true; + rise (MSR_PRIORITY); + } } else { - if (data & MCR_LOOPBACK_Enable_MASK) { // is switched on: - Bit8u par = 0; - if (data & MCR_RTS_MASK) - par |= MSR_CD_MASK; - if (data & MCR_DTR_MASK) - par |= MSR_RI_MASK; - if (data & MCR_OP1_MASK) - par |= MSR_DSR_MASK; - if (data & MCR_OP2_MASK) - par |= MSR_CTS_MASK; + // loopback is off + if(temp_rts!=rts) { + // RTS difference + if(temp_dtr!=dtr) { + // both difference - changeMSR_Loopback (par); +#if SERIAL_DEBUG + if(dbg_modemcontrol) + { + fprintf(debugfp,temp_rts?"%12.3f RTS on.\r\n": + "%12.3f RTS off.\r\n", PIC_FullIndex()); + fprintf(debugfp,temp_dtr?"%12.3f DTR on.\r\n": + "%12.3f DTR off.\r\n", PIC_FullIndex()); + } +#endif + setRTSDTR(temp_rts, temp_dtr); + } else { + // only RTS - // go back to empty state - LSR &= (LSR_TX_EMPTY_MASK | LSR_TX_HOLDING_EMPTY_MASK); +#if SERIAL_DEBUG + if(dbg_modemcontrol) + fprintf(debugfp,temp_rts?"%12.3f RTS on.\r\n":"%12.3f RTS off.\r\n", PIC_FullIndex()); +#endif - } else { - MCR = data; - updateModemControlLines (); - // loopback is off + setRTS(temp_rts); + } + } else if(temp_dtr!=dtr) { + // only DTR +#if SERIAL_DEBUG + if(dbg_modemcontrol) + fprintf(debugfp,temp_dtr?"%12.3f DTR on.\r\n":"%12.3f DTR off.\r\n", PIC_FullIndex()); +#endif + setDTR(temp_dtr); } } - MCR = data; + dtr=temp_dtr; + rts=temp_rts; + op1=temp_op1; + op2=temp_op2; + loopback=temp_loopback; } /*****************************************************************************/ @@ -581,19 +762,14 @@ Bitu CSerial::Read_LSR () { Bitu retval = LSR; LSR &= (~LSR_ERROR_MASK); // clear error bits on read clear (ERROR_PRIORITY); - -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from LSR value 0x%x", base, retval); -#endif return retval; } void CSerial::Write_MSR (Bit8u val) { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Write to MSR, value 0x%x", base, val); -#endif - MSR &= MSR_LINE_MASK; - MSR |= val & MSR_delta_MASK; + d_cts = (val&MSR_dCTS_MASK)?true:false; + d_dsr = (val&MSR_dDSR_MASK)?true:false; + d_cd = (val&MSR_dCD_MASK)?true:false; + d_ri = (val&MSR_dRI_MASK)?true:false; } /*****************************************************************************/ @@ -605,17 +781,36 @@ void CSerial::Write_MSR (Bit8u val) { // - real values // - write operation to MCR in loopback mode Bitu CSerial::Read_MSR () { - Bit8u retval; - if (!(MCR & MCR_LOOPBACK_Enable_MASK)) { - updateMSR (); + Bit8u retval=0; + + if (loopback) { + + if (rts) retval |= MSR_CTS_MASK; + if (dtr) retval |= MSR_DSR_MASK; + if (op1) retval |= MSR_RI_MASK; + if (op2) retval |= MSR_CD_MASK; + + } else { + + updateMSR(); + if (cd) retval |= MSR_CD_MASK; + if (ri) retval |= MSR_RI_MASK; + if (dsr) retval |= MSR_DSR_MASK; + if (cts) retval |= MSR_CTS_MASK; + } - retval = MSR; + // new delta flags + if(d_cd) retval|=MSR_dCD_MASK; + if(d_ri) retval|=MSR_dRI_MASK; + if(d_cts) retval|=MSR_dCTS_MASK; + if(d_dsr) retval|=MSR_dDSR_MASK; + + d_cd = false; + d_ri = false; + d_cts = false; + d_dsr = false; + clear (MSR_PRIORITY); - // clear deltas - MSR &= MSR_LINE_MASK; -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from MSR value 0x%x", base, retval); -#endif return retval; } @@ -624,16 +819,10 @@ Bitu CSerial::Read_MSR () { /*****************************************************************************/ // Just a memory register. Not much to do here. Bitu CSerial::Read_SPR () { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Read from SPR value 0x%x", base, SPR); -#endif return SPR; } void CSerial::Write_SPR (Bit8u data) { -#ifdef SERIALPORT_DEBUGMSG - LOG_UART ("Serial port at %x: Write to SPR value 0x%x", base, data); -#endif SPR = data; } @@ -641,96 +830,100 @@ void CSerial::Write_SPR (Bit8u data) { /* Write_reserved **/ /*****************************************************************************/ void CSerial::Write_reserved (Bit8u data, Bit8u address) { - LOG_UART("Serial port at %x: Write to reserved register, value 0x%x, register %x", base, data, address); -} - -/*****************************************************************************/ -/* Loopback: add byte to loopback buffer; it is received next time Timer **/ -/* function is invoked; (time needed is not emulated correctly, but I don't **/ -/* think this is sooooo important....) **/ -/*****************************************************************************/ -void CSerial::transmitLoopbackByte (Bit8u val) { - //LOG_MSG("Serial port at %x: Loopback requested", base); - loopback_pending = true; - loopback_data = val; + /*LOG_UART("Serial%d: Write to reserved register, value 0x%x, register %x", + COMNUMBER, data, address);*/ } /*****************************************************************************/ /* MCR Access: returns cirquit state as boolean. **/ /*****************************************************************************/ bool CSerial::getDTR () { - return (MCR & MCR_DTR_MASK) != 0; + if(loopback) return false; + else return dtr; } bool CSerial::getRTS () { - return (MCR & MCR_RTS_MASK) != 0; + if(loopback) return false; + else return rts; } /*****************************************************************************/ /* MSR Access **/ /*****************************************************************************/ bool CSerial::getRI () { - return (MSR & MSR_RI_MASK) != 0; + return ri; } bool CSerial::getCD () { - return (MSR & MSR_CD_MASK) != 0; + return cd; } bool CSerial::getDSR () { - return (MSR & MSR_DSR_MASK) != 0; + return dsr; } bool CSerial::getCTS () { - return (MSR & MSR_CTS_MASK) != 0; + return cts; } -// these give errors if invoked while loopback mode... but who cares. void CSerial::setRI (bool value) { - bool compare = ((MSR & MSR_RI_MASK) != 0); - if (value != compare) { - if (value) - MSR |= MSR_RI_MASK; - else - MSR &= (~MSR_RI_MASK); - MSR |= MSR_dRI_MASK; - rise (MSR_PRIORITY); + if (value != ri) { + +#if SERIAL_DEBUG + if(dbg_modemcontrol) + fprintf(debugfp,value?"%12.3f RI on.\r\n":"%12.3f RI off.\r\n", PIC_FullIndex()); +#endif + // don't change delta when in loopback mode + ri=value; + if(!loopback) { + if(value==false) d_ri=true; + rise (MSR_PRIORITY); + } } //else no change } void CSerial::setDSR (bool value) { - bool compare = ((MSR & MSR_DSR_MASK) != 0); - if (value != compare) { - if (value) - MSR |= MSR_DSR_MASK; - else - MSR &= (~MSR_DSR_MASK); - MSR |= MSR_dDSR_MASK; - rise (MSR_PRIORITY); + if (value != dsr) { +#if SERIAL_DEBUG + if(dbg_modemcontrol) + fprintf(debugfp,value?"%12.3f DSR on.\r\n":"%12.3f DSR off.\r\n", PIC_FullIndex()); +#endif + // don't change delta when in loopback mode + dsr=value; + if(!loopback) { + d_dsr=true; + rise (MSR_PRIORITY); + } } //else no change } void CSerial::setCD (bool value) { - bool compare = ((MSR & MSR_CD_MASK) != 0); - if (value != compare) { - if (value) - MSR |= MSR_CD_MASK; - else - MSR &= (~MSR_CD_MASK); - MSR |= MSR_dCD_MASK; - rise (MSR_PRIORITY); + if (value != cd) { +#if SERIAL_DEBUG + if(dbg_modemcontrol) + fprintf(debugfp,value?"%12.3f CD on.\r\n":"%12.3f CD off.\r\n", PIC_FullIndex()); +#endif + // don't change delta when in loopback mode + cd=value; + if(!loopback) { + d_cd=true; + rise (MSR_PRIORITY); + } } //else no change } void CSerial::setCTS (bool value) { - bool compare = ((MSR & MSR_CTS_MASK) != 0); - if (value != compare) { - if (value) - MSR |= MSR_CTS_MASK; - else - MSR &= (~MSR_CTS_MASK); - MSR |= MSR_dCTS_MASK; - rise (MSR_PRIORITY); + if (value != cts) { +#if SERIAL_DEBUG + if(dbg_modemcontrol) + fprintf(debugfp,value?"%12.3f CTS on.\r\n":"%12.3f CTS off.\r\n", PIC_FullIndex()); +#endif + // don't change delta when in loopback mode + cts=value; + if(!loopback) { + d_cts=true; + rise (MSR_PRIORITY); + } } //else no change } @@ -738,8 +931,16 @@ void CSerial::setCTS (bool value) { /*****************************************************************************/ /* Initialisation **/ /*****************************************************************************/ -void CSerial::Init_Registers (Bit32u initbps, Bit8u bytesize, - const char *parity, Bit8u stopbits) { +void CSerial::Init_Registers () { + // The "power on" settings + irq_active=false; + waiting_interrupts = 0x0; + + Bit32u initbps = 9600; + Bit8u bytesize = 8; + char parity = 'N'; + Bit8u stopbits = 1; + Bit8u lcrresult = 0; Bit16u baudresult = 0; @@ -748,20 +949,27 @@ void CSerial::Init_Registers (Bit32u initbps, Bit8u bytesize, IER = 0; ISR = 0x1; LCR = 0; - MCR = 0; + //MCR = 0xff; + loopback = true; + dtr=true; + rts=true; + op1=true; + op2=true; + + LSR = 0x60; - MSR = 0; + d_cts = true; + d_dsr = true; + d_ri = true; + d_cd = true; + cts = true; + dsr = true; + ri = true; + cd = true; SPR = 0xFF; - DLL = 0x0; - DLM = 0x0; - - pending_interrupts = 0x0; - current_priority = 0x0; - waiting_interrupts = 0x0; - loopback_pending = false; - + baud_divider=0x0; // make lcr: byte size, parity, stopbits, baudrate @@ -774,313 +982,259 @@ void CSerial::Init_Registers (Bit32u initbps, Bit8u bytesize, else lcrresult |= LCR_DATABITS_8; - if (parity[0] == 'O' || parity[0] == 'o') - lcrresult |= LCR_PARITY_ODD; - else if (parity[0] == 'E' || parity[0] == 'e') - lcrresult |= LCR_PARITY_EVEN; - else if (parity[0] == 'M' || parity[0] == 'm') - lcrresult |= LCR_PARITY_MARK; - else if (parity[0] == 'S' || parity[0] == 's') - lcrresult |= LCR_PARITY_SPACE; - else + switch(parity) + { + case 'N': + case 'n': lcrresult |= LCR_PARITY_NONE; - - if (stopbits == 2) - lcrresult |= LCR_STOPBITS_MORE_THAN_1; - else - lcrresult |= LCR_STOPBITS_1; + break; + case 'O': + case 'o': + lcrresult |= LCR_PARITY_ODD; + break; + case 'E': + case 'e': + lcrresult |= LCR_PARITY_EVEN; + break; + case 'M': + case 'm': + lcrresult |= LCR_PARITY_MARK; + break; + case 'S': + case 's': + lcrresult |= LCR_PARITY_SPACE; + break; + } // baudrate - if (initbps > 0) baudresult = (Bit16u) (115200 / initbps); else baudresult = 12; // = 9600 baud + Write_MCR (0); Write_LCR (LCR_DIVISOR_Enable_MASK); Write_THR ((Bit8u) baudresult & 0xff); Write_IER ((Bit8u) (baudresult >> 8)); Write_LCR (lcrresult); + updateMSR(); + Read_MSR(); } -CSerial::CSerial(IO_ReadHandler * rh, IO_WriteHandler * wh, TIMER_TickHandler, - Bit16u initbase, Bit8u initirq, Bit32u initbps, Bit8u bytesize, - const char *parity, Bit8u stopbits) { - base = initbase; - irq = initirq; - TimerHnd = NULL; - //TimerHnd = th; // for destructor - //TIMER_AddTickHandler(TimerHnd); +CSerial::CSerial(Bitu id, CommandLine* cmd) { + +#if SERIAL_DEBUG + dbg_serialtraffic = cmd->FindExist("dbgtr", false); + dbg_modemcontrol = cmd->FindExist("dbgmd", false); + dbg_register = cmd->FindExist("dbgreg", false); + dbg_interrupt = cmd->FindExist("dbgirq", false); + dbg_aux = cmd->FindExist("dbgaux", false); + + + if(dbg_serialtraffic|dbg_modemcontrol|dbg_register|dbg_interrupt|dbg_aux) + debugfp=OpenCaptureFile("serlog",".serlog.txt"); + else debugfp=0; + +#endif + + + + idnumber=id; + mydosdevice=new device_COM(this); + DOS_AddDevice(mydosdevice); + Bit16u base = serial_baseaddr[id]; + fifo_warn=false; + + errormsg_pending=false; + framingErrors=0; + parityErrors=0; + overrunErrors=0; + overrunIF0=0; + breakErrors=0; + + // find the IRQ + irq = serial_defaultirq[id]; + getBituSubstring("irq:",&irq, cmd); + if (irq < 2 || irq > 15) irq = serial_defaultirq[id]; + for (Bitu i = 0; i <= 7; i++) { - WriteHandler[i].Install (i + base, wh, IO_MB); - ReadHandler[i].Install (i + base, rh, IO_MB); + WriteHandler[i].Install (i + base, SERIAL_Write, IO_MB); + ReadHandler[i].Install (i + base, SERIAL_Read, IO_MB); } + +#if SERIAL_DEBUG + if(debugfp) fprintf(debugfp,"COM%d: BASE %3x, IRQ %d\r\n\r\n", + COMNUMBER,base,irq); +#endif }; +bool CSerial::getBituSubstring(const char* name,Bitu* data, CommandLine* cmd) { + std::string tmpstring; + if(!(cmd->FindStringBegin(name,tmpstring,false))) return false; + const char* tmpchar=tmpstring.c_str(); + if(sscanf(tmpchar,"%u",data)!=1) return false; + return true; +} + CSerial::~CSerial(void) { - - if(TimerHnd) TIMER_DelTickHandler(TimerHnd); + DOS_DelDevice(mydosdevice); + for(Bitu i = 0; i <= SERIAL_BASE_EVENT_COUNT; i++) + removeEvent(i); }; - -void CSerial::InstallTimerHandler(TIMER_TickHandler th) -{ - if(TimerHnd==NULL) { - TimerHnd=th; - TIMER_AddTickHandler(th); - } -} - -bool getParameter(char *input, char *buffer, const char *parametername, - Bitu buffersize) { - Bitu outputPos = 0; - Bitu currentState = 0; // 0 = before '=' 1 = after '=' 2 = in word - Bitu startInputPos; - Bitu inputPos; - char *res1 = strstr(input, parametername); - if (res1 == 0) - return false; - inputPos = res1 - input; - inputPos += strlen (parametername); - startInputPos = inputPos; - while (input[inputPos] != 0 && outputPos + 2 < buffersize) { - if (currentState == 0) { - if (input[inputPos] == ' ') - inputPos++; - else if (input[inputPos] == ':') { - currentState = 1; - inputPos++; - } else - return false; - } else if (currentState == 1) { - if (input[inputPos] == ' ') - inputPos++; - else { - currentState = 2; - buffer[outputPos] = input[inputPos]; - outputPos++; - inputPos++; - } - - } else { - if (input[inputPos] == ' ') { - buffer[outputPos] = 0; - return true; - } else { - buffer[outputPos] = input[inputPos]; - outputPos++; - inputPos++; - } - } - } - buffer[outputPos] = 0; - if (inputPos == startInputPos) - return false; - return true; -} - -// functions for parsing the config line -bool scanNumber (char *scan, Bitu * retval) { - *retval = 0; - - while (char c = *scan) { - if (c >= '0' && c <= '9') { - *retval *= 10; - *retval += c - '0'; - scan++; - } else +bool CSerial::Getchar(Bit8u* data, bool wait_dsr, Bitu timeout) { + + double starttime=PIC_FullIndex(); + // wait for it to become empty + // wait for DSR on + if(wait_dsr) { + while((!(Read_MSR()&0x20))&&(starttime>PIC_FullIndex()-timeout)) + CALLBACK_Idle(); + if(!(starttime>PIC_FullIndex()-timeout)) { + #if SERIAL_DEBUG +if(dbg_aux) + fprintf(debugfp,"%12.3f API read timeout: MSR 0x%x\r\n", PIC_FullIndex(),Read_MSR()); +#endif return false; + } } + // wait for a byte to arrive + while((!(Read_LSR()&0x1))&&(starttime>PIC_FullIndex()-timeout)) + CALLBACK_Idle(); + + if(!(starttime>PIC_FullIndex()-timeout)) { + #if SERIAL_DEBUG +if(dbg_aux) + fprintf(debugfp,"%12.3f API read timeout: MSR 0x%x\r\n", PIC_FullIndex(),Read_MSR()); +#endif + return false; + } + + + *data=Read_RHR(); + +#if SERIAL_DEBUG + if(dbg_aux) + fprintf(debugfp,"%12.3f API read success: 0x%x\r\n", PIC_FullIndex(),*data); +#endif + return true; } -bool getFirstWord (char *input, char *buffer, Bitu buffersize) { - Bitu outputPointer = 0; - Bitu currentState = 0; // 0 = scanning spaces 1 = in word - Bitu currentPos = 0; - while (input[currentPos] != 0 && outputPointer + 2 < buffersize) { - if (currentState == 0) { - if (input[currentPos] != ' ') { - currentState = 1; - buffer[outputPointer] = input[currentPos]; - outputPointer++; - } - } else { - if (input[currentPos] == ' ') { - buffer[outputPointer] = 0; - return true; - } else { - buffer[outputPointer] = input[currentPos]; - outputPointer++; - } - } - currentPos++; - } - buffer[outputPointer] = 0; // end of string - if (currentState == 0) - return false; - else - return true; -} -void BIOS_SetComPorts (Bit16u baseaddr[]); +bool CSerial::Putchar(Bit8u data, bool wait_dsr, bool wait_cts, Bitu timeout) { + + double starttime=PIC_FullIndex(); + //Bit16u starttime= + // wait for it to become empty + while(!(LSR&0x20)) { + CALLBACK_Idle(); + } + // wait for DSR+CTS on + if(wait_dsr||wait_cts) { + if(wait_dsr||wait_cts) { + while(((Read_MSR()&0x30)!=0x30)&&(starttime>PIC_FullIndex()-timeout)) + CALLBACK_Idle(); + } else if(wait_dsr) { + while(!(Read_MSR()&0x20)&&(starttime>PIC_FullIndex()-timeout)) + CALLBACK_Idle(); + } else if(wait_cts) { + while(!(Read_MSR()&0x10)&&(starttime>PIC_FullIndex()-timeout)) + CALLBACK_Idle(); + + } + if(!(starttime>PIC_FullIndex()-timeout)) { +#if SERIAL_DEBUG + if(dbg_aux) + fprintf(debugfp,"%12.3f API write timeout: MSR 0x%x\r\n", + PIC_FullIndex(),Read_MSR()); +#endif + return false; + } + } + Write_THR(data); + +#if SERIAL_DEBUG + if(dbg_aux) + fprintf(debugfp,"%12.3f API write success: 0x%x\r\n", PIC_FullIndex(),data); +#endif + + return true; +} class SERIALPORTS:public Module_base { public: - CSerial ** serialPortObjects[4]; SERIALPORTS (Section * configuration):Module_base (configuration) { - // put handlers into arrays - IO_ReadHandler *serialReadHandlers[] = { - &SERIAL1_Read, &SERIAL2_Read, &SERIAL3_Read, &SERIAL4_Read - }; - IO_WriteHandler *serialWriteHandlers[] = { - &SERIAL1_Write, &SERIAL2_Write, &SERIAL3_Write, &SERIAL4_Write - }; - TIMER_TickHandler serialTimerHandlers[] = { - &SERIAL1_Update, &SERIAL2_Update, &SERIAL3_Update, &SERIAL4_Update - }; - - // default ports & interrupts - Bit16u addresses[] = { COM1_BASE, COM2_BASE, COM3_BASE, COM4_BASE }; - Bit8u defaultirq[] = { 4, 3, 4, 3 }; + Bit16u biosParameter[4] = { 0, 0, 0, 0 }; Section_prop *section = static_cast (configuration); - char tmpbuffer[15]; - const char *configstringsconst[4] = { + const char *configstrings[4] = { section->Get_string ("serial1"), section->Get_string ("serial2"), section->Get_string ("serial3"), section->Get_string ("serial4") }; - /* Create copies so they can be modified */ - char *configstrings[4] = { 0 }; - for(Bitu i = 0;i < 4;i++) { - size_t len = strlen(configstringsconst[i]); - configstrings[i] = new char[len+1]; - strcpy(configstrings[i],configstringsconst[i]); - configstrings[i] = upcase(configstrings[i]); - } - - serialPortObjects[0] = &serial1; - serialPortObjects[1] = &serial2; - serialPortObjects[2] = &serial3; - serialPortObjects[3] = &serial4; - // iterate through all 4 com ports for (Bitu i = 0; i < 4; i++) { - Bit16u baseAddress = addresses[i]; - Bitu irq = defaultirq[i]; - Bitu bps = 9600; - Bitu bytesize = 8; - Bitu stopbits = 1; - char parity = 'N'; - biosParameter[i] = baseAddress; + biosParameter[i] = serial_baseaddr[i]; - // parameter: irq - if (getParameter(configstrings[i], tmpbuffer, "IRQ", sizeof (tmpbuffer))) { - if (scanNumber (tmpbuffer, &irq)) { - if (irq < 0 || irq == 2 || irq > 15) - irq = defaultirq[i]; - } else - irq = defaultirq[i]; + CommandLine* cmd; + std::string str; + cmd=new CommandLine(0,configstrings[i]); + cmd->FindCommand(1,str); + + if(!str.compare("dummy")) { + serialports[i] = new CSerialDummy (i, cmd); } - // parameter: bps - if (getParameter(configstrings[i], tmpbuffer, "STARTBPS", sizeof (tmpbuffer))) { - if (scanNumber (tmpbuffer, &bps)) { - if (bps <= 0) - bps = 9600; - } else - bps = 9600; - } - // parameter: bytesize - if (getParameter(configstrings[i], tmpbuffer, "BYTESIZE", sizeof (tmpbuffer))) { - if (scanNumber (tmpbuffer, &bytesize)) { - if (bytesize < 5 || bytesize > 8) - bytesize = 8; - } else - bytesize = 8; - } - // parameter: stopbits - if (getParameter(configstrings[i], tmpbuffer, "STOPBITS", sizeof (tmpbuffer))) { - if (scanNumber (tmpbuffer, &stopbits)) { - if (stopbits < 1 || stopbits > 2) - stopbits = 1; - } else - stopbits = 1; - } - // parameter: parity - if (getParameter(configstrings[i], tmpbuffer, "PARITY", sizeof (tmpbuffer))) { - if (!(tmpbuffer[0] == 'N' || tmpbuffer[0] == 'O' || tmpbuffer[0] == 'E' - || tmpbuffer[0] == 'M' || tmpbuffer[0] == 'S')) - tmpbuffer[0] = 'N'; - parity = tmpbuffer[0]; - } - //LOG_MSG("COM%d: %s",i+1,configstrings[i]); - if (getFirstWord (configstrings[i], tmpbuffer, sizeof (tmpbuffer))) { - //LOG_MSG("COM%d: %s",i+1,tmpbuffer); - if (!strcmp (tmpbuffer, "DUMMY")) { - *serialPortObjects[i] = new CSerialDummy (serialReadHandlers[i], serialWriteHandlers[i],serialTimerHandlers[i], baseAddress, irq, bps,bytesize, &parity, stopbits); - } #ifdef DIRECTSERIAL_AVAILIBLE - else if (!strcmp (tmpbuffer, "DIRECTSERIAL")) { - // parameter: realport - if (getParameter (configstrings[i], tmpbuffer, "REALPORT", sizeof (tmpbuffer))) { // realport is required - CDirectSerial *cdstemp = new CDirectSerial (serialReadHandlers[i], serialWriteHandlers[i], serialTimerHandlers[i], baseAddress, irq, bps,bytesize, &parity,stopbits,tmpbuffer); - - if (cdstemp->InstallationSuccessful) { - *serialPortObjects[i] = cdstemp; - } else { // serial port name was wrong or already in use - delete cdstemp; - *serialPortObjects[i] = NULL; - biosParameter[i] = 0; - } - - } else { - *serialPortObjects[i] = NULL; - biosParameter[i] = 0; - } + else if(!str.compare("directserial")) { + serialports[i] = new CDirectSerial (i, cmd); + if (!serialports[i]->InstallationSuccessful) { + // serial port name was wrong or already in use + delete serialports[i]; + serialports[i] = NULL; + biosParameter[i] = 0; } + } #endif + #if C_MODEM - else if (!strcmp (tmpbuffer, "MODEM")) { - Bitu listenport = 23; - // parameter: listenport - if (getParameter(configstrings[i], tmpbuffer, "LISTENPORT", sizeof (tmpbuffer))) { - if (scanNumber (tmpbuffer, &listenport)) { - if (listenport <= 0 || listenport > 65535) - listenport = 23; - } else - listenport = 23; - } - - *serialPortObjects[i] = new CSerialModem (serialReadHandlers[i], serialWriteHandlers[i], serialTimerHandlers[i], baseAddress, irq, bps,bytesize, &parity, stopbits, 0, listenport); + else if(!str.compare("modem")) { + serialports[i] = new CSerialModem (i, cmd); + if (!serialports[i]->InstallationSuccessful) { + delete serialports[i]; + serialports[i] = NULL; + biosParameter[i] = 0; } + } + else if(!str.compare("nullmodem")) { + serialports[i] = new CNullModem (i, cmd); + if (!serialports[i]->InstallationSuccessful) { + delete serialports[i]; + serialports[i] = NULL; + biosParameter[i] = 0; + } + } #endif - else if (!strcmp (tmpbuffer, "DISABLED")) { - *serialPortObjects[i] = NULL; - biosParameter[i] = 0; - } else { - LOG_MSG ("Invalid type for COM%d.", i + 1); - *serialPortObjects[i] = NULL; - biosParameter[i] = 0; - } + else if(!str.compare("disabled")) { + serialports[i] = NULL; + biosParameter[i] = 0; } else { - *serialPortObjects[i] = NULL; + LOG_MSG ("Invalid type for COM%d.", i + 1); + serialports[i] = NULL; biosParameter[i] = 0; } - } - - delete [] configstrings[0];delete [] configstrings[1]; - delete [] configstrings[2];delete [] configstrings[3]; + delete cmd; + } // for BIOS_SetComPorts (biosParameter); } ~SERIALPORTS () { for (Bitu i = 0; i < 4; i++) - if (*serialPortObjects[i]) { - delete *(serialPortObjects[i]); - *(serialPortObjects[i]) = 0; + if (serialports[i]) { + delete serialports[i]; + serialports[i] = 0; } } }; diff --git a/src/hardware/serialport/softmodem.cpp b/src/hardware/serialport/softmodem.cpp index cfcadb9..28c52eb 100644 --- a/src/hardware/serialport/softmodem.cpp +++ b/src/hardware/serialport/softmodem.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: softmodem.cpp,v 1.5 2006/03/24 17:11:35 qbix79 Exp $ */ +/* $Id: softmodem.cpp,v 1.7 2007/01/13 08:35:49 qbix79 Exp $ */ #include "dosbox.h" @@ -26,90 +26,88 @@ #include #include -#include "SDL_net.h" - #include "support.h" -#include "timer.h" #include "serialport.h" #include "softmodem.h" +#include "misc_util.h" //#include "mixer.h" -CSerialModem::CSerialModem( - IO_ReadHandler* rh, - IO_WriteHandler* wh, - TIMER_TickHandler th, - Bit16u baseAddr, - Bit8u initIrq, - Bit32u initBps, - Bit8u bytesize, - const char* parity, - Bit8u stopbits, - const char *remotestr, - Bit16u lport) - : CSerial(rh, wh, th, - baseAddr, initIrq, initBps, bytesize, parity, stopbits) { - socket=0; - incomingsocket=0; - InstallTimerHandler(th); +CSerialModem::CSerialModem(Bitu id, CommandLine* cmd):CSerial(id, cmd) { + InstallationSuccessful=false; + connected=false; - if(!SDLNetInited) { - if(SDLNet_Init()==-1) { - LOG_MSG("SDLNet_Init failed: %s\n", SDLNet_GetError()); - return; - } - SDLNetInited = true; - } rqueue=new CFifo(MODEM_BUFFER_QUEUE_SIZE); tqueue=new CFifo(MODEM_BUFFER_QUEUE_SIZE); - /* Default to direct null modem connection. Telnet mode interprets IAC codes */ + // Default to direct null modem connection. Telnet mode interprets IAC codes telnetmode = false; - /* Initialize the sockets and setup the listening port */ - socketset = SDLNet_AllocSocketSet(1); - listensocketset = SDLNet_AllocSocketSet(1); - if (!socketset || !listensocketset) { - LOG_MSG("MODEM:Can't open socketset:%s",SDLNet_GetError()); - //TODO Should probably just exit - return; - } - socket=0; - listenport=lport; - if (listenport) { - IPaddress listen_ip; - SDLNet_ResolveHost(&listen_ip, NULL, listenport); - listensocket=SDLNet_TCP_Open(&listen_ip); - if (!listensocket) LOG_MSG("MODEM:Can't open listen port: %s",SDLNet_GetError()); - - else LOG_MSG("MODEM: Port listener installed at port %d",listenport); - - } - else listensocket=0; - - // TODO: Fix dialtones if requested - //mhd.chan=MIXER_AddChannel((MIXER_MixHandler)this->MODEM_CallBack,8000,"MODEM"); - //MIXER_Enable(mhd.chan,false); - //MIXER_SetMode(mhd.chan,MIXER_16MONO); + // Initialize the sockets and setup the listening port + listenport = 23; + waitingclientsocket=0; + clientsocket = 0; + serversocket = 0; + getBituSubstring("listenport:", &listenport, cmd); + + // TODO: Fix dialtones if requested + //mhd.chan=MIXER_AddChannel((MIXER_MixHandler)this->MODEM_CallBack,8000,"MODEM"); + //MIXER_Enable(mhd.chan,false); + //MIXER_SetMode(mhd.chan,MIXER_16MONO); - Reset(); - //EnterIdleState(); - CSerial::Init_Registers(initBps,bytesize,parity,stopbits); - } + CSerial::Init_Registers(); + Reset(); // reset calls EnterIdleState + + setEvent(SERIAL_POLLING_EVENT,1); + InstallationSuccessful=true; +} - CSerialModem::~CSerialModem() { - if(socket) { - SDLNet_TCP_DelSocket(socketset,socket); - SDLNet_TCP_Close(socket); +CSerialModem::~CSerialModem() { + if(serversocket) delete serversocket; + if(clientsocket) delete clientsocket; + if(waitingclientsocket) delete waitingclientsocket; + + delete rqueue; + delete tqueue; + + // remove events + for(Bitu i = SERIAL_BASE_EVENT_COUNT+1; i <= SERIAL_MODEM_EVENT_COUNT; i++) + removeEvent(i); +} + +void CSerialModem::handleUpperEvent(Bit16u type) { + switch(type) + { + case SERIAL_RX_EVENT: + { + break; + } + case MODEM_TX_EVENT: + { + if(tqueue->left()) { + tqueue->addb(waiting_tx_character); + if(tqueue->left() < 2) { + CSerial::setCTS(false); + } + } else LOG_MSG("MODEM: TX Buffer overflow!"); + ByteTransmitted(); + + break; + } + case SERIAL_POLLING_EVENT: + { + Timer2(); + setEvent(SERIAL_POLLING_EVENT,1); + break; } - if(listensocket) SDLNet_TCP_Close(listensocket); - if(socketset) SDLNet_FreeSocketSet(socketset); - - delete rqueue; - delete tqueue; + case MODEM_RING_EVENT: + { + break; + } } +} void CSerialModem::SendLine(const char *line) { rqueue->addb(0xd); @@ -164,18 +162,9 @@ void CSerialModem::SendRes(ResTypes response) { } } -void CSerialModem::openConnection(void) { - if (socket) { - LOG_MSG("Huh? already connected"); - SDLNet_TCP_DelSocket(socketset,socket); - SDLNet_TCP_Close(socket); - } - socket = SDLNet_TCP_Open(&openip); -} - bool CSerialModem::Dial(char * host) { - /* Scan host for port */ + // Scan host for port Bit16u port; char * hasport=strrchr(host,':'); if (hasport) { @@ -183,26 +172,30 @@ bool CSerialModem::Dial(char * host) { port=(Bit16u)atoi(hasport); } else port=MODEM_DEFAULT_PORT; - /* Resolve host we're gonna dial */ + // Resolve host we're gonna dial LOG_MSG("Connecting to host %s port %d",host,port); - if (!SDLNet_ResolveHost(&openip,host,port)) { - openConnection(); - EnterConnectedState(); - return true; - } else { - LOG_MSG("Failed to resolve host %s: %s",host,SDLNet_GetError()); - SendRes(ResNODIALTONE); + clientsocket = new TCPClientSocket(host, port); + if(!clientsocket->isopen) { + delete clientsocket; + clientsocket=0; + LOG_MSG("Failed to connect."); + SendRes(ResNOCARRIER); EnterIdleState(); return false; + } else { + EnterConnectedState(); + return true; } } void CSerialModem::AcceptIncomingCall(void) { -// assert(!socket); - socket=incomingsocket; - SDLNet_TCP_AddSocket(socketset,socket); - incomingsocket = 0; - EnterConnectedState(); + if(waitingclientsocket) { + clientsocket=waitingclientsocket; + waitingclientsocket=0; + EnterConnectedState(); + } else { + EnterIdleState(); + } } Bitu CSerialModem::ScanNumber(char * & scan) { @@ -224,7 +217,10 @@ void CSerialModem::Reset(){ oldDTRstate = getDTR(); flowcontrol = 0; plusinc = 0; - incomingsocket = 0; + if(clientsocket) { + delete clientsocket; + clientsocket=0; + } memset(®,0,sizeof(reg)); reg[MREG_AUTOANSWER_COUNT]=0; // no autoanswer reg[MREG_RING_COUNT] = 1; @@ -246,23 +242,29 @@ void CSerialModem::EnterIdleState(void){ connected=false; ringing=false; - if(socket) { // clear current socket - SDLNet_TCP_DelSocket(socketset,socket); - SDLNet_TCP_Close(socket); - socket=0; + if(clientsocket) { + delete clientsocket; + clientsocket=0; } - if(incomingsocket) { // clear current incoming socket - SDLNet_TCP_DelSocket(socketset,incomingsocket); - SDLNet_TCP_Close(incomingsocket); + + if(waitingclientsocket) { // clear current incoming socket + delete waitingclientsocket; + waitingclientsocket=0; } // get rid of everything - if(listensocket) { - while(incomingsocket=SDLNet_TCP_Accept(listensocket)) { - SDLNet_TCP_DelSocket(socketset,incomingsocket); - SDLNet_TCP_Close(incomingsocket); - } + if(serversocket) { + while(waitingclientsocket=serversocket->Accept()) + delete waitingclientsocket; + } else if (listenport) { + + serversocket=new TCPServerSocket(listenport); + if(!serversocket->isopen) { + LOG_MSG("Serial%d: Modem could not open TCP port %d.",COMNUMBER,listenport); + delete serversocket; + serversocket=0; + } else LOG_MSG("Serial%d: Modem listening on port %d...",COMNUMBER,listenport); } - incomingsocket=0; + waitingclientsocket=0; commandmode = true; CSerial::setCD(false); @@ -273,19 +275,18 @@ void CSerialModem::EnterIdleState(void){ } void CSerialModem::EnterConnectedState(void) { - if(socket) { - SDLNet_TCP_AddSocket(socketset,socket); - SendRes(ResCONNECT); - commandmode = false; - memset(&telClient, 0, sizeof(telClient)); - connected = true; - ringing = false; - CSerial::setCD(true); - CSerial::setRI(false); - } else { - SendRes(ResNOCARRIER); - EnterIdleState(); + if(serversocket) { + // we don't accept further calls + delete serversocket; + serversocket=0; } + SendRes(ResCONNECT); + commandmode = false; + memset(&telClient, 0, sizeof(telClient)); + connected = true; + ringing = false; + CSerial::setCD(true); + CSerial::setRI(false); } void CSerialModem::DoCommand() { @@ -309,7 +310,7 @@ void CSerialModem::DoCommand() { if ((cmdbuf[0] != 'A') || (cmdbuf[1] != 'T')) { SendRes(ResERROR); - return;//goto ret_error; + return; } if (strstr(cmdbuf,"NET0")) { @@ -329,7 +330,7 @@ void CSerialModem::DoCommand() { if (*foundstr=='T' || *foundstr=='P') foundstr++; /* Small protection against empty line */ if (!foundstr[0]) { - SendRes(ResERROR);//goto ret_error; + SendRes(ResERROR); return; } char* helper; @@ -397,7 +398,7 @@ void CSerialModem::DoCommand() { if (connected) { SendRes(ResNOCARRIER); EnterIdleState(); - return;//goto ret_none; + return; } //Else return ok };break; @@ -405,12 +406,12 @@ void CSerialModem::DoCommand() { switch (num=ScanNumber(scanbuf)) { case 0: - if (socket) { + if (clientsocket) { commandmode = false; - return;//goto ret_none; + return; } else { SendRes(ResERROR); - return;//goto ret_none; + return; } };break; case 'T': //Tone Dial @@ -421,18 +422,18 @@ void CSerialModem::DoCommand() { ScanNumber(scanbuf); break; case 'A': //Answer call - if (incomingsocket) { + if (waitingclientsocket) { AcceptIncomingCall(); } else { SendRes(ResERROR); - return;//goto ret_none; + return; } - return;//goto ret_none; + return; case 'Z': //Reset and load profiles { // scan the number away, if any ScanNumber(scanbuf); - if (socket) SendRes(ResNOCARRIER); + if (clientsocket/*socket*/) SendRes(ResNOCARRIER); Reset(); break; } @@ -525,107 +526,103 @@ void CSerialModem::TelnetEmulation(Bit8u * data, Bitu size) { LOG_MSG("MODEM: Unrecognized option %d", c); if(telClient.command>250) { /* Reject anything we don't recognize */ + tqueue->addb(0xff); + tqueue->addb(252); + tqueue->addb(c); /* We won't do crap! */ + } + } + switch(telClient.command) { + case 251: /* Will */ + if(c == 0) telClient.binary[TEL_SERVER] = true; + if(c == 1) telClient.echo[TEL_SERVER] = true; + if(c == 3) telClient.supressGA[TEL_SERVER] = true; + break; + case 252: /* Won't */ + if(c == 0) telClient.binary[TEL_SERVER] = false; + if(c == 1) telClient.echo[TEL_SERVER] = false; + if(c == 3) telClient.supressGA[TEL_SERVER] = false; + break; + case 253: /* Do */ + if(c == 0) { + telClient.binary[TEL_CLIENT] = true; + tqueue->addb(0xff); + tqueue->addb(251); + tqueue->addb(0); /* Will do binary transfer */ + } + if(c == 1) { + telClient.echo[TEL_CLIENT] = false; tqueue->addb(0xff); tqueue->addb(252); - tqueue->addb(c); /* We won't do crap! */ + tqueue->addb(1); /* Won't echo (too lazy) */ } - } - switch(telClient.command) { - case 251: /* Will */ - if(c == 0) telClient.binary[TEL_SERVER] = true; - if(c == 1) telClient.echo[TEL_SERVER] = true; - if(c == 3) telClient.supressGA[TEL_SERVER] = true; - break; - case 252: /* Won't */ - if(c == 0) telClient.binary[TEL_SERVER] = false; - if(c == 1) telClient.echo[TEL_SERVER] = false; - if(c == 3) telClient.supressGA[TEL_SERVER] = false; - break; - case 253: /* Do */ - if(c == 0) { - telClient.binary[TEL_CLIENT] = true; - tqueue->addb(0xff); - tqueue->addb(251); - tqueue->addb(0); /* Will do binary transfer */ - } - if(c == 1) { - telClient.echo[TEL_CLIENT] = false; - tqueue->addb(0xff); - tqueue->addb(252); - tqueue->addb(1); /* Won't echo (too lazy) */ - } - if(c == 3) { - telClient.supressGA[TEL_CLIENT] = true; - tqueue->addb(0xff); - tqueue->addb(251); - tqueue->addb(3); /* Will Suppress GA */ - } - break; - case 254: /* Don't */ - if(c == 0) { - telClient.binary[TEL_CLIENT] = false; - tqueue->addb(0xff); - tqueue->addb(252); - tqueue->addb(0); /* Won't do binary transfer */ - } - if(c == 1) { - telClient.echo[TEL_CLIENT] = false; - tqueue->addb(0xff); - tqueue->addb(252); - tqueue->addb(1); /* Won't echo (fine by me) */ - } - if(c == 3) { - telClient.supressGA[TEL_CLIENT] = true; - tqueue->addb(0xff); - tqueue->addb(251); - tqueue->addb(3); /* Will Suppress GA (too lazy) */ - } - break; - default: - LOG_MSG("MODEM: Telnet client sent IAC %d", telClient.command); - break; - } - + if(c == 3) { + telClient.supressGA[TEL_CLIENT] = true; + tqueue->addb(0xff); + tqueue->addb(251); + tqueue->addb(3); /* Will Suppress GA */ + } + break; + case 254: /* Don't */ + if(c == 0) { + telClient.binary[TEL_CLIENT] = false; + tqueue->addb(0xff); + tqueue->addb(252); + tqueue->addb(0); /* Won't do binary transfer */ + } + if(c == 1) { + telClient.echo[TEL_CLIENT] = false; + tqueue->addb(0xff); + tqueue->addb(252); + tqueue->addb(1); /* Won't echo (fine by me) */ + } + if(c == 3) { + telClient.supressGA[TEL_CLIENT] = true; + tqueue->addb(0xff); + tqueue->addb(251); + tqueue->addb(3); /* Will Suppress GA (too lazy) */ + } + break; + default: + LOG_MSG("MODEM: Telnet client sent IAC %d", telClient.command); + break; + } + telClient.inIAC = false; + telClient.recCommand = false; + continue; + } else { + if(c==249) { + /* Go Ahead received */ + telClient.inIAC = false; + continue; + } + telClient.command = c; + telClient.recCommand = true; + + if((telClient.binary[TEL_SERVER]) && (c == 0xff)) { + /* Binary data with value of 255 */ telClient.inIAC = false; telClient.recCommand = false; + rqueue->addb(0xff); continue; - - } else { - if(c==249) { - /* Go Ahead received */ - telClient.inIAC = false; - continue; - } - telClient.command = c; - telClient.recCommand = true; - - if((telClient.binary[TEL_SERVER]) && (c == 0xff)) { - /* Binary data with value of 255 */ - telClient.inIAC = false; - telClient.recCommand = false; - rqueue->addb(0xff); - continue; - } - - } - } else { - if(c == 0xff) { - telClient.inIAC = true; - continue; - } - rqueue->addb(c); } } + } else { + if(c == 0xff) { + telClient.inIAC = true; + continue; + } + rqueue->addb(c); + } } +} void CSerialModem::Timer2(void) { - int result =0; + unsigned long args = 1; bool sendbyte = true; Bitu usesize; Bit8u txval; Bitu txbuffersize =0; - Bitu testres = 0; // check for bytes to be sent to port if(CSerial::CanReceiveByte()) @@ -634,13 +631,11 @@ void CSerialModem::Timer2(void) { //LOG_MSG("Modem: sending byte %2x back to UART3",rbyte); CSerial::receiveByte(rbyte); } - /* Check for eventual break command */ + // Check for eventual break command if (!commandmode) cmdpause++; - /* Handle incoming data from serial port, read as much as available */ - //Bitu tx_size=tqueue->inuse(); - //Bitu tx_first = tx_size; // TODO:comment out + // Handle incoming data from serial port, read as much as available CSerial::setCTS(true); // buffer will get 'emptier', new data can be received - while (/*tx_size--*/tqueue->inuse()) { + while (tqueue->inuse()) { txval = tqueue->getb(); if (commandmode) { if (echo) { @@ -658,9 +653,9 @@ void CSerialModem::Timer2(void) { } } else {// + character - /* 1000 ticks have passed, can check for pause command */ + // 1000 ticks have passed, can check for pause command if (cmdpause > 1000) { - if(txval ==/* '+')*/reg[MREG_ESCAPE_CHAR]) + if(txval ==reg[MREG_ESCAPE_CHAR]) // + { plusinc++; if(plusinc>=3) { @@ -673,46 +668,37 @@ void CSerialModem::Timer2(void) { } else { plusinc=0; } - //If not a special pause command, should go for bigger blocks to send + // If not a special pause command, should go for bigger blocks to send } tmpbuf[txbuffersize] = txval; txbuffersize++; } } // while loop - if (socket && sendbyte && txbuffersize) { + if (clientsocket && sendbyte && txbuffersize) { // down here it saves a lot of network traffic - SDLNet_TCP_Send(socket, tmpbuf,txbuffersize); + clientsocket->SendArray(tmpbuf,txbuffersize); //TODO error testing } - SDLNet_CheckSockets(socketset,0); - /* Handle incoming to the serial port */ - if(!commandmode && socket) { - if(rqueue->left() && SDLNet_SocketReady(socket) /*&& CSerial::getRTS()*/) - { - usesize = rqueue->left(); - if (usesize>16) usesize=16; - result = SDLNet_TCP_Recv(socket, tmpbuf, usesize); - if (result>0) { - if(telnetmode) { - /* Filter telnet commands */ - TelnetEmulation(tmpbuf, result); - } else { - rqueue->adds(tmpbuf,result); - } - cmdpause = 0; - } else { - SendRes(ResNOCARRIER); - EnterIdleState(); - } - } + // Handle incoming to the serial port + if(!commandmode && clientsocket && rqueue->left()) { + usesize = rqueue->left(); + if (usesize>16) usesize=16; + if(!clientsocket->ReceiveArray(tmpbuf, &usesize)) { + SendRes(ResNOCARRIER); + EnterIdleState(); + } else if(usesize) { + // LOG_MSG("rcv:%d", result); + // Filter telnet commands + if(telnetmode) TelnetEmulation(tmpbuf, usesize); + else rqueue->adds(tmpbuf,usesize); + cmdpause = 0; + } } - /* Check for incoming calls */ - if (!connected && !incomingsocket && listensocket) { - incomingsocket = SDLNet_TCP_Accept(listensocket); - if (incomingsocket) { - SDLNet_TCP_AddSocket(listensocketset, incomingsocket); - + // Check for incoming calls + if (!connected && !waitingclientsocket && serversocket) { + waitingclientsocket=serversocket->Accept(); + if(waitingclientsocket) { if(!CSerial::getDTR()) { // accept no calls with DTR off; TODO: AT &Dn EnterIdleState(); @@ -754,18 +740,14 @@ void CSerialModem::RXBufferEmpty() { } } -void CSerialModem::transmitByte(Bit8u val) { +void CSerialModem::transmitByte(Bit8u val, bool first) { + waiting_tx_character=val; + setEvent(MODEM_TX_EVENT, bytetime); // TX event + if(first) ByteTransmitting(); //LOG_MSG("MODEM: Byte %x to be transmitted",val); - if(tqueue->left()) { - tqueue->addb(val); - if(tqueue->left() < 2) { - CSerial::setCTS(false); - } - } else LOG_MSG("MODEM: TX Buffer overflow!"); - CSerial::ByteTransmitted(); } -void CSerialModem::updatePortConfig(Bit8u dll, Bit8u dlm, Bit8u lcr) { +void CSerialModem::updatePortConfig(Bit16u, Bit8u lcr) { // nothing to do here right? } @@ -777,6 +759,21 @@ void CSerialModem::setBreak(bool) { // TODO: handle this } +void CSerialModem::setRTSDTR(bool rts, bool dtr) { + setDTR(dtr); +} +void CSerialModem::setRTS(bool val) { + +} +void CSerialModem::setDTR(bool val) { + if(!val && connected) { + // If DTR goes low, hang up. + SendRes(ResNOCARRIER); + EnterIdleState(); + LOG_MSG("Modem: Hang up due to dropped DTR."); + } +} +/* void CSerialModem::updateModemControlLines() { //bool txrdy=tqueue->left(); //if(CSerial::getRTS() && txrdy) CSerial::setCTS(true); @@ -793,7 +790,7 @@ void CSerialModem::updateModemControlLines() { oldDTRstate = getDTR(); } - +*/ #endif diff --git a/src/hardware/serialport/softmodem.h b/src/hardware/serialport/softmodem.h index c9803cd..a937ee6 100644 --- a/src/hardware/serialport/softmodem.h +++ b/src/hardware/serialport/softmodem.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,16 +16,17 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: softmodem.h,v 1.5 2006/02/26 13:48:06 qbix79 Exp $ */ +/* $Id: softmodem.h,v 1.7 2007/01/13 08:35:49 qbix79 Exp $ */ #ifndef DOSBOX_SERIALMODEM_H #define DOSBOX_SERIALMODEM_H #include "dosbox.h" #if C_MODEM -#include "SDL_net.h" #include "serialport.h" +#include "misc_util.h" + #define MODEMSPD 57600 #define SREGS 100 @@ -34,6 +35,12 @@ #define MODEM_DEFAULT_PORT 23 +#define MODEM_TX_EVENT SERIAL_BASE_EVENT_COUNT + 1 +#define MODEM_RX_POLLING SERIAL_BASE_EVENT_COUNT + 2 +#define MODEM_RING_EVENT SERIAL_BASE_EVENT_COUNT + 3 +#define SERIAL_MODEM_EVENT_COUNT SERIAL_BASE_EVENT_COUNT+3 + + enum ResTypes { ResNONE, ResOK,ResERROR, @@ -118,9 +125,6 @@ public: private: Bit8u * data; Bitu size,pos,used; - //Bit8u tmpbuf[MODEM_BUFFER_QUEUE_SIZE]; - - }; #define MREG_AUTOANSWER_COUNT 0 #define MREG_RING_COUNT 1 @@ -136,20 +140,7 @@ public: CFifo *rqueue; CFifo *tqueue; - CSerialModem( - IO_ReadHandler* rh, - IO_WriteHandler* wh, - TIMER_TickHandler th, - Bit16u baseAddr, - Bit8u initIrq, - Bit32u initBps, - Bit8u bytesize, - const char* parity, - Bit8u stopbits, - - const char *remotestr = NULL, - Bit16u lport = 23); - + CSerialModem(Bitu id, CommandLine* cmd); ~CSerialModem(); void Reset(); @@ -172,17 +163,21 @@ public: void TelnetEmulation(Bit8u * data, Bitu size); + //TODO void Timer2(void); + void handleUpperEvent(Bit16u type); void RXBufferEmpty(); - void transmitByte(Bit8u val); - void updatePortConfig(Bit8u dll, Bit8u dlm, Bit8u lcr); + void transmitByte(Bit8u val, bool first); + void updatePortConfig(Bit16u divider, Bit8u lcr); void updateMSR(); void setBreak(bool); - void updateModemControlLines(/*Bit8u mcr*/); + void setRTSDTR(bool rts, bool dtr); + void setRTS(bool val); + void setDTR(bool val); protected: char cmdbuf[255]; @@ -199,7 +194,7 @@ protected: bool connected; Bitu doresponse; - + Bit8u waiting_tx_character; Bitu cmdpause; Bits ringtimer; @@ -208,18 +203,15 @@ protected: Bitu cmdpos; Bitu flowcontrol; - //Bit8u mctrl; Bit8u tmpbuf[MODEM_BUFFER_QUEUE_SIZE]; Bitu listenport; Bit8u reg[SREGS]; - IPaddress openip; - TCPsocket incomingsocket; - TCPsocket socket; - TCPsocket listensocket; - SDLNet_SocketSet socketset; - SDLNet_SocketSet listensocketset; + + TCPServerSocket* serversocket; + TCPClientSocket* clientsocket; + TCPClientSocket* waitingclientsocket; struct { bool binary[2]; diff --git a/src/hardware/tandy_sound.cpp b/src/hardware/tandy_sound.cpp index 84f34df..ab48087 100644 --- a/src/hardware/tandy_sound.cpp +++ b/src/hardware/tandy_sound.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/hardware/timer.cpp b/src/hardware/timer.cpp index 97a0b30..c1307a5 100644 --- a/src/hardware/timer.cpp +++ b/src/hardware/timer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: timer.cpp,v 1.35 2006/02/27 20:16:49 qbix79 Exp $ */ +/* $Id: timer.cpp,v 1.42 2007/01/13 09:57:25 qbix79 Exp $ */ #include #include "dosbox.h" @@ -53,13 +53,23 @@ struct PIT_Block { bool bcd; bool go_read_latch; bool new_mode; + bool counterstatus_set; }; static PIT_Block pit[3]; -static void PIT0_Event(Bitu val) { +static Bit8u latched_timerstatus; +// the timer status can not be overwritten until it is read or the timer was +// reprogrammed. +static bool latched_timerstatus_locked; + +static void PIT0_Event(Bitu /*val*/) { PIC_ActivateIRQ(0); - if (pit[0].mode!=0) PIC_AddEvent(PIT0_Event,pit[0].delay); + if (pit[0].mode != 0) { + pit[0].start += pit[0].delay; + double error = pit[0].start - PIC_FullIndex(); + PIC_AddEvent(PIT0_Event,pit[0].delay + error); + } } static bool counter_output(Bitu counter) { @@ -84,7 +94,32 @@ static bool counter_output(Bitu counter) { return true; } } - +static void status_latch(Bitu counter) { + // the timer status can not be overwritten until it is read or the timer was + // reprogrammed. + if(!latched_timerstatus_locked) { + PIT_Block * p=&pit[counter]; + latched_timerstatus=0; + // Timer Status Word + // 0: BCD + // 1-3: Timer mode + // 4-5: read/load mode + // 6: "NULL" - this is 0 if "the counter value is in the counter" ;) + // should rarely be 1 (i.e. on exotic modes) + // 7: OUT - the logic level on the Timer output pin + if(p->bcd)latched_timerstatus|=0x1; + latched_timerstatus|=((p->mode&7)<<1); + if((p->read_state==0)||(p->read_state==3)) latched_timerstatus|=0x30; + else if(p->read_state==1) latched_timerstatus|=0x10; + else if(p->read_state==2) latched_timerstatus|=0x20; + if(counter_output(counter)) latched_timerstatus|=0x80; + if(p->new_mode) latched_timerstatus|=0x40; + // The first thing that is being read from this counter now is the + // counter status. + p->counterstatus_set=true; + latched_timerstatus_locked=true; + } +} static void counter_latch(Bitu counter) { /* Fill the read_latch of the selected counter with current count */ PIT_Block * p=&pit[counter]; @@ -96,8 +131,13 @@ static void counter_latch(Bitu counter) { /* Counter keeps on counting after passing terminal count */ if (index>p->delay) { index-=p->delay; - index=fmod(index,(1000.0/PIT_TICK_RATE)*0x1000); - p->read_latch=(Bit16u)(0xffff-index*0xffff); + if(p->bcd) { + index = fmod(index,(1000.0/PIT_TICK_RATE)*10000.0); + p->read_latch = (Bit16u)(9999-index*(PIT_TICK_RATE/1000.0)); + } else { + index = fmod(index,(1000.0/PIT_TICK_RATE)*(double)0x10000); + p->read_latch = (Bit16u)(0xffff-index*(PIT_TICK_RATE/1000.0)); + } } else { p->read_latch=(Bit16u)(p->cntr-index*(PIT_TICK_RATE/1000.0)); } @@ -111,6 +151,10 @@ static void counter_latch(Bitu counter) { index*=2; if (index>p->delay) index-=p->delay; p->read_latch=(Bit16u)(p->cntr - (index/p->delay)*p->cntr); + // In mode 3 it never returns odd numbers LSB (if odd number is written 1 will be + // subtracted on first clock and then always 2) + // fixes "Corncob 3D" + p->read_latch&=0xfffe; break; default: LOG(LOG_PIT,LOG_ERROR)("Illegal Mode %d for reading counter %d",p->mode,counter); @@ -120,7 +164,7 @@ static void counter_latch(Bitu counter) { } -static void write_latch(Bitu port,Bitu val,Bitu iolen) { +static void write_latch(Bitu port,Bitu val,Bitu /*iolen*/) { //LOG(LOG_PIT,LOG_ERROR)("port %X write:%X state:%X",port,val,pit[port-0x40].write_state); Bitu counter=port-0x40; PIT_Block * p=&pit[counter]; @@ -153,7 +197,6 @@ static void write_latch(Bitu port,Bitu val,Bitu iolen) { switch (counter) { case 0x00: /* Timer hooked to IRQ 0 */ if (p->new_mode || p->mode == 0 ) { - p->new_mode=false; PIC_AddEvent(PIT0_Event,p->delay); } else LOG(LOG_PIT,LOG_NORMAL)("PIT 0 Timer set without new control word"); LOG(LOG_PIT,LOG_NORMAL)("PIT 0 Timer at %.2f Hz mode %d",1000.0/p->delay,p->mode); @@ -165,47 +208,54 @@ static void write_latch(Bitu port,Bitu val,Bitu iolen) { default: LOG(LOG_PIT,LOG_ERROR)("PIT:Illegal timer selected for writing"); } + p->new_mode=false; } } -static Bitu read_latch(Bitu port,Bitu iolen) { +static Bitu read_latch(Bitu port,Bitu /*iolen*/) { //LOG(LOG_PIT,LOG_ERROR)("port read %X",port); Bit32u counter=port-0x40; - if (pit[counter].go_read_latch == true) - counter_latch(counter); - Bit8u ret; - if( pit[counter].bcd == true) BIN2BCD(pit[counter].read_latch); - - switch (pit[counter].read_state) { - case 0: /* read MSB & return to state 3 */ - ret=(pit[counter].read_latch >> 8) & 0xff; - pit[counter].read_state = 3; - pit[counter].go_read_latch = true; - break; - case 3: /* read LSB followed by MSB */ - ret = (pit[counter].read_latch & 0xff); - if (pit[counter].mode & 0x80) pit[counter].mode &= 7; /* moved here */ - else - pit[counter].read_state = 0; - break; - case 1: /* read LSB */ - ret = (pit[counter].read_latch & 0xff); - pit[counter].go_read_latch = true; - break; - case 2: /* read MSB */ - ret = (pit[counter].read_latch >> 8) & 0xff; - pit[counter].go_read_latch = true; - break; - default: - ret=0; - E_Exit("Timer.cpp: error in readlatch"); - break; + Bit8u ret=0; + if(GCC_UNLIKELY(pit[counter].counterstatus_set)){ + pit[counter].counterstatus_set = false; + latched_timerstatus_locked = false; + ret = latched_timerstatus; + } else { + if (pit[counter].go_read_latch == true) + counter_latch(counter); + + if( pit[counter].bcd == true) BIN2BCD(pit[counter].read_latch); + + switch (pit[counter].read_state) { + case 0: /* read MSB & return to state 3 */ + ret=(pit[counter].read_latch >> 8) & 0xff; + pit[counter].read_state = 3; + pit[counter].go_read_latch = true; + break; + case 3: /* read LSB followed by MSB */ + ret = pit[counter].read_latch & 0xff; + + if (pit[counter].mode & 0x80) pit[counter].mode &= 7; + else pit[counter].read_state = 0; + break; + case 1: /* read LSB */ + ret = pit[counter].read_latch & 0xff; + pit[counter].go_read_latch = true; + break; + case 2: /* read MSB */ + ret = (pit[counter].read_latch >> 8) & 0xff; + pit[counter].go_read_latch = true; + break; + default: + E_Exit("Timer.cpp: error in readlatch"); + break; + } + if( pit[counter].bcd == true) BCD2BIN(pit[counter].read_latch); } - if( pit[counter].bcd == true) BCD2BIN(pit[counter].read_latch); return ret; } -static void write_p43(Bitu port,Bitu val,Bitu iolen) { +static void write_p43(Bitu /*port*/,Bitu val,Bitu /*iolen*/) { //LOG(LOG_PIT,LOG_ERROR)("port 43 %X",val); Bitu latch=(val >> 6) & 0x03; switch (latch) { @@ -221,6 +271,12 @@ static void write_p43(Bitu port,Bitu val,Bitu iolen) { /* Counter latch command */ counter_latch(latch); } else { + // Timer is being reprogrammed, unlock the status + if(pit[latch].counterstatus_set) { + pit[latch].counterstatus_set=false; + latched_timerstatus_locked=false; + } + pit[latch].read_state = (val >> 4) & 0x03; pit[latch].write_state = (val >> 4) & 0x03; Bit8u mode = (val >> 1) & 0x07; @@ -241,8 +297,11 @@ static void write_p43(Bitu port,Bitu val,Bitu iolen) { if (latch == 0) { PIC_RemoveEvents(PIT0_Event); - if (!counter_output(0) && mode) + if (!counter_output(0) && mode) { PIC_ActivateIRQ(0); + //Don't raise instantaniously. (Origamo) + if(CPU_Cycles < 25) CPU_Cycles = 25; + } if(!mode) PIC_DeActivateIRQ(0); } @@ -255,9 +314,14 @@ static void write_p43(Bitu port,Bitu val,Bitu iolen) { if (val & 0x02) counter_latch(0); if (val & 0x04) counter_latch(1); if (val & 0x08) counter_latch(2); - } else if ((val & 0x10)==0) { /* Latch status words */ - LOG(LOG_PIT,LOG_ERROR)("Unsupported Latch status word call"); - } else LOG(LOG_PIT,LOG_ERROR)("Unhandled command:%X",val); + } + // status and values can be latched simultaneously + if ((val & 0x10)==0) { /* Latch status words */ + // but only 1 status can be latched simultaneously + if (val & 0x02) status_latch(0); + else if (val & 0x04) status_latch(1); + else if (val & 0x08) status_latch(2); + } break; } } @@ -285,6 +349,7 @@ public: pit[0].mode=3; pit[0].bcd = false; pit[0].go_read_latch = true; + pit[0].counterstatus_set = false; pit[1].bcd = false; pit[1].write_state = 1; @@ -292,7 +357,8 @@ public: pit[1].go_read_latch = true; pit[1].cntr = 18; pit[1].mode = 2; - pit[1].write_state = 3; + pit[1].write_state = 3; + pit[1].counterstatus_set = false; pit[2].read_latch=0; /* MadTv1 */ pit[2].write_state = 3; /* Chuck Yeager */ @@ -301,11 +367,13 @@ public: pit[2].bcd=false; pit[2].cntr=1320; pit[2].go_read_latch=true; + pit[2].counterstatus_set = false; pit[0].delay=(1000.0f/((float)PIT_TICK_RATE/(float)pit[0].cntr)); pit[1].delay=(1000.0f/((float)PIT_TICK_RATE/(float)pit[1].cntr)); pit[2].delay=(1000.0f/((float)PIT_TICK_RATE/(float)pit[2].cntr)); - + + latched_timerstatus_locked=false; PIC_AddEvent(PIT0_Event,pit[0].delay); } ~TIMER(){ @@ -314,7 +382,7 @@ public: }; static TIMER* test; -void TIMER_Destroy(Section* sec){ +void TIMER_Destroy(Section*){ delete test; } void TIMER_Init(Section* sec) { diff --git a/src/hardware/vga.cpp b/src/hardware/vga.cpp index 696a5be..b6d0f66 100644 --- a/src/hardware/vga.cpp +++ b/src/hardware/vga.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,7 +64,6 @@ void VGA_DetermineMode(void) { VGA_SetMode(M_LIN4); else VGA_SetMode(M_EGA); - } } else { VGA_SetMode(M_TEXT); diff --git a/src/hardware/vga_attr.cpp b/src/hardware/vga_attr.cpp index 1f2f1f9..3a0e3f9 100644 --- a/src/hardware/vga_attr.cpp +++ b/src/hardware/vga_attr.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,10 +23,13 @@ #define attr(blah) vga.attr.blah void VGA_ATTR_SetPalette(Bit8u index,Bit8u val) { - if (vga.attr.mode_control & 0x80) val=(val&0xf) | (vga.attr.color_select << 4); - else val=(val & 63) | (vga.attr.color_select & 0xc) << 4; + vga.attr.palette[index] = val; + if (vga.attr.mode_control & 0x80) val = (val&0xf) | (vga.attr.color_select << 4); + val &= 63; + val |= (vga.attr.color_select & 0xc) << 4; VGA_DAC_CombineColor(index,val); } + Bitu read_p3c0(Bitu port,Bitu iolen) { //Wcharts return 0x0; diff --git a/src/hardware/vga_crtc.cpp b/src/hardware/vga_crtc.cpp index cf47441..0f8fcf5 100644 --- a/src/hardware/vga_crtc.cpp +++ b/src/hardware/vga_crtc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,12 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include #include "dosbox.h" #include "inout.h" #include "vga.h" #include "debug.h" #include "cpu.h" #include "video.h" +#include "pic.h" #define crtc(blah) vga.crtc.blah @@ -215,6 +217,10 @@ void vga_write_p3d5(Bitu port,Bitu val,Bitu iolen) { break; case 0x12: /* Vertical Display End Register */ if (val!=crtc(vertical_display_end)) { + if (abs((Bits)val-(Bits)crtc(vertical_display_end))<3) { + PIC_RemoveEvents(VGA_SetupDrawing); + vga.draw.resizing=false; + } crtc(vertical_display_end)=val; VGA_StartResize(); } @@ -236,6 +242,13 @@ void vga_write_p3d5(Bitu port,Bitu val,Bitu iolen) { break; case 0x14: /* Underline Location Register */ crtc(underline_location)=val; + //Byte,word,dword mode + if ( crtc(underline_location) & 0x20 ) + vga.config.addr_shift = 2; + else if ( crtc( mode_control) & 0x40 ) + vga.config.addr_shift = 0; + else + vga.config.addr_shift = 1; /* 0-4 Position of underline within Character cell. 5 If set memory address is only changed every fourth character clock. @@ -262,7 +275,24 @@ void vga_write_p3d5(Bitu port,Bitu val,Bitu iolen) { break; case 0x17: /* Mode Control Register */ crtc(mode_control)=val; + vga.tandy.line_mask = (~val) & 3; + //Byte,word,dword mode + if ( crtc(underline_location) & 0x20 ) + vga.config.addr_shift = 2; + else if ( crtc( mode_control) & 0x40 ) + vga.config.addr_shift = 0; + else + vga.config.addr_shift = 1; + + if ( vga.tandy.line_mask ) { + vga.tandy.line_shift = 13; + vga.tandy.addr_mask = (1 << 13) - 1; + } else { + vga.tandy.addr_mask = ~0; + vga.tandy.line_shift = 0; + } VGA_DetermineMode(); + //Should we really need to do a determinemode here? /* 0 If clear use CGA compatible memory addressing system by substituting character row scan counter bit 0 for address bit 13, diff --git a/src/hardware/vga_dac.cpp b/src/hardware/vga_dac.cpp index b6648e3..9aee884 100644 --- a/src/hardware/vga_dac.cpp +++ b/src/hardware/vga_dac.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,10 +50,22 @@ Note: Each read or write of this register will cycle through first the enum {DAC_READ,DAC_WRITE}; +static INLINE void VGA_DAC_UpdateColor( Bitu index ) { + Bitu maskIndex = index & vga.dac.pel_mask; + RENDER_SetPal( index, + vga.dac.rgb[maskIndex].red << 2, + vga.dac.rgb[maskIndex].green << 2, + vga.dac.rgb[maskIndex].blue << 2 + ); +} static void write_p3c6(Bitu port,Bitu val,Bitu iolen) { - if (val!=0xff) LOG(LOG_VGAGFX,LOG_NORMAL)("VGA:Pel Mask not 0xff"); - vga.dac.pel_mask=val; + if ( vga.dac.pel_mask != val ) { + LOG(LOG_VGAMISC,LOG_NORMAL)("VGA:DCA:Pel Mask set to %X", val); + vga.dac.pel_mask = val; + for ( Bitu i = 0;i<256;i++) + VGA_DAC_UpdateColor( i ); + } } @@ -100,17 +112,20 @@ static void write_p3c9(Bitu port,Bitu val,Bitu iolen) { switch (vga.mode) { case M_VGA: case M_LIN8: - case M_LIN16: - RENDER_SetPal(vga.dac.write_index, - vga.dac.rgb[vga.dac.write_index].red << 2, - vga.dac.rgb[vga.dac.write_index].green << 2, - vga.dac.rgb[vga.dac.write_index].blue << 2 - ); + VGA_DAC_UpdateColor( vga.dac.write_index ); + if ( GCC_UNLIKELY( vga.dac.pel_mask != 0xff)) { + Bitu index = vga.dac.write_index; + if ( (index & vga.dac.pel_mask) == index ) { + for ( Bitu i = index+1;i<256;i++) + if ( (i & vga.dac.pel_mask) == index ) + VGA_DAC_UpdateColor( i ); + } + } break; default: /* Check for attributes and DAC entry link */ for (Bitu i=0;i<16;i++) { - if (vga.attr.palette[i]==vga.dac.write_index) { + if (vga.dac.combine[i]==vga.dac.write_index) { RENDER_SetPal(i, vga.dac.rgb[vga.dac.write_index].red << 2, vga.dac.rgb[vga.dac.write_index].green << 2, @@ -152,11 +167,10 @@ static Bitu read_p3c9(Bitu port,Bitu iolen) { void VGA_DAC_CombineColor(Bit8u attr,Bit8u pal) { /* Check if this is a new color */ - vga.attr.palette[attr]=pal; + vga.dac.combine[attr]=pal; switch (vga.mode) { case M_VGA: case M_LIN8: - case M_LIN16: break; default: RENDER_SetPal(attr, @@ -168,17 +182,12 @@ void VGA_DAC_CombineColor(Bit8u attr,Bit8u pal) { } void VGA_DAC_SetEntry(Bitu entry,Bit8u red,Bit8u green,Bit8u blue) { + //Should only be called in machine != vga vga.dac.rgb[entry].red=red; vga.dac.rgb[entry].green=green; vga.dac.rgb[entry].blue=blue; - switch (vga.mode) { - case M_VGA: - case M_LIN8: - case M_LIN16: - return; - } for (Bitu i=0;i<16;i++) - if (vga.attr.palette[i]==entry) + if (vga.dac.combine[i]==entry) RENDER_SetPal(i,red << 2,green << 2,blue << 2); } diff --git a/src/hardware/vga_draw.cpp b/src/hardware/vga_draw.cpp index 1aac305..6a79b16 100644 --- a/src/hardware/vga_draw.cpp +++ b/src/hardware/vga_draw.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,46 +27,41 @@ #define VGA_PARTS 4 -typedef Bit8u * (* VGA_Line_Handler)(Bitu vidstart,Bitu panning,Bitu line); -typedef void (* VGA_FrameStart_Handler)(); +typedef Bit8u * (* VGA_Line_Handler)(Bitu vidstart, Bitu line); static VGA_Line_Handler VGA_DrawLine; -static VGA_FrameStart_Handler VGA_FrameStart; static Bit8u TempLine[SCALER_MAXWIDTH * 4]; -static Bit8u * VGA_Draw_1BPP_Line(Bitu vidstart,Bitu panning,Bitu line) { - line*=8*1024;Bit32u * draw=(Bit32u *)TempLine; - for (Bitu x=vga.draw.blocks;x>0;x--) { - Bitu val=vga.gfxmem_start[vidstart+line]; - vidstart++; - if((vga.crtc.mode_control & 0x01) == 0) // CGA compatible addressing - vidstart &= 0x1dfff; +static Bit8u * VGA_Draw_1BPP_Line(Bitu vidstart, Bitu line) { + const Bit8u *base = vga.tandy.draw_base + ((line & vga.tandy.line_mask) << vga.tandy.line_shift); + Bit32u *draw = (Bit32u *)TempLine; + for (Bitu x=vga.draw.blocks;x>0;x--, vidstart++) { + Bitu val = base[(vidstart & (8 * 1024 -1))]; *draw++=CGA_2_Table[val >> 4]; *draw++=CGA_2_Table[val & 0xf]; } return TempLine; } -static Bit8u * VGA_Draw_2BPP_Line(Bitu vidstart,Bitu panning,Bitu line) { - line*=8*1024;Bit32u * draw=(Bit32u *)TempLine; +static Bit8u * VGA_Draw_2BPP_Line(Bitu vidstart, Bitu line) { + const Bit8u *base = vga.tandy.draw_base + ((line & vga.tandy.line_mask) << vga.tandy.line_shift); + Bit32u * draw=(Bit32u *)TempLine; for (Bitu x=0;x>4)|(val2&0xf0)]; *draw++=CGA_4_HiRes_Table[(val1&0x0f)|((val2&0x0f)<<4)]; } @@ -75,8 +70,9 @@ static Bit8u * VGA_Draw_2BPPHiRes_Line(Bitu vidstart,Bitu panning,Bitu line) { static Bitu temp[643]={0}; -static Bit8u * VGA_Draw_CGA16_Line(Bitu vidstart,Bitu panning,Bitu line) { - const Bit8u * reader=&vga.mem.linear[vidstart + (line * 8 * 1024)]; +static Bit8u * VGA_Draw_CGA16_Line(Bitu vidstart, Bitu line) { + const Bit8u *base = vga.tandy.draw_base + ((line & vga.tandy.line_mask) << vga.tandy.line_shift); + const Bit8u *reader = base + vidstart; Bit32u * draw=(Bit32u *)TempLine; //Generate a temporary bitline to calculate the avarage //over bit-2 bit-1 bit bit+1. @@ -114,17 +110,14 @@ static Bit8u * VGA_Draw_CGA16_Line(Bitu vidstart,Bitu panning,Bitu line) { return TempLine; } -static Bit8u * VGA_Draw_4BPP_Line(Bitu vidstart,Bitu panning,Bitu line) { - line*=8*1024;Bit32u * draw=(Bit32u *)TempLine; +static Bit8u * VGA_Draw_4BPP_Line(Bitu vidstart, Bitu line) { + const Bit8u *base = vga.tandy.draw_base + ((line & vga.tandy.line_mask) << vga.tandy.line_shift); + Bit32u * draw=(Bit32u *)TempLine; for (Bitu x=0;x> 4 | (val2 & 0x0f) << 24 | @@ -133,13 +126,12 @@ static Bit8u * VGA_Draw_4BPP_Line(Bitu vidstart,Bitu panning,Bitu line) { return TempLine; } -static Bit8u * VGA_Draw_4BPP_Line_Double(Bitu vidstart,Bitu panning,Bitu line) { - line*=8*1024;Bit32u * draw=(Bit32u *)TempLine; +static Bit8u * VGA_Draw_4BPP_Line_Double(Bitu vidstart, Bitu line) { + const Bit8u *base = vga.tandy.draw_base + ((line & vga.tandy.line_mask) << vga.tandy.line_shift); + Bit32u * draw=(Bit32u *)TempLine; for (Bitu x=0;x> 4 | (val & 0xf0) << 4 | (val & 0x0f) << 16 | @@ -148,43 +140,62 @@ static Bit8u * VGA_Draw_4BPP_Line_Double(Bitu vidstart,Bitu panning,Bitu line) { return TempLine; } -static Bit8u * VGA_Draw_LIN4_Line(Bitu vidstart,Bitu panning,Bitu line) { - return &vga.mem.linear[512*1024+vidstart*8+panning]; -} -static Bit8u * VGA_Draw_EGA_Line(Bitu vidstart,Bitu panning,Bitu line) { - return &vga.mem.linear[512*1024+vidstart*8+panning]; -} -static Bit8u * VGA_Draw_VGA_Line(Bitu vidstart,Bitu panning,Bitu line) { - return &vga.mem.linear[vidstart*4+panning]; -} -static Bit8u * VGA_Draw_LIN16_Line(Bitu vidstart,Bitu panning,Bitu line) { - return &vga.mem.linear[vidstart*4+panning]; -} -static Bit8u * VGA_Draw_LIN32_Line(Bitu vidstart,Bitu panning,Bitu line) { - return &vga.mem.linear[vidstart*4+panning]; +#ifdef VGA_KEEP_CHANGES +static Bit8u * VGA_Draw_Changes_Line(Bitu vidstart, Bitu line) { + Bitu checkMask = vga.changes.checkMask; + Bit8u *map = vga.changes.map; + Bitu start = (vidstart >> VGA_CHANGE_SHIFT); + Bitu end = ((vidstart + vga.draw.line_length ) >> VGA_CHANGE_SHIFT); + for (; start <= end;start++) { + if ( map[start] & checkMask ) { + Bit8u *ret = &vga.draw.linear_base[ vidstart & vga.draw.linear_mask ]; +#if !defined(C_UNALIGNED_MEMORY) + if (GCC_UNLIKELY( ((Bitu)ret) & (sizeof(Bitu)-1)) ) { + memcpy( TempLine, ret, vga.draw.line_length ); + return TempLine; + } +#endif + return ret; + } + } +// memset( TempLine, 0x30, vga.changes.lineWidth ); +// return TempLine; + return 0; } -static Bit8u * VGA_Draw_VGAChained_Line(Bitu vidstart,Bitu panning,Bitu line) { - return &vga.mem.linear[512*1024+((vidstart*4+panning)&0xffff)]; +#endif + +static Bit8u * VGA_Draw_Linear_Line(Bitu vidstart, Bitu line) { + Bit8u *ret = &vga.draw.linear_base[ vidstart & vga.draw.linear_mask ]; +#if !defined(C_UNALIGNED_MEMORY) + if (GCC_UNLIKELY( ((Bitu)ret) & (sizeof(Bitu)-1)) ) { + memcpy( TempLine, ret, vga.draw.line_length ); + return TempLine; + } +#endif + return ret; } -static void VGA_StartFrame_VGA() { - if(vga.config.compatible_chain4 && (vga.crtc.underline_location & 0x40)) - VGA_DrawLine=VGA_Draw_VGAChained_Line; - else - VGA_DrawLine = VGA_Draw_VGA_Line; +//Test version, might as well keep it +static Bit8u * VGA_Draw_Chain_Line(Bitu vidstart, Bitu line) { + Bitu i = 0; + for ( i = 0; i < vga.draw.width;i++ ) { + Bitu addr = vidstart + i; + TempLine[i] = vga.mem.linear[((addr&~3)<<2)+(addr&3)]; + } + return TempLine; } -static Bit8u * VGA_Draw_VGA_Line_HWMouse(Bitu vidstart, Bitu panning, Bitu line) { +static Bit8u * VGA_Draw_VGA_Line_HWMouse( Bitu vidstart, Bitu line) { if(vga.s3.hgc.curmode & 0x1) { - Bitu lineat = vidstart / ((160 * vga.draw.height) / 480); + Bitu lineat = vidstart / vga.draw.width; if((lineat < vga.s3.hgc.originy) || (lineat > (vga.s3.hgc.originy + 63U))) { - return VGA_Draw_VGA_Line(vidstart, panning, line); + return &vga.mem.linear[ vidstart ]; } else { - memcpy(TempLine, VGA_Draw_VGA_Line(vidstart, panning, line), vga.draw.width); + memcpy(TempLine, &vga.mem.linear[ vidstart ], vga.draw.width); /* Draw mouse cursor */ Bits moff = ((Bits)lineat - (Bits)vga.s3.hgc.originy) + (Bits)vga.s3.hgc.posy; - if(moff>63) return VGA_Draw_VGA_Line(vidstart, panning, line); + if(moff>63) return &vga.mem.linear[ vidstart ]; if(moff<0) moff+=64; Bitu xat = vga.s3.hgc.originx; Bitu m, mapat; @@ -231,15 +242,147 @@ static Bit8u * VGA_Draw_VGA_Line_HWMouse(Bitu vidstart, Bitu panning, Bitu line) } } else { /* HW Mouse not enabled, use the tried and true call */ - return VGA_Draw_VGA_Line(vidstart, panning, line); + return &vga.mem.linear[ vidstart ]; + } +} + +static Bit8u * VGA_Draw_LIN16_Line_HWMouse(Bitu vidstart, Bitu line) { + if(vga.s3.hgc.curmode & 0x1) { + Bitu lineat = (vidstart >> 1) / vga.draw.width; + if((lineat < vga.s3.hgc.originy) || (lineat > (vga.s3.hgc.originy + 63U))) { + return &vga.mem.linear[ vidstart ]; + } else { + memcpy(TempLine, &vga.mem.linear[ vidstart ], 2*vga.draw.width); + /* Draw mouse cursor */ + Bits moff = ((Bits)lineat - (Bits)vga.s3.hgc.originy) + (Bits)vga.s3.hgc.posy; + if(moff>63) return &vga.mem.linear[ vidstart ]; + if(moff<0) moff+=64; + Bitu xat = 2*vga.s3.hgc.originx; + Bitu m, mapat; + Bits r, z; + mapat = 0; + + Bitu mouseaddr = (Bit32u)vga.s3.hgc.startaddr * (Bit32u)1024; + mouseaddr+=(moff * 16); + + Bit16u bitsA, bitsB; + Bit8u mappoint; + for(m=0;m<4;m++) { + bitsA = *(Bit16u *)&vga.mem.linear[mouseaddr]; + mouseaddr+=2; + bitsB = *(Bit16u *)&vga.mem.linear[mouseaddr]; + mouseaddr+=2; + z = 7; + for(r=15;r>=0;--r) { + mappoint = (((bitsA >> z) & 0x1) << 1) | ((bitsB >> z) & 0x1); + if(mapat >= vga.s3.hgc.posx) { + switch(mappoint) { + case 0: + TempLine[xat] = vga.s3.hgc.backstack[0]; + TempLine[xat+1] = vga.s3.hgc.backstack[1]; + break; + case 1: + TempLine[xat] = vga.s3.hgc.forestack[0]; + TempLine[xat+1] = vga.s3.hgc.forestack[1]; + break; + case 2: + //Transparent + break; + case 3: + // Invert screen data + TempLine[xat] = ~TempLine[xat]; + TempLine[xat+1] = ~TempLine[xat+1]; + break; + } + xat+=2; + } + mapat++; + --z; + if(z<0) z=15; + } + } + return TempLine; + } + } else { + /* HW Mouse not enabled, use the tried and true call */ + return &vga.mem.linear[ vidstart ]; + } +} + +static Bit8u * VGA_Draw_LIN32_Line_HWMouse(Bitu vidstart, Bitu line) { + if(vga.s3.hgc.curmode & 0x1) { + Bitu lineat = (vidstart >> 2) / vga.draw.width; + if((lineat < vga.s3.hgc.originy) || (lineat > (vga.s3.hgc.originy + 63U))) { + return &vga.mem.linear[ vidstart ]; + } else { + memcpy(TempLine, &vga.mem.linear[ vidstart ], 4*vga.draw.width); + /* Draw mouse cursor */ + Bits moff = ((Bits)lineat - (Bits)vga.s3.hgc.originy) + (Bits)vga.s3.hgc.posy; + if(moff>63) return &vga.mem.linear[ vidstart ]; + if(moff<0) moff+=64; + Bitu xat = 4*vga.s3.hgc.originx; + Bitu m, mapat; + Bits r, z; + mapat = 0; + + Bitu mouseaddr = (Bit32u)vga.s3.hgc.startaddr * (Bit32u)1024; + mouseaddr+=(moff * 16); + + Bit16u bitsA, bitsB; + Bit8u mappoint; + for(m=0;m<4;m++) { + bitsA = *(Bit16u *)&vga.mem.linear[mouseaddr]; + mouseaddr+=2; + bitsB = *(Bit16u *)&vga.mem.linear[mouseaddr]; + mouseaddr+=2; + z = 7; + for(r=15;r>=0;--r) { + mappoint = (((bitsA >> z) & 0x1) << 1) | ((bitsB >> z) & 0x1); + if(mapat >= vga.s3.hgc.posx) { + switch(mappoint) { + case 0: + TempLine[xat] = vga.s3.hgc.backstack[0]; + TempLine[xat+1] = vga.s3.hgc.backstack[1]; + TempLine[xat+2] = vga.s3.hgc.backstack[2]; + TempLine[xat+3] = 255; + break; + case 1: + TempLine[xat] = vga.s3.hgc.forestack[0]; + TempLine[xat+1] = vga.s3.hgc.forestack[1]; + TempLine[xat+2] = vga.s3.hgc.forestack[2]; + TempLine[xat+3] = 255; + break; + case 2: + //Transparent + break; + case 3: + // Invert screen data + TempLine[xat] = ~TempLine[xat]; + TempLine[xat+1] = ~TempLine[xat+1]; + TempLine[xat+2] = ~TempLine[xat+2]; + TempLine[xat+2] = ~TempLine[xat+3]; + break; + } + xat+=4; + } + mapat++; + --z; + if(z<0) z=15; + } + } + return TempLine; + } + } else { + /* HW Mouse not enabled, use the tried and true call */ + return &vga.mem.linear[ vidstart ]; } } static Bit32u FontMask[2]={0xffffffff,0x0}; -static Bit8u * VGA_TEXT_Draw_Line(Bitu vidstart,Bitu panning,Bitu line) { +static Bit8u * VGA_TEXT_Draw_Line(Bitu vidstart, Bitu line) { Bitu font_addr; Bit32u * draw=(Bit32u *)TempLine; - Bit8u * vidmem=&vga.gfxmem_start[vidstart]; + const Bit8u *vidmem = &vga.tandy.draw_base[vidstart]; for (Bitu cx=0;cxvga.draw.cursor.eline) goto skip_cursor; draw=(Bit32u *)&TempLine[font_addr*8]; - Bit32u att=TXT_FG_Table[vga.gfxmem_start[vga.draw.cursor.address+1]&0xf]; + Bit32u att=TXT_FG_Table[vga.tandy.draw_base[vga.draw.cursor.address+1]&0xf]; *draw++=att;*draw++=att; } skip_cursor: @@ -265,7 +408,7 @@ skip_cursor: } static void VGA_VerticalDisplayEnd(Bitu val) { - vga.config.retrace=true; +// vga.config.retrace=true; vga.config.real_start=vga.config.display_start & ((2*1024*1024)-1); } @@ -273,28 +416,55 @@ static void VGA_HorizontalTimer(void) { } +#ifdef VGA_KEEP_CHANGES +static INLINE void VGA_ChangesEnd(void ) { + if ( vga.changes.active ) { +// vga.changes.active = false; + Bitu end = vga.draw.address >> VGA_CHANGE_SHIFT; + Bitu total = 4 + end - vga.changes.start; + Bit32u clearMask = vga.changes.clearMask; + total >>= 2; + Bit32u *clear = (Bit32u *)&vga.changes.map[ vga.changes.start & ~3 ]; + while ( total-- ) { + clear[0] &= clearMask; + clear++; + } + } +} +#endif + + static void VGA_DrawPart(Bitu lines) { while (lines--) { - vga.draw.lines_done++; - Bit8u * data=VGA_DrawLine(vga.draw.address,vga.draw.panning,vga.draw.address_line); + Bit8u * data=VGA_DrawLine( vga.draw.address, vga.draw.address_line ); RENDER_DrawLine(data); vga.draw.address_line++; if (vga.draw.address_line>=vga.draw.address_line_total) { vga.draw.address_line=0; vga.draw.address+=vga.draw.address_add; } + vga.draw.lines_done++; if (vga.draw.split_line==vga.draw.lines_done) { +#ifdef VGA_KEEP_CHANGES + VGA_ChangesEnd( ); +#endif vga.draw.address=0; - if(vga.attr.mode_control&0x20) - vga.draw.panning=0; + if(!(vga.attr.mode_control&0x20)) + vga.draw.address += vga.config.pel_panning; vga.draw.address_line=0; +#ifdef VGA_KEEP_CHANGES + vga.changes.start = vga.draw.address >> VGA_CHANGE_SHIFT; +#endif } } if (--vga.draw.parts_left) { - PIC_AddEvent(VGA_DrawPart,vga.draw.delay.parts, + PIC_AddEvent(VGA_DrawPart,(float)vga.draw.delay.parts, (vga.draw.parts_left!=1) ? vga.draw.parts_lines : (vga.draw.lines_total - vga.draw.lines_done)); } else { - RENDER_EndUpdate( true ); +#ifdef VGA_KEEP_CHANGES + VGA_ChangesEnd(); +#endif + RENDER_EndUpdate(); } } @@ -313,26 +483,83 @@ void VGA_SetBlinking(Bitu enabled) { for (Bitu i=0;i<8;i++) TXT_BG_Table[i+8]=(b+i) | ((b+i) << 8)| ((b+i) <<16) | ((b+i) << 24); } -static void VGA_VerticalTimer(Bitu val) { - if (VGA_FrameStart) - VGA_FrameStart(); - vga.config.retrace=false; - PIC_AddEvent(VGA_VerticalTimer,vga.draw.delay.vtotal); - PIC_AddEvent(VGA_VerticalDisplayEnd,vga.draw.delay.vend); - bool bDoDraw = RENDER_StartUpdate(); - if (bDoDraw) { -// if (RENDER_StartUpdate()) { - vga.draw.parts_left=vga.draw.parts_total; - vga.draw.lines_done=0; - vga.draw.address=vga.config.real_start; - vga.draw.address_line=vga.config.hlines_skip; - vga.draw.split_line=(vga.config.line_compare/vga.draw.lines_scaled); - vga.draw.panning=vga.config.pel_panning; -// PIC_AddEvent(VGA_DrawPart,vga.draw.delay.parts,vga.draw.parts_lines); +#ifdef VGA_KEEP_CHANGES +static void INLINE VGA_ChangesStart( void ) { + vga.changes.start = vga.draw.address >> VGA_CHANGE_SHIFT; + vga.changes.last = vga.changes.start; + if ( vga.changes.lastAddress != vga.draw.address ) { +// LOG_MSG("Address"); + VGA_DrawLine = VGA_Draw_Linear_Line; + vga.changes.lastAddress = vga.draw.address; + } else if ( render.fullFrame ) { +// LOG_MSG("Full Frame"); + VGA_DrawLine = VGA_Draw_Linear_Line; + } else { +// LOG_MSG("Changes"); + VGA_DrawLine = VGA_Draw_Changes_Line; } + vga.changes.active = true; + vga.changes.checkMask = vga.changes.writeMask; + vga.changes.clearMask = ~( 0x01010101 << (vga.changes.frame & 7)); + vga.changes.frame++; + vga.changes.writeMask = 1 << (vga.changes.frame & 7); +} +#endif + + +static void VGA_VerticalTimer(Bitu val) { + double error = vga.draw.delay.framestart; + vga.draw.delay.framestart = PIC_FullIndex(); + error = vga.draw.delay.framestart - error - vga.draw.delay.vtotal; +// if (abs(error) > 0.001 ) +// LOG_MSG("vgaerror: %f",error); + PIC_AddEvent( VGA_VerticalTimer, (float)vga.draw.delay.vtotal ); + PIC_AddEvent( VGA_VerticalDisplayEnd, (float)vga.draw.delay.vrstart ); + if ( GCC_UNLIKELY( vga.draw.parts_left )) { + LOG(LOG_VGAMISC,LOG_NORMAL)( "Parts left: %d", vga.draw.parts_left ); + PIC_RemoveEvents( &VGA_DrawPart ); + RENDER_EndUpdate(); + vga.draw.parts_left = 0; + } + //Check if we can actually render, else skip the rest + if (!RENDER_StartUpdate()) + return; + //TODO Maybe check for an active frame on parts_left and clear that first? + vga.draw.parts_left = vga.draw.parts_total; + vga.draw.lines_done = 0; +// vga.draw.address=vga.config.display_start; + vga.draw.address = vga.config.real_start; + vga.draw.address_line = vga.config.hlines_skip; + vga.draw.split_line = (vga.config.line_compare/vga.draw.lines_scaled); switch (vga.mode) { + case M_EGA: + case M_LIN4: + vga.draw.address *= 8; + vga.draw.address += vga.config.pel_panning; +#ifdef VGA_KEEP_CHANGES + VGA_ChangesStart(); +#endif + break; + case M_VGA: + if(vga.config.compatible_chain4 && (vga.crtc.underline_location & 0x40)) { + vga.draw.linear_base = vga.mem.linear + VGA_CACHE_OFFSET; + vga.draw.linear_mask = 0xffff; + } else { + vga.draw.linear_base = vga.mem.linear; + vga.draw.linear_mask = VGA_MEMORY - 1; + } + case M_LIN8: + case M_LIN15: + case M_LIN16: + case M_LIN32: + vga.draw.address *= 4; + vga.draw.address += vga.config.pel_panning; +#ifdef VGA_KEEP_CHANGES + VGA_ChangesStart(); +#endif + break; case M_TEXT: - vga.draw.address=(vga.draw.address*2); + vga.draw.address = vga.config.display_start * 2; case M_TANDY_TEXT: case M_HERC_TEXT: vga.draw.cursor.address=vga.config.cursor_start*2; @@ -341,30 +568,33 @@ static void VGA_VerticalTimer(Bitu val) { FontMask[1]=(vga.draw.blinking & (vga.draw.cursor.count >> 4)) ? 0 : 0xffffffff; break; - case M_CGA4:case M_CGA2:case M_CGA16: - case M_TANDY2:case M_TANDY4:case M_TANDY16: + case M_HERC_GFX: + break; + case M_CGA4:case M_CGA2: vga.draw.address=(vga.draw.address*2)&0x1fff; break; + case M_CGA16: + case M_TANDY2:case M_TANDY4:case M_TANDY16: + vga.draw.address *= 2; + break; } - if (IS_TANDY_ARCH) { - vga.draw.address+=vga.tandy.disp_bank << 14; - vga.draw.cursor.address+=vga.tandy.disp_bank << 14; - } - if (bDoDraw) -// VGA_DrawPart(vga.draw.parts_lines); - PIC_AddEvent(VGA_DrawPart,vga.draw.delay.parts/2,vga.draw.parts_lines); //Else tearline in Tyrian and second reality + //VGA_DrawPart( vga.draw.parts_lines ); + PIC_AddEvent(VGA_DrawPart,vga.draw.delay.parts,vga.draw.parts_lines); +// PIC_AddEvent(VGA_DrawPart,vga.draw.delay.parts/2,vga.draw.parts_lines); //Else tearline in Tyrian and second reality } void VGA_CheckScanLength(void) { switch (vga.mode) { case M_EGA: - case M_VGA: case M_LIN4: + vga.draw.address_add=vga.config.scan_len*16; + break; + case M_VGA: case M_LIN8: case M_LIN15: case M_LIN16: case M_LIN32: - vga.draw.address_add=vga.config.scan_len*2; + vga.draw.address_add=vga.config.scan_len*8; break; case M_TEXT: vga.draw.address_add=vga.config.scan_len*4; @@ -397,9 +627,19 @@ void VGA_CheckScanLength(void) { void VGA_ActivateHardwareCursor(void) { if(vga.s3.hgc.curmode & 0x1) { - VGA_DrawLine=VGA_Draw_VGA_Line_HWMouse; + switch(vga.mode) { + case M_LIN32: + VGA_DrawLine=VGA_Draw_LIN32_Line_HWMouse; + break; + case M_LIN15: + case M_LIN16: + VGA_DrawLine=VGA_Draw_LIN16_Line_HWMouse; + break; + default: + VGA_DrawLine=VGA_Draw_VGA_Line_HWMouse; + } } else { - VGA_DrawLine=VGA_Draw_VGA_Line; + VGA_DrawLine=VGA_Draw_Linear_Line; } } @@ -411,24 +651,49 @@ void VGA_SetupDrawing(Bitu val) { } /* Calculate the FPS for this screen */ float fps;Bitu clock; - Bitu htotal,hdispend,hbstart,hrstart; - Bitu vtotal,vdispend,vbstart,vrstart; + Bitu htotal, hdend, hbstart, hbend, hrstart, hrend; + Bitu vtotal, vdend, vbstart, vbend, vrstart, vrend; if (machine==MCH_VGA) { + htotal = 5 + vga.crtc.horizontal_total; + hdend = 1 + vga.crtc.horizontal_display_end; + hbstart = vga.crtc.start_horizontal_blanking; + hbend = vga.crtc.end_horizontal_blanking&0x1F | + ((vga.crtc.end_horizontal_retrace&0x80)>>2); + hbend = hbstart + ((hbend - hbstart) & 0x3F); + hrstart = vga.crtc.start_horizontal_retrace; + hrend = vga.crtc.end_horizontal_retrace & 0x1f; + hrend = (hrend - hrstart) & 0x1f; + if ( !hrend ) + hrend = hrstart + 0x1f + 1; + else + hrend = hrstart + hrend; + vtotal=2 + vga.crtc.vertical_total | ((vga.crtc.overflow & 1) << 8) | ((vga.crtc.overflow & 0x20) << 4); - htotal=5 + vga.crtc.horizontal_total; - vdispend = 1 + (vga.crtc.vertical_display_end | - ((vga.crtc.overflow & 2)<<7) | ((vga.crtc.overflow & 0x40) << 3) | + vdend = 1 + (vga.crtc.vertical_display_end | + ((vga.crtc.overflow & 2)<<7) | + ((vga.crtc.overflow & 0x40) << 3) | ((vga.s3.ex_ver_overflow & 0x2) << 9)); - hdispend = 1 + (vga.crtc.horizontal_display_end); - hbstart = vga.crtc.start_horizontal_blanking; - vbstart = vga.crtc.start_vertical_blanking | ((vga.crtc.overflow & 0x08) << 5) | - ((vga.crtc.maximum_scan_line & 0x20) << 4) ; - hrstart = vga.crtc.start_horizontal_retrace; - vrstart = vga.crtc.vertical_retrace_start + ((vga.crtc.overflow & 0x04) << 6) | + vrstart = vga.crtc.vertical_retrace_start + + ((vga.crtc.overflow & 0x04) << 6) | ((vga.crtc.overflow & 0x80) << 2); - if (hbstart0; } else { - vga.draw.address_line_total=vga.other.max_scanline+1; - htotal=vga.other.htotal; - hdispend=vga.other.hdend; - hrstart=vga.other.hsyncp; - vtotal=vga.draw.address_line_total*vga.other.vtotal+vga.other.vadjust; - vdispend=vga.draw.address_line_total*vga.other.vdend; - vrstart=vga.draw.address_line_total*vga.other.vsyncp; + htotal = vga.other.htotal + 1; + hdend = vga.other.hdend; + hbstart = hdend; + hbend = htotal; + hrstart = vga.other.hsyncp; + hrend = hrstart + (vga.other.syncw & 0xf) ; + + vga.draw.address_line_total = vga.other.max_scanline + 1; + vtotal = vga.draw.address_line_total * (vga.other.vtotal+1)+vga.other.vadjust; + vdend = vga.draw.address_line_total * vga.other.vdend; + vrstart = vga.draw.address_line_total * vga.other.vsyncp; + vrend = (vga.other.syncw >> 4); + if (!vrend) + vrend = vrstart + 0xf + 1; + else + vrend = vrstart + vrend; + vbstart = vdend; + vbend = vtotal; vga.draw.double_scan=false; switch (machine) { case MCH_CGA: @@ -475,39 +751,93 @@ void VGA_SetupDrawing(Bitu val) { break; } } - LOG(LOG_VGA,LOG_NORMAL)("H total %d, V Total %d",htotal,vtotal); - LOG(LOG_VGA,LOG_NORMAL)("H D End %d, V D End %d",hdispend,vdispend); +#if C_DEBUG + LOG(LOG_VGA,LOG_NORMAL)("h total %d end %d blank (%d/%d) retrace (%d/%d)", + htotal, hdend, hbstart, hbend, hrstart, hrend ); + LOG(LOG_VGA,LOG_NORMAL)("v total %d end %d blank (%d/%d) retrace (%d/%d)", + vtotal, vdend, vbstart, vbend, vrstart, vrend ); +#endif if (!htotal) return; if (!vtotal) return; + fps=(float)clock/(vtotal*htotal); - float linetime=1000.0f/fps; - vga.draw.parts_total=VGA_PARTS; - vga.draw.delay.vtotal=linetime; - linetime/=vtotal; //Really make it the line_delay - vga.draw.delay.vend=linetime*vrstart; - vga.draw.delay.parts=(linetime*vdispend)/vga.draw.parts_total; - vga.draw.delay.htotal=linetime; - vga.draw.delay.hend=(linetime/htotal)*hrstart; + // The time a complete video frame takes + vga.draw.delay.vtotal = (1000.0 * (double)(vtotal*htotal)) / (double)clock; + // Horizontal total (that's how long a line takes with whistles and bells) + vga.draw.delay.htotal = htotal*1000.0/clock; //in milliseconds + // Start and End of horizontal blanking + vga.draw.delay.hblkstart = hbstart*1000.0/clock; //in milliseconds + vga.draw.delay.hblkend = hbend*1000.0/clock; + vga.draw.delay.hrstart = 0; + + // Start and End of vertical blanking + vga.draw.delay.vblkstart = vbstart * vga.draw.delay.htotal; + vga.draw.delay.vblkend = vbend * vga.draw.delay.htotal; + // Start and End of vertical retrace pulse + vga.draw.delay.vrstart = vrstart * vga.draw.delay.htotal; + vga.draw.delay.vrend = vrend * vga.draw.delay.htotal; + // Display end + vga.draw.delay.vdend = vdend * vga.draw.delay.htotal; + /* + // just curious + LOG_MSG("H total %d, V Total %d",htotal,vtotal); + LOG_MSG("H D End %d, V D End %d",hdispend,vdispend); + LOG_MSG("vrstart: %d, vrend: %d\n",vrstart,vrend); + LOG_MSG("htotal: %2.6f, vtotal: %2.6f,\n"\ + "hblkstart: %2.6f, hblkend: %2.6f,\n"\ + "vblkstart: %2.6f, vblkend: %2.6f,\n"\ + "vrstart: %2.6f, vrend: %2.6f,\n"\ + "vdispend: %2.6f", + vga.draw.delay.htotal, vga.draw.delay.vtotal, + vga.draw.delay.hblkstart, vga.draw.delay.hblkend, + vga.draw.delay.vblkstart, vga.draw.delay.vblkend, + vga.draw.delay.vrstart, vga.draw.delay.vrend, + vga.draw.delay.vend); + */ + vga.draw.parts_total=VGA_PARTS; double correct_ratio=(100.0/525.0); double aspect_ratio=((double)htotal/((double)vtotal)/correct_ratio); - + vga.draw.delay.parts = vga.draw.delay.vdend/vga.draw.parts_total; vga.draw.resizing=false; - Bitu width=hdispend; - Bitu height=vdispend; - Bitu bpp=8; + + //Check to prevent useless black areas + if (hbstart>= 1; - } - VGA_DrawLine=VGA_Draw_LIN16_Line; - break; - case M_LIN16: - bpp = 16; - width<<=3; - if (vga.crtc.mode_control & 0x8) { - doublewidth = true; - width >>= 1; - } - VGA_DrawLine=VGA_Draw_LIN16_Line; - break; - case M_LIN32: - bpp = 32; - width<<=3; - if (vga.crtc.mode_control & 0x8) { - doublewidth = true; - width >>= 1; - } - VGA_DrawLine=VGA_Draw_LIN32_Line; - break; case M_LIN4: doublewidth=(vga.seq.clocking_mode & 0x8) > 0; vga.draw.blocks = width; width<<=3; - VGA_DrawLine=VGA_Draw_LIN4_Line; + VGA_DrawLine=VGA_Draw_Linear_Line; + vga.draw.linear_base = vga.mem.linear + VGA_CACHE_OFFSET; + vga.draw.linear_mask = 1024 * 1024 - 1; break; case M_EGA: doublewidth=(vga.seq.clocking_mode & 0x8) > 0; vga.draw.blocks = width; width<<=3; - VGA_DrawLine=VGA_Draw_EGA_Line; + VGA_DrawLine=VGA_Draw_Linear_Line; + vga.draw.linear_base = vga.mem.linear + VGA_CACHE_OFFSET; + vga.draw.linear_mask = 512 * 1024 - 1; break; case M_CGA16: doubleheight=true; @@ -603,18 +910,26 @@ void VGA_SetupDrawing(Bitu val) { vga.draw.blocks=width * 2; width=vga.draw.blocks*4; if ((machine==MCH_TANDY && (vga.tandy.gfx_control & 0x8)) || - (machine==MCH_PCJR && (vga.tandy.mode_control==0x0b))) VGA_DrawLine=VGA_Draw_2BPPHiRes_Line; + (machine==MCH_PCJR && (vga.tandy.mode_control==0x0b))) + VGA_DrawLine=VGA_Draw_2BPPHiRes_Line; else VGA_DrawLine=VGA_Draw_2BPP_Line; break; case M_TANDY16: aspect_ratio=1.2; doubleheight=true; - doublewidth=true; vga.draw.blocks=width*2; if (vga.tandy.mode_control & 0x1) { - width=vga.draw.blocks*2; + if (( machine==MCH_TANDY ) && ( vga.tandy.mode_control & 0x10 )) { + doublewidth = false; + vga.draw.blocks*=2; + width=vga.draw.blocks*2; + } else { + doublewidth = true; + width=vga.draw.blocks*2; + } VGA_DrawLine=VGA_Draw_4BPP_Line; } else { + doublewidth=true; width=vga.draw.blocks*4; VGA_DrawLine=VGA_Draw_4BPP_Line_Double; } @@ -644,6 +959,12 @@ void VGA_SetupDrawing(Bitu val) { } vga.draw.lines_total=height; vga.draw.parts_lines=vga.draw.lines_total/vga.draw.parts_total; + vga.draw.line_length = width * ((bpp + 1) / 8); +#ifdef VGA_KEEP_CHANGES + vga.changes.active = false; + vga.changes.frame = 0; + vga.changes.writeMask = 1; +#endif if (( width != vga.draw.width) || (height != vga.draw.height) || (vga.mode != vga.lastmode)) { vga.lastmode = vga.mode; PIC_RemoveEvents(VGA_VerticalTimer); @@ -661,7 +982,8 @@ void VGA_SetupDrawing(Bitu val) { doublewidth ? "double":"normal",doubleheight ? "double":"normal",aspect_ratio); #endif RENDER_SetSize(width,height,bpp,fps,aspect_ratio,doublewidth,doubleheight); - PIC_AddEvent(VGA_VerticalTimer,vga.draw.delay.vtotal); + vga.draw.delay.framestart = PIC_FullIndex(); + PIC_AddEvent( VGA_VerticalTimer , vga.draw.delay.vtotal ); } }; diff --git a/src/hardware/vga_gfx.cpp b/src/hardware/vga_gfx.cpp index 7a8190b..e6d378a 100644 --- a/src/hardware/vga_gfx.cpp +++ b/src/hardware/vga_gfx.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/hardware/vga_memory.cpp b/src/hardware/vga_memory.cpp index 6138229..2588264 100644 --- a/src/hardware/vga_memory.cpp +++ b/src/hardware/vga_memory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,37 @@ #include "pic.h" #include "inout.h" +#ifdef VGA_KEEP_CHANGES +#define MEM_CHANGED( _MEM ) vga.changes.map[ (_MEM) >> VGA_CHANGE_SHIFT ] |= vga.changes.writeMask; +//#define MEM_CHANGED( _MEM ) vga.changes.map[ (_MEM) >> VGA_CHANGE_SHIFT ] = 1; +#else +#define MEM_CHANGED( _MEM ) +#endif + +#define TANDY_VIDBASE(_X_) &MemBase[ 0x80000 + (_X_)] + +template +static INLINE void hostWrite(HostPt off, Bitu val) { + if ( sizeof( Size ) == 1) + host_writeb( off, (Bit8u)val ); + else if ( sizeof( Size ) == 2) + host_writew( off, (Bit16u)val ); + else if ( sizeof( Size ) == 4) + host_writed( off, (Bit32u)val ); +} + +template +static INLINE Bitu hostRead(HostPt off ) { + if ( sizeof( Size ) == 1) + return host_readb( off ); + else if ( sizeof( Size ) == 2) + return host_readw( off ); + else if ( sizeof( Size ) == 4) + return host_readd( off ); + return 0; +} + + void VGA_MapMMIO(void); //Nice one from DosEmu INLINE static Bit32u RasterOp(Bit32u input,Bit32u mask) { @@ -83,7 +114,7 @@ static struct { class VGA_UnchainedRead_Handler : public PageHandler { public: Bitu readHandler(PhysPt start) { - vga.latch.d=vga.mem.latched[start].d; + vga.latch.d=((Bit32u*)vga.mem.linear)[start]; switch (vga.config.read_mode) { case 0: return (vga.latch.b[vga.config.read_map_select]); @@ -115,45 +146,20 @@ public: } }; -class VGA_Chained_ReadHandler : public PageHandler { +class VGA_ChainedEGA_Handler : public PageHandler { public: Bitu readHandler(PhysPt addr) { - if(vga.mode == M_VGA) - return vga.mem.linear[((addr&~3)<<2)|(addr&3)]; return vga.mem.linear[addr]; } -public: - Bitu readb(PhysPt addr) { - addr = PAGING_GetPhysicalAddress(addr) & 0xffff; - return readHandler(addr); - } - Bitu readw(PhysPt addr) { - addr = PAGING_GetPhysicalAddress(addr) & 0xffff; - return - (readHandler(addr+0) << 0) | - (readHandler(addr+1) << 8); - } - Bitu readd(PhysPt addr) { - addr = PAGING_GetPhysicalAddress(addr) & 0xffff; - return - (readHandler(addr+0) << 0) | - (readHandler(addr+1) << 8) | - (readHandler(addr+2) << 16) | - (readHandler(addr+3) << 24); - } -}; - -class VGA_ChainedEGA_Handler : public VGA_Chained_ReadHandler { -public: void writeHandler(PhysPt start, Bit8u val) { Bit32u data=ModeOperation(val); /* Update video memory and the pixel buffer */ VGA_Latch pixels; vga.mem.linear[start] = val; start >>= 2; - pixels.d=vga.mem.latched[start].d; + pixels.d=((Bit32u*)vga.mem.linear)[start]; - Bit8u * write_pixels=&vga.mem.linear[512*1024+(start<<3)]; + Bit8u * write_pixels=&vga.mem.linear[VGA_CACHE_OFFSET+(start<<3)]; Bit32u colors0_3, colors4_7; VGA_Latch temp;temp.d=(pixels.d>>4) & 0x0f0f0f0f; @@ -177,33 +183,55 @@ public: } void writeb(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + MEM_CHANGED( addr << 3); writeHandler(addr+0,(Bit8u)(val >> 0)); } void writew(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + MEM_CHANGED( addr << 3); writeHandler(addr+0,(Bit8u)(val >> 0)); writeHandler(addr+1,(Bit8u)(val >> 8)); } void writed(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + MEM_CHANGED( addr << 3); writeHandler(addr+0,(Bit8u)(val >> 0)); writeHandler(addr+1,(Bit8u)(val >> 8)); writeHandler(addr+2,(Bit8u)(val >> 16)); writeHandler(addr+3,(Bit8u)(val >> 24)); } + Bitu readb(PhysPt addr) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + return readHandler(addr); + } + Bitu readw(PhysPt addr) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + return + (readHandler(addr+0) << 0) | + (readHandler(addr+1) << 8); + } + Bitu readd(PhysPt addr) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + return + (readHandler(addr+0) << 0) | + (readHandler(addr+1) << 8) | + (readHandler(addr+2) << 16) | + (readHandler(addr+3) << 24); + } }; class VGA_UnchainedEGA_Handler : public VGA_UnchainedRead_Handler { public: + template< bool wrapping> void writeHandler(PhysPt start, Bit8u val) { Bit32u data=ModeOperation(val); /* Update video memory and the pixel buffer */ VGA_Latch pixels; - pixels.d=vga.mem.latched[start].d; + pixels.d=((Bit32u*)vga.mem.linear)[start]; pixels.d&=vga.config.full_not_map_mask; pixels.d|=(data & vga.config.full_map_mask); - vga.mem.latched[start].d=pixels.d; - Bit8u * write_pixels=&vga.mem.linear[512*1024+(start<<3)]; + ((Bit32u*)vga.mem.linear)[start]=pixels.d; + Bit8u * write_pixels=&vga.mem.linear[VGA_CACHE_OFFSET+(start<<3)]; Bit32u colors0_3, colors4_7; VGA_Latch temp;temp.d=(pixels.d>>4) & 0x0f0f0f0f; @@ -213,7 +241,6 @@ public: Expand16Table[2][temp.b[2]] | Expand16Table[3][temp.b[3]]; *(Bit32u *)write_pixels=colors0_3; - *(Bit32u *)(write_pixels+512*1024)=colors0_3; temp.d=pixels.d & 0x0f0f0f0f; colors4_7 = Expand16Table[0][temp.b[0]] | @@ -221,7 +248,10 @@ public: Expand16Table[2][temp.b[2]] | Expand16Table[3][temp.b[3]]; *(Bit32u *)(write_pixels+4)=colors4_7; - *(Bit32u *)(write_pixels+512*1024+4)=colors4_7; + if (wrapping && GCC_UNLIKELY( start < 512)) { + *(Bit32u *)(write_pixels+512*1024)=colors0_3; + *(Bit32u *)(write_pixels+512*1024+4)=colors4_7; + } } public: VGA_UnchainedEGA_Handler() { @@ -229,53 +259,133 @@ public: } void writeb(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; - writeHandler(addr+0,(Bit8u)(val >> 0)); + MEM_CHANGED( addr << 3); + writeHandler(addr+0,(Bit8u)(val >> 0)); } void writew(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; - writeHandler(addr+0,(Bit8u)(val >> 0)); - writeHandler(addr+1,(Bit8u)(val >> 8)); + MEM_CHANGED( addr << 3); + writeHandler(addr+0,(Bit8u)(val >> 0)); + writeHandler(addr+1,(Bit8u)(val >> 8)); } void writed(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; - writeHandler(addr+0,(Bit8u)(val >> 0)); - writeHandler(addr+1,(Bit8u)(val >> 8)); - writeHandler(addr+2,(Bit8u)(val >> 16)); - writeHandler(addr+3,(Bit8u)(val >> 24)); + MEM_CHANGED( addr << 3); + writeHandler(addr+0,(Bit8u)(val >> 0)); + writeHandler(addr+1,(Bit8u)(val >> 8)); + writeHandler(addr+2,(Bit8u)(val >> 16)); + writeHandler(addr+3,(Bit8u)(val >> 24)); } }; - -class VGA_ChainedVGA_Handler : public VGA_Chained_ReadHandler { +//Slighly unusual version, will directly write 8,16,32 bits values +class VGA_ChainedVGA_Handler : public PageHandler { public: - void writeHandler(PhysPt addr, Bitu val) { - // No need to check for compatible chains here, this one is only enabled if that bit is set - vga.mem.linear[((addr&~3)<<2)|(addr&3)] = val; - // Linearized version for faster rendering - vga.mem.linear[512*1024+addr] = val; - // And replicate the first line - if (addr < 320) - vga.mem.linear[512*1024+addr+64*1024] = val; - } -public: VGA_ChainedVGA_Handler() { flags=PFLAG_NOCODE; } - void writeb(PhysPt addr,Bitu val) { + template + static INLINE Bitu readHandler(PhysPt addr ) { + return hostRead( &vga.mem.linear[((addr&~3)<<2)+(addr&3)] ); + } + template + static INLINE void writeCache(PhysPt addr, Bitu val) { + hostWrite( &vga.mem.linear[VGA_CACHE_OFFSET+addr], val ); + if (GCC_UNLIKELY(addr < 320)) { + // And replicate the first line + hostWrite( &vga.mem.linear[VGA_CACHE_OFFSET+addr+64*1024], val ); + } + } + template + static INLINE void writeHandler(PhysPt addr, Bitu val) { + // No need to check for compatible chains here, this one is only enabled if that bit is set + hostWrite( &vga.mem.linear[((addr&~3)<<2)+(addr&3)], val ); + } + Bitu readb(PhysPt addr ) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; - writeHandler(addr+0,(Bit8u)(val >> 0)); + return readHandler( addr ); + } + Bitu readw(PhysPt addr ) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + return readHandler( addr ); + } + Bitu readd(PhysPt addr ) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + return readHandler( addr ); + } + bool readw_checked( PhysPt addr,Bitu *val ) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + if ( addr & 1) { + *val = + (readHandler( addr+0 ) << 0 ) | + (readHandler( addr+1 ) << 8 ); + } else { + *val = readHandler( addr ); + } + return false; + } + bool readd_checked( PhysPt addr,Bitu *val ) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + if ( addr & 3) { + *val = + (readHandler( addr+0 ) << 0 ) | + (readHandler( addr+1 ) << 8 ) | + (readHandler( addr+2 ) << 16 ) | + (readHandler( addr+3 ) << 24 ); + } else { + *val = readHandler( addr ); + } + return false; + } + void writeb(PhysPt addr, Bitu val ) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + MEM_CHANGED( addr ); + writeHandler( addr, val ); + writeCache( addr, val ); } void writew(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; - writeHandler(addr+0,(Bit8u)(val >> 0)); - writeHandler(addr+1,(Bit8u)(val >> 8)); + MEM_CHANGED( addr ); + writeHandler( addr, val ); + writeCache( addr, val ); } void writed(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; - writeHandler(addr+0,(Bit8u)(val >> 0)); - writeHandler(addr+1,(Bit8u)(val >> 8)); - writeHandler(addr+2,(Bit8u)(val >> 16)); - writeHandler(addr+3,(Bit8u)(val >> 24)); + MEM_CHANGED( addr ); + writeHandler( addr, val ); + writeCache( addr, val ); + } + bool writew_checked( PhysPt addr,Bitu val ) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + if ( addr & 1 ) { + MEM_CHANGED( addr ); + MEM_CHANGED( addr + 1); + writeHandler( addr+0, val >> 0 ); + writeHandler( addr+1, val >> 8 ); + writeCache( addr, val ); + } else { + MEM_CHANGED( addr ); + writeHandler( addr, val ); + writeCache( addr, val ); + } + return false; + } + bool writed_checked( PhysPt addr,Bitu val ) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + if ( addr & 3) { + MEM_CHANGED( addr ); + MEM_CHANGED( addr + 3); + writeHandler( addr+0, val >> 0 ); + writeHandler( addr+1, val >> 8 ); + writeHandler( addr+2, val >> 16 ); + writeHandler( addr+3, val >> 24 ); + writeCache( addr, val ); + } else { + MEM_CHANGED( addr ); + writeHandler( addr, val ); + writeCache( addr, val ); + } + return false; } }; @@ -284,11 +394,12 @@ public: void writeHandler( PhysPt addr, Bit8u val ) { Bit32u data=ModeOperation(val); VGA_Latch pixels; - pixels.d=vga.mem.latched[addr].d; + pixels.d=((Bit32u*)vga.mem.linear)[addr]; pixels.d&=vga.config.full_not_map_mask; pixels.d|=(data & vga.config.full_map_mask); - vga.mem.latched[addr].d=pixels.d; - vga.mem.latched[addr+64*1024].d=pixels.d; + ((Bit32u*)vga.mem.linear)[addr]=pixels.d; + if(vga.config.compatible_chain4) + ((Bit32u*)vga.mem.linear)[addr+64*1024]=pixels.d; } public: VGA_UnchainedVGA_Handler() { @@ -296,15 +407,21 @@ public: } void writeb(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + addr += vga.s3.svga_bank.fullbank; + MEM_CHANGED( addr << 2 ); writeHandler(addr+0,(Bit8u)(val >> 0)); } void writew(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + addr += vga.s3.svga_bank.fullbank; + MEM_CHANGED( addr << 2); writeHandler(addr+0,(Bit8u)(val >> 0)); writeHandler(addr+1,(Bit8u)(val >> 8)); } void writed(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + addr += vga.s3.svga_bank.fullbank; + MEM_CHANGED( addr << 2); writeHandler(addr+0,(Bit8u)(val >> 0)); writeHandler(addr+1,(Bit8u)(val >> 8)); writeHandler(addr+2,(Bit8u)(val >> 16)); @@ -329,102 +446,103 @@ public: } }; -class VGA_MAP_PageHandler : public PageHandler { +class VGA_Map_Handler : public PageHandler { public: - VGA_MAP_PageHandler() { + VGA_Map_Handler() { flags=PFLAG_READABLE|PFLAG_WRITEABLE|PFLAG_NOCODE; } HostPt GetHostReadPt(Bitu phys_page) { phys_page-=vgapages.base; - return &vga.mem.linear[vga.s3.bank*64*1024+phys_page*4096]; + return &vga.mem.linear[vga.s3.svga_bank.fullbank+phys_page*4096]; } HostPt GetHostWritePt(Bitu phys_page) { phys_page-=vgapages.base; - return &vga.mem.linear[vga.s3.bank*64*1024+phys_page*4096]; + return &vga.mem.linear[vga.s3.svga_bank.fullbank+phys_page*4096]; } }; - -class VGA_LIN4Linear_Handler : public VGA_UnchainedEGA_Handler { +class VGA_Changes_Handler : public PageHandler { public: - VGA_LIN4Linear_Handler() { - flags=PFLAG_READABLE|PFLAG_WRITEABLE|PFLAG_NOCODE; - } - void writeb(PhysPt addr,Bitu val) { - addr = (PAGING_GetPhysicalAddress(addr) - vga.lfb.addr) & (512*1024-1); - writeHandler(addr+0,(Bit8u)(val >> 0)); - } - void writew(PhysPt addr,Bitu val) { - addr = (PAGING_GetPhysicalAddress(addr) - vga.lfb.addr) & (512*1024-1); - writeHandler(addr+0,(Bit8u)(val >> 0)); - writeHandler(addr+1,(Bit8u)(val >> 8)); - } - void writed(PhysPt addr,Bitu val) { - addr = (PAGING_GetPhysicalAddress(addr) - vga.lfb.addr) & (512*1024-1); - writeHandler(addr+0,(Bit8u)(val >> 0)); - writeHandler(addr+1,(Bit8u)(val >> 8)); - writeHandler(addr+2,(Bit8u)(val >> 16)); - writeHandler(addr+3,(Bit8u)(val >> 24)); + VGA_Changes_Handler() { + flags=PFLAG_NOCODE; } Bitu readb(PhysPt addr) { - addr = (PAGING_GetPhysicalAddress(addr) - vga.lfb.addr) & (512*1024-1); - return readHandler(addr); + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + addr += vga.s3.svga_bank.fullbank; + return hostRead( &vga.mem.linear[addr] ); } Bitu readw(PhysPt addr) { - addr = (PAGING_GetPhysicalAddress(addr) - vga.lfb.addr) & (512*1024-1); - return - (readHandler(addr+0) << 0) | - (readHandler(addr+1) << 8); + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + addr += vga.s3.svga_bank.fullbank; + return hostRead( &vga.mem.linear[addr] ); } Bitu readd(PhysPt addr) { - addr = (PAGING_GetPhysicalAddress(addr) - vga.lfb.addr) & (512*1024-1); - return - (readHandler(addr+0) << 0) | - (readHandler(addr+1) << 8) | - (readHandler(addr+2) << 16) | - (readHandler(addr+3) << 24); + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + addr += vga.s3.svga_bank.fullbank; + return hostRead( &vga.mem.linear[addr] ); + } + void writeb(PhysPt addr,Bitu val) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + addr += vga.s3.svga_bank.fullbank; + MEM_CHANGED( addr ); + hostWrite( &vga.mem.linear[addr], val ); + } + void writew(PhysPt addr,Bitu val) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + addr += vga.s3.svga_bank.fullbank; + MEM_CHANGED( addr ); + hostWrite( &vga.mem.linear[addr], val ); + } + void writed(PhysPt addr,Bitu val) { + addr = PAGING_GetPhysicalAddress(addr) & 0xffff; + addr += vga.s3.svga_bank.fullbank; + MEM_CHANGED( addr ); + hostWrite( &vga.mem.linear[addr], val ); } }; -class VGA_LIN4Banked_Handler : public VGA_UnchainedEGA_Handler { +class VGA_LIN4_Handler : public VGA_UnchainedEGA_Handler { public: - VGA_LIN4Banked_Handler() { + VGA_LIN4_Handler() { flags=PFLAG_NOCODE; } void writeb(PhysPt addr,Bitu val) { - addr = vga.s3.bank*64*1024 + (PAGING_GetPhysicalAddress(addr) & 0xffff); - addr &= (512*1024-1); - writeHandler(addr+0,(Bit8u)(val >> 0)); + addr = vga.s3.svga_bank.fullbank + (PAGING_GetPhysicalAddress(addr) & 0xffff); + addr &= (128*1024-1); + MEM_CHANGED( addr << 3 ); + writeHandler(addr+0,(Bit8u)(val >> 0)); } void writew(PhysPt addr,Bitu val) { - addr = vga.s3.bank*64*1024 + (PAGING_GetPhysicalAddress(addr) & 0xffff); - addr &= (512*1024-1); - writeHandler(addr+0,(Bit8u)(val >> 0)); - writeHandler(addr+1,(Bit8u)(val >> 8)); + addr = vga.s3.svga_bank.fullbank + (PAGING_GetPhysicalAddress(addr) & 0xffff); + addr &= (128*1024-1); + MEM_CHANGED( addr << 3 ); + writeHandler(addr+0,(Bit8u)(val >> 0)); + writeHandler(addr+1,(Bit8u)(val >> 8)); } void writed(PhysPt addr,Bitu val) { - addr = vga.s3.bank*64*1024 + (PAGING_GetPhysicalAddress(addr) & 0xffff); - addr &= (512*1024-1); - writeHandler(addr+0,(Bit8u)(val >> 0)); - writeHandler(addr+1,(Bit8u)(val >> 8)); - writeHandler(addr+2,(Bit8u)(val >> 16)); - writeHandler(addr+3,(Bit8u)(val >> 24)); + addr = vga.s3.svga_bank.fullbank + (PAGING_GetPhysicalAddress(addr) & 0xffff); + addr &= (128*1024-1); + MEM_CHANGED( addr << 3 ); + writeHandler(addr+0,(Bit8u)(val >> 0)); + writeHandler(addr+1,(Bit8u)(val >> 8)); + writeHandler(addr+2,(Bit8u)(val >> 16)); + writeHandler(addr+3,(Bit8u)(val >> 24)); } Bitu readb(PhysPt addr) { - addr = vga.s3.bank*64*1024 + (PAGING_GetPhysicalAddress(addr) & 0xffff); - addr &= (512*1024-1); + addr = vga.s3.svga_bank.fullbank + (PAGING_GetPhysicalAddress(addr) & 0xffff); + addr &= (128*1024-1); return readHandler(addr); } Bitu readw(PhysPt addr) { - addr = vga.s3.bank*64*1024 + (PAGING_GetPhysicalAddress(addr) & 0xffff); - addr &= (512*1024-1); + addr = vga.s3.svga_bank.fullbank + (PAGING_GetPhysicalAddress(addr) & 0xffff); + addr &= (128*1024-1); return (readHandler(addr+0) << 0) | (readHandler(addr+1) << 8); } Bitu readd(PhysPt addr) { - addr = vga.s3.bank*64*1024 + (PAGING_GetPhysicalAddress(addr) & 0xffff); - addr &= (512*1024-1); + addr = vga.s3.svga_bank.fullbank + (PAGING_GetPhysicalAddress(addr) & 0xffff); + addr &= (128*1024-1); return (readHandler(addr+0) << 0) | (readHandler(addr+1) << 8) | @@ -441,31 +559,38 @@ public: } Bitu readb(PhysPt addr) { addr = PAGING_GetPhysicalAddress(addr) - vga.lfb.addr; - return *(Bit8u*)(&vga.mem.linear[addr]); + return hostRead( &vga.mem.linear[addr] ); } Bitu readw(PhysPt addr) { addr = PAGING_GetPhysicalAddress(addr) - vga.lfb.addr; - return *(Bit16u*)(&vga.mem.linear[addr]); + return hostRead( &vga.mem.linear[addr] ); } Bitu readd(PhysPt addr) { addr = PAGING_GetPhysicalAddress(addr) - vga.lfb.addr; - return *(Bit32u*)(&vga.mem.linear[addr]); + return hostRead( &vga.mem.linear[addr] ); } void writeb(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) - vga.lfb.addr; - *(Bit8u*)(&vga.mem.linear[addr]) = val; - vga.changed[addr >> VGA_CHANGE_SHIFT] = 1; + hostWrite( &vga.mem.linear[addr], val ); + MEM_CHANGED( addr ); } void writew(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) - vga.lfb.addr; - *(Bit16u*)(&vga.mem.linear[addr]) = val; - vga.changed[addr >> VGA_CHANGE_SHIFT] = 1; + hostWrite( &vga.mem.linear[addr], val ); + MEM_CHANGED( addr ); } void writed(PhysPt addr,Bitu val) { addr = PAGING_GetPhysicalAddress(addr) - vga.lfb.addr; - *(Bit32u*)(&vga.mem.linear[addr]) = val; - vga.changed[addr >> VGA_CHANGE_SHIFT] = 1; + hostWrite( &vga.mem.linear[addr], val ); + MEM_CHANGED( addr ); } + bool writed_checked( PhysPt addr,Bitu val ) { + addr = PAGING_GetPhysicalAddress(addr) - vga.lfb.addr; + hostWrite( &vga.mem.linear[addr], val ); + MEM_CHANGED( addr ); + return false; + } + }; class VGA_LFB_Handler : public PageHandler { @@ -539,8 +664,9 @@ public: } Bitu readb(PhysPt addr) { + Bitu port = PAGING_GetPhysicalAddress(addr) & 0xffff; + if(port >= 0x82E8) return IO_ReadB(port); //LOG_MSG("MMIO: Read byte from %x", addr); - return 0x00; } Bitu readw(PhysPt addr) { @@ -550,6 +676,8 @@ public: return 0x00; } Bitu readd(PhysPt addr) { + Bitu port = PAGING_GetPhysicalAddress(addr) & 0xffff; + if(port >= 0x82E8) return IO_ReadD(port); //LOG_MSG("MMIO: Read dword from %x", addr); return 0x00; } @@ -563,156 +691,207 @@ public: // |PFLAG_NOCODE; } HostPt GetHostReadPt(Bitu phys_page) { - if (phys_page>=0xb8) { - phys_page-=0xb8; - return &vga.mem.linear[(vga.tandy.mem_bank << 14)+(phys_page * 4096)]; - } else { - if (machine==MCH_TANDY) phys_page-=0x80; - return &vga.mem.linear[phys_page * 4096]; - } + if (vga.tandy.mem_bank & 1) + phys_page&=0x03; + else + phys_page&=0x07; + return vga.tandy.mem_base + (phys_page * 4096); } HostPt GetHostWritePt(Bitu phys_page) { return GetHostReadPt( phys_page ); } }; -class VGA_PCJR_PageHandler : public PageHandler { + +class VGA_PCJR_Handler : public PageHandler { public: - VGA_PCJR_PageHandler() { + VGA_PCJR_Handler() { flags=PFLAG_READABLE|PFLAG_WRITEABLE; } HostPt GetHostReadPt(Bitu phys_page) { phys_page-=0xb8; - if (!vga.tandy.is_32k_mode) phys_page&=0x03; - return MemBase+(vga.tandy.mem_bank << 14)+(phys_page * 4096); + //test for a unaliged bank, then replicate 2x16kb + if (vga.tandy.mem_bank & 1) + phys_page&=0x03; + return vga.tandy.mem_base + (phys_page * 4096); } HostPt GetHostWritePt(Bitu phys_page) { return GetHostReadPt( phys_page ); } }; +class VGA_Empty_Handler : public PageHandler { +public: + VGA_Empty_Handler() { + flags=PFLAG_NOCODE; + } + Bitu readb(PhysPt addr) { +// LOG(LOG_VGA, LOG_NORMAL ) ( "Read from empty memory space at %x", addr ); + return 0xff; + } + void writeb(PhysPt addr,Bitu val) { +// LOG(LOG_VGA, LOG_NORMAL ) ( "Write %x to empty memory space at %x", val, addr ); + } +}; static struct vg { - VGA_MAP_PageHandler map; + VGA_Map_Handler map; + VGA_Changes_Handler changes; VGA_TEXT_PageHandler text; VGA_TANDY_PageHandler tandy; VGA_ChainedEGA_Handler cega; VGA_ChainedVGA_Handler cvga; VGA_UnchainedEGA_Handler uega; VGA_UnchainedVGA_Handler uvga; - VGA_PCJR_PageHandler hpcjr; - VGA_LIN4Banked_Handler l4banked; - VGA_LIN4Linear_Handler l4linear; + VGA_PCJR_Handler pcjr; + VGA_LIN4_Handler lin4; VGA_LFB_Handler lfb; VGA_LFBChanges_Handler lfbchanges; VGA_MMIO_Handler mmio; + VGA_Empty_Handler empty; } vgaph; +void VGA_ChangedBank(void) { +#ifndef VGA_LFB_MAPPED + //If the mode is accurate than the correct mapper must have been installed already + if ( vga.mode >= M_LIN4 && vga.mode <= M_LIN32 ) { + return; + } +#endif + VGA_SetupHandlers(); +} void VGA_SetupHandlers(void) { - PageHandler * range_handler; + PageHandler *newHandler; switch (machine) { case MCH_CGA: - range_handler=&vgaph.map; - goto range_b800; - case MCH_HERC: - range_handler=&vgaph.map; - if (vga.herc.mode_control&0x80) goto range_b800; - else goto range_b000; - case MCH_TANDY: - range_handler=&vgaph.tandy; - MEM_SetPageHandler(0x80,32,range_handler); - goto range_b800; case MCH_PCJR: - range_handler=&vgaph.hpcjr; + MEM_SetPageHandler( VGA_PAGE_B8, 8, &vgaph.pcjr ); + goto range_done; + case MCH_HERC: + vgapages.base=VGA_PAGE_B0; + if (vga.herc.enable_bits & 0x2) { + vgapages.mask=0xffff; + MEM_SetPageHandler(VGA_PAGE_B0,16,&vgaph.map); + } else { + vgapages.mask=0x7fff; + /* With hercules in 32kb mode it leaves a memory hole on 0xb800 */ + MEM_SetPageHandler(VGA_PAGE_B0,8,&vgaph.map); + MEM_SetPageHandler(VGA_PAGE_B8,8,&vgaph.empty); + } + goto range_done; + case MCH_TANDY: + /* Always map 0xa000 - 0xbfff, might overwrite 0xb800 */ + vgapages.base=VGA_PAGE_A0; + vgapages.mask=0x1ffff; + MEM_SetPageHandler(VGA_PAGE_A0, 32, &vgaph.map ); + if ( vga.tandy.extended_ram & 1 ) { + //You seem to be able to also map different 64kb banks, but have to figure that out + //This seems to work so far though + vga.tandy.draw_base = vga.mem.linear; + vga.tandy.mem_base = vga.mem.linear; + } else { + vga.tandy.draw_base = TANDY_VIDBASE( vga.tandy.draw_bank * 16 * 1024); + vga.tandy.mem_base = TANDY_VIDBASE( vga.tandy.mem_bank * 16 * 1024); + MEM_SetPageHandler( 0xb8, 8, &vgaph.tandy ); + } + goto range_done; // MEM_SetPageHandler(vga.tandy.mem_bank<<2,vga.tandy.is_32k_mode ? 0x08 : 0x04,range_handler); - goto range_b800; + case MCH_VGA: + break; + default: + LOG_MSG("Illegal machine type %d", machine ); + return; } + + /* This should be vga only */ switch (vga.mode) { case M_ERROR: return; case M_LIN4: - range_handler=&vgaph.l4banked; + newHandler = &vgaph.lin4; break; - case M_LIN8: case M_LIN15: case M_LIN16: case M_LIN32: - range_handler=&vgaph.map; +#ifdef VGA_LFB_MAPPED + newHandler = &vgaph.map; +#else + newHandler = &vgaph.changes; +#endif break; + case M_LIN8: case M_VGA: if (vga.config.chained) { if(vga.config.compatible_chain4) - range_handler = &vgaph.cvga; - else - range_handler=&vgaph.map; + newHandler = &vgaph.cvga; + else +#ifdef VGA_LFB_MAPPED + newHandler = &vgaph.map; +#else + newHandler = &vgaph.changes; +#endif } else { - range_handler=&vgaph.uvga; + newHandler = &vgaph.uvga; } break; case M_EGA: if (vga.config.chained) - range_handler=&vgaph.cega; + newHandler = &vgaph.cega; else - range_handler=&vgaph.uega; + newHandler = &vgaph.uega; break; case M_TEXT: /* Check if we're not in odd/even mode */ - if (vga.gfx.miscellaneous & 0x2) range_handler=&vgaph.map; - else range_handler=&vgaph.text; + if (vga.gfx.miscellaneous & 0x2) newHandler = &vgaph.map; + else newHandler = &vgaph.text; break; case M_CGA4: case M_CGA2: - range_handler=&vgaph.map; + newHandler = &vgaph.map; break; } switch ((vga.gfx.miscellaneous >> 2) & 3) { case 0: - vgapages.base=VGA_PAGE_A0; - vgapages.mask=0x1ffff; - MEM_SetPageHandler(VGA_PAGE_A0,32,range_handler); + vgapages.base = VGA_PAGE_A0; + vgapages.mask = 0x1ffff; + MEM_SetPageHandler(VGA_PAGE_A0, 32, newHandler ); break; case 1: - vgapages.base=VGA_PAGE_A0; - vgapages.mask=0xffff; - MEM_SetPageHandler(VGA_PAGE_A0,16,range_handler); - MEM_ResetPageHandler(VGA_PAGE_B0,16); + vgapages.base = VGA_PAGE_A0; + vgapages.mask = 0xffff; + MEM_SetPageHandler( VGA_PAGE_A0, 16, newHandler ); + MEM_ResetPageHandler( VGA_PAGE_B0, 16); break; case 2: -range_b000: - vgapages.base=VGA_PAGE_B0; - vgapages.mask=0x7fff; - MEM_SetPageHandler(VGA_PAGE_B0,8,range_handler); - MEM_ResetPageHandler(VGA_PAGE_A0,16); - MEM_ResetPageHandler(VGA_PAGE_B8,8); + vgapages.base = VGA_PAGE_B0; + vgapages.mask = 0x7fff; + MEM_SetPageHandler( VGA_PAGE_B0, 8, newHandler ); + MEM_ResetPageHandler( VGA_PAGE_A0, 16 ); + MEM_ResetPageHandler( VGA_PAGE_B8, 8 ); break; case 3: -range_b800: - vgapages.base=VGA_PAGE_B8; - vgapages.mask=0x7fff; - MEM_SetPageHandler(VGA_PAGE_B8,8,range_handler); - MEM_ResetPageHandler(VGA_PAGE_A0,16); - MEM_ResetPageHandler(VGA_PAGE_B0,8); + vgapages.base = VGA_PAGE_B8; + vgapages.mask = 0x7fff; + MEM_SetPageHandler( VGA_PAGE_B8, 8, newHandler ); + MEM_ResetPageHandler( VGA_PAGE_A0, 16 ); + MEM_ResetPageHandler( VGA_PAGE_B0, 8 ); break; } - - if(((vga.s3.ext_mem_ctrl & 0x10) != 0x00) && (vga.mode == M_LIN8)) + if(((vga.s3.ext_mem_ctrl & 0x10) != 0x00) /*&& (vga.mode == M_LIN8)*/) MEM_SetPageHandler(VGA_PAGE_A0, 16, &vgaph.mmio); - +range_done: PAGING_ClearTLB(); } void VGA_StartUpdateLFB(void) { vga.lfb.page = vga.s3.la_window << 4; vga.lfb.addr = vga.s3.la_window << 16; - switch (vga.mode) { - case M_LIN4: - vga.lfb.handler = &vgaph.l4linear; - break; - default: - vga.lfb.handler = &vgaph.lfbchanges; - break; - } +#ifdef VGA_LFB_MAPPED + vga.lfb.handler = &vgaph.lfb; +#else + vga.lfb.handler = &vgaph.lfbchanges; +#endif MEM_SetLFB(vga.s3.la_window << 4 ,sizeof(vga.mem.linear)/4096, vga.lfb.handler ); } @@ -726,10 +905,14 @@ void VGA_UnmapMMIO(void) { void VGA_SetupMemory() { - memset((void *)&vga.mem,0,512*1024*4); + memset( &vga.mem, 0, VGA_MEMORY ); +#ifdef VGA_KEEP_CHANGES + memset( &vga.changes, 0, sizeof( vga.changes )); +#endif + vga.s3.svga_bank.fullbank=0; if (machine==MCH_PCJR) { /* PCJr does not have dedicated graphics memory but uses conventional memory below 128k */ - vga.gfxmem_start=GetMemBase(); - } else vga.gfxmem_start=&vga.mem.linear[0]; + //TODO map? + } } diff --git a/src/hardware/vga_misc.cpp b/src/hardware/vga_misc.cpp index 141bfba..9306acf 100644 --- a/src/hardware/vga_misc.cpp +++ b/src/hardware/vga_misc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #include "inout.h" #include "pic.h" #include "vga.h" +#include static Bit8u flip=0; @@ -31,24 +32,45 @@ Bitu vga_read_p3d5(Bitu port,Bitu iolen); static Bitu vga_read_p3da(Bitu port,Bitu iolen) { vga.internal.attrindex=false; vga.tandy.pcjr_flipflop=false; - if (vga.config.retrace) { - switch (machine) { - case MCH_HERC: - return 0x81; - default: - return 9; - } - } - flip++; - if (flip>20) flip=0; - if (flip>10) return 1; - return 0; - /* - 0 Either Vertical or Horizontal Retrace active if set - 3 Vertical Retrace in progress if set - */ -} + Bit8u retval=0; + double timeInFrame = PIC_FullIndex()-vga.draw.delay.framestart; + vga.internal.attrindex=false; + vga.tandy.pcjr_flipflop=false; + + double timeInLine=fmod(timeInFrame,vga.draw.delay.htotal); + + switch (machine) { + case MCH_HERC: + // 3BAh (R): Status Register + // bit 0 Horizontal sync + // 3 Video signal + // 7 Vertical sync + if(timeInFrame >= vga.draw.delay.vrstart && + timeInFrame <= vga.draw.delay.vrend) + retval |= 0x80; + if(timeInLine >= vga.draw.delay.hrstart && + timeInLine <= vga.draw.delay.hrend) + retval |= 1; + retval |= 0x10; //Hercules ident + break; + default: + // 3DAh (R): Status Register + // bit 0 Horizontal or Vertical blanking + // 3 Vertical sync + + if(timeInFrame >= vga.draw.delay.vrstart && + timeInFrame <= vga.draw.delay.vrend) + retval |= 8; + if(timeInFrame >= vga.draw.delay.vblkstart && + timeInFrame <= vga.draw.delay.vblkend) + retval |= 1; + else if(timeInLine >= vga.draw.delay.hblkstart && + timeInLine <= vga.draw.delay.hblkend) + retval |= 1; + } + return retval; +} static void write_p3c2(Bitu port,Bitu val,Bitu iolen) { vga.misc_output=val; diff --git a/src/hardware/vga_other.cpp b/src/hardware/vga_other.cpp index 3cbf5b3..fefabd2 100644 --- a/src/hardware/vga_other.cpp +++ b/src/hardware/vga_other.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,13 +16,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: vga_other.cpp,v 1.18 2006/02/12 23:55:53 harekiet Exp $ */ +/* $Id: vga_other.cpp,v 1.21 2007/02/01 16:24:03 c2woody Exp $ */ #include #include #include "dosbox.h" #include "inout.h" #include "vga.h" +#include "mem.h" #include "render.h" #include "mapper.h" @@ -47,8 +48,8 @@ static void write_crtc_data_other(Bitu port,Bitu val,Bitu iolen) { case 0x02: //Horizontal sync position vga.other.hsyncp=val; break; - case 0x03: //Horizontal sync width - vga.other.hsyncw=val; + case 0x03: //Horizontal and vertical sync width + vga.other.syncw=val; break; case 0x04: //Vertical total if (vga.other.vtotal ^ val) VGA_StartResize(); @@ -70,10 +71,12 @@ static void write_crtc_data_other(Bitu port,Bitu val,Bitu iolen) { vga.other.max_scanline=val; break; case 0x0A: /* Cursor Start Register */ + vga.other.cursor_start = val & 0x3f; vga.draw.cursor.sline = val&0x1f; vga.draw.cursor.enabled = ((val & 0x60) != 0x20); break; case 0x0B: /* Cursor End Register */ + vga.other.cursor_end = val&0x1f; vga.draw.cursor.eline = val&0x1f; break; case 0x0C: /* Start Address High Register */ @@ -90,6 +93,12 @@ static void write_crtc_data_other(Bitu port,Bitu val,Bitu iolen) { vga.config.cursor_start&=0xff00; vga.config.cursor_start|=val; break; + case 0x10: /* Light Pen High */ + vga.other.lpen_high = val & 0x1f; //only 6 bits + break; + case 0x11: /* Light Pen Low */ + vga.other.lpen_low = val; + break; default: LOG(LOG_VGAMISC,LOG_NORMAL)("MC6845:Write %X to illegal index %x",val,vga.other.index); } @@ -102,8 +111,8 @@ static Bitu read_crtc_data_other(Bitu port,Bitu iolen) { return vga.other.hdend; case 0x02: //Horizontal sync position return vga.other.hsyncp; - case 0x03: //Horizontal sync width - return vga.other.hsyncw; + case 0x03: //Horizontal and vertical sync width + return vga.other.syncw; case 0x04: //Vertical total return vga.other.vtotal; case 0x05: //Vertical display adjust @@ -114,6 +123,10 @@ static Bitu read_crtc_data_other(Bitu port,Bitu iolen) { return vga.other.vsyncp; case 0x09: //Max scanline return vga.other.max_scanline; + case 0x0A: /* Cursor Start Register */ + return vga.other.cursor_start; + case 0x0B: /* Cursor End Register */ + return vga.other.cursor_end; case 0x0C: /* Start Address High Register */ return vga.config.display_start >> 8; case 0x0D: /* Start Address Low Register */ @@ -122,10 +135,14 @@ static Bitu read_crtc_data_other(Bitu port,Bitu iolen) { return vga.config.cursor_start>>8; case 0x0F: /* Cursor Location Low Register */ return vga.config.cursor_start; + case 0x10: /* Light Pen High */ + return vga.other.lpen_high; + case 0x11: /* Light Pen Low */ + return vga.other.lpen_low; default: LOG(LOG_VGAMISC,LOG_NORMAL)("MC6845:Read from illegal index %x",vga.other.index); } - return (Bitu)-1; + return ~0; } static double hue_offset = 0.0; @@ -241,25 +258,16 @@ static void write_color_select(Bit8u val) { } } -static void write_mode_control(Bit8u val) { - /* Check if someone changes the blinking/hi intensity bit */ - vga.tandy.mode_control=val; - VGA_SetBlinking((val & 0x20)); - if (val & 0x2) { - if (val & 0x10) { - } else VGA_SetMode(M_CGA4); - write_color_select(vga.tandy.color_select); //Setup the correct palette - } else { - VGA_SetMode(M_TEXT); - } -} - static void TANDY_FindMode(void) { if (vga.tandy.mode_control & 0x2) { - if (vga.tandy.gfx_control & 0x10) VGA_SetMode(M_TANDY16); - else if (vga.tandy.gfx_control & 0x08) VGA_SetMode(M_TANDY4); - else if (vga.tandy.mode_control & 0x10) VGA_SetMode(M_TANDY2); - else VGA_SetMode(M_TANDY4); + if (vga.tandy.gfx_control & 0x10) + VGA_SetMode(M_TANDY16); + else if (vga.tandy.gfx_control & 0x08) + VGA_SetMode(M_TANDY4); + else if (vga.tandy.mode_control & 0x10) + VGA_SetMode(M_TANDY2); + else + VGA_SetMode(M_TANDY4); write_color_select(vga.tandy.color_select); } else { VGA_SetMode(M_TANDY_TEXT); @@ -284,6 +292,21 @@ static void PCJr_FindMode(void) { } } +static void TandyCheckLineMask(void ) { + if ( vga.tandy.extended_ram & 1 ) { + vga.tandy.line_mask = 0; + } else if ( vga.tandy.mode_control & 0x2) { + vga.tandy.line_mask |= 1; + } + if ( vga.tandy.line_mask ) { + vga.tandy.line_shift = 13; + vga.tandy.addr_mask = (1 << 13) - 1; + } else { + vga.tandy.addr_mask = ~0; + vga.tandy.line_shift = 0; + } +} + static void write_tandy_reg(Bit8u val) { switch (vga.tandy.reg_index) { case 0x0: @@ -291,7 +314,10 @@ static void write_tandy_reg(Bit8u val) { vga.tandy.mode_control=val; VGA_SetBlinking(val & 0x20); PCJr_FindMode(); - } else LOG(LOG_VGAMISC,LOG_NORMAL)("Unhandled Write %2X to tandy reg %X",val,vga.tandy.reg_index); + } else { + LOG(LOG_VGAMISC,LOG_NORMAL)("Unhandled Write %2X to tandy reg %X",val,vga.tandy.reg_index); + } + break; case 0x2: /* Border color */ vga.tandy.border_color=val; break; @@ -300,6 +326,19 @@ static void write_tandy_reg(Bit8u val) { if (machine==MCH_TANDY) TANDY_FindMode(); else PCJr_FindMode(); break; + case 0x5: /* Extended ram page register */ + // Bit 0 enables extended ram + // Bit 7 Switches clock, 0 -> cga 28.6 , 1 -> mono 32.5 + vga.tandy.extended_ram = val; + //This is a bit of a hack to enable mapping video memory differently for highres mode + TandyCheckLineMask(); + VGA_SetupHandlers(); + break; + case 0x8: /* Monitor mode seletion */ + //Bit 1 select mode e, for 640x200x16, some double clocking thing? + //Bit 4 select 350 line mode for hercules emulation + LOG(LOG_VGAMISC,LOG_NORMAL)("Write %2X to tandy monitor mode",val ); + break; /* palette colors */ case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17: @@ -340,6 +379,7 @@ static void write_tandy(Bitu port,Bitu val,Bitu iolen) { switch (port) { case 0x3d8: vga.tandy.mode_control=val; + TandyCheckLineMask(); VGA_SetBlinking(val & 0x20); TANDY_FindMode(); break; @@ -349,13 +389,20 @@ static void write_tandy(Bitu port,Bitu val,Bitu iolen) { case 0x3da: vga.tandy.reg_index=val; break; +// case 0x3db: //Clear lightpen latch + break; +// case 0x3dc: //Preset lightpen latch + break; +// case 0x3dd: //Extended ram page address register: + break; case 0x3de: write_tandy_reg(val); break; case 0x3df: - vga.tandy.is_32k_mode=(val & 0x80)==0x80; - vga.tandy.disp_bank=val & ((val & 0x80) ? 0x6 : 0x7); - vga.tandy.mem_bank=(val >> 3) & ((val & 0x80) ? 0x6 : 0x7); + vga.tandy.line_mask = val >> 6; + vga.tandy.draw_bank = val & ((vga.tandy.line_mask&2) ? 0x6 : 0x7); + vga.tandy.mem_bank = (val >> 3) & ((vga.tandy.line_mask&2) ? 0x6 : 0x7); + TandyCheckLineMask(); VGA_SetupHandlers(); break; } @@ -372,9 +419,12 @@ static void write_pcjr(Bitu port,Bitu val,Bitu iolen) { vga.tandy.pcjr_flipflop=!vga.tandy.pcjr_flipflop; break; case 0x3df: - vga.tandy.is_32k_mode=(val & 0x80)==0x80; - vga.tandy.disp_bank=val & (vga.tandy.is_32k_mode ? 0x6 : 0x7); - vga.tandy.mem_bank=(val >> 3) & 0x7; + vga.tandy.line_mask = val >> 6; + vga.tandy.draw_bank = val & ((vga.tandy.line_mask&2) ? 0x6 : 0x7); + vga.tandy.mem_bank = (val >> 3) & ((vga.tandy.line_mask&2) ? 0x6 : 0x7); + vga.tandy.draw_base = &MemBase[vga.tandy.draw_bank * 16 * 1024]; + vga.tandy.mem_base = &MemBase[vga.tandy.mem_bank * 16 * 1024]; + TandyCheckLineMask(); VGA_SetupHandlers(); break; } @@ -383,7 +433,7 @@ static void write_pcjr(Bitu port,Bitu val,Bitu iolen) { static void write_hercules(Bitu port,Bitu val,Bitu iolen) { switch (port) { case 0x3b8: - if (vga.herc.enable_bits & 1) { + if (vga.herc.enable_bits & 1 ) { vga.herc.mode_control&=~0x2; vga.herc.mode_control|=(val&0x2); if (val & 0x2) { @@ -394,11 +444,14 @@ static void write_hercules(Bitu port,Bitu val,Bitu iolen) { } if ((vga.herc.enable_bits & 0x2) && ((vga.herc.mode_control ^ val)&0x80)) { vga.herc.mode_control^=0x80; - VGA_SetupHandlers(); } + vga.tandy.draw_base = &vga.mem.linear[(vga.herc.mode_control & 0x80 ) ? 32*1024 : 0]; break; case 0x3bf: - vga.herc.enable_bits=val; + if ( vga.herc.enable_bits ^ val) { + vga.herc.enable_bits=val; + VGA_SetupHandlers(); + } break; } } @@ -411,6 +464,14 @@ static Bitu read_hercules(Bitu port,Bitu iolen) { void VGA_SetupOther(void) { Bitu i; + memset( &vga.tandy, 0, sizeof( vga.tandy )); + //Initialize values common for most machines, can be overwritten + vga.tandy.draw_base = vga.mem.linear; + vga.tandy.mem_base = vga.mem.linear; + vga.tandy.addr_mask = 8*1024 - 1; + vga.tandy.line_mask = 3; + vga.tandy.line_shift = 13; + if (machine==MCH_CGA || IS_TANDY_ARCH) { extern Bit8u int10_font_08[256 * 8]; for (i=0;i<256;i++) memcpy(&vga.draw.font[i*32],&int10_font_08[i*8],8); @@ -434,7 +495,7 @@ void VGA_SetupOther(void) { IO_RegisterWriteHandler(0x3bf,write_hercules,IO_MB); } if (machine==MCH_TANDY) { - vga.tandy.is_32k_mode=false; + write_tandy( 0x3df, 0x0, 0 ); IO_RegisterWriteHandler(0x3d8,write_tandy,IO_MB); IO_RegisterWriteHandler(0x3d9,write_tandy,IO_MB); IO_RegisterWriteHandler(0x3de,write_tandy,IO_MB); @@ -442,8 +503,8 @@ void VGA_SetupOther(void) { IO_RegisterWriteHandler(0x3da,write_tandy,IO_MB); } if (machine==MCH_PCJR) { - vga.tandy.mem_bank=7;vga.tandy.disp_bank=7; - vga.tandy.is_32k_mode=false;vga.tandy.pcjr_flipflop=false; + //write_pcjr will setup base address + write_pcjr( 0x3df, 0x7 | (0x7 << 3), 0 ); IO_RegisterWriteHandler(0x3d9,write_pcjr,IO_MB); IO_RegisterWriteHandler(0x3da,write_pcjr,IO_MB); IO_RegisterWriteHandler(0x3df,write_pcjr,IO_MB); diff --git a/src/hardware/vga_s3.cpp b/src/hardware/vga_s3.cpp index 1d1ee4a..3812429 100644 --- a/src/hardware/vga_s3.cpp +++ b/src/hardware/vga_s3.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: vga_s3.cpp,v 1.3 2006/02/14 12:44:38 qbix79 Exp $ */ +/* $Id: vga_s3.cpp,v 1.6 2007/01/08 19:45:40 qbix79 Exp $ */ #include "dosbox.h" #include "inout.h" @@ -26,8 +26,10 @@ void SVGA_S3_WriteCRTC(Bitu reg,Bitu val,Bitu iolen) { switch (reg) { case 0x31: /* CR31 Memory Configuration */ //TODO Base address - vga.s3.reg_31 = val; + vga.s3.reg_31 = val; + vga.config.compatible_chain4 = !(val&0x08); VGA_DetermineMode(); + VGA_SetupHandlers(); break; /* 0 Enable Base Address Offset (CPUA BASE). Enables bank operation if @@ -46,9 +48,9 @@ void SVGA_S3_WriteCRTC(Bitu reg,Bitu val,Bitu iolen) { case 0x35: /* CR35 CRT Register Lock */ if (vga.s3.reg_lock1 != 0x48) return; //Needed for uvconfig detection vga.s3.reg_35=val & 0xf0; - if ((vga.s3.bank & 0xf) ^ (val & 0xf)) { - vga.s3.bank&=0xf0; - vga.s3.bank|=val & 0xf; + if ((vga.s3.svga_bank.b.bank & 0xf) ^ (val & 0xf)) { + vga.s3.svga_bank.b.bank&=0xf0; + vga.s3.svga_bank.b.bank|=val & 0xf; VGA_SetupHandlers(); } break; @@ -128,9 +130,9 @@ void SVGA_S3_WriteCRTC(Bitu reg,Bitu val,Bitu iolen) { //TODO Display start vga.config.display_start&=0xFCFFFF; vga.config.display_start|=(val & 3) << 16; - if ((vga.s3.bank&0xcf) ^ ((val&0xc)<<2)) { - vga.s3.bank&=0xcf; - vga.s3.bank|=(val&0xc)<<2; + if ((vga.s3.svga_bank.b.bank&0xcf) ^ ((val&0xc)<<2)) { + vga.s3.svga_bank.b.bank&=0xcf; + vga.s3.svga_bank.b.bank|=(val&0xc)<<2; VGA_SetupHandlers(); } if (((val & 0x30) ^ (vga.config.scan_len >> 4)) & 0x30) { @@ -297,7 +299,7 @@ void SVGA_S3_WriteCRTC(Bitu reg,Bitu val,Bitu iolen) { } break; case 0x6a: /* Extended System Control 4 */ - vga.s3.bank=val & 0x3f; + vga.s3.svga_bank.b.bank=val & 0x3f; VGA_SetupHandlers(); break; default: @@ -323,7 +325,7 @@ Bitu SVGA_S3_ReadCRTC( Bitu reg, Bitu iolen) { //TODO mix in bits from baseaddress; return vga.s3.reg_31; case 0x35: /* CR35 CRT Register Lock */ - return vga.s3.reg_35|(vga.s3.bank & 0xf); + return vga.s3.reg_35|(vga.s3.svga_bank.b.bank & 0xf); case 0x36: /* CR36 Reset State Read 1 */ //return 0x8f; return 0x8e; /* PCI version */ @@ -344,7 +346,7 @@ Bitu SVGA_S3_ReadCRTC( Bitu reg, Bitu iolen) { return vga.s3.hgc.curmode; case 0x51: /* Extended System Control 2 */ return ((vga.config.display_start >> 16) & 3 ) | - ((vga.s3.bank & 0x30) >> 2) | + ((vga.s3.svga_bank.b.bank & 0x30) >> 2) | ((vga.config.scan_len & 0x300) >> 4) | vga.s3.reg_51; case 0x53: @@ -366,7 +368,7 @@ Bitu SVGA_S3_ReadCRTC( Bitu reg, Bitu iolen) { case 0x69: /* Extended System Control 3 */ return (Bit8u)((vga.config.display_start & 0x1f0000)>>16); case 0x6a: /* Extended System Control 4 */ - return (Bit8u)(vga.s3.bank & 0x3f); + return (Bit8u)(vga.s3.svga_bank.b.bank & 0x3f); default: return 0x00; } diff --git a/src/hardware/vga_seq.cpp b/src/hardware/vga_seq.cpp index 406baba..6ca6634 100644 --- a/src/hardware/vga_seq.cpp +++ b/src/hardware/vga_seq.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,7 +40,9 @@ void write_p3c5(Bitu port,Bitu val,Bitu iolen) { case 1: /* Clocking Mode */ if (val!=seq(clocking_mode)) { seq(clocking_mode)=val; - VGA_StartResize(); + // don't resize if only the screen off bit was changed + if ((val&(~0x20))!=(seq(clocking_mode)&(~0x20))) + VGA_StartResize(); } /* TODO Figure this out :) 0 If set character clocks are 8 dots wide, else 9. diff --git a/src/hardware/vga_xga.cpp b/src/hardware/vga_xga.cpp index c998eae..83b4a63 100644 --- a/src/hardware/vga_xga.cpp +++ b/src/hardware/vga_xga.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,8 +35,8 @@ struct XGAStatus { Bit32u readmask; Bit32u writemask; - Bit8u forecolor; - Bit8u backcolor; + Bit32u forecolor; + Bit32u backcolor; Bitu curcommand; @@ -51,6 +51,8 @@ struct XGAStatus { Bit16u MAPcount; Bit16u pix_cntl; + Bit16u control1; + Bit16u control2; Bit16u read_sel; struct XGA_WaitCmd { @@ -59,6 +61,8 @@ struct XGAStatus { Bit16u cmd; Bit16u curx, cury; Bit16u x1, y1, x2, y2, sizex, sizey; + Bit32u data; /* transient data passed by multiple calls */ + Bitu datasize; } waitcmd; } xga; @@ -85,6 +89,12 @@ void XGA_Write_Multifunc(Bitu val, Bitu len) { case 0xa: xga.pix_cntl = dataval; break; + case 0xd: + xga.control2 = dataval; + break; + case 0xe: + xga.control1 = dataval; + break; case 0xf: xga.read_sel = dataval; break; @@ -94,7 +104,26 @@ void XGA_Write_Multifunc(Bitu val, Bitu len) { } } -void XGA_DrawPoint8(Bitu x, Bitu y, Bit8u c) { +Bitu XGA_Read_Multifunc() +{ + switch(xga.read_sel++) { + case 0: return xga.MIPcount; + case 1: return xga.scissors.y1; + case 2: return xga.scissors.x1; + case 3: return xga.scissors.y2; + case 4: return xga.scissors.x2; + case 5: return xga.pix_cntl; + case 6: return xga.control1; + case 7: return 0; // TODO + case 8: return 0; // TODO + case 9: return 0; // TODO + case 10: return xga.control2; + default: return 0; + } +} + + +void XGA_DrawPoint(Bitu x, Bitu y, Bitu c) { if(!(xga.curcommand & 0x1)) return; if(!(xga.curcommand & 0x10)) return; @@ -105,23 +134,28 @@ void XGA_DrawPoint8(Bitu x, Bitu y, Bit8u c) { if(y > xga.scissors.y2) return; Bit32u memaddr = (y * XGA_SCREEN_WIDTH) + x; - vga.mem.linear[memaddr] = c; + /* Need to zero out all unused bits in modes that have any (15-bit or "32"-bit -- the last + one is actually 24-bit. Without this step there may be some graphics corruption (mainly, + during windows dragging. */ + switch(vga.mode) { + case M_LIN8: vga.mem.linear[memaddr] = c; break; + case M_LIN15: ((Bit16u*)(vga.mem.linear))[memaddr] = c&0x7fff; break; + case M_LIN16: ((Bit16u*)(vga.mem.linear))[memaddr] = c; break; + case M_LIN32: ((Bit32u*)(vga.mem.linear))[memaddr] = c&0x00ffffff; break; + } } -Bit8u XGA_GetPoint8(Bitu x, Bitu y) { +Bitu XGA_GetPoint(Bitu x, Bitu y) { Bit32u memaddr = (y * XGA_SCREEN_WIDTH) + x; - return vga.mem.linear[memaddr]; - - + switch(vga.mode) { + case M_LIN8: return vga.mem.linear[memaddr]; + case M_LIN15: case M_LIN16: return ((Bit16u*)(vga.mem.linear))[memaddr]; + case M_LIN32: return ((Bit32u*)(vga.mem.linear))[memaddr]; + } + return 0; } -void XGA_DrawPoint16(Bitu x, Bitu y, Bit16u c) { - Bit16u *memptr; - Bit32u memaddr = (y * XGA_SCREEN_WIDTH) + x; - memptr = (Bit16u *)&vga.mem.linear[memaddr]; - *memptr = c; -} Bitu XGA_GetMixResult(Bitu mixmode, Bitu srcval, Bitu dstdata) { Bitu destval = 0; @@ -133,7 +167,7 @@ Bitu XGA_GetMixResult(Bitu mixmode, Bitu srcval, Bitu dstdata) { destval = 0; break; case 0x02: /* 1 (true) */ - destval = 0xff; + destval = 0xffffffff; break; case 0x03: /* 2 DST */ destval = dstdata; @@ -184,9 +218,9 @@ Bitu XGA_GetMixResult(Bitu mixmode, Bitu srcval, Bitu dstdata) { void XGA_DrawLineVector(Bitu val) { Bits xat, yat; - Bit8u srcval; - Bit8u destval; - Bit8u dstdata; + Bitu srcval; + Bitu destval; + Bitu dstdata; Bits i; Bits dx, sx, sy; @@ -260,11 +294,11 @@ void XGA_DrawLineVector(Bitu val) { LOG_MSG("XGA: DrawRect: Shouldn't be able to get here!"); break; } - dstdata = XGA_GetPoint8(xat,yat); + dstdata = XGA_GetPoint(xat,yat); destval = XGA_GetMixResult(mixmode, srcval, dstdata); - XGA_DrawPoint8(xat,yat, destval); + XGA_DrawPoint(xat,yat, destval); break; default: LOG_MSG("XGA: DrawLine: Needs mixmode %x", mixmode); @@ -283,9 +317,9 @@ void XGA_DrawLineVector(Bitu val) { void XGA_DrawLineBresenham(Bitu val) { Bits xat, yat; - Bit8u srcval; - Bit8u destval; - Bit8u dstdata; + Bitu srcval; + Bitu destval; + Bitu dstdata; Bits i; Bits tmpswap; bool steep; @@ -353,17 +387,17 @@ void XGA_DrawLineBresenham(Bitu val) { } if(steep) { - dstdata = XGA_GetPoint8(xat,yat); + dstdata = XGA_GetPoint(xat,yat); } else { - dstdata = XGA_GetPoint8(yat,xat); + dstdata = XGA_GetPoint(yat,xat); } destval = XGA_GetMixResult(mixmode, srcval, dstdata); if(steep) { - XGA_DrawPoint8(xat,yat, destval); + XGA_DrawPoint(xat,yat, destval); } else { - XGA_DrawPoint8(yat,xat, destval); + XGA_DrawPoint(yat,xat, destval); } break; @@ -393,9 +427,9 @@ void XGA_DrawLineBresenham(Bitu val) { void XGA_DrawRectangle(Bitu val) { Bit32u xat, yat; - Bit8u srcval; - Bit8u destval; - Bit8u dstdata; + Bitu srcval; + Bitu destval; + Bitu dstdata; Bits srcx, srcy, dx, dy; @@ -433,11 +467,11 @@ void XGA_DrawRectangle(Bitu val) { LOG_MSG("XGA: DrawRect: Shouldn't be able to get here!"); break; } - dstdata = XGA_GetPoint8(srcx,srcy); + dstdata = XGA_GetPoint(srcx,srcy); destval = XGA_GetMixResult(mixmode, srcval, dstdata); - XGA_DrawPoint8(srcx,srcy, destval); + XGA_DrawPoint(srcx,srcy, destval); break; default: LOG_MSG("XGA: DrawRect: Needs mixmode %x", mixmode); @@ -476,10 +510,10 @@ void XGA_DrawWait(Bitu val, Bitu len) { //if(!(xga.curcommand & 0x2)) return; Bitu mixmode = (xga.pix_cntl >> 6) & 0x3; - Bit8u srcval; - Bit8u destval; - Bit8u dstdata; - Bitu tmpval; + Bitu srcval; + Bitu destval; + Bitu dstdata; + //Bitu tmpval; Bits bitneed; switch(xga.waitcmd.cmd) { @@ -489,7 +523,6 @@ void XGA_DrawWait(Bitu val, Bitu len) { mixmode = xga.foremix; Bitu t; for(t=0;t> (8 * t)) & 0xff; switch((mixmode >> 5) & 0x03) { case 0x00: /* Src is background color */ srcval = xga.backcolor; @@ -498,7 +531,29 @@ void XGA_DrawWait(Bitu val, Bitu len) { srcval = xga.forecolor; break; case 0x02: /* Src is pixel data from PIX_TRANS register */ - srcval = tmpval; + /* This register is 16 bit. In theory, it is possible to access it as 8-bit + or 32-bit but all calls from Win3 drivers are 16-bit. 8-bit color modes + would work regardless of the access size (although something else in this + function may break), other color modes may require more complex code to + collect transient data or break incoming data in chunks. */ + if(vga.mode == M_LIN8) + srcval = (val >> (8 * t)) & 0xff; + else if(vga.mode == M_LIN32) { /* May need transient data */ + if(xga.waitcmd.datasize == 0) { + xga.waitcmd.data = val; + xga.waitcmd.datasize = 2; + return; + } else { + srcval = (val<<16)|xga.waitcmd.data; + xga.waitcmd.data = 0; + xga.waitcmd.datasize = 0; + t = len; /* All data used */ + } + } + else { + srcval = val; + t = len; /* All data used */ + } //LOG_MSG("XGA: DrawBlitWait: Wants data from PIX_TRANS register"); break; case 0x03: /* Src is bitmap data */ @@ -512,13 +567,13 @@ void XGA_DrawWait(Bitu val, Bitu len) { - dstdata = XGA_GetPoint8(xga.waitcmd.curx, xga.waitcmd.cury); + dstdata = XGA_GetPoint(xga.waitcmd.curx, xga.waitcmd.cury); destval = XGA_GetMixResult(mixmode, srcval, dstdata); //LOG_MSG("XGA: DrawPattern: Mixmode: %x srcval: %x", mixmode, srcval); - XGA_DrawPoint8(xga.waitcmd.curx++, xga.waitcmd.cury, destval); + XGA_DrawPoint(xga.waitcmd.curx++, xga.waitcmd.cury, destval); XGA_CheckX(); if(xga.waitcmd.newline) break; @@ -582,11 +637,11 @@ void XGA_DrawWait(Bitu val, Bitu len) { break; } - Bit8u dstdata = XGA_GetPoint8(xga.waitcmd.curx, xga.waitcmd.cury); + Bitu dstdata = XGA_GetPoint(xga.waitcmd.curx, xga.waitcmd.cury); destval = XGA_GetMixResult(mixmode, srcval, dstdata); - XGA_DrawPoint8(xga.waitcmd.curx, xga.waitcmd.cury, destval); + XGA_DrawPoint(xga.waitcmd.curx, xga.waitcmd.cury, destval); --i; if(i < 0) break; @@ -621,11 +676,11 @@ void XGA_BlitRect(Bitu val) { //Bit8u *destptr; //Bit8u *destline; //Bit8u *srcline; - Bit8u srcdata; - Bit8u dstdata; + Bitu srcdata; + Bitu dstdata; - Bit8u srcval; - Bit8u destval; + Bitu srcval; + Bitu destval; Bits srcx, srcy, tarx, tary, dx, dy; //bool incx = false; @@ -674,8 +729,8 @@ void XGA_BlitRect(Bitu val) { tarx = xga.destx; for(xat=0;xat<=xga.MAPcount;xat++) { - srcdata = XGA_GetPoint8(srcx, srcy); - dstdata = XGA_GetPoint8(tarx, tary); + srcdata = XGA_GetPoint(srcx, srcy); + dstdata = XGA_GetPoint(tarx, tary); if(mixselect == 0x3) { if(srcdata == xga.forecolor) { @@ -713,7 +768,7 @@ void XGA_BlitRect(Bitu val) { //LOG_MSG("XGA: DrawPattern: Mixmode: %x Mixselect: %x", mixmode, mixselect); //*smallptr++ = destval; - XGA_DrawPoint8(tarx, tary, destval); + XGA_DrawPoint(tarx, tary, destval); srcx += dx; tarx += dx; @@ -725,11 +780,11 @@ void XGA_BlitRect(Bitu val) { } void XGA_DrawPattern(Bitu val) { - Bit8u srcdata; - Bit8u dstdata; + Bitu srcdata; + Bitu dstdata; - Bit8u srcval; - Bit8u destval; + Bitu srcval; + Bitu destval; Bits xat, yat, srcx, srcy, tarx, tary, dx, dy; @@ -765,8 +820,8 @@ void XGA_DrawPattern(Bitu val) { tarx = xga.destx; for(xat=0;xat<=xga.MAPcount;xat++) { - srcdata = XGA_GetPoint8(srcx + (tarx & 0x7), srcy + (tary & 0x7)); - dstdata = XGA_GetPoint8(tarx, tary); + srcdata = XGA_GetPoint(srcx + (tarx & 0x7), srcy + (tary & 0x7)); + dstdata = XGA_GetPoint(tarx, tary); if(mixselect == 0x3) { @@ -802,7 +857,7 @@ void XGA_DrawPattern(Bitu val) { destval = XGA_GetMixResult(mixmode, srcval, dstdata); - XGA_DrawPoint8(tarx, tary, destval); + XGA_DrawPoint(tarx, tary, destval); tarx += dx; } @@ -858,6 +913,9 @@ void XGA_DrawCmd(Bitu val, Bitu len) { xga.waitcmd.sizey = xga.MIPcount + 1; xga.waitcmd.cmd = 2; + xga.waitcmd.data = 0; + xga.waitcmd.datasize = 0; + #if XGA_SHOW_COMMAND_TRACE == 1 LOG_MSG("XGA: Draw wait rect, width %d, heigth %d", xga.MAPcount, xga.MIPcount+1); #endif @@ -882,6 +940,42 @@ void XGA_DrawCmd(Bitu val, Bitu len) { } } +void XGA_SetDualReg(Bit32u& reg, Bitu val) +{ + switch(vga.mode) { + case M_LIN8: reg = val&0x000000ff; break; + case M_LIN15: case M_LIN16: reg = val&0x0000ffff; break; + case M_LIN32: { + if(xga.control1 & 0x200) + reg = val; + else if(xga.control1 & 0x10) + reg = (reg&0x0000ffff)|(val<<16); + else + reg = (reg&0xffff0000)|(val&0x0000ffff); + xga.control1 ^= 0x10; + } + break; + } +} + +Bitu XGA_GetDualReg(Bit32u reg) +{ + switch(vga.mode) { + case M_LIN8: return reg&0x000000ff; + case M_LIN15: case M_LIN16: return reg&0x0000ffff; + case M_LIN32: { + if(xga.control1 & 0x200) + return reg; + xga.control1 ^= 0x10; + if(xga.control1 & 0x10) + return reg&0x0000ffff; + else + return reg>>16; + } + } + return 0; +} + void XGA_Write(Bitu port, Bitu val, Bitu len) { switch(port) { case 0x92e8: @@ -894,16 +988,16 @@ void XGA_Write(Bitu port, Bitu val, Bitu len) { XGA_DrawCmd(val, len); break; case 0xa2e8: - xga.backcolor = val; + XGA_SetDualReg(xga.backcolor, val); break; case 0xa6e8: - xga.forecolor = val; + XGA_SetDualReg(xga.forecolor, val); break; case 0xaae8: - xga.writemask = val; + XGA_SetDualReg(xga.writemask, val); break; case 0xaee8: - xga.readmask = val; + XGA_SetDualReg(xga.readmask, val); break; case 0x82e8: xga.cury = val; @@ -958,8 +1052,20 @@ Bitu XGA_Read(Bitu port, Bitu len) { } else { return 0x0; } + case 0xbee8: + return XGA_Read_Multifunc(); case 0xa2e8: - return xga.backcolor; + return XGA_GetDualReg(xga.backcolor); + break; + case 0xa6e8: + return XGA_GetDualReg(xga.forecolor); + break; + case 0xaae8: + return XGA_GetDualReg(xga.writemask); + break; + case 0xaee8: + return XGA_GetDualReg(xga.readmask); + break; default: LOG_MSG("XGA: Read from port %x, len %x", port, len); return 0x0; diff --git a/src/ints/Makefile.in b/src/ints/Makefile.in index e228636..57f0392 100644 --- a/src/ints/Makefile.in +++ b/src/ints/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libints_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,48 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/ints -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libints_a_AR = $(AR) $(ARFLAGS) -libints_a_LIBADD = -am_libints_a_OBJECTS = mouse.$(OBJEXT) xms.$(OBJEXT) ems.$(OBJEXT) \ - int10.$(OBJEXT) int10_char.$(OBJEXT) int10_memory.$(OBJEXT) \ - int10_misc.$(OBJEXT) int10_modes.$(OBJEXT) \ - int10_vesa.$(OBJEXT) int10_pal.$(OBJEXT) \ - int10_put_pixel.$(OBJEXT) bios.$(OBJEXT) bios_disk.$(OBJEXT) \ - bios_keyboard.$(OBJEXT) -libints_a_OBJECTS = $(am_libints_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(libints_a_SOURCES) -DIST_SOURCES = $(libints_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -104,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -134,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -144,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -153,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -179,45 +139,65 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + noinst_LIBRARIES = libints.a libints_a_SOURCES = mouse.cpp xms.cpp xms.h ems.cpp \ int10.cpp int10.h int10_char.cpp int10_memory.cpp int10_misc.cpp int10_modes.cpp \ int10_vesa.cpp int10_pal.cpp int10_put_pixel.cpp \ bios.cpp bios_disk.cpp bios_keyboard.cpp +subdir = src/ints +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libints_a_AR = $(AR) cru +libints_a_LIBADD = +am_libints_a_OBJECTS = mouse.$(OBJEXT) xms.$(OBJEXT) ems.$(OBJEXT) \ + int10.$(OBJEXT) int10_char.$(OBJEXT) int10_memory.$(OBJEXT) \ + int10_misc.$(OBJEXT) int10_modes.$(OBJEXT) int10_vesa.$(OBJEXT) \ + int10_pal.$(OBJEXT) int10_put_pixel.$(OBJEXT) bios.$(OBJEXT) \ + bios_disk.$(OBJEXT) bios_keyboard.$(OBJEXT) +libints_a_OBJECTS = $(am_libints_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bios.Po ./$(DEPDIR)/bios_disk.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/bios_keyboard.Po ./$(DEPDIR)/ems.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/int10.Po ./$(DEPDIR)/int10_char.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/int10_memory.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/int10_misc.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/int10_modes.Po ./$(DEPDIR)/int10_pal.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/int10_put_pixel.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/int10_vesa.Po ./$(DEPDIR)/mouse.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/xms.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(libints_a_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libints_a_SOURCES) + all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/ints/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/ints/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/ints/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -227,7 +207,7 @@ libints.a: $(libints_a_OBJECTS) $(libints_a_DEPENDENCIES) $(RANLIB) libints.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -248,20 +228,36 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xms.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -270,7 +266,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -282,11 +277,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -309,6 +303,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -322,7 +320,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -340,6 +338,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) + installdirs: install: install-am install-exec: install-exec-am @@ -360,7 +359,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -379,8 +378,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -416,14 +413,13 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/ints/bios.cpp b/src/ints/bios.cpp index d14acb8..118e43c 100644 --- a/src/ints/bios.cpp +++ b/src/ints/bios.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: bios.cpp,v 1.57 2006/02/09 11:47:55 qbix79 Exp $ */ +/* $Id: bios.cpp,v 1.66 2007/02/22 08:33:15 qbix79 Exp $ */ #include "dosbox.h" #include "mem.h" @@ -29,6 +29,7 @@ #include "joystick.h" #include "mouse.h" #include "setup.h" +#include "serialport.h" /* if mem_systems 0 then size_extended is reported as the real size else @@ -62,7 +63,7 @@ static Bitu INT70_Handler(void) { return 0; } -CALLBACK_HandlerObject* tandy_DAC_callback; +CALLBACK_HandlerObject* tandy_DAC_callback[2]; static struct { Bit16u port; Bit8u irq; @@ -137,9 +138,9 @@ static void Tandy_SetupTransfer(PhysPt bufpt,bool isplayback) { /* revector IRQ-handler if necessary */ RealPt current_irq=RealGetVec(tandy_sb.irq+8); - if (current_irq!=tandy_DAC_callback->Get_RealPointer()) { + if (current_irq!=tandy_DAC_callback[0]->Get_RealPointer()) { real_writed(0x40,0xd6,current_irq); - RealSetVec(tandy_sb.irq+8,tandy_DAC_callback->Get_RealPointer()); + RealSetVec(tandy_sb.irq+8,tandy_DAC_callback[0]->Get_RealPointer()); } IO_Write(tandy_sb.port+0xc,0xd0); /* stop DMA transfer */ @@ -216,12 +217,8 @@ static Bitu IRQ_TandyDAC(void) { IO_Read(tandy_sb.port+0xe); /* issue BIOS tandy sound device busy callout */ - Bit16u oldax=reg_ax; - reg_ax=0x91fb; - CALLBACK_RunRealInt(0x15); - reg_ax = oldax; - - IO_Write(0x20,0x20); + SegSet16(cs, RealSeg(tandy_DAC_callback[1]->Get_RealPointer())); + reg_ip = RealOff(tandy_DAC_callback[1]->Get_RealPointer()); } return CBRET_NONE; } @@ -332,16 +329,6 @@ static Bitu INT8_Handler(void) { if (val) mem_writeb(BIOS_DISK_MOTOR_TIMEOUT,val-1); /* and running drive */ mem_writeb(BIOS_DRIVE_RUNNING,mem_readb(BIOS_DRIVE_RUNNING) & 0xF0); - // Save ds,dx,ax - Bit16u oldds = SegValue(ds); - Bit16u olddx = reg_dx; - Bit16u oldax = reg_ax; - // run int 1c - CALLBACK_RunRealInt(0x1c); - // restore old values - SegSet16(ds,oldds); - reg_dx = olddx; - reg_ax = oldax; return CBRET_NONE; }; @@ -375,10 +362,15 @@ static Bitu INT17_Handler(void) { static Bitu INT14_Handler(void) { + if(reg_ah > 0x3 || reg_dx > 0x3) { // 0-3 serial port functions + // and no more than 4 serial ports + LOG_MSG("BIOS INT14: Unhandled call AH=%2X DX=%4x",reg_dx); + return CBRET_NONE; + } + Bit16u port = real_readw(0x40,reg_dx*2); // DX is always port number - if(reg_dx > 0x3 || port==0) // no more than 4 serial ports - { - LOG_MSG("BIOS INT14: port %d does not exist.",reg_dx); + if(port==0) { + LOG(LOG_BIOS,LOG_NORMAL)("BIOS INT14: port %d does not exist.",reg_dx); return CBRET_NONE; } switch (reg_ah) @@ -416,12 +408,11 @@ static Bitu INT14_Handler(void) // disable interrupts IO_WriteB(port+1, 0); IO_ReadB(port+2); - // put RTS and DTR on - IO_WriteB(port+4,0x3); // get result reg_ah=IO_ReadB(port+5); reg_al=IO_ReadB(port+6); + CALLBACK_SCF(false); } break; case 0x01: /* Write character */ @@ -431,126 +422,49 @@ static Bitu INT14_Handler(void) // AH: line status // AL: modem status { - if((IO_ReadB(port+5)&&0x20)==0) - { - // TODO: should wait until they become empty->timeout - LOG_MSG("BIOS INT14: port %d: transmit register not empty.",reg_dx); - reg_ah = IO_ReadB(port+5)|0x80; - return CBRET_NONE; + if(serialports[reg_dx]) { + bool timeout; + // switch modem lines on + IO_WriteB(port+4,0x3); + timeout = !serialports[reg_dx]->Putchar(reg_al,true,true, + mem_readb(BIOS_COM1_TIMEOUT+reg_dx)*1000); + // get result + reg_ah=IO_ReadB(port+5); + if(timeout) reg_ah |= 0x80; + reg_al=IO_ReadB(port+6); } - // transmit it - IO_WriteB(port,reg_al); - - if((IO_ReadB(port+5)&&0x60)==0) - { - // TODO: should wait until they become empty->timeout - LOG_MSG("BIOS INT14: port %d: transmit register not empty after write.",reg_dx); - reg_ah = IO_ReadB(port+5)|0x80; - return CBRET_NONE; - } - - // get result - reg_ah=IO_ReadB(port+5); - reg_al=IO_ReadB(port+6); + CALLBACK_SCF(false); } break; case 0x02: /* Read character */ { - if((IO_ReadB(port+5)&0x1)!=0) - { - reg_al=IO_ReadB(port); + if(serialports[reg_dx]) { + bool timeout; + Bit8u buffer; + // switch modem lines on + IO_WriteB(port+4,0x3); + // wait for something + timeout = !serialports[reg_dx]->Getchar(&buffer,true, + mem_readb(BIOS_COM1_TIMEOUT+reg_dx)*1000); + + // RTS off + IO_WriteB(port+4,0x1); + // get result + reg_ah=IO_ReadB(port+5); + if(timeout) reg_ah |= 0x80; + else reg_al=buffer; } - else - { - // TODO: should wait until timeout - LOG_MSG("BIOS INT14: port %d: nothing received.",reg_dx); - reg_ah = IO_ReadB(port+5)|0x80; - return CBRET_NONE; - } - reg_ah=IO_ReadB(port+5); + CALLBACK_SCF(false); + break; } - break; case 0x03: // get status { reg_ah=IO_ReadB(port+5); - //LOG_MSG("status reg_ah: %x",reg_ah); reg_al=IO_ReadB(port+6); + CALLBACK_SCF(false); } - break; - case 0x04: // extended initialisation - // Parameters: - // AL: break - // BH: parity - // BL: stopbit - // CH: word length - // CL: baudrate - { - Bit8u lcr = 0; - - // baud rate - Bitu baudrate = 9600; - Bit16u baudresult; - Bitu rawbaud=reg_cl; - - if(rawbaud==0){ baudrate=110;} - else if (rawbaud==1){ baudrate=150;} - else if (rawbaud==2){ baudrate=300;} - else if (rawbaud==3){ baudrate=600;} - else if (rawbaud==4){ baudrate=1200;} - else if (rawbaud==5){ baudrate=2400;} - else if (rawbaud==6){ baudrate=4800;} - else if (rawbaud==7){ baudrate=9600;} - else if (rawbaud==8){ baudrate=19200;} - - baudresult = (Bit16u)(115200 / baudrate); - - IO_WriteB(port+3, 0x80); // enable divider access - IO_WriteB(port,(Bit8u)baudresult&0xff); - IO_WriteB(port+1,(Bit8u)(baudresult>>8)); - - // line configuration - // break - if(reg_al!=0) lcr=0x40; - // parity - if(reg_bh!=0) - { - if(reg_bh==1)lcr|=0x8;// odd - else if(reg_bh==2)lcr|=0x18;// even - else if(reg_bh==3)lcr|=0x28;// mark - else if(reg_bh==4)lcr|=0x38;// mark - } - // stopbit - if(reg_bl!=0) - { - lcr|=0x4; - } - // data length - lcr|=(reg_ch&0x3); - IO_WriteB(port+3,lcr); - - reg_ah=IO_ReadB(port+5); - reg_al=IO_ReadB(port+6); - } - break; - case 0x05: // modem control - { - if(reg_al==0) // read MCR - { - reg_bl=IO_ReadB(port+4); - } - else if(reg_al==1) // write MCR - { - IO_WriteB(port+4,reg_bl); - } - else LOG_MSG("BIOS INT14: port %d, function 5: invalid subfunction.",reg_dx); - reg_ah=IO_ReadB(port+5); - reg_al=IO_ReadB(port+6); - } - break; - default: - LOG_MSG("Unhandled INT 14 call %2X",reg_ah); - + break; } return CBRET_NONE; } @@ -599,7 +513,13 @@ static Bitu INT15_Handler(void) { break; case 0x83: /* BIOS - SET EVENT WAIT INTERVAL */ { - if(reg_al == 0x01) LOG(LOG_BIOS,LOG_WARN)("Bios set event interval cancelled: not handled"); + if(reg_al == 0x01) { /* Cancel it */ + mem_writeb(BIOS_WAIT_FLAG_ACTIVE,0); + IO_Write(0x70,0xb); + IO_Write(0x71,IO_Read(0x71)&~0x40); + CALLBACK_SCF(false); + break; + } if (mem_readb(BIOS_WAIT_FLAG_ACTIVE)) { reg_ah=0x80; CALLBACK_SCF(true); @@ -715,10 +635,6 @@ static Bitu INT15_Handler(void) { CALLBACK_SCF(false); reg_ah=0; break; - case 0xc3: /* set carry flag so BorlandRTM doesn't assume a VECTRA/PS2 */ - reg_ah=0x86; - CALLBACK_SCF(true); - break; case 0xc2: /* BIOS PS2 Pointing Device Support */ switch (reg_al) { case 0x00: // enable/disable @@ -777,6 +693,10 @@ static Bitu INT15_Handler(void) { break; } break; + case 0xc3: /* set carry flag so BorlandRTM doesn't assume a VECTRA/PS2 */ + reg_ah=0x86; + CALLBACK_SCF(true); + break; case 0xc4: /* BIOS POS Programm option Select */ LOG(LOG_BIOS,LOG_NORMAL)("INT15:Function %X called, bios mouse not supported",reg_ah); CALLBACK_SCF(true); @@ -784,7 +704,11 @@ static Bitu INT15_Handler(void) { default: LOG(LOG_BIOS,LOG_ERROR)("INT15:Unknown call %4X",reg_ax); reg_ah=0x86; - CALLBACK_SCF(false); + CALLBACK_SCF(true); + if ((machine==MCH_VGA) || (machine==MCH_CGA)) { + /* relict from comparisons, as int15 exits with a retf2 instead of an iret */ + CALLBACK_SZF(false); + } } return CBRET_NONE; } @@ -807,30 +731,29 @@ void BIOS_SetupDisks(void); class BIOS:public Module_base{ private: - CALLBACK_HandlerObject callback[9]; + CALLBACK_HandlerObject callback[10]; public: BIOS(Section* configuration):Module_base(configuration){ /* tandy DAC can be requested in tandy_sound.cpp by initializing this field */ bool use_tandyDAC=(real_readb(0x40,0xd4)==0xff); + /* Clear the Bios Data Area (0x400-0x5ff, 0x600- is accounted to DOS) */ for (Bit16u i=0;i<0x200;i++) real_writeb(0x40,i,0); + /* Setup all the interrupt handlers the bios controls */ /* INT 8 Clock IRQ Handler */ - //TODO Maybe give this a special callback that will also call int 8 instead of starting - //a new system - callback[0].Install(INT8_Handler,CB_IRET,"Int 8 Clock"); + callback[0].Install(INT8_Handler,CB_IRQ0,"Int 8 Clock"); callback[0].Set_RealVec(0x8); - Bit16u call_int8=callback[0].Get_callback(); - phys_writeb(CB_BASE+(call_int8<<4)+0,(Bit8u)0xFE); //GRP 4 - phys_writeb(CB_BASE+(call_int8<<4)+1,(Bit8u)0x38); //Extra Callback instruction - phys_writew(CB_BASE+(call_int8<<4)+2,call_int8); //The immediate word - phys_writeb(CB_BASE+(call_int8<<4)+4,(Bit8u)0x50); // push ax - phys_writeb(CB_BASE+(call_int8<<4)+5,(Bit8u)0xb0); // mov al, 0x20 - phys_writeb(CB_BASE+(call_int8<<4)+6,(Bit8u)0x20); - phys_writeb(CB_BASE+(call_int8<<4)+7,(Bit8u)0xe6); // out 0x20, al - phys_writeb(CB_BASE+(call_int8<<4)+8,(Bit8u)0x20); - phys_writeb(CB_BASE+(call_int8<<4)+9,(Bit8u)0x58); // pop ax - phys_writeb(CB_BASE+(call_int8<<4)+10,(Bit8u)0xcf); // iret + // pseudocode for CB_IRQ0: + // callback INT8_Handler + // push ax,dx,ds + // int 0x1c + // cli + // pop ds,dx + // mov al, 0x20 + // out 0x20, al + // pop ax + // iret mem_writed(BIOS_TIMER,0); //Calculate the correct time @@ -853,7 +776,7 @@ public: BIOS_SetupDisks(); /* INT 14 Serial Ports */ - callback[3].Install(&INT14_Handler,CB_IRET,"Int 14 COM-port"); + callback[3].Install(&INT14_Handler,CB_IRET_STI,"Int 14 COM-port"); callback[3].Set_RealVec(0x14); /* INT 15 Misc Calls */ @@ -872,13 +795,29 @@ public: callback[6].Set_RealVec(0x1A); /* INT 1C System Timer tick called from INT 8 */ - callback[7].Install(&INT1C_Handler,CB_IRET,"Int 1c Timer tick"); + callback[7].Install(&INT1C_Handler,CB_IRET,"Int 1c Timer"); callback[7].Set_RealVec(0x1C); /* IRQ 8 RTC Handler */ callback[8].Install(&INT70_Handler,CB_IRET,"Int 70 RTC"); callback[8].Set_RealVec(0x70); + /* Irq 9 rerouted to irq 2 */ + callback[9].Install(NULL,CB_IRQ9,"irq 9 bios"); + callback[9].Set_RealVec(0x71); + + /* Irq 2 */ + RealPt irq2pt=RealMake(0xf000,0xff55); /* Ghost busters 2 mt32 mode */ + Bitu call_irq2=CALLBACK_Allocate(); + CALLBACK_Setup(call_irq2,NULL,CB_IRET_EOI_PIC1,Real2Phys(irq2pt),"irq 2 bios"); + RealSetVec(0x0a,irq2pt); + + /* Some hardcoded vectors */ + phys_writeb(0xfff53,0xcf); /* bios default interrupt vector location */ + phys_writeb(0xfe987,0xea); /* original IRQ1 location (Defender booter) */ + phys_writed(0xfe988,RealGetVec(0x09)); + phys_writew(Real2Phys(RealGetVec(0x12))+0x12,0x20); //Hack for Jurresic + if (machine==MCH_TANDY) phys_writeb(0xffffe,0xff) ; /* Tandy model */ else if (machine==MCH_PCJR) phys_writeb(0xffffe,0xfd); /* PCJr model */ else phys_writeb(0xffffe,0xfc); /* PC */ @@ -891,8 +830,20 @@ public: real_writeb(0x40,0xd4,0xff); /* tandy DAC init value */ real_writed(0x40,0xd6,0x00000000); /* install the DAC callback handler */ - tandy_DAC_callback=new CALLBACK_HandlerObject(); - tandy_DAC_callback->Install(&IRQ_TandyDAC,CB_IRET,"Tandy DAC IRQ"); + tandy_DAC_callback[0]=new CALLBACK_HandlerObject(); + tandy_DAC_callback[1]=new CALLBACK_HandlerObject(); + tandy_DAC_callback[0]->Install(&IRQ_TandyDAC,CB_IRET,"Tandy DAC IRQ"); + tandy_DAC_callback[1]->Install(NULL,CB_TDE_IRET,"Tandy DAC end transfer"); + // pseudocode for CB_TDE_IRET: + // push ax + // mov ax, 0x91fb + // int 15 + // cli + // mov al, 0x20 + // out 0x20, al + // pop ax + // iret + RealPt current_irq=RealGetVec(tandy_sb.irq+8); real_writed(0x40,0xd6,current_irq); for (Bitu i=0; i<0x10; i++) phys_writeb(PhysMake(0xf000,0xa084+i),0x80); @@ -900,61 +851,63 @@ public: } /* Setup some stuff in 0x40 bios segment */ + + // port timeouts + // always 1 second even if the port does not exist + mem_writeb(BIOS_LPT1_TIMEOUT,1); + mem_writeb(BIOS_LPT2_TIMEOUT,1); + mem_writeb(BIOS_LPT3_TIMEOUT,1); + mem_writeb(BIOS_COM1_TIMEOUT,1); + mem_writeb(BIOS_COM2_TIMEOUT,1); + mem_writeb(BIOS_COM3_TIMEOUT,1); + mem_writeb(BIOS_COM4_TIMEOUT,1); + /* detect parallel ports */ - Bit8u DEFAULTPORTTIMEOUT = 10; // 10 whatevers - Bitu ppindex=0; // number of lpt ports - if ((IO_Read(0x378)!=0xff)|(IO_Read(0x379)!=0xff)) { - // this is our LPT1 - mem_writew(BIOS_ADDRESS_LPT1,0x378); - mem_writeb(BIOS_LPT1_TIMEOUT,DEFAULTPORTTIMEOUT); - ppindex++; - if((IO_Read(0x278)!=0xff)|(IO_Read(0x279)!=0xff)) { - // this is our LPT2 - mem_writew(BIOS_ADDRESS_LPT2,0x278); - mem_writeb(BIOS_LPT2_TIMEOUT,DEFAULTPORTTIMEOUT); + Bitu ppindex=0; // number of lpt ports + if ((IO_Read(0x378)!=0xff)|(IO_Read(0x379)!=0xff)) { + // this is our LPT1 + mem_writew(BIOS_ADDRESS_LPT1,0x378); ppindex++; - if((IO_Read(0x3bc)!=0xff)|(IO_Read(0x3be)!=0xff)) { - // this is our LPT3 - mem_writew(BIOS_ADDRESS_LPT3,0x3bc); - mem_writeb(BIOS_LPT3_TIMEOUT,DEFAULTPORTTIMEOUT); + if((IO_Read(0x278)!=0xff)|(IO_Read(0x279)!=0xff)) { + // this is our LPT2 + mem_writew(BIOS_ADDRESS_LPT2,0x278); + ppindex++; + if((IO_Read(0x3bc)!=0xff)|(IO_Read(0x3be)!=0xff)) { + // this is our LPT3 + mem_writew(BIOS_ADDRESS_LPT3,0x3bc); + ppindex++; + } + } else if((IO_Read(0x3bc)!=0xff)|(IO_Read(0x3be)!=0xff)) { + // this is our LPT2 + mem_writew(BIOS_ADDRESS_LPT2,0x3bc); ppindex++; } } else if((IO_Read(0x3bc)!=0xff)|(IO_Read(0x3be)!=0xff)) { - // this is our LPT2 - mem_writew(BIOS_ADDRESS_LPT2,0x3bc); - mem_writeb(BIOS_LPT2_TIMEOUT,DEFAULTPORTTIMEOUT); + // this is our LPT1 + mem_writew(BIOS_ADDRESS_LPT1,0x3bc); + ppindex++; + if((IO_Read(0x278)!=0xff)|(IO_Read(0x279)!=0xff)) { + // this is our LPT2 + mem_writew(BIOS_ADDRESS_LPT2,0x278); + ppindex++; + } + } else if((IO_Read(0x278)!=0xff)|(IO_Read(0x279)!=0xff)) { + // this is our LPT1 + mem_writew(BIOS_ADDRESS_LPT1,0x278); ppindex++; } - } else if((IO_Read(0x3bc)!=0xff)|(IO_Read(0x3be)!=0xff)) { - // this is our LPT1 - mem_writew(BIOS_ADDRESS_LPT1,0x3bc); - mem_writeb(BIOS_LPT1_TIMEOUT,DEFAULTPORTTIMEOUT); - ppindex++; - if((IO_Read(0x278)!=0xff)|(IO_Read(0x279)!=0xff)) { - // this is our LPT2 - mem_writew(BIOS_ADDRESS_LPT2,0x278); - mem_writeb(BIOS_LPT2_TIMEOUT,DEFAULTPORTTIMEOUT); - ppindex++; - } - } - else if((IO_Read(0x278)!=0xff)|(IO_Read(0x279)!=0xff)) { - // this is our LPT1 - mem_writew(BIOS_ADDRESS_LPT1,0x278); - mem_writeb(BIOS_LPT1_TIMEOUT,DEFAULTPORTTIMEOUT); - ppindex++; - } - /* Setup equipment list */ - // look http://www.bioscentral.com/misc/bda.htm - - //Bitu config=0x4400; //1 Floppy, 2 serial and 1 parrallel - Bitu config = 0x0; - - // set number of parallel ports - // if(ppindex == 0) config |= 0x8000; // looks like 0 ports are not specified - //else if(ppindex == 1) config |= 0x0000; - if(ppindex == 2) config |= 0x4000; - else config |= 0xc000; // 3 ports + /* Setup equipment list */ + // look http://www.bioscentral.com/misc/bda.htm + + //Bitu config=0x4400; //1 Floppy, 2 serial and 1 parrallel + Bitu config = 0x0; + + // set number of parallel ports + // if(ppindex == 0) config |= 0x8000; // looks like 0 ports are not specified + //else if(ppindex == 1) config |= 0x0000; + if(ppindex == 2) config |= 0x4000; + else config |= 0xc000; // 3 ports #if (C_FPU) //FPU config|=0x2; @@ -977,6 +930,8 @@ public: } // PS2 mouse config |= 0x04; + // Gameport + config |= 0x1000; mem_writew(BIOS_CONFIGURATION,config); CMOS_SetRegister(0x14,config); //Should be updated on changes /* Setup extended memory size */ @@ -985,10 +940,6 @@ public: IO_Write(0x70,0x31); size_extended|=(IO_Read(0x71) << 8); - phys_writeb(0xfff53,0xcf); /* bios default interrupt vector location */ - phys_writeb(0xfe987,0xea); /* original IRQ1 location (Defender booter) */ - phys_writed(0xfe988,RealGetVec(0x09)); - if (machine==MCH_PCJR) PIC_AddEvent(RAMRefresh_Event,RAM_REFRESH_DELAY); } ~BIOS(){ @@ -998,15 +949,17 @@ public: IO_Write(tandy_sb.port+0xc,0xd0); } real_writeb(0x40,0xd4,0x00); - if (tandy_DAC_callback) { + if (tandy_DAC_callback[0]) { Bit32u orig_vector=real_readd(0x40,0xd6); - if (orig_vector==tandy_DAC_callback->Get_RealPointer()) { + if (orig_vector==tandy_DAC_callback[0]->Get_RealPointer()) { /* set IRQ vector to old value */ RealSetVec(tandy_sb.irq+8,real_readd(0x40,0xd6)); real_writed(0x40,0xd6,0x00000000); } - delete tandy_DAC_callback; - tandy_DAC_callback=NULL; + delete tandy_DAC_callback[0]; + delete tandy_DAC_callback[1]; + tandy_DAC_callback[0]=NULL; + tandy_DAC_callback[1]=NULL; } } }; @@ -1014,24 +967,14 @@ public: // set com port data in bios data area // parameter: array of 4 com port base addresses, 0 = none void BIOS_SetComPorts(Bit16u baseaddr[]) { - Bit8u DEFAULTPORTTIMEOUT = 10; // 10 whatevers Bit16u portcount=0; Bit16u equipmentword; for(Bitu i = 0; i < 4; i++) { if(baseaddr[i]!=0) portcount++; - if(i==0) { // com1 - mem_writew(BIOS_BASE_ADDRESS_COM1,baseaddr[i]); - mem_writeb(BIOS_COM1_TIMEOUT,DEFAULTPORTTIMEOUT); - } else if(i==1) { - mem_writew(BIOS_BASE_ADDRESS_COM2,baseaddr[i]); - mem_writeb(BIOS_COM2_TIMEOUT,DEFAULTPORTTIMEOUT); - } else if(i==2) { - mem_writew(BIOS_BASE_ADDRESS_COM3,baseaddr[i]); - mem_writeb(BIOS_COM3_TIMEOUT,DEFAULTPORTTIMEOUT); - } else { - mem_writew(BIOS_BASE_ADDRESS_COM4,baseaddr[i]); - mem_writeb(BIOS_COM4_TIMEOUT,DEFAULTPORTTIMEOUT); - } + if(i==0) mem_writew(BIOS_BASE_ADDRESS_COM1,baseaddr[i]); + else if(i==1) mem_writew(BIOS_BASE_ADDRESS_COM2,baseaddr[i]); + else if(i==2) mem_writew(BIOS_BASE_ADDRESS_COM3,baseaddr[i]); + else mem_writew(BIOS_BASE_ADDRESS_COM4,baseaddr[i]); } // set equipment word equipmentword = mem_readw(BIOS_CONFIGURATION); diff --git a/src/ints/bios_disk.cpp b/src/ints/bios_disk.cpp index 11b4414..e5967de 100644 --- a/src/ints/bios_disk.cpp +++ b/src/ints/bios_disk.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: bios_disk.cpp,v 1.27 2006/02/12 23:23:52 harekiet Exp $ */ +/* $Id: bios_disk.cpp,v 1.33 2007/01/21 16:21:22 c2woody Exp $ */ #include "dosbox.h" #include "callback.h" @@ -24,9 +24,9 @@ #include "regs.h" #include "mem.h" #include "dos_inc.h" /* for Drives[] */ +#include "../dos/drives.h" #include "mapper.h" -#define MAX_SWAPPABLE_DISKS 20 #define MAX_DISK_IMAGES 4 diskGeo DiskGeometryList[] = { @@ -51,6 +51,7 @@ Bit16u imgDTASeg; RealPt imgDTAPtr; DOS_DTA *imgDTA; bool killRead; +static bool swapping_requested; void CMOS_SetRegister(Bitu regNr, Bit8u val); //For setting equipment word @@ -62,24 +63,26 @@ Bits swapPosition; void updateDPT(void) { Bit32u tmpheads, tmpcyl, tmpsect, tmpsize; if(imageDiskList[2] != NULL) { + PhysPt dp0physaddr=CALLBACK_PhysPointer(diskparm0); imageDiskList[2]->Get_Geometry(&tmpheads, &tmpcyl, &tmpsect, &tmpsize); - real_writew(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0)),tmpcyl); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+2,tmpheads); - real_writew(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+0x3,0); - real_writew(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+0x5,(Bit16u)-1); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+0x7,0); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+0x8,(0xc0 | (((imageDiskList[2]->heads) > 8) << 3))); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+0x9,0); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+0xa,0); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+0xb,0); - real_writew(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+0xc,tmpcyl); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+0xe,tmpsect); + phys_writew(dp0physaddr,tmpcyl); + phys_writeb(dp0physaddr+0x2,tmpheads); + phys_writew(dp0physaddr+0x3,0); + phys_writew(dp0physaddr+0x5,(Bit16u)-1); + phys_writeb(dp0physaddr+0x7,0); + phys_writeb(dp0physaddr+0x8,(0xc0 | (((imageDiskList[2]->heads) > 8) << 3))); + phys_writeb(dp0physaddr+0x9,0); + phys_writeb(dp0physaddr+0xa,0); + phys_writeb(dp0physaddr+0xb,0); + phys_writew(dp0physaddr+0xc,tmpcyl); + phys_writeb(dp0physaddr+0xe,tmpsect); } if(imageDiskList[3] != NULL) { + PhysPt dp1physaddr=CALLBACK_PhysPointer(diskparm1); imageDiskList[3]->Get_Geometry(&tmpheads, &tmpcyl, &tmpsect, &tmpsize); - real_writew(RealSeg(CALLBACK_RealPointer(diskparm1)),RealOff(CALLBACK_RealPointer(diskparm1)),tmpcyl); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm1)),RealOff(CALLBACK_RealPointer(diskparm1))+2,tmpheads); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm1)),RealOff(CALLBACK_RealPointer(diskparm1))+0xe,tmpsect); + phys_writew(dp1physaddr,tmpcyl); + phys_writeb(dp1physaddr+0x2,tmpheads); + phys_writeb(dp1physaddr+0xe,tmpsect); } } @@ -112,16 +115,24 @@ void swapInDisks(void) { } } +bool getSwapRequest(void) { + bool sreq=swapping_requested; + swapping_requested = false; + return sreq; +} + void swapInNextDisk(bool pressed) { if (!pressed) return; /* Hack/feature: rescan all disks as well */ + DriveManager::CycleAllDisks(); for(Bitu i=0;iEmptyCache(); } swapPosition++; if(diskSwap[swapPosition] == NULL) swapPosition = 0; swapInDisks(); + swapping_requested = true; } @@ -243,7 +254,7 @@ Bit32u imageDisk::getSectSize(void) { static Bitu GetDosDriveNumber(Bitu biosNum) { switch(biosNum) { - case 0x0: + case 0x0: return 0x0; case 0x1: return 0x1; @@ -290,15 +301,16 @@ static Bitu INT13_DiskHandler(void) { int i,t; last_drive = reg_dl; drivenum = GetDosDriveNumber(reg_dl); + bool any_images = false; + for(Bitu i = 0;i < MAX_DISK_IMAGES;i++) { + if(imageDiskList[i]) any_images=true; + } + //drivenum = 0; //LOG_MSG("INT13: Function %x called on drive %x (dos drive %d)", reg_ah, reg_dl, drivenum); switch(reg_ah) { case 0x0: /* Reset disk */ { - bool any_images = false; - for(Bitu i = 0;i < MAX_DISK_IMAGES;i++) { - if(imageDiskList[i]) any_images=true; - } /* if there aren't any diskimages (so only localdrives and virtual drives) * always succeed on reset disk. If there are diskimages then and only then * do real checks @@ -334,6 +346,11 @@ static Bitu INT13_DiskHandler(void) { CALLBACK_SCF(true); return CBRET_NONE; } + if(!any_images && (reg_dh == 0)) { // Inherit the Earth cdrom (uses it as disk test) + reg_ah = 0; + CALLBACK_SCF(false); + return CBRET_NONE; + } if(driveInactive(drivenum)) { reg_ah = 0xff; CALLBACK_SCF(true); @@ -357,7 +374,7 @@ static Bitu INT13_DiskHandler(void) { } } reg_ah = 0x00; - CALLBACK_SCF(false); + CALLBACK_SCF(false); break; case 0x3: /* Write sectors */ @@ -381,6 +398,7 @@ static Bitu INT13_DiskHandler(void) { return CBRET_NONE; } } + reg_ah = 0x00; CALLBACK_SCF(false); break; case 0x04: /* Verify sectors */ @@ -480,9 +498,11 @@ void BIOS_SetupDisks(void) { RealSetVec(0x41,CALLBACK_RealPointer(diskparm0)); RealSetVec(0x46,CALLBACK_RealPointer(diskparm1)); + PhysPt dp0physaddr=CALLBACK_PhysPointer(diskparm0); + PhysPt dp1physaddr=CALLBACK_PhysPointer(diskparm1); for(i=0;i<16;i++) { - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm0)),RealOff(CALLBACK_RealPointer(diskparm0))+i,0); - real_writeb(RealSeg(CALLBACK_RealPointer(diskparm1)),RealOff(CALLBACK_RealPointer(diskparm1))+i,0); + phys_writeb(dp0physaddr+i,0); + phys_writeb(dp1physaddr+i,0); } imgDTASeg = 0; @@ -492,4 +512,5 @@ void BIOS_SetupDisks(void) { MAPPER_AddHandler(swapInNextDisk,MK_f4,MMOD1,"swapimg","Swap Image"); killRead = false; + swapping_requested = false; } diff --git a/src/ints/bios_keyboard.cpp b/src/ints/bios_keyboard.cpp index 0a524e9..46d7058 100644 --- a/src/ints/bios_keyboard.cpp +++ b/src/ints/bios_keyboard.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,7 +33,6 @@ static Bitu call_int16,call_irq1,call_irq6; /* Nice table from BOCHS i should feel bad for ripping this */ #define none 0 -#define MAX_SCAN_CODE 0x58 static struct { Bit16u normal; Bit16u shift; @@ -131,7 +130,7 @@ static struct { { 0x8600, 0x8800, 0x8a00, 0x8c00 } /* F12 */ }; -static bool add_key_forced(Bit16u code) { +bool BIOS_AddKeyToBuffer(Bit16u code) { if (mem_readb(BIOS_KEYBOARD_FLAGS2)&8) return true; Bit16u start,end,head,tail,ttail; if (machine==MCH_PCJR) { @@ -157,7 +156,7 @@ static bool add_key_forced(Bit16u code) { } static void add_key(Bit16u code) { - if (code!=0) add_key_forced(code); + if (code!=0) BIOS_AddKeyToBuffer(code); } static bool get_key(Bit16u &code) { @@ -223,32 +222,14 @@ static bool check_key(Bit16u &code) { */ - +/* the scancode is in reg_al */ static Bitu IRQ1_Handler(void) { -/* handling of the locks key is difficult as sdl only gives states for - * numlock capslock. +/* handling of the locks key is difficult as sdl only gives + * states for numlock capslock. */ -/* in reg_al is the scancode */ - - /* Read the code */ - Bitu scancode; //,ascii,mod; -#if 1 - scancode=reg_al; //IO_Read(0x60); moved out of handler - - -#else - /* Old code capable of unicode keys. Dropped Readkey disabled in keyboard.cpp */ - KEYBOARD_ReadKey(scancode,ascii,mod); - LOG_MSG("Got code %X ascii %C mod %X",scancode,ascii,mod); -#endif - Bit16u old_ax=reg_ax; - reg_flags|=1; - reg_ah=0x4f;reg_al=scancode; - CALLBACK_RunRealInt(0x15); - reg_ax=old_ax;Bit8u flags1,flags2,flags3,leds; - if (!(reg_flags&1)) goto irq1_return; - + Bitu scancode=reg_al; /* Read the code */ + Bit8u flags1,flags2,flags3,leds; flags1=mem_readb(BIOS_KEYBOARD_FLAGS1); flags2=mem_readb(BIOS_KEYBOARD_FLAGS2); flags3=mem_readb(BIOS_KEYBOARD_FLAGS3); @@ -258,6 +239,7 @@ static Bitu IRQ1_Handler(void) { #else flags2&=~(0x40+0x20);//remove numlock/capslock pressed (hack for sdl only reporting states) #endif + if (DOS_LayoutKey(scancode,flags1,flags2,flags3)) return CBRET_NONE; switch (scancode) { /* First the hard ones */ case 0xfa: /* ack. Do nothing for now */ @@ -334,7 +316,7 @@ static Bitu IRQ1_Handler(void) { mem_writeb(BIOS_KEYBOARD_FLAGS2,flags2|8); IO_Write(0x20,0x20); while (mem_readb(BIOS_KEYBOARD_FLAGS2)&8) CALLBACK_Idle(); // pause loop - reg_ip+=4; // skip out 20,20 + reg_ip+=5; // skip out 20,20 return CBRET_NONE; } } else { @@ -460,7 +442,6 @@ irq1_end: mem_writeb(BIOS_KEYBOARD_FLAGS2,flags2); mem_writeb(BIOS_KEYBOARD_FLAGS3,flags3); mem_writeb(BIOS_KEYBOARD_LEDS,leds); -irq1_return: /* IO_Write(0x20,0x20); moved out of handler to be virtualizable */ #if 0 /* Signal the keyboard for next code */ @@ -472,22 +453,6 @@ irq1_return: return CBRET_NONE; } -static Bitu IRQ6_Handler(void) { - Bit8u scancode=IO_Read(0x60); - /* skip extended keys, all of them should map quite nicely - onto corresponding non-extended keys */ - if (scancode!=0xe0) { - Bit16u old_ax=reg_ax; - reg_al=scancode; - /* call the real keyboard IRQ now, with the scancode in AL */ - CALLBACK_RunRealInt(0x09); - reg_ax=old_ax; - } - - IO_Write(0x20,0x20); - return CBRET_NONE; -} - /* check whether key combination is enhanced or not, translate key if necessary */ @@ -519,32 +484,29 @@ static Bitu INT16_Handler(void) { Bit16u temp=0; switch (reg_ah) { case 0x00: /* GET KEYSTROKE */ - for (;;) { - if (get_key(temp)) { - if (!IsEnhancedKey(temp)) { - /* normal key, exit scanning for keys */ - break; - } - } - CALLBACK_Idle(); + if ((get_key(temp)) && (!IsEnhancedKey(temp))) { + /* normal key found, return translated key in ax */ + reg_ax=temp; + } else { + /* enter small idle loop to allow for irqs to happen */ + reg_ip+=1; } - /* normal key found, return translated key in ax */ - reg_ax=temp; break; case 0x10: /* GET KEYSTROKE (enhanced keyboards only) */ - for (;;) { - if (get_key(temp)) { - if (((temp&0xff)==0xf0) && (temp>>8)) { - /* special enhanced key, clear low part before returning key */ - temp&=0xff00; - } - break; + if (get_key(temp)) { + if (((temp&0xff)==0xf0) && (temp>>8)) { + /* special enhanced key, clear low part before returning key */ + temp&=0xff00; } - CALLBACK_Idle(); + reg_ax=temp; + } else { + /* enter small idle loop to allow for irqs to happen */ + reg_ip+=1; } - reg_ax=temp; break; case 0x01: /* CHECK FOR KEYSTROKE */ + // enable interrupt-flag after IRET of this int16 + mem_writew(SegPhys(ss)+reg_sp+4,(mem_readw(SegPhys(ss)+reg_sp+4) | FLAG_IF)); for (;;) { if (check_key(temp)) { if (!IsEnhancedKey(temp)) { @@ -561,7 +523,7 @@ static Bitu INT16_Handler(void) { CALLBACK_SZF(true); break; } - CALLBACK_Idle(); +// CALLBACK_Idle(); } break; case 0x11: /* CHECK FOR KEYSTROKE (enhanced keyboards only) */ @@ -591,7 +553,7 @@ static Bitu INT16_Handler(void) { } break; case 0x05: /* STORE KEYSTROKE IN KEYBOARD BUFFER */ - if (add_key_forced(reg_cx)) reg_al=0; + if (BIOS_AddKeyToBuffer(reg_cx)) reg_al=0; else reg_al=1; break; case 0x12: /* GET EXTENDED SHIFT STATES */ @@ -630,37 +592,51 @@ static void InitBiosSegment(void) { mem_writeb(BIOS_KEYBOARD_FLAGS3,16); /* Enhanced keyboard installed */ mem_writeb(BIOS_KEYBOARD_TOKEN,0); mem_writeb(BIOS_KEYBOARD_LEDS,leds); - } void BIOS_SetupKeyboard(void) { /* Init the variables */ InitBiosSegment(); - /* Allocate a callback for int 0x16 and for standard IRQ 1 handler */ + + /* Allocate/setup a callback for int 0x16 and for standard IRQ 1 handler */ call_int16=CALLBACK_Allocate(); - call_irq1=CALLBACK_Allocate(); - CALLBACK_Setup(call_int16,&INT16_Handler,CB_IRET_STI,"keyboard"); + CALLBACK_Setup(call_int16,&INT16_Handler,CB_INT16,"keyboard"); RealSetVec(0x16,CALLBACK_RealPointer(call_int16)); - CALLBACK_Setup(call_irq1,&IRQ1_Handler,CB_IRET,"keyboard irq"); + + call_irq1=CALLBACK_Allocate(); + CALLBACK_Setup(call_irq1,&IRQ1_Handler,CB_IRQ1,"keyboard irq"); RealSetVec(0x9,CALLBACK_RealPointer(call_irq1)); + // pseudocode for CB_IRQ1: + // push ax + // in al, 0x60 + // mov ah, 0x4f + // stc + // int 15 + // jc skip + // callback IRQ1_Handler + // label skip: + // cli + // mov al, 0x20 + // out 0x20, al + // pop ax + // iret + if (machine==MCH_PCJR) { call_irq6=CALLBACK_Allocate(); - CALLBACK_Setup(call_irq6,&IRQ6_Handler,CB_IRET,"PCJr kb irq"); + CALLBACK_Setup(call_irq6,NULL,CB_IRQ6_PCJR,"PCJr kb irq"); RealSetVec(0x0e,CALLBACK_RealPointer(call_irq6)); + // pseudocode for CB_IRQ6_PCJR: + // push ax + // in al, 0x60 + // cmp al, 0xe0 + // je skip + // int 0x09 + // label skip: + // cli + // mov al, 0x20 + // out 0x20, al + // pop ax + // iret } - - /* bring the all port operations outside the callback */ - phys_writeb(CB_BASE+(call_irq1<<4)+0x00,(Bit8u)0x50); // push ax - phys_writeb(CB_BASE+(call_irq1<<4)+0x01,(Bit8u)0xe4); // in al, 0x60 - phys_writeb(CB_BASE+(call_irq1<<4)+0x02,(Bit8u)0x60); - phys_writeb(CB_BASE+(call_irq1<<4)+0x03,(Bit8u)0xFE); //GRP 4 - phys_writeb(CB_BASE+(call_irq1<<4)+0x04,(Bit8u)0x38); //Extra Callback instruction - phys_writew(CB_BASE+(call_irq1<<4)+0x05,call_irq1); //The immediate word - phys_writeb(CB_BASE+(call_irq1<<4)+0x07,(Bit8u)0xb0); // mov al, 0x20 - phys_writeb(CB_BASE+(call_irq1<<4)+0x08,(Bit8u)0x20); - phys_writeb(CB_BASE+(call_irq1<<4)+0x09,(Bit8u)0xe6); // out 0x20, al - phys_writeb(CB_BASE+(call_irq1<<4)+0x0a,(Bit8u)0x20); - phys_writeb(CB_BASE+(call_irq1<<4)+0x0b,(Bit8u)0x58); // pop ax - phys_writeb(CB_BASE+(call_irq1<<4)+0x0c,(Bit8u)0xcf); // iret } diff --git a/src/ints/ems.cpp b/src/ints/ems.cpp index d05bbb9..cb3e216 100644 --- a/src/ints/ems.cpp +++ b/src/ints/ems.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: ems.cpp,v 1.47 2006/03/12 20:31:49 c2woody Exp $ */ +/* $Id: ems.cpp,v 1.55 2007/01/08 22:04:20 c2woody Exp $ */ #include #include @@ -41,6 +41,7 @@ #define EMM_MAX_PHYS 4 /* 4 16kb pages in pageframe */ #define EMM_VERSION 0x40 +#define GEMMIS_VERSION 0x0001 // Version 1.0 #define NULL_HANDLE 0xffff #define NULL_PAGE 0xffff @@ -68,10 +69,14 @@ #define EMM_MOVE_OVLAPI 0x97 #define EMM_NOT_FOUND 0xa0 +static Bit16u GEMMIS_seg; class device_EMM : public DOS_Device { public: - device_EMM(){SetName("EMMXXXX0");} + device_EMM() { + SetName("EMMXXXX0"); + GEMMIS_seg=0; + } bool Read(Bit8u * data,Bit16u * size) { return false;} bool Write(Bit8u * data,Bit16u * size){ LOG(LOG_IOCTL,LOG_NORMAL)("EMS:Write to device"); @@ -79,11 +84,83 @@ public: } bool Seek(Bit32u * pos,Bit32u type){return false;} bool Close(){return false;} - Bit16u GetInformation(void){return 0x8093;} + Bit16u GetInformation(void){return 0xc080;} + bool ReadFromControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode); + bool WriteToControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode){return true;} private: Bit8u cache; }; +bool device_EMM::ReadFromControlChannel(PhysPt bufptr,Bit16u size,Bit16u * retcode) { + Bitu subfct=mem_readb(bufptr); + switch (subfct) { + case 0x00: + if (size!=6) return false; + mem_writew(bufptr+0x00,0x0023); // ID + mem_writed(bufptr+0x02,0); // private API entry point + *retcode=6; + return true; + case 0x01: { + if (size!=6) return false; + if (GEMMIS_seg==0) GEMMIS_seg=DOS_GetMemory(0x20); + PhysPt GEMMIS_addr=PhysMake(GEMMIS_seg,0); + + mem_writew(GEMMIS_addr+0x00,0x0004); // flags + mem_writew(GEMMIS_addr+0x02,0x019d); // size of this structure + mem_writew(GEMMIS_addr+0x04,GEMMIS_VERSION); // version 1.0 (provide ems information only) + mem_writed(GEMMIS_addr+0x06,0); // reserved + + /* build non-EMS frames (0-0xe000) */ + for (Bitu frct=0; frct>4); // version 4.0 + mem_writew(bufptr+0x01,EMM_VERSION&0x0f); + *retcode=2; + return true; + } + return false; +} + struct EMM_Mapping { Bit16u handle; Bit16u page; @@ -99,6 +176,7 @@ struct EMM_Handle { static EMM_Handle emm_handles[EMM_MAX_HANDLES]; static EMM_Mapping emm_mappings[EMM_MAX_PHYS]; +static EMM_Mapping emm_segmentmappings[0x40]; static struct { bool enabled; @@ -197,6 +275,56 @@ static Bit8u EMM_MapPage(Bitu phys_page,Bit16u handle,Bit16u log_page) { } } +static Bit8u EMM_MapSegment(Bitu segment,Bit16u handle,Bit16u log_page) { +// LOG_MSG("EMS MapSegment handle %d segment %d log %d",handle,segment,log_page); + + if (((segment>=0xa000) && (segment<0xb000)) || ((segment>=EMM_PAGEFRAME-0x1000) && (segment=0) && (tphysPage>10].handle=NULL_HANDLE; + emm_segmentmappings[segment>>10].page=NULL_PAGE; + } + for (Bitu i=0;i<4;i++) + PAGING_MapPage(segment*16/4096+i,segment*16/4096+i); + PAGING_ClearTLB(); + return EMM_NO_ERROR; + } + /* Check for valid handle */ + if (!ValidHandle(handle)) return EMM_INVALID_HANDLE; + + if (log_page=0) && (tphysPage>10].handle=handle; + emm_segmentmappings[segment>>10].page=log_page; + } + + MemHandle memh=MEM_NextHandleAt(emm_handles[handle].mem,log_page*4);; + for (Bitu i=0;i<4;i++) { + PAGING_MapPage(segment*16/4096+i,memh); + memh=MEM_NextHandle(memh); + } + PAGING_ClearTLB(); + return EMM_NO_ERROR; + } else { + /* Illegal logical page it is */ + return EMM_LOG_OUT_RANGE; + } + } + + return EMM_ILL_PHYS; +} + static Bit8u EMM_ReleaseMemory(Bit16u handle) { /* Check for valid handle */ if (!ValidHandle(handle)) return EMM_INVALID_HANDLE; @@ -228,6 +356,11 @@ static Bit8u EMM_SavePageMap(Bit16u handle) { static Bit8u EMM_RestoreMappingTable(void) { Bit8u result; /* Move through the mappings table and setup mapping accordingly */ + for (Bitu i=0;i<0x40;i++) { + /* Skip the pageframe */ + if ((i>=EMM_PAGEFRAME/0x400) && (i<(EMM_PAGEFRAME/0x400)+EMM_MAX_PHYS)) continue; + result=EMM_MapSegment(i<<10,emm_segmentmappings[i].handle,emm_segmentmappings[i].page); + } for (Bitu i=0;i0;count--) { - Bit16u page=mem_readw(list);list+=2; - if ((page=EMM_PAGEFRAME+0x1000)) return EMM_ILL_PHYS; - page = (page-EMM_PAGEFRAME) / (EMM_PAGE_SIZE>>4); - mem_writew(data,page);data+=2; - MEM_BlockWrite(data,&emm_mappings[page],sizeof(EMM_Mapping)); - data+=sizeof(EMM_Mapping); + Bit16u segment=mem_readw(list);list+=2; + if ((segment>=EMM_PAGEFRAME) && (segment>4); + mem_writew(data,segment);data+=2; + MEM_BlockWrite(data,&emm_mappings[page],sizeof(EMM_Mapping)); + data+=sizeof(EMM_Mapping); + } else if (((segment>=EMM_PAGEFRAME-0x1000) && (segment=0xa000) && (segment<0xb000))) { + mem_writew(data,segment);data+=2; + MEM_BlockWrite(data,&emm_segmentmappings[segment>>10],sizeof(EMM_Mapping)); + data+=sizeof(EMM_Mapping); + } else { + return EMM_ILL_PHYS; + } } break; case 0x01: /* Restore Partial Page Map */ data = SegPhys(ds)+reg_si; count= mem_readw(data);data+=2; for (;count>0;count--) { - Bit16u page=mem_readw(data);data+=2; - if (page>=EMM_MAX_PHYS) return EMM_ILL_PHYS; - MEM_BlockRead(data,&emm_mappings[page],sizeof(EMM_Mapping)); + Bit16u segment=mem_readw(data);data+=2; + if ((segment>=EMM_PAGEFRAME) && (segment>4); + MEM_BlockRead(data,&emm_mappings[page],sizeof(EMM_Mapping)); + } else if (((segment>=EMM_PAGEFRAME-0x1000) && (segment=0xa000) && (segment<0xb000))) { + MEM_BlockRead(data,&emm_segmentmappings[segment>>10],sizeof(EMM_Mapping)); + } else { + return EMM_ILL_PHYS; + } data+=sizeof(EMM_Mapping); } return EMM_RestoreMappingTable(); @@ -559,8 +705,7 @@ static Bitu INT67_Handler(void) { { PhysPt data = SegPhys(ds)+reg_si; for (int i=0; i>16; + /* Descriptor 1 (code segment, callback segment) */ + real_writed(SegValue(ds),reg_si+0x00,0x0000ffff|cbseg_low); + real_writed(SegValue(ds),reg_si+0x04,0x00009a00|cbseg_high); + /* Descriptor 2 (data segment, full access) */ + real_writed(SegValue(ds),reg_si+0x08,0x0000ffff); + real_writed(SegValue(ds),reg_si+0x0c,0x00009200); + /* Descriptor 3 (full access) */ + real_writed(SegValue(ds),reg_si+0x10,0x0000ffff); + real_writed(SegValue(ds),reg_si+0x14,0x00009200); reg_ebx=(vcpi.pm_interface&0xffff); reg_ah=EMM_NO_ERROR; @@ -861,7 +1011,7 @@ static Bitu V86_Monitor() { if ((rm_val<0xc0) || (rm_val>=0xe8)) E_Exit("Invalid opcode 0x0f 0x20 %x caused a protection fault!",rm_val); Bit32u crx=CPU_GET_CRX(which); - switch (rm_val&3) { + switch (rm_val&7) { case 0: reg_eax=crx; break; case 1: reg_ecx=crx; break; case 2: reg_edx=crx; break; @@ -880,7 +1030,7 @@ static Bitu V86_Monitor() { if ((rm_val<0xc0) || (rm_val>=0xe8)) E_Exit("Invalid opcode 0x0f 0x22 %x caused a protection fault!",rm_val); Bit32u crx; - switch (rm_val&3) { + switch (rm_val&7) { case 0: crx=reg_eax; break; case 1: crx=reg_ecx; break; case 2: crx=reg_edx; break; @@ -1067,6 +1217,7 @@ public: call_vdma.Set_RealVec(0x4b); vcpi.enabled=false; + GEMMIS_seg=0; Section_prop * section=static_cast(configuration); if (!section->Get_bool("ems")) return; @@ -1078,21 +1229,23 @@ public: int67.Install(&INT67_Handler,CB_IRET,"Int 67 ems"); Bit16u call_int67=int67.Get_callback(); - /* Register the ems device */ + /* Register the ems device */ //TODO MAYBE put it in the class. DOS_Device * newdev = new device_EMM(); DOS_AddDevice(newdev); - /* Add a little hack so it appears that there is an actual ems device installed */ + /* Add a little hack so it appears that there is an actual ems device installed */ char * emsname="EMMXXXX0"; if(!emsnameseg) emsnameseg=DOS_GetMemory(2); //We have 32 bytes MEM_BlockWrite(PhysMake(emsnameseg,0xa),emsname,strlen(emsname)+1); - /* Copy the callback piece into the beginning, and set the interrupt vector to it*/ + + /* Copy the callback piece into the beginning, and set the interrupt vector to it*/ char buf[16]; - MEM_BlockRead(PhysMake(CB_SEG,call_int67<<4),buf,0xa); + MEM_BlockRead(CALLBACK_PhysPointer(call_int67),buf,0xa); MEM_BlockWrite(PhysMake(emsnameseg,0),buf,0xa); RealSetVec(0x67,RealMake(emsnameseg,0),old67_pointer); - /* Clear handle and page tables */ + + /* Clear handle and page tables */ Bitu i; for (i=0;itype) { @@ -458,14 +458,17 @@ void WriteChar(Bit16u col,Bit16u row,Bit8u page,Bit8u chr,Bit8u attr,bool useatt case M_CGA4: case M_CGA2: case M_TANDY16: - if (chr<128) fontdata=Real2Phys(RealGetVec(0x43))+chr*cheight; + if (chr<128) + fontdata=RealGetVec(0x43); else { chr-=128; - fontdata=Real2Phys(RealGetVec(0x1F))+(chr)*cheight; + fontdata=RealGetVec(0x1f); } + fontdata=RealMake(RealSeg(fontdata), RealOff(fontdata) + chr*cheight); break; default: - fontdata=Real2Phys(RealGetVec(0x43))+chr*cheight; + fontdata=RealGetVec(0x43); + fontdata=RealMake(RealSeg(fontdata), RealOff(fontdata) + chr*cheight); break; } @@ -503,7 +506,8 @@ void WriteChar(Bit16u col,Bit16u row,Bit8u page,Bit8u chr,Bit8u attr,bool useatt } for (Bit8u h=0;hmode]; @@ -398,6 +407,12 @@ bool INT10_SetVideoMode_OTHER(Bitu mode,bool clearmem) { default: IO_WriteB(0x3de,0x0);break; } + //Clear extended mapping + IO_WriteB(0x3da,0x5); + IO_WriteB(0x3de,0x0); + //Clear monitor mode + IO_WriteB(0x3da,0x8); + IO_WriteB(0x3de,0x0); crtpage=(CurMode->mode>=0x9) ? 0xf6 : 0x3f; IO_WriteB(0x3df,crtpage); real_writeb(BIOSMEM_SEG,BIOSMEM_CRTCPU_PAGE,crtpage); @@ -681,6 +696,9 @@ bool INT10_SetVideoMode(Bitu mode) { /* This register actually has more bits but only use the extended offset ones */ IO_Write(crtc_base,0x51); IO_Write(crtc_base + 1,(offset & 0x300) >> 4); + /* Clear remaining bits of the display start */ + IO_Write(crtc_base,0x69); + IO_Write(crtc_base + 1,0); /* Extended Vertical Overflow */ IO_Write(crtc_base,0x5e);IO_Write(crtc_base+1,ver_overflow); @@ -784,8 +802,8 @@ bool INT10_SetVideoMode(Bitu mode) { att_data[0x12]=0xf; //Always have all color planes enabled /* Program Attribute Controller */ switch (CurMode->type) { - case M_LIN4: case M_EGA: + case M_LIN4: att_data[0x10]=0x01; //Color Graphics switch (CurMode->mode) { case 0x0f: @@ -802,6 +820,8 @@ bool INT10_SetVideoMode(Bitu mode) { case 0x10: case 0x12: goto att_text16; default: + if ( CurMode->type == M_LIN4 ) + goto att_text16; for (i=0;i<8;i++) { att_data[i]=i; att_data[i+8]=i+0x10; @@ -969,7 +989,6 @@ dac_text16: } IO_Write(crtc_base,0x31);IO_Write(crtc_base+1,reg_31); //Enable banked memory and 256k+ access IO_Write(crtc_base,0x58);IO_Write(crtc_base+1,0x3); //Enable 8 mb of linear addressing - IO_Write(crtc_base,0x58);IO_Write(crtc_base+1,0x3); //Enable 8 mb of linear addressing IO_Write(crtc_base,0x38);IO_Write(crtc_base+1,0x48); //Register lock 1 IO_Write(crtc_base,0x39);IO_Write(crtc_base+1,0xa5); //Register lock 2 diff --git a/src/ints/int10_pal.cpp b/src/ints/int10_pal.cpp index 62f4398..9544f86 100644 --- a/src/ints/int10_pal.cpp +++ b/src/ints/int10_pal.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -239,6 +239,8 @@ void INT10_SetColorSelect(Bit8u val) { if (machine == MCH_CGA || IS_TANDY_ARCH) IO_Write(0x3d9,temp); else if (machine == MCH_VGA) { + if (CurMode->mode <= 3) //Maybe even skip the total function! + return; val = (temp & 0x10) | 2 | val; INT10_SetSinglePaletteRegister( 1, val ); val+=2; diff --git a/src/ints/int10_put_pixel.cpp b/src/ints/int10_put_pixel.cpp index 93db017..c76adf4 100644 --- a/src/ints/int10_put_pixel.cpp +++ b/src/ints/int10_put_pixel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,8 +21,8 @@ #include "inout.h" #include "int10.h" -static Bit8u cga_masks[4]={~192,~48,~12,~3}; -static Bit8u cga_masks2[8]={~128,~64,~32,~16,~8,~4,~2,~1}; +static Bit8u cga_masks[4]={~192U,~48U,~12U,~3U}; +static Bit8u cga_masks2[8]={~128U,~64U,~32U,~16U,~8U,~4U,~2U,~1U}; void INT10_PutPixel(Bit16u x,Bit16u y,Bit8u page,Bit8u color) { switch (CurMode->type) { diff --git a/src/ints/int10_vesa.cpp b/src/ints/int10_vesa.cpp index 086076f..783a9f7 100644 --- a/src/ints/int10_vesa.cpp +++ b/src/ints/int10_vesa.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: int10_vesa.cpp,v 1.23 2006/02/12 23:06:15 harekiet Exp $ */ +/* $Id: int10_vesa.cpp,v 1.26 2007/01/24 16:29:53 harekiet Exp $ */ #include #include @@ -292,6 +292,7 @@ Bit8u VESA_ScanLineLength(Bit8u subcall,Bit16u val, Bit16u & bytes,Bit16u & pixe Bit8u bpp; switch (CurMode->type) { case M_LIN4: + bpp = 1; break; case M_LIN8: bpp=1; @@ -356,11 +357,11 @@ Bit8u VESA_SetDisplayStart(Bit16u x,Bit16u y) { break; case M_LIN16: case M_LIN15: - start=vga.config.scan_len*8*y+x; + start=vga.config.scan_len*8*y+x*2; vga.config.display_start=start/4; break; case M_LIN32: - start=vga.config.scan_len*8*y+x; + start=vga.config.scan_len*8*y+x*4; vga.config.display_start=start/4; break; default: @@ -443,20 +444,17 @@ void INT10_SetupVESA(void) { int10.rom.pmode_interface_window = int10.rom.used - RealOff( int10.rom.pmode_interface ); phys_writew( Real2Phys(int10.rom.pmode_interface) + 0, int10.rom.pmode_interface_window ); callback.pmWindow=CALLBACK_Allocate(); - CALLBACK_Setup(callback.pmWindow, VESA_PMSetWindow, CB_RETF, "VESA PM Set Window"); - int10.rom.used += CALLBACK_SetupExtra( callback.pmWindow, CB_RETN, PhysMake(0xc000,int10.rom.used)); + int10.rom.used += CALLBACK_Setup(callback.pmWindow, VESA_PMSetWindow, CB_RETN, PhysMake(0xc000,int10.rom.used), "VESA PM Set Window"); /* PM Set start call */ int10.rom.pmode_interface_start = int10.rom.used - RealOff( int10.rom.pmode_interface ); phys_writew( Real2Phys(int10.rom.pmode_interface) + 2, int10.rom.pmode_interface_start); callback.pmStart=CALLBACK_Allocate(); - CALLBACK_Setup(callback.pmStart, VESA_PMSetStart, CB_RETF, "VESA PM Set Start"); - int10.rom.used += CALLBACK_SetupExtra( callback.pmStart, CB_RETN, PhysMake(0xc000,int10.rom.used)); + int10.rom.used += CALLBACK_Setup(callback.pmStart, VESA_PMSetStart, CB_RETN, PhysMake(0xc000,int10.rom.used), "VESA PM Set Start"); /* PM Set Palette call */ int10.rom.pmode_interface_palette = int10.rom.used - RealOff( int10.rom.pmode_interface ); phys_writew( Real2Phys(int10.rom.pmode_interface) + 4, int10.rom.pmode_interface_palette); callback.pmPalette=CALLBACK_Allocate(); - CALLBACK_Setup(callback.pmPalette, VESA_PMSetPalette, CB_RETF, "VESA PM Set Palette"); - int10.rom.used += CALLBACK_SetupExtra( callback.pmPalette, CB_RETN, PhysMake(0xc000,int10.rom.used)); + int10.rom.used += CALLBACK_Setup(callback.pmPalette, VESA_PMSetPalette, CB_RETN, PhysMake(0xc000,int10.rom.used), "VESA PM Set Palette"); /* Finalize the size and clear the required ports pointer */ phys_writew( Real2Phys(int10.rom.pmode_interface) + 6, 0); int10.rom.pmode_interface_size=int10.rom.used - RealOff( int10.rom.pmode_interface ); diff --git a/src/ints/mouse.cpp b/src/ints/mouse.cpp index a2a9637..64642b9 100644 --- a/src/ints/mouse.cpp +++ b/src/ints/mouse.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: mouse.cpp,v 1.61 2006/02/13 07:48:25 qbix79 Exp $ */ +/* $Id: mouse.cpp,v 1.66 2007/01/08 19:45:41 qbix79 Exp $ */ #include #include @@ -34,7 +34,7 @@ #include "bios.h" -static Bitu call_int33,call_int74; +static Bitu call_int33,call_int74,int74_ret_callback; static Bit16u ps2cbseg,ps2cbofs; static bool useps2callback,ps2callbackinit; static Bit16u call_ps2; @@ -86,7 +86,7 @@ static struct { Bit16u last_released_y[MOUSE_BUTTONS]; Bit16u last_pressed_x[MOUSE_BUTTONS]; Bit16u last_pressed_y[MOUSE_BUTTONS]; - Bit16s shown; + Bit16u shown; float add_x,add_y; Bit16u min_x,max_x,min_y,max_y; float mickey_x,mickey_y; @@ -116,7 +116,7 @@ static struct { Bit16u doubleSpeedThreshold; Bit16u language; Bit16u cursorType; - Bit16s oldshown; + Bit16u oldshown; Bit8u page; bool enabled; @@ -216,7 +216,7 @@ extern void ReadCharAttr(Bit16u col,Bit16u row,Bit8u page,Bit16u * result); void RestoreCursorBackgroundText() { - if (mouse.shown<0) return; + if (mouse.shown) return; if (mouse.background) { WriteChar(mouse.backposx,mouse.backposy,0,mouse.backData[0],mouse.backData[1],true); @@ -303,7 +303,7 @@ void ClipCursorArea(Bit16s& x1, Bit16s& x2, Bit16s& y1, Bit16s& y2, Bit16u& addx void RestoreCursorBackground() { - if (mouse.shown<0) return; + if (mouse.shown) return; SaveVgaRegisters(); if (mouse.background) { @@ -332,7 +332,7 @@ void RestoreCursorBackground() }; void DrawCursor() { - if (mouse.shown<0) return; + if (mouse.shown) return; // Check video page if (real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE)!=mouse.page) return; // Check if cursor in update region @@ -525,7 +525,8 @@ void Mouse_NewVideoMode(void) } else { real_writed(0,((0x8+MOUSE_IRQ)<<2),CALLBACK_RealPointer(call_int74)); } -// mouse.shown=-1;//Disabled as ida doesn't have mousecursor anymore + mouse.shown = 1;//Disabled as ida doesn't have mousecursor anymore + //enabled again as it seems to be a bug in ida4 /* Get the correct resolution from the current video mode */ Bitu mode=mem_readb(BIOS_VIDEO_MODE); switch (mode) { @@ -557,7 +558,7 @@ void Mouse_NewVideoMode(void) mouse.max_y=199; LOG(LOG_MOUSE,LOG_ERROR)("Unhandled videomode %X on reset",mode); // Hide mouse cursor on non supported modi. Pirates Gold - mouse.shown = -1; + mouse.shown = 1; break; } mouse.max_x = 639; @@ -586,7 +587,7 @@ void Mouse_NewVideoMode(void) mouse.updateRegion_y[1] = 1; mouse.cursorType = 0; mouse.enabled=true; - mouse.oldshown=-1; + mouse.oldshown=1; SetMickeyPixelRate(8,16); oldmouseX = static_cast(mouse.x); @@ -599,17 +600,14 @@ static void mouse_reset(void) { /* Remove drawn mouse Legends of Valor */ if (CurMode->type!=M_TEXT) RestoreCursorBackground(); else RestoreCursorBackgroundText(); - mouse.shown = -1; + mouse.shown = 1; Mouse_NewVideoMode(); mouse.sub_mask=0; - mouse.sub_seg=0; - mouse.sub_ofs=0; + mouse.senv_x=1.0; - mouse.senv_y=1.0; - } static Bitu INT33_Handler(void) { @@ -625,16 +623,15 @@ static Bitu INT33_Handler(void) { Mouse_AutoLock(true); break; case 0x01: /* Show Mouse */ - mouse.shown++; + if(mouse.shown) mouse.shown--; Mouse_AutoLock(true); - if (mouse.shown>0) mouse.shown=0; DrawCursor(); break; case 0x02: /* Hide Mouse */ { if (CurMode->type!=M_TEXT) RestoreCursorBackground(); else RestoreCursorBackgroundText(); - mouse.shown--; + mouse.shown++; } break; case 0x03: /* Return position and Button Status */ @@ -823,7 +820,7 @@ static Bitu INT33_Handler(void) { SegSet16(es,0); mouse.enabled=false; /* Just for reporting not doing a thing with it */ mouse.oldshown=mouse.shown; - mouse.shown=-1; + mouse.shown=1; break; case 0x20: /* Enable Mousedriver */ mouse.enabled=true; @@ -870,83 +867,86 @@ static Bitu INT74_Handler(void) { mouse.events--; /* Check for an active Interrupt Handler that will get called */ if (mouse.sub_mask & mouse.event_queue[mouse.events].type) { - /* Save lot's of registers */ - Bit32u oldeax,oldebx,oldecx,oldedx,oldesi,oldedi,oldebp,oldesp; - Bit16u oldds,oldes,oldss; - oldeax=reg_eax;oldebx=reg_ebx;oldecx=reg_ecx;oldedx=reg_edx; - oldesi=reg_esi;oldedi=reg_edi;oldebp=reg_ebp;oldesp=reg_esp; - oldds=SegValue(ds); oldes=SegValue(es); oldss=SegValue(ss); // Save segments reg_ax=mouse.event_queue[mouse.events].type; reg_bx=mouse.event_queue[mouse.events].buttons; reg_cx=POS_X; reg_dx=POS_Y; reg_si=(Bit16s)(mouse.mickey_x*mouse.mickeysPerPixel_x); reg_di=(Bit16s)(mouse.mickey_y*mouse.mickeysPerPixel_y); - // Hmm... this look ok, but moonbase wont work with it - /*if (mouse.event_queue[mouse.events].type==MOUSE_MOVED) { - mouse.mickey_x=0; - mouse.mickey_y=0; - }*/ - CALLBACK_RunRealFar(mouse.sub_seg,mouse.sub_ofs); - reg_eax=oldeax;reg_ebx=oldebx;reg_ecx=oldecx;reg_edx=oldedx; - reg_esi=oldesi;reg_edi=oldedi;reg_ebp=oldebp;reg_esp=oldesp; - SegSet16(ds,oldds); SegSet16(es,oldes); SegSet16(ss,oldss); // Save segments - + CPU_Push16(RealSeg(CALLBACK_RealPointer(int74_ret_callback))); + CPU_Push16(RealOff(CALLBACK_RealPointer(int74_ret_callback))); + SegSet16(cs, mouse.sub_seg); + reg_ip = mouse.sub_ofs; + } else if (useps2callback) { + CPU_Push16(RealSeg(CALLBACK_RealPointer(int74_ret_callback))); + CPU_Push16(RealOff(CALLBACK_RealPointer(int74_ret_callback))); + DoPS2Callback(mouse.event_queue[mouse.events].buttons, POS_X, POS_Y); + } else { + SegSet16(cs, RealSeg(CALLBACK_RealPointer(int74_ret_callback))); + reg_ip = RealOff(CALLBACK_RealPointer(int74_ret_callback)); } - DoPS2Callback(mouse.event_queue[mouse.events].buttons, POS_X, POS_Y); - + } else { + SegSet16(cs, RealSeg(CALLBACK_RealPointer(int74_ret_callback))); + reg_ip = RealOff(CALLBACK_RealPointer(int74_ret_callback)); } - IO_Write(0xa0,0x20); - IO_Write(0x20,0x20); - /* Check for more Events if so reactivate IRQ */ + return CBRET_NONE; +} + +Bitu MOUSE_UserInt_CB_Handler(void) { if (mouse.events) { PIC_ActivateIRQ(MOUSE_IRQ); } return CBRET_NONE; } -void WriteMouseIntVector(void) -{ - // Create a mouse vector with weird address - // for strange mouse detection routines in Sim City & Wasteland - real_writed(0,0x33<<2,RealMake(CB_SEG+1,(call_int33<<4)-0x10+1)); // +1 = Skip NOP -}; - -void CreateMouseCallback(void) -{ - // Create callback +void MOUSE_Init(Section* sec) { + // Callback for mouse interrupt 0x33 call_int33=CALLBACK_Allocate(); CALLBACK_Setup(call_int33,&INT33_Handler,CB_IRET,"Mouse"); + // Wasteland needs low(seg(int33))!=0 and low(ofs(int33))!=0 + real_writed(0,0x33<<2,RealMake(CB_SEG+1,(call_int33*CB_SIZE)-0x10)); - // Create a mouse vector with weird address - // for strange mouse detection routines in Sim City & Wasteland - Bit16u ofs = call_int33<<4; - phys_writeb(CB_BASE+ofs+0,(Bit8u)0x90); //NOP - phys_writeb(CB_BASE+ofs+1,(Bit8u)0xFE); //GRP 4 - phys_writeb(CB_BASE+ofs+2,(Bit8u)0x38); //Extra Callback instruction - phys_writew(CB_BASE+ofs+3,call_int33); //The immediate word - phys_writeb(CB_BASE+ofs+5,(Bit8u)0xCF); //An IRET Instruction - // Write weird vector - WriteMouseIntVector(); -}; - -void MOUSE_Init(Section* sec) { - - // Callback 0x33 - CreateMouseCallback(); + // Callback for ps2 irq call_int74=CALLBACK_Allocate(); - CALLBACK_Setup(call_int74,&INT74_Handler,CB_IRET,"int 74"); - if(MOUSE_IRQ > 7) { - real_writed(0,((0x70+MOUSE_IRQ-8)<<2),CALLBACK_RealPointer(call_int74)); - } else { - real_writed(0,((0x8+MOUSE_IRQ)<<2),CALLBACK_RealPointer(call_int74)); - } + CALLBACK_Setup(call_int74,&INT74_Handler,CB_IRQ12,"int 74"); + // pseudocode for CB_IRQ12: + // push ds + // push es + // pushad + // sti + // callback INT74_Handler + // doesn't return here, but rather to CB_IRQ12_RET + // (ps2 callback/user callback inbetween if requested) + + int74_ret_callback=CALLBACK_Allocate(); + CALLBACK_Setup(int74_ret_callback,&MOUSE_UserInt_CB_Handler,CB_IRQ12_RET,"int 74 ret"); + // pseudocode for CB_IRQ12_RET: + // callback MOUSE_UserInt_CB_Handler + // cli + // mov al, 0x20 + // out 0xa0, al + // out 0x20, al + // popad + // pop es + // pop ds + // iret + + Bit8u hwvec=(MOUSE_IRQ>7)?(0x70+MOUSE_IRQ-8):(0x8+MOUSE_IRQ); + RealSetVec(hwvec,CALLBACK_RealPointer(call_int74)); + + // Callback for ps2 user callback handling useps2callback = false; ps2callbackinit = false; call_ps2=CALLBACK_Allocate(); - CALLBACK_Setup(call_ps2,&PS2_Handler,CB_IRET,"ps2 bios callback"); + CALLBACK_Setup(call_ps2,&PS2_Handler,CB_RETF,"ps2 bios callback"); ps2_callback=CALLBACK_RealPointer(call_ps2); + memset(&mouse,0,sizeof(mouse)); - mouse.shown=-1; //Hide mouse on startup + mouse.shown = 1; //Hide mouse on startup + + mouse.sub_mask=0; + mouse.sub_seg=0x6362; // magic value + mouse.sub_ofs=0; + mouse_reset_hardware(); mouse_reset(); } diff --git a/src/ints/xms.cpp b/src/ints/xms.cpp index 20917a3..d426127 100644 --- a/src/ints/xms.cpp +++ b/src/ints/xms.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: xms.cpp,v 1.39 2006/02/09 11:47:57 qbix79 Exp $ */ +/* $Id: xms.cpp,v 1.46 2007/01/08 21:40:15 qbix79 Exp $ */ #include #include @@ -55,6 +55,7 @@ #define XMS_QUERY_ANY_FREE_MEMORY 0x88 #define XMS_ALLOCATE_ANY_MEMORY 0x89 #define XMS_GET_EMB_HANDLE_INFORMATION_EXT 0x8e +#define XMS_RESIZE_ANY_EXTENDED_MEMORY_BLOCK 0x8f #define XMS_FUNCTION_NOT_IMPLEMENTED 0x80 #define HIGH_MEMORY_NOT_EXIST 0x90 @@ -63,6 +64,11 @@ #define XMS_OUT_OF_SPACE 0xa0 #define XMS_OUT_OF_HANDLES 0xa1 #define XMS_INVALID_HANDLE 0xa2 +#define XMS_INVALID_SOURCE_HANDLE 0xa3 +#define XMS_INVALID_SOURCE_OFFSET 0xa4 +#define XMS_INVALID_DEST_HANDLE 0xa5 +#define XMS_INVALID_DEST_OFFSET 0xa6 +#define XMS_INVALID_LENGTH 0xa7 #define XMS_BLOCK_NOT_LOCKED 0xaa #define XMS_BLOCK_LOCKED 0xab #define UMB_ONLY_SMALLER_BLOCK 0xb0 @@ -122,17 +128,21 @@ Bitu XMS_QueryFreeMemory(Bit16u& largestFree, Bit16u& totalFree) { return 0; }; -Bitu XMS_AllocateMemory(Bitu size, Bit16u& handle) -// size = kb -{ +Bitu XMS_AllocateMemory(Bitu size, Bit16u& handle) { // size = kb /* Find free handle */ Bit16u index=1; while (!xms_handles[index].free) { if (++index>=XMS_HANDLES) return XMS_OUT_OF_HANDLES; } - Bitu pages=(size/4) + ((size & 3) ? 1 : 0); - MemHandle mem=MEM_AllocatePages(pages,true); - if ((!mem) && (size != 0)) return XMS_OUT_OF_SPACE; + MemHandle mem; + if (size!=0) { + Bitu pages=(size/4) + ((size & 3) ? 1 : 0); + mem=MEM_AllocatePages(pages,true); + if (!mem) return XMS_OUT_OF_SPACE; + } else { + mem=MEM_GetNextFreePage(); + if (mem==0) LOG(LOG_MISC,LOG_ERROR)("XMS:Allocate zero pages with no memory left"); + } xms_handles[index].free=false; xms_handles[index].mem=mem; xms_handles[index].locked=0; @@ -141,8 +151,7 @@ Bitu XMS_AllocateMemory(Bitu size, Bit16u& handle) return 0; }; -Bitu XMS_FreeMemory(Bitu handle) -{ +Bitu XMS_FreeMemory(Bitu handle) { if (InvalidHandle(handle)) return XMS_INVALID_HANDLE; MEM_ReleasePages(xms_handles[handle].mem); xms_handles[handle].mem=-1; @@ -151,8 +160,7 @@ Bitu XMS_FreeMemory(Bitu handle) return 0; }; -Bitu XMS_MoveMemory(PhysPt bpt) -{ +Bitu XMS_MoveMemory(PhysPt bpt) { /* Read the block with mem_read's */ Bitu length=mem_readd(bpt+offsetof(XMS_MemMove,length)); Bitu src_handle=mem_readw(bpt+offsetof(XMS_MemMove,src_handle)); @@ -166,13 +174,13 @@ Bitu XMS_MoveMemory(PhysPt bpt) PhysPt srcpt,destpt; if (src_handle) { if (InvalidHandle(src_handle)) { - return 0xa3; /* Src Handle invalid */ + return XMS_INVALID_SOURCE_HANDLE; } if (src.offset>=(xms_handles[src_handle].size*1024U)) { - return 0xa4; /* Src Offset invalid */ + return XMS_INVALID_SOURCE_OFFSET; } if (length>xms_handles[src_handle].size*1024U-src.offset) { - return 0xa7; /* Length invalid */ + return XMS_INVALID_LENGTH; } srcpt=(xms_handles[src_handle].mem*4096)+src.offset; } else { @@ -180,13 +188,13 @@ Bitu XMS_MoveMemory(PhysPt bpt) } if (dest_handle) { if (InvalidHandle(dest_handle)) { - return 0xa3; /* Dest Handle invalid */ + return XMS_INVALID_DEST_HANDLE; } if (dest.offset>=(xms_handles[dest_handle].size*1024U)) { - return 0xa4; /* Dest Offset invalid */ + return XMS_INVALID_DEST_OFFSET; } if (length>xms_handles[dest_handle].size*1024U-dest.offset) { - return 0xa7; /* Length invalid */ + return XMS_INVALID_LENGTH; } destpt=(xms_handles[dest_handle].mem*4096)+dest.offset; } else { @@ -197,16 +205,14 @@ Bitu XMS_MoveMemory(PhysPt bpt) return 0; } -Bitu XMS_LockMemory(Bitu handle, Bit32u& address) -{ +Bitu XMS_LockMemory(Bitu handle, Bit32u& address) { if (InvalidHandle(handle)) return XMS_INVALID_HANDLE; if (xms_handles[handle].locked<255) xms_handles[handle].locked++; address = xms_handles[handle].mem*4096; return 0; }; -Bitu XMS_UnlockMemory(Bitu handle) -{ +Bitu XMS_UnlockMemory(Bitu handle) { if (InvalidHandle(handle)) return XMS_INVALID_HANDLE; if (xms_handles[handle].locked) { xms_handles[handle].locked--; @@ -215,8 +221,7 @@ Bitu XMS_UnlockMemory(Bitu handle) return XMS_BLOCK_NOT_LOCKED; }; -Bitu XMS_GetHandleInformation(Bitu handle, Bit8u& lockCount, Bit8u& numFree, Bit16u& size) -{ +Bitu XMS_GetHandleInformation(Bitu handle, Bit8u& lockCount, Bit8u& numFree, Bit16u& size) { if (InvalidHandle(handle)) return XMS_INVALID_HANDLE; lockCount = xms_handles[handle].locked; /* Find available blocks */ @@ -228,13 +233,13 @@ Bitu XMS_GetHandleInformation(Bitu handle, Bit8u& lockCount, Bit8u& numFree, Bit return 0; }; -Bitu XMS_ResizeMemory(Bitu handle, Bitu newSize) -{ +Bitu XMS_ResizeMemory(Bitu handle, Bitu newSize) { if (InvalidHandle(handle)) return XMS_INVALID_HANDLE; // Block has to be unlocked if (xms_handles[handle].locked>0) return XMS_BLOCK_LOCKED; Bitu pages=newSize/4 + ((newSize & 3) ? 1 : 0); if (MEM_ReAllocatePages(xms_handles[handle].mem,pages,true)) { + xms_handles[handle].size = newSize; return 0; } else return XMS_OUT_OF_SPACE; } @@ -252,9 +257,15 @@ static bool multiplex_xms(void) { return false; }; +#define SET_RESULT(caller) { \ +res = caller; \ +if(res) reg_bl = res; \ +reg_ax = (res==0); \ +} Bitu XMS_Handler(void) { // LOG(LOG_MISC,LOG_ERROR)("XMS: CALL %02X",reg_ah); + Bitu res = 0; switch (reg_ah) { case XMS_GET_VERSION: /* 00 */ @@ -273,13 +284,11 @@ Bitu XMS_Handler(void) { case XMS_GLOBAL_ENABLE_A20: /* 03 */ case XMS_LOCAL_ENABLE_A20: /* 05 */ - reg_bl = XMS_EnableA20(true); - reg_ax = (reg_bl==0); + SET_RESULT(XMS_EnableA20(true)); break; case XMS_GLOBAL_DISABLE_A20: /* 04 */ case XMS_LOCAL_DISABLE_A20: /* 06 */ - reg_bl = XMS_EnableA20(false); - reg_ax = (reg_bl==0); + SET_RESULT(XMS_EnableA20(false)); break; case XMS_QUERY_A20: /* 07 */ reg_ax = XMS_GetEnabledA20(); @@ -294,39 +303,36 @@ Bitu XMS_Handler(void) { case XMS_ALLOCATE_EXTENDED_MEMORY: /* 09 */ { Bit16u handle = 0; - reg_bl = XMS_AllocateMemory(reg_dx,handle); + SET_RESULT(XMS_AllocateMemory(reg_dx,handle)); reg_dx = handle; - reg_ax = (reg_bl==0); // set ax to success/failure }; break; case XMS_FREE_EXTENDED_MEMORY: /* 0a */ - reg_bl = XMS_FreeMemory(reg_dx); - reg_ax = (reg_bl==0); + SET_RESULT(XMS_FreeMemory(reg_dx)); break; case XMS_MOVE_EXTENDED_MEMORY_BLOCK: /* 0b */ - reg_bl = XMS_MoveMemory(SegPhys(ds)+reg_si); - reg_ax = (reg_bl==0); + SET_RESULT(XMS_MoveMemory(SegPhys(ds)+reg_si)); break; case XMS_LOCK_EXTENDED_MEMORY_BLOCK: { /* 0c */ Bit32u address; - reg_bl = XMS_LockMemory(reg_dx, address); - reg_ax = (reg_bl==0); - if (reg_bl==0) { // success + res = XMS_LockMemory(reg_dx, address); + if(res) reg_bl = res; + reg_ax = (res==0); + if (res==0) { // success reg_bx=(Bit16u)(address & 0xFFFF); reg_dx=(Bit16u)(address >> 16); }; }; break; case XMS_UNLOCK_EXTENDED_MEMORY_BLOCK: /* 0d */ - reg_bl = XMS_UnlockMemory(reg_dx); - reg_ax = (reg_bl==0); + SET_RESULT(XMS_UnlockMemory(reg_dx)); break; - case XMS_GET_EMB_HANDLE_INFORMATION: { /* 0e */ - Bitu result = XMS_GetHandleInformation(reg_dx,reg_bh,reg_bl,reg_dx); - if (result != 0) reg_bl = result; - reg_ax = (result==0); - }; break; + case XMS_GET_EMB_HANDLE_INFORMATION: /* 0e */ + SET_RESULT(XMS_GetHandleInformation(reg_dx,reg_bh,reg_bl,reg_dx)); + break; + case XMS_RESIZE_ANY_EXTENDED_MEMORY_BLOCK: /* 0x8f */ + if(reg_ebx > reg_bx) LOG_MSG("64MB memory limit!"); + //fall through case XMS_RESIZE_EXTENDED_MEMORY_BLOCK: /* 0f */ - reg_bl = XMS_ResizeMemory(reg_dx, reg_bx); - reg_ax = (reg_bl==0); + SET_RESULT(XMS_ResizeMemory(reg_dx, reg_bx)); break; case XMS_ALLOCATE_UMB: { /* 10 */ if (!umb_available) { @@ -387,7 +393,7 @@ Bitu XMS_Handler(void) { reg_ecx = (MEM_TotalPages()*MEM_PAGESIZE)-1; // highest known physical memory address break; case XMS_GET_EMB_HANDLE_INFORMATION_EXT: { /* 8e */ - Bit8u free_handles; + Bit8u free_handles; Bitu result = XMS_GetHandleInformation(reg_dx,reg_bh,free_handles,reg_dx); if (result != 0) reg_bl = result; else { @@ -415,20 +421,16 @@ public: Bitu i; BIOS_ZeroExtendedSize(true); DOS_AddMultiplexHandler(multiplex_xms); - callbackhandler.Install(&XMS_Handler,CB_RETF, "XMS Handler"); - xms_callback=callbackhandler.Get_RealPointer(); - Bit16u call_xms=callbackhandler.Get_callback(); - - /* Override the callback with one that can be hooked */ - phys_writeb(CB_BASE+(call_xms<<4)+0,(Bit8u)0xeb); //jump near - phys_writeb(CB_BASE+(call_xms<<4)+1,(Bit8u)0x03); //offset - phys_writeb(CB_BASE+(call_xms<<4)+2,(Bit8u)0x90); //NOP - phys_writeb(CB_BASE+(call_xms<<4)+3,(Bit8u)0x90); //NOP - phys_writeb(CB_BASE+(call_xms<<4)+4,(Bit8u)0x90); //NOP - phys_writeb(CB_BASE+(call_xms<<4)+5,(Bit8u)0xFE); //GRP 4 - phys_writeb(CB_BASE+(call_xms<<4)+6,(Bit8u)0x38); //Extra Callback instruction - phys_writew(CB_BASE+(call_xms<<4)+7,call_xms); //The immediate word - phys_writeb(CB_BASE+(call_xms<<4)+9,(Bit8u)0xCB); //A RETF Instruction + + /* place hookable callback in writable memory area */ + xms_callback=RealMake(DOS_GetMemory(0x1),0); + callbackhandler.Install(&XMS_Handler,CB_HOOKABLE,Real2Phys(xms_callback),"XMS Handler"); + // pseudocode for CB_HOOKABLE: + // jump near skip + // nop,nop,nop + // label skip: + // callback XMS_Handler + // retf for (i=0;iGet_string("umb"),"false")!=0; - DOS_BuildUMBChain(section->Get_string("umb"),section->Get_bool("ems")); + umb_available=section->Get_bool("umb"); + DOS_BuildUMBChain(section->Get_bool("umb"),section->Get_bool("ems")); } ~XMS(){ @@ -468,7 +470,7 @@ public: }; static XMS* test; -void XMS_ShutDown(Section* sec) { +void XMS_ShutDown(Section* /*sec*/) { delete test; } diff --git a/src/ints/xms.h b/src/ints/xms.h index 5944911..863d27c 100644 --- a/src/ints/xms.h +++ b/src/ints/xms.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/libs/Makefile.in b/src/libs/Makefile.in index 2702c53..a1f01c8 100644 --- a/src/libs/Makefile.in +++ b/src/libs/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -20,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -33,31 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/libs -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -84,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -114,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -124,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -133,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -159,39 +139,30 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + SUBDIRS = zmbv +subdir = src/libs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/libs/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/libs/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu src/libs/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd @@ -201,13 +172,7 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -219,7 +184,7 @@ $(RECURSIVE_TARGETS): local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -227,13 +192,7 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -254,7 +213,7 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -265,6 +224,14 @@ ctags-recursive: test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -273,22 +240,19 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ - empty_fix=.; \ else \ include_option=--include; \ - empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ + test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -298,11 +262,10 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -325,6 +288,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -338,7 +305,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -353,17 +320,15 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ @@ -373,6 +338,7 @@ check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: + install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -392,7 +358,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -409,8 +375,6 @@ dvi: dvi-recursive dvi-am: -html: html-recursive - info: info-recursive info-am: @@ -445,17 +409,20 @@ uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-recursive ctags ctags-recursive \ - distclean distclean-generic distclean-recursive distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-recursive ctags ctags-recursive distclean \ + distclean-generic distclean-recursive distclean-tags distdir \ + dvi dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am + mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ + ps-recursive tags tags-recursive uninstall uninstall-am \ + uninstall-info-am uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/libs/zmbv/Makefile.in b/src/libs/zmbv/Makefile.in index 34920a3..d215400 100644 --- a/src/libs/zmbv/Makefile.in +++ b/src/libs/zmbv/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -20,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -33,22 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/libs/zmbv -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -75,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -105,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -115,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -124,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -150,38 +139,21 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ EXTRA_DIST = zmbv.cpp zmbv.h +subdir = src/libs/zmbv +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/libs/zmbv/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/libs/zmbv/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu src/libs/zmbv/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: tags: TAGS TAGS: @@ -189,6 +161,10 @@ TAGS: ctags: CTAGS CTAGS: +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -202,7 +178,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -220,6 +196,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile + installdirs: install: install-am install-exec: install-exec-am @@ -240,7 +217,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -257,8 +234,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -292,8 +267,8 @@ ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ diff --git a/src/libs/zmbv/zmbv.cpp b/src/libs/zmbv/zmbv.cpp index 0681251..2eb0fcb 100644 --- a/src/libs/zmbv/zmbv.cpp +++ b/src/libs/zmbv/zmbv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/libs/zmbv/zmbv.h b/src/libs/zmbv/zmbv.h index eae58d9..db61940 100644 --- a/src/libs/zmbv/zmbv.h +++ b/src/libs/zmbv/zmbv.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/misc/Makefile.in b/src/misc/Makefile.in index a61a777..520cc47 100644 --- a/src/misc/Makefile.in +++ b/src/misc/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libmisc_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,40 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/misc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libmisc_a_AR = $(AR) $(ARFLAGS) -libmisc_a_LIBADD = -am_libmisc_a_OBJECTS = programs.$(OBJEXT) messages.$(OBJEXT) \ - support.$(OBJEXT) setup.$(OBJEXT) -libmisc_a_OBJECTS = $(am_libmisc_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -SOURCES = $(libmisc_a_SOURCES) -DIST_SOURCES = $(libmisc_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -96,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -126,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -136,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -145,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -171,41 +139,47 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + noinst_LIBRARIES = libmisc.a libmisc_a_SOURCES = programs.cpp messages.cpp support.cpp setup.cpp +subdir = src/misc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libmisc_a_AR = $(AR) cru +libmisc_a_LIBADD = +am_libmisc_a_OBJECTS = programs.$(OBJEXT) messages.$(OBJEXT) \ + support.$(OBJEXT) setup.$(OBJEXT) +libmisc_a_OBJECTS = $(am_libmisc_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/messages.Po ./$(DEPDIR)/programs.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/setup.Po ./$(DEPDIR)/support.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +DIST_SOURCES = $(libmisc_a_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libmisc_a_SOURCES) + all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/misc/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/misc/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/misc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -215,7 +189,7 @@ libmisc.a: $(libmisc_a_OBJECTS) $(libmisc_a_DEPENDENCIES) $(RANLIB) libmisc.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -226,20 +200,36 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/support.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -248,7 +238,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -260,11 +249,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -287,6 +275,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -300,7 +292,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -318,6 +310,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) + installdirs: install: install-am install-exec: install-exec-am @@ -338,7 +331,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -357,8 +350,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -394,14 +385,13 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/misc/messages.cpp b/src/misc/messages.cpp index c2b31b0..89e7a27 100644 --- a/src/misc/messages.cpp +++ b/src/misc/messages.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: messages.cpp,v 1.18 2006/02/09 11:47:57 qbix79 Exp $ */ +/* $Id: messages.cpp,v 1.19 2007/01/08 19:45:41 qbix79 Exp $ */ #include #include diff --git a/src/misc/programs.cpp b/src/misc/programs.cpp index 9f739f5..5642617 100644 --- a/src/misc/programs.cpp +++ b/src/misc/programs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: programs.cpp,v 1.24 2006/03/02 14:12:49 qbix79 Exp $ */ +/* $Id: programs.cpp,v 1.27 2007/01/08 19:45:41 qbix79 Exp $ */ #include #include @@ -51,7 +51,7 @@ static Bit8u exe_block[]={ static std::vector internal_progs; -void PROGRAMS_MakeFile(char * name,PROGRAMS_Main * main) { +void PROGRAMS_MakeFile(char const * const name,PROGRAMS_Main * main) { Bit8u * comdata=(Bit8u *)malloc(32); //MEM LEAK memcpy(comdata,&exe_block,sizeof(exe_block)); comdata[CB_POS]=call_program&0xff; @@ -248,7 +248,7 @@ void CONFIG::Run(void) { WriteOut(MSG_Get("PROGRAM_CONFIG_SECTION_ERROR"),temp_line.c_str()); return; } - char* val = sec->GetPropValue(prop.c_str()); + char const* val = sec->GetPropValue(prop.c_str()); if(!val) { WriteOut(MSG_Get("PROGRAM_CONFIG_NO_PROPERTY"),prop.c_str(),temp_line.c_str()); return; diff --git a/src/misc/setup.cpp b/src/misc/setup.cpp index e960965..5be52ff 100644 --- a/src/misc/setup.cpp +++ b/src/misc/setup.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: setup.cpp,v 1.34 2006/03/12 21:26:22 qbix79 Exp $ */ +/* $Id: setup.cpp,v 1.38 2007/01/08 19:45:41 qbix79 Exp $ */ #include "dosbox.h" #include "cross.h" @@ -59,27 +59,27 @@ void Prop_hex::SetValue(char* input){ if(!sscanf(input,"%X",&(value._hex))) value._hex=0; } -void Prop_int::GetValuestring(char* str){ +void Prop_int::GetValuestring(char* str) const{ sprintf(str,"%d",value._int); } -void Prop_string::GetValuestring(char* str){ +void Prop_string::GetValuestring(char* str) const{ sprintf(str,"%s",value._string->c_str()); } -void Prop_bool::GetValuestring(char* str){ +void Prop_bool::GetValuestring(char* str) const{ sprintf(str,"%s",value._bool?"true":"false"); } -void Prop_float::GetValuestring(char* str){ +void Prop_float::GetValuestring(char* str) const { sprintf(str,"%1.2f",value._float); } -void Prop_hex::GetValuestring(char* str){ +void Prop_hex::GetValuestring(char* str) const { sprintf(str,"%X",value._hex); } -void Section_prop::Add_float(const char* _propname, float _value) { +void Section_prop::Add_float(char const * const _propname, float _value) { Property* test=new Prop_float(_propname,_value); properties.push_back(test); } @@ -90,12 +90,12 @@ void Section_prop::Add_int(const char* _propname, int _value) { properties.push_back(test); } -void Section_prop::Add_string(const char* _propname, char* _value) { +void Section_prop::Add_string(char const * const _propname, char const * const _value) { Property* test=new Prop_string(_propname,_value); properties.push_back(test); } -void Section_prop::Add_bool(const char* _propname, bool _value) { +void Section_prop::Add_bool(char const * const _propname, bool _value) { Property* test=new Prop_bool(_propname,_value); properties.push_back(test); } @@ -103,8 +103,8 @@ void Section_prop::Add_hex(const char* _propname, int _value) { Property* test=new Prop_hex(_propname,_value); properties.push_back(test); } -int Section_prop::Get_int(const char* _propname){ - for(it tel=properties.begin();tel!=properties.end();tel++){ +int Section_prop::Get_int(char const * const _propname) const { + for(const_it tel=properties.begin();tel!=properties.end();tel++){ if((*tel)->propname==_propname){ return ((*tel)->GetValue())._int; } @@ -112,16 +112,16 @@ int Section_prop::Get_int(const char* _propname){ return 0; } -bool Section_prop::Get_bool(const char* _propname){ - for(it tel=properties.begin();tel!=properties.end();tel++){ +bool Section_prop::Get_bool(char const * const _propname) const { + for(const_it tel=properties.begin();tel!=properties.end();tel++){ if((*tel)->propname==_propname){ return ((*tel)->GetValue())._bool; } } return false; } -float Section_prop::Get_float(const char* _propname){ - for(it tel=properties.begin();tel!=properties.end();tel++){ +float Section_prop::Get_float(char const * const _propname) const { + for(const_it tel=properties.begin();tel!=properties.end();tel++){ if((*tel)->propname==_propname){ return ((*tel)->GetValue())._float; } @@ -129,16 +129,16 @@ float Section_prop::Get_float(const char* _propname){ return false; } -const char* Section_prop::Get_string(const char* _propname){ - for(it tel=properties.begin();tel!=properties.end();tel++){ +const char* Section_prop::Get_string(char const * const _propname) const { + for(const_it tel=properties.begin();tel!=properties.end();tel++){ if((*tel)->propname==_propname){ return ((*tel)->GetValue())._string->c_str(); } } return ""; } -int Section_prop::Get_hex(const char* _propname){ - for(it tel=properties.begin();tel!=properties.end();tel++){ +int Section_prop::Get_hex(char const * const _propname) const { + for(const_it tel=properties.begin();tel!=properties.end();tel++){ if((*tel)->propname==_propname){ return ((*tel)->GetValue())._hex; } @@ -160,18 +160,18 @@ void Section_prop::HandleInputline(char *gegevens){ } -void Section_prop::PrintData(FILE* outfile){ +void Section_prop::PrintData(FILE* outfile) const { char temp[1000]; /* Should be enough for the properties */ /* Now print out the individual section entries */ - for(it tel=properties.begin();tel!=properties.end();tel++){ + for(const_it tel=properties.begin();tel!=properties.end();tel++){ (*tel)->GetValuestring(temp); fprintf(outfile,"%s=%s\n",(*tel)->propname.c_str(),temp); } } static char buffer[1024]; -char* Section_prop::GetPropValue(const char* _property) { - for(it tel=properties.begin();tel!=properties.end();tel++){ +char const * Section_prop::GetPropValue(char const * const _property) const{ + for(const_it tel=properties.begin();tel!=properties.end();tel++){ if(!strcasecmp((*tel)->propname.c_str(),_property)){ (*tel)->GetValuestring(buffer); return buffer; @@ -185,19 +185,19 @@ void Section_line::HandleInputline(char* line){ data+="\n"; } -void Section_line::PrintData(FILE* outfile) { +void Section_line::PrintData(FILE* outfile) const { fprintf(outfile,"%s",data.c_str()); } -char* Section_line::GetPropValue(const char* _property) { +char const* Section_line::GetPropValue(char const * const /* _property*/) const { return NULL; } -void Config::PrintConfig(const char* configfilename){ +void Config::PrintConfig(char const * const configfilename) const { char temp[50];char helpline[256]; FILE* outfile=fopen(configfilename,"w+t"); if(outfile==NULL) return; - for (it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){ + for (const_it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){ /* Print out the Section header */ strcpy(temp,(*tel)->GetName()); lowcase(temp); @@ -223,7 +223,7 @@ void Config::PrintConfig(const char* configfilename){ } -Section_prop* Config::AddSection_prop(const char* _name,void (*_initfunction)(Section*),bool canchange){ +Section_prop* Config::AddSection_prop(char const * const _name,void (*_initfunction)(Section*),bool canchange){ Section_prop* blah = new Section_prop(_name); blah->AddInitFunction(_initfunction,canchange); sectionlist.push_back(blah); @@ -239,7 +239,7 @@ Section_prop::~Section_prop() { } -Section_line* Config::AddSection_line(const char* _name,void (*_initfunction)(Section*)){ +Section_line* Config::AddSection_line(char const * const _name,void (*_initfunction)(Section*)){ Section_line* blah = new Section_line(_name); blah->AddInitFunction(_initfunction); sectionlist.push_back(blah); @@ -247,8 +247,8 @@ Section_line* Config::AddSection_line(const char* _name,void (*_initfunction)(Se } -void Config::Init(){ - for (it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){ +void Config::Init() { + for (const_it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){ (*tel)->ExecuteInit(); } } @@ -278,24 +278,27 @@ Config::~Config() { } } -Section* Config::GetSection(const char* _sectionname){ - for (it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){ +Section* Config::GetSection(char const * const _sectionname) const{ + for (const_it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){ if (!strcasecmp((*tel)->GetName(),_sectionname)) return (*tel); } return NULL; } -Section* Config::GetSectionFromProperty(const char* prop) -{ - for (it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){ +Section* Config::GetSectionFromProperty(char const * const prop) const{ + for (const_it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){ if ((*tel)->GetPropValue(prop)) return (*tel); } return NULL; } -bool Config::ParseConfigFile(const char* configfilename){ + +bool Config::ParseConfigFile(char const * const configfilename){ + static bool first_configfile = true; ifstream in(configfilename); if (!in) return false; - LOG_MSG("CONFIG:Loading settings from config file %s", configfilename); + const char * settings_type = first_configfile?"primary":"additional"; + first_configfile = false; + LOG_MSG("CONFIG:Loading %s settings from config file %s", settings_type,configfilename); char gegevens[1024]; Section* currentsection = NULL; Section* testsec = NULL; @@ -373,14 +376,14 @@ void Config::StartUp(void) { (*_start_function)(); } -bool CommandLine::FindExist(char * name,bool remove) { +bool CommandLine::FindExist(char const * const name,bool remove) { cmd_it it; if (!(FindEntry(name,it,false))) return false; if (remove) cmds.erase(it); return true; } -bool CommandLine::FindHex(char * name,int & value,bool remove) { +bool CommandLine::FindHex(char const * const name,int & value,bool remove) { cmd_it it,it_next; if (!(FindEntry(name,it,true))) return false; it_next=it;it_next++; @@ -389,7 +392,7 @@ bool CommandLine::FindHex(char * name,int & value,bool remove) { return true; } -bool CommandLine::FindInt(char * name,int & value,bool remove) { +bool CommandLine::FindInt(char const * const name,int & value,bool remove) { cmd_it it,it_next; if (!(FindEntry(name,it,true))) return false; it_next=it;it_next++; @@ -398,7 +401,7 @@ bool CommandLine::FindInt(char * name,int & value,bool remove) { return true; } -bool CommandLine::FindString(char * name,std::string & value,bool remove) { +bool CommandLine::FindString(char const * const name,std::string & value,bool remove) { cmd_it it,it_next; if (!(FindEntry(name,it,true))) return false; it_next=it;it_next++; @@ -416,7 +419,7 @@ bool CommandLine::FindCommand(unsigned int which,std::string & value) { return true; } -bool CommandLine::FindEntry(char * name,cmd_it & it,bool neednext) { +bool CommandLine::FindEntry(char const * const name,cmd_it & it,bool neednext) { for (it=cmds.begin();it!=cmds.end();it++) { if (!strcasecmp((*it).c_str(),name)) { cmd_it itnext=it;itnext++; @@ -427,11 +430,11 @@ bool CommandLine::FindEntry(char * name,cmd_it & it,bool neednext) { return false; } -bool CommandLine::FindStringBegin(char * begin,std::string & value, bool remove) { - cmd_it it; - for (it=cmds.begin();it!=cmds.end();it++) { - if (strncmp(begin,(*it).c_str(),strlen(begin))==0) { - value=((*it).c_str()+strlen(begin)); +bool CommandLine::FindStringBegin(char const* const begin,std::string & value, bool remove) { + size_t len = strlen(begin); + for (cmd_it it=cmds.begin();it!=cmds.end();it++) { + if (strncmp(begin,(*it).c_str(),len)==0) { + value=((*it).c_str() + len); if (remove) cmds.erase(it); return true; } @@ -439,7 +442,7 @@ bool CommandLine::FindStringBegin(char * begin,std::string & value, bool remove) return false; } -bool CommandLine::FindStringRemain(char * name,std::string & value) { +bool CommandLine::FindStringRemain(char const * const name,std::string & value) { cmd_it it;value=""; if (!FindEntry(name,it)) return false; it++; @@ -466,7 +469,7 @@ unsigned int CommandLine::GetCount(void) { return cmds.size(); } -CommandLine::CommandLine(int argc,char * argv[]) { +CommandLine::CommandLine(int argc,char const * const argv[]) { if (argc>0) { file_name=argv[0]; } @@ -478,13 +481,14 @@ CommandLine::CommandLine(int argc,char * argv[]) { } -CommandLine::CommandLine(char * name,char * cmdline) { +CommandLine::CommandLine(char const * const name,char const * const cmdline) { if (name) file_name=name; /* Parse the cmds and put them in the list */ bool inword,inquote;char c; inword=false;inquote=false; std::string str; - while ((c=*cmdline)!=0) { + const char * c_cmdline=cmdline; + while ((c=*c_cmdline)!=0) { if (inquote) { if (c!='"') str+=c; else { @@ -502,7 +506,14 @@ CommandLine::CommandLine(char * name,char * cmdline) { } else if (c=='"') { inquote=true;} else if (c!=' ') { str+=c;inword=true;} - cmdline++; + c_cmdline++; } if (inword || inquote) cmds.push_back(str); } + +void CommandLine::Shift(unsigned int amount) { + while(amount--) { + file_name = cmds.size()?(*(cmds.begin())):""; + if(cmds.size()) cmds.erase(cmds.begin()); + } +} diff --git a/src/misc/support.cpp b/src/misc/support.cpp index 0ac9ad2..934e048 100644 --- a/src/misc/support.cpp +++ b/src/misc/support.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: support.cpp,v 1.29 2006/02/09 11:47:57 qbix79 Exp $ */ +/* $Id: support.cpp,v 1.31 2007/01/08 19:45:41 qbix79 Exp $ */ #include #include @@ -65,7 +65,7 @@ char *trim(char *str) { } -bool ScanCMDBool(char * cmd,char * check) { +bool ScanCMDBool(char * cmd,char const * const check) { char * scan=cmd;size_t c_len=strlen(check); while ((scan=strchr(scan,'/'))) { /* found a / now see behind it */ @@ -145,7 +145,7 @@ double ConvDblWord(char * word) { static char buf[1024]; //greater scope as else it doesn't always gets thrown right (linux/gcc2.95) -void E_Exit(char * format,...) { +void E_Exit(const char * format,...) { #if C_DEBUG && C_HEAVY_DEBUG DEBUG_HeavyWriteLogInstruction(); #endif diff --git a/src/platform/Makefile.in b/src/platform/Makefile.in index 9758a77..6823dd2 100644 --- a/src/platform/Makefile.in +++ b/src/platform/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -20,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -33,31 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/platform -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-exec-recursive install-info-recursive \ - install-recursive installcheck-recursive installdirs-recursive \ - pdf-recursive ps-recursive uninstall-info-recursive \ - uninstall-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -84,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -114,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -124,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -133,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -159,38 +139,28 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SUBDIRS = visualc +subdir = src/platform +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/platform/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/platform/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu src/platform/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd @@ -200,13 +170,7 @@ uninstall-info-am: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -218,7 +182,7 @@ $(RECURSIVE_TARGETS): local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -226,13 +190,7 @@ $(RECURSIVE_TARGETS): mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -253,7 +211,7 @@ maintainer-clean-recursive: local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -264,6 +222,14 @@ ctags-recursive: test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -272,22 +238,19 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ - empty_fix=.; \ else \ include_option=--include; \ - empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ + test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ @@ -297,11 +260,10 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -324,6 +286,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -337,7 +303,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -352,17 +318,15 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(mkdir_p) "$(distdir)/$$subdir" \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ @@ -372,6 +336,7 @@ check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: + install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -391,7 +356,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -408,8 +373,6 @@ dvi: dvi-recursive dvi-am: -html: html-recursive - info: info-recursive info-am: @@ -444,17 +407,20 @@ uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ - clean clean-generic clean-recursive ctags ctags-recursive \ - distclean distclean-generic distclean-recursive distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-recursive ctags ctags-recursive distclean \ + distclean-generic distclean-recursive distclean-tags distdir \ + dvi dvi-am dvi-recursive info info-am info-recursive install \ + install-am install-data install-data-am install-data-recursive \ + install-exec install-exec-am install-exec-recursive \ + install-info install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-info-am + mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ + ps-recursive tags tags-recursive uninstall uninstall-am \ + uninstall-info-am uninstall-info-recursive uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/platform/visualc/Makefile.in b/src/platform/visualc/Makefile.in index c258d56..5942280 100644 --- a/src/platform/visualc/Makefile.in +++ b/src/platform/visualc/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -20,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -33,22 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/platform/visualc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -75,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -105,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -115,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -124,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -150,38 +139,21 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ EXTRA_DIST = dirent.c dirent.h unistd.h config.h ntddscsi.h ntddcdrm.h +subdir = src/platform/visualc +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/platform/visualc/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/platform/visualc/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu src/platform/visualc/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: tags: TAGS TAGS: @@ -189,6 +161,10 @@ TAGS: ctags: CTAGS CTAGS: +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -202,7 +178,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -220,6 +196,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile + installdirs: install: install-am install-exec: install-exec-am @@ -240,7 +217,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -257,8 +234,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -292,8 +267,8 @@ ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ diff --git a/src/platform/visualc/config.h b/src/platform/visualc/config.h index f80fb7c..45cfa5b 100644 --- a/src/platform/visualc/config.h +++ b/src/platform/visualc/config.h @@ -1,6 +1,6 @@ #define INLINE __forceinline -#define VERSION "0.63" +#define VERSION "0.70" /* Define to 1 to enable internal debugger, requires libcurses */ @@ -54,6 +54,10 @@ #define GCC_ATTRIBUTE(x) /* attribute not supported */ #define GCC_UNLIKELY(x) (x) +#if defined(_MSC_VER) && (_MSC_VER >= 1400) +#pragma warning(disable : 4996) +#endif + typedef double Real64; /* The internal types */ typedef unsigned char Bit8u; diff --git a/src/shell/Makefile.in b/src/shell/Makefile.in index 33a53df..0861bff 100644 --- a/src/shell/Makefile.in +++ b/src/shell/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -14,8 +14,6 @@ @SET_MAKE@ -SOURCES = $(libshell_a_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -23,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -36,40 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = src/shell -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -AR = ar -ARFLAGS = cru -libshell_a_AR = $(AR) $(ARFLAGS) -libshell_a_LIBADD = -am_libshell_a_OBJECTS = shell.$(OBJEXT) shell_batch.$(OBJEXT) \ - shell_cmds.$(OBJEXT) shell_misc.$(OBJEXT) -libshell_a_OBJECTS = $(am_libshell_a_OBJECTS) -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ - -o $@ -SOURCES = $(libshell_a_SOURCES) -DIST_SOURCES = $(libshell_a_SOURCES) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -96,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -126,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -136,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -145,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -171,41 +139,47 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ AM_CPPFLAGS = -I$(top_srcdir)/include + noinst_LIBRARIES = libshell.a libshell_a_SOURCES = shell.cpp shell_batch.cpp shell_cmds.cpp shell_misc.cpp +subdir = src/shell +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libshell_a_AR = $(AR) cru +libshell_a_LIBADD = +am_libshell_a_OBJECTS = shell.$(OBJEXT) shell_batch.$(OBJEXT) \ + shell_cmds.$(OBJEXT) shell_misc.$(OBJEXT) +libshell_a_OBJECTS = $(am_libshell_a_OBJECTS) + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/shell.Po ./$(DEPDIR)/shell_batch.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/shell_cmds.Po ./$(DEPDIR)/shell_misc.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ +DIST_SOURCES = $(libshell_a_SOURCES) +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +SOURCES = $(libshell_a_SOURCES) + all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits src/shell/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits src/shell/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; + $(AUTOMAKE) --gnu src/shell/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -215,7 +189,7 @@ libshell.a: $(libshell_a_OBJECTS) $(libshell_a_DEPENDENCIES) $(RANLIB) libshell.a mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -226,20 +200,36 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_misc.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: -@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -248,7 +238,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -260,11 +249,10 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -287,6 +275,10 @@ GTAGS: distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -300,7 +292,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -318,6 +310,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) + installdirs: install: install-am install-exec: install-exec-am @@ -338,7 +331,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -357,8 +350,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -394,14 +385,13 @@ uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-exec install-exec-am install-info \ - install-info-am install-man install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-info-am + distclean-generic distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/shell/shell.cpp b/src/shell/shell.cpp index 6465504..f41c491 100644 --- a/src/shell/shell.cpp +++ b/src/shell/shell.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell.cpp,v 1.72 2006/02/26 15:58:49 qbix79 Exp $ */ +/* $Id: shell.cpp,v 1.84 2007/02/22 08:34:10 qbix79 Exp $ */ #include #include @@ -48,16 +48,11 @@ typedef std::list::iterator auto_it; void VFILE_Remove(const char *name); -void AutoexecObject::Install(char* line,...) { - if(GCC_UNLIKELY(installed)) E_Exit("autoexec: allready created %s",buf); +void AutoexecObject::Install(const std::string &in) { + if(GCC_UNLIKELY(installed)) E_Exit("autoexec: allready created %s",buf.c_str()); installed = true; - va_list msg; - - va_start(msg,line); - vsprintf(buf,line,msg); - va_end(msg); - autoexec_strings.push_back(std::string(buf)); - + buf = in; + autoexec_strings.push_back(buf); this->CreateAutoexec(); //autoexec.bat is normally created AUTOEXEC_Init. @@ -65,7 +60,10 @@ void AutoexecObject::Install(char* line,...) { //we have to update the envirionment to display changes if(first_shell) { - char buf2[256]; strcpy(buf2,buf);//used in shell.h + //create a copy as the string will be modified + std::string::size_type n = buf.size(); + char* buf2 = new char[n + 1]; + safe_strncpy(buf2, buf.c_str(), n + 1); if((strncasecmp(buf2,"set ",4) == 0) && (strlen(buf2) > 4)){ char* after_set = buf2 + 4;//move to variable that is being set char* test = strpbrk(after_set,"="); @@ -74,18 +72,15 @@ void AutoexecObject::Install(char* line,...) { //If the shell is running/exists update the environment first_shell->SetEnv(after_set,test); } + delete [] buf2; } } -void AutoexecObject::InstallBefore(char* line,...) { - if(GCC_UNLIKELY(installed)) E_Exit("autoexec: allready created %s",buf); +void AutoexecObject::InstallBefore(const std::string &in) { + if(GCC_UNLIKELY(installed)) E_Exit("autoexec: allready created %s",buf.c_str()); installed = true; - va_list msg; - - va_start(msg,line); - vsprintf(buf,line,msg); - va_end(msg); - autoexec_strings.push_front(std::string(buf)); + buf = in; + autoexec_strings.push_front(buf); this->CreateAutoexec(); } @@ -98,7 +93,7 @@ void AutoexecObject::CreateAutoexec(void) { size_t auto_len; for(auto_it it= autoexec_strings.begin(); it != autoexec_strings.end(); it++) { auto_len = strlen(autoexec_data); - if ((auto_len+strlen((*it).c_str())+3)>AUTOEXEC_SIZE) { + if ((auto_len+(*it).length()+3)>AUTOEXEC_SIZE) { E_Exit("SYSTEM:Autoexec.bat file overflow"); } sprintf((autoexec_data+auto_len),"%s\r\n",(*it).c_str()); @@ -113,15 +108,19 @@ AutoexecObject::~AutoexecObject(){ for(auto_it it = autoexec_strings.begin(); it != autoexec_strings.end(); ) { if((*it) == buf) { it = autoexec_strings.erase(it); + std::string::size_type n = buf.size(); + char* buf2 = new char[n + 1]; + safe_strncpy(buf2, buf.c_str(), n + 1); // If it's a environment variable remove it from there as well - if((strncasecmp(buf,"set ",4) == 0) && (strlen(buf) > 4)){ - char* after_set = buf + 4;//move to variable that is being set + if((strncasecmp(buf2,"set ",4) == 0) && (strlen(buf2) > 4)){ + char* after_set = buf2 + 4;//move to variable that is being set char* test = strpbrk(after_set,"="); if(!test) continue; *test = 0; //If the shell is running/exists update the environment if(first_shell) first_shell->SetEnv(after_set,""); } + delete [] buf2; } else it++; } this->CreateAutoexec(); @@ -263,7 +262,7 @@ void DOS_Shell::ParseLine(char * line) { void DOS_Shell::RunInternal(void) { - char input_line[CMD_MAXLINE]; + char input_line[CMD_MAXLINE] = {0}; std::string line; while(bf && bf->ReadLine(input_line)) { @@ -281,7 +280,7 @@ void DOS_Shell::RunInternal(void) void DOS_Shell::Run(void) { - char input_line[CMD_MAXLINE]; + char input_line[CMD_MAXLINE] = {0}; std::string line; if (cmd->FindStringRemain("/C",line)) { strcpy(input_line,line.c_str()); @@ -292,12 +291,15 @@ void DOS_Shell::Run(void) { return; } /* Start a normal shell and check for a first command init */ - WriteOut(MSG_Get("SHELL_STARTUP_BEGIN")); + if(machine != MCH_HERC) { //Hide it for hercules as that looks too weird + WriteOut(MSG_Get("SHELL_STARTUP_BEGIN"),VERSION); #if C_DEBUG - WriteOut(MSG_Get("SHELL_STARTUP_DEBUG")); + WriteOut(MSG_Get("SHELL_STARTUP_DEBUG")); #endif - if(machine == MCH_CGA) WriteOut(MSG_Get("SHELL_STARTUP_CGA")); - WriteOut(MSG_Get("SHELL_STARTUP_END")); + if(machine == MCH_CGA) WriteOut(MSG_Get("SHELL_STARTUP_CGA")); + WriteOut(MSG_Get("SHELL_STARTUP_END")); + } + if (cmd->FindString("/INIT",line,true)) { strcpy(input_line,line.c_str()); line.erase(); @@ -320,7 +322,7 @@ void DOS_Shell::Run(void) { if (echo) ShowPrompt(); InputCommand(input_line); ParseLine(input_line); - if (echo) WriteOut("\n"); + if (echo && !bf) WriteOut("\n"); } } while (!exit); } @@ -350,15 +352,20 @@ public: if(echo_off) autoexec_echo.InstallBefore("@echo off"); /* Install the stuff from the configfile */ - autoexec[0].Install("%s",extra); + autoexec[0].Install(section->data); } /* Check to see for extra command line options to be added (before the command specified on commandline) */ /* Maximum of extra commands: 10 */ Bitu i = 1; - while (control->cmdline->FindString("-c",line,true) && (i <= 11)) - autoexec[i++].Install((char *)line.c_str()); - + while (control->cmdline->FindString("-c",line,true) && (i <= 11)) { +#if defined (WIN32) || defined (OS2) + //replace single with double quotes so that mount commands can contain spaces + for(Bitu temp = 0;temp < line.size();++temp) if(line[temp] == '\'') line[temp]='\"'; +#endif //Linux users can simply use \" in their shell + autoexec[i++].Install(line); + } + /* Check for the -exit switch which causes dosbox to when the command on the commandline has finished */ bool addexit = control->cmdline->FindExist("-exit",true); @@ -375,7 +382,7 @@ public: if (stat(buffer,&test)) goto nomount; } if (test.st_mode & S_IFDIR) { - autoexec[12].Install("MOUNT C \"%s\"",buffer); + autoexec[12].Install(std::string("MOUNT C \"") + buffer + "\""); autoexec[13].Install("C:"); } else { char* name = strrchr(buffer,CROSS_FILESPLIT); @@ -390,17 +397,14 @@ public: } *name++ = 0; if (access(buffer,F_OK)) goto nomount; - autoexec[12].Install("MOUNT C \"%s\"",buffer); + autoexec[12].Install(std::string("MOUNT C \"") + buffer + "\""); autoexec[13].Install("C:"); upcase(name); if(strstr(name,".BAT") == 0) { autoexec[14].Install(name); } else { - /* BATch files are called else exit will not work */ - char call[CROSS_LEN] = { 0 }; - strcpy(call,"CALL "); - strcat(call,name); - autoexec[14].Install(call); + /* BATch files are called else exit will not work */ + autoexec[14].Install(std::string("CALL ") + name); } if(addexit) autoexec[15].Install("exit"); } @@ -424,10 +428,11 @@ static char * init_line="/INIT AUTOEXEC.BAT"; void SHELL_Init() { /* Add messages */ MSG_Add("SHELL_ILLEGAL_PATH","Illegal Path.\n"); - MSG_Add("SHELL_CMD_HELP","supported commands are:\n"); + MSG_Add("SHELL_CMD_HELP","If you want a list of all supported commands type \033[33;1mhelp /all\033[0m .\nA short list of the most often used commands:\n"); MSG_Add("SHELL_CMD_ECHO_ON","ECHO is on.\n"); MSG_Add("SHELL_CMD_ECHO_OFF","ECHO is off.\n"); MSG_Add("SHELL_ILLEGAL_SWITCH","Illegal switch: %s.\n"); + MSG_Add("SHELL_MISSING_PARAMETER","Required parameter missing.\n"); MSG_Add("SHELL_CMD_CHDIR_ERROR","Unable to change to: %s.\n"); MSG_Add("SHELL_CMD_CHDIR_HINT","To change to different drive type \033[31m%c:\033[0m\n"); MSG_Add("SHELL_CMD_MKDIR_ERROR","Unable to make: %s.\n"); @@ -459,10 +464,11 @@ void SHELL_Init() { "\033[44;1m\xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBB\n" - "\xBA \033[32mDOSBox Shell v" VERSION "\033[37m \xBA\n" - "\xBA DOSBox runs real and protected mode games. \xBA\n" + "\xBA \033[32mWelcome to DOSBox v%-8s\033[37m \xBA\n" + "\xBA \xBA\n" +// "\xBA DOSBox runs real and protected mode games. \xBA\n" + "\xBA For a short introduction for new users type: \033[33mINTRO\033[37m \xBA\n" "\xBA For supported shell commands type: \033[33mHELP\033[37m \xBA\n" - "\xBA For a short introduction type: \033[33mINTRO\033[37m \xBA\n" "\xBA \xBA\n" "\xBA If you want more speed, try \033[31mctrl-F8\033[37m and \033[31mctrl-F12\033[37m. \xBA\n" "\xBA To activate the keymapper \033[31mctrl-F1\033[37m. \xBA\n" @@ -485,29 +491,53 @@ void SHELL_Init() { "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBC\033[0m\n" //"\n" //Breaks the startup message if you type a mount and a drive change. ); - MSG_Add("SHELL_CMD_CHDIR_HELP","Change Directory.\n"); + MSG_Add("SHELL_CMD_CHDIR_HELP","Displays/changes the current directory.\n"); + MSG_Add("SHELL_CMD_CHDIR_HELP_LONG","CHDIR [drive:][path]\n" + "CHDIR [..]\n" + "CD [drive:][path]\n" + "CD [..]\n\n" + " .. Specifies that you want to change to the parent directory.\n\n" + "Type CD drive: to display the current directory in the specified drive.\n" + "Type CD without parameters to display the current drive and directory.\n"); MSG_Add("SHELL_CMD_CLS_HELP","Clear screen.\n"); MSG_Add("SHELL_CMD_DIR_HELP","Directory View.\n"); MSG_Add("SHELL_CMD_ECHO_HELP","Display messages and enable/disable command echoing.\n"); MSG_Add("SHELL_CMD_EXIT_HELP","Exit from the shell.\n"); MSG_Add("SHELL_CMD_HELP_HELP","Show help.\n"); MSG_Add("SHELL_CMD_MKDIR_HELP","Make Directory.\n"); + MSG_Add("SHELL_CMD_MKDIR_HELP_LONG","MKDIR [drive:][path]\n" + "MD [drive:][path]\n"); MSG_Add("SHELL_CMD_RMDIR_HELP","Remove Directory.\n"); + MSG_Add("SHELL_CMD_RMDIR_HELP_LONG","RMDIR [drive:][path]\n" + "RD [drive:][path]\n"); MSG_Add("SHELL_CMD_SET_HELP","Change environment variables.\n"); MSG_Add("SHELL_CMD_IF_HELP","Performs conditional processing in batch programs.\n"); MSG_Add("SHELL_CMD_GOTO_HELP","Jump to a labeled line in a batch script.\n"); + MSG_Add("SHELL_CMD_SHIFT_HELP","Leftshift commandline parameters in a batch script.\n"); MSG_Add("SHELL_CMD_TYPE_HELP","Display the contents of a text-file.\n"); + MSG_Add("SHELL_CMD_TYPE_HELP_LONG","TYPE [drive:][path][filename]\n"); MSG_Add("SHELL_CMD_REM_HELP","Add comments in a batch file.\n"); + MSG_Add("SHELL_CMD_REM_HELP_LONG","REM [comment]\n"); MSG_Add("SHELL_CMD_NO_WILD","This is a simple version of the command, no wildcards allowed!\n"); - MSG_Add("SHELL_CMD_RENAME_HELP","Renames files.\n"); - MSG_Add("SHELL_CMD_DELETE_HELP","Removes files.\n"); + MSG_Add("SHELL_CMD_RENAME_HELP","Renames one or more files.\n"); + MSG_Add("SHELL_CMD_RENAME_HELP_LONG","RENAME [drive:][path]filename1 filename2.\n" + "REN [drive:][path]filename1 filename2.\n\n" + "Note that you can not specify a new drive or path for your destination file.\n"); + MSG_Add("SHELL_CMD_DELETE_HELP","Removes one or more files.\n"); MSG_Add("SHELL_CMD_COPY_HELP","Copy files.\n"); MSG_Add("SHELL_CMD_CALL_HELP","Start a batch file from within another batch file.\n"); MSG_Add("SHELL_CMD_SUBST_HELP","Assign an internal directory to a drive.\n"); - MSG_Add("SHELL_CMD_LOADHIGH_HELP","Run a program. For batch file compatibility only.\n"); + MSG_Add("SHELL_CMD_LOADHIGH_HELP","Loads a program into upper memory (requires xms=true,umb=true).\n"); MSG_Add("SHELL_CMD_CHOICE_HELP","Waits for a keypress and sets ERRORLEVEL.\n"); + MSG_Add("SHELL_CMD_CHOICE_HELP_LONG","CHOICE [/C:choices] [/N] [/S] text\n" + " /C[:]choices - Specifies allowable keys. Default is: yn.\n" + " /N - Do not display the choices at end of prompt.\n" + " /S - Enables case-sensitive choices to be selected.\n" + " text - The text to display as a prompt.\n"); MSG_Add("SHELL_CMD_ATTRIB_HELP","Does nothing. Provided for compatibility.\n"); MSG_Add("SHELL_CMD_PATH_HELP","Provided for compatibility.\n"); + MSG_Add("SHELL_CMD_VER_HELP","View and set the reported DOS version.\n"); + MSG_Add("SHELL_CMD_VER_VER","DOSBox version %s. Reported DOS version %d.%d.\n"); /* Regular startup */ call_shellstop=CALLBACK_Allocate(); diff --git a/src/shell/shell_batch.cpp b/src/shell/shell_batch.cpp index 445ede5..289289c 100644 --- a/src/shell/shell_batch.cpp +++ b/src/shell/shell_batch.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell_batch.cpp,v 1.20 2006/02/23 08:13:14 qbix79 Exp $ */ +/* $Id: shell_batch.cpp,v 1.23 2007/01/08 19:45:42 qbix79 Exp $ */ #include #include @@ -43,7 +43,7 @@ BatchFile::~BatchFile() { } bool BatchFile::ReadLine(char * line) { - Bit8u c;Bit16u n; + Bit8u c=0;Bit16u n=1; char temp[CMD_MAXLINE]; emptyline: char * cmd_write=temp; @@ -149,3 +149,6 @@ again: goto again; return false; }; +void BatchFile::Shift(void) { + cmd->Shift(1); +} diff --git a/src/shell/shell_cmds.cpp b/src/shell/shell_cmds.cpp index cb3a604..e5199f2 100644 --- a/src/shell/shell_cmds.cpp +++ b/src/shell/shell_cmds.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,11 +16,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell_cmds.cpp,v 1.62 2006/02/24 11:50:11 qbix79 Exp $ */ +/* $Id: shell_cmds.cpp,v 1.73 2007/01/21 16:18:12 qbix79 Exp $ */ #include #include - +#include +#include #include "shell.h" #include "callback.h" #include "regs.h" @@ -28,43 +29,45 @@ #include "support.h" static SHELL_Cmd cmd_list[]={ -{ "CHDIR", 0, &DOS_Shell::CMD_CHDIR, "SHELL_CMD_CHDIR_HELP"}, -{ "CD", 1, &DOS_Shell::CMD_CHDIR, "SHELL_CMD_CHDIR_HELP"}, +{ "CHDIR", 1, &DOS_Shell::CMD_CHDIR, "SHELL_CMD_CHDIR_HELP"}, +{ "CD", 0, &DOS_Shell::CMD_CHDIR, "SHELL_CMD_CHDIR_HELP"}, { "CLS", 0, &DOS_Shell::CMD_CLS, "SHELL_CMD_CLS_HELP"}, { "COPY", 0, &DOS_Shell::CMD_COPY, "SHELL_CMD_COPY_HELP"}, { "DIR", 0, &DOS_Shell::CMD_DIR, "SHELL_CMD_DIR_HELP"}, -{ "DEL", 1, &DOS_Shell::CMD_DELETE, "SHELL_CMD_DELETE_HELP"}, -{ "DELETE", 0, &DOS_Shell::CMD_DELETE, "SHELL_CMD_DELETE_HELP"}, +{ "DEL", 0, &DOS_Shell::CMD_DELETE, "SHELL_CMD_DELETE_HELP"}, +{ "DELETE", 1, &DOS_Shell::CMD_DELETE, "SHELL_CMD_DELETE_HELP"}, { "ERASE", 1, &DOS_Shell::CMD_DELETE, "SHELL_CMD_DELETE_HELP"}, -{ "ECHO", 0, &DOS_Shell::CMD_ECHO, "SHELL_CMD_ECHO_HELP"}, +{ "ECHO", 1, &DOS_Shell::CMD_ECHO, "SHELL_CMD_ECHO_HELP"}, { "EXIT", 0, &DOS_Shell::CMD_EXIT, "SHELL_CMD_EXIT_HELP"}, { "HELP", 1, &DOS_Shell::CMD_HELP, "SHELL_CMD_HELP_HELP"}, -{ "MKDIR", 0, &DOS_Shell::CMD_MKDIR, "SHELL_CMD_MKDIR_HELP"}, -{ "MD", 1, &DOS_Shell::CMD_MKDIR, "SHELL_CMD_MKDIR_HELP"}, -{ "RMDIR", 0, &DOS_Shell::CMD_RMDIR, "SHELL_CMD_RMDIR_HELP"}, -{ "RD", 1, &DOS_Shell::CMD_RMDIR, "SHELL_CMD_RMDIR_HELP"}, -{ "SET", 0, &DOS_Shell::CMD_SET, "SHELL_CMD_SET_HELP"}, -{ "IF", 0, &DOS_Shell::CMD_IF, "SHELL_CMD_IF_HELP"}, -{ "GOTO", 0, &DOS_Shell::CMD_GOTO, "SHELL_CMD_GOTO_HELP"}, +{ "MKDIR", 1, &DOS_Shell::CMD_MKDIR, "SHELL_CMD_MKDIR_HELP"}, +{ "MD", 0, &DOS_Shell::CMD_MKDIR, "SHELL_CMD_MKDIR_HELP"}, +{ "RMDIR", 1, &DOS_Shell::CMD_RMDIR, "SHELL_CMD_RMDIR_HELP"}, +{ "RD", 0, &DOS_Shell::CMD_RMDIR, "SHELL_CMD_RMDIR_HELP"}, +{ "SET", 1, &DOS_Shell::CMD_SET, "SHELL_CMD_SET_HELP"}, +{ "IF", 1, &DOS_Shell::CMD_IF, "SHELL_CMD_IF_HELP"}, +{ "GOTO", 1, &DOS_Shell::CMD_GOTO, "SHELL_CMD_GOTO_HELP"}, +{ "SHIFT", 1, &DOS_Shell::CMD_SHIFT, "SHELL_CMD_SHIFT_HELP"}, { "TYPE", 0, &DOS_Shell::CMD_TYPE, "SHELL_CMD_TYPE_HELP"}, -{ "REM", 0, &DOS_Shell::CMD_REM, "SHELL_CMD_REM_HELP"}, -{ "RENAME", 0, &DOS_Shell::CMD_RENAME, "SHELL_CMD_RENAME_HELP"}, -{ "REN", 1, &DOS_Shell::CMD_RENAME, "SHELL_CMD_RENAME_HELP"}, -{ "PAUSE", 0, &DOS_Shell::CMD_PAUSE, "SHELL_CMD_PAUSE_HELP"}, -{ "CALL", 0, &DOS_Shell::CMD_CALL, "SHELL_CMD_CALL_HELP"}, -{ "SUBST", 0, &DOS_Shell::CMD_SUBST, "SHELL_CMD_SUBST_HELP"}, +{ "REM", 1, &DOS_Shell::CMD_REM, "SHELL_CMD_REM_HELP"}, +{ "RENAME", 1, &DOS_Shell::CMD_RENAME, "SHELL_CMD_RENAME_HELP"}, +{ "REN", 0, &DOS_Shell::CMD_RENAME, "SHELL_CMD_RENAME_HELP"}, +{ "PAUSE", 1, &DOS_Shell::CMD_PAUSE, "SHELL_CMD_PAUSE_HELP"}, +{ "CALL", 1, &DOS_Shell::CMD_CALL, "SHELL_CMD_CALL_HELP"}, +{ "SUBST", 1, &DOS_Shell::CMD_SUBST, "SHELL_CMD_SUBST_HELP"}, { "LOADHIGH", 0, &DOS_Shell::CMD_LOADHIGH, "SHELL_CMD_LOADHIGH_HELP"}, { "LH", 1, &DOS_Shell::CMD_LOADHIGH, "SHELL_CMD_LOADHIGH_HELP"}, { "CHOICE", 0, &DOS_Shell::CMD_CHOICE, "SHELL_CMD_CHOICE_HELP"}, -{ "ATTRIB", 0, &DOS_Shell::CMD_ATTRIB, "SHELL_CMD_ATTRIB_HELP"}, +{ "ATTRIB", 1, &DOS_Shell::CMD_ATTRIB, "SHELL_CMD_ATTRIB_HELP"}, { "PATH", 1, &DOS_Shell::CMD_PATH, "SHELL_CMD_PATH_HELP"}, +{ "VER", 0, &DOS_Shell::CMD_VER, "SHELL_CMD_VER_HELP"}, {0,0,0,0} }; bool DOS_Shell::CheckConfig(char* cmd,char*line) { Section* test = control->GetSectionFromProperty(cmd); if(!test) return false; if(line && !line[0]) { - char* val = test->GetPropValue(cmd); + char const* val = test->GetPropValue(cmd); if(val) WriteOut("%s\n",val); return true; } @@ -95,7 +98,7 @@ void DOS_Shell::DoCommand(char * line) { } cmd_index++; } - } + } *cmd_write++=*line++; } *cmd_write=0; @@ -115,13 +118,24 @@ void DOS_Shell::DoCommand(char * line) { WriteOut(MSG_Get("SHELL_EXECUTE_ILLEGAL_COMMAND"),cmd); } +#define HELP(command) \ + if (ScanCMDBool(args,"?")) { \ + WriteOut(MSG_Get("SHELL_CMD_" command "_HELP")); \ + const char* long_m = MSG_Get("SHELL_CMD_" command "_HELP_LONG"); \ + WriteOut("\n"); \ + if(strcmp("Message not Found!\n",long_m)) WriteOut(long_m); \ + else WriteOut(command "\n"); \ + return; \ + } void DOS_Shell::CMD_CLS(char * args) { + HELP("CLS"); reg_ax=0x0003; CALLBACK_RunRealInt(0x10); }; void DOS_Shell::CMD_DELETE(char * args) { + HELP("DELETE"); /* Command uses dta so set it to our internal dta */ RealPt save_dta=dos.dta(); dos.dta(dos.tables.tempdta); @@ -161,17 +175,22 @@ void DOS_Shell::CMD_DELETE(char * args) { } void DOS_Shell::CMD_HELP(char * args){ + HELP("HELP"); + bool optall=ScanCMDBool(args,"ALL"); /* Print the help */ - WriteOut(MSG_Get("SHELL_CMD_HELP")); - Bit32u cmd_index=0; + if(!optall) WriteOut(MSG_Get("SHELL_CMD_HELP")); + Bit32u cmd_index=0,write_count=0; while (cmd_list[cmd_index].name) { - if (!cmd_list[cmd_index].flags) WriteOut("%-8s %s",cmd_list[cmd_index].name,MSG_Get(cmd_list[cmd_index].help)); + if (optall || !cmd_list[cmd_index].flags) { + WriteOut("<\033[34;1m%-8s\033[0m> %s",cmd_list[cmd_index].name,MSG_Get(cmd_list[cmd_index].help)); + if(!(++write_count%22)) CMD_PAUSE(""); + } cmd_index++; } - } void DOS_Shell::CMD_RENAME(char * args){ + HELP("RENAME"); StripSpaces(args); if(!*args) {SyntaxError();return;} if((strchr(args,'*')!=NULL) || (strchr(args,'?')!=NULL) ) { WriteOut(MSG_Get("SHELL_CMD_NO_WILD"));return;} @@ -205,6 +224,7 @@ void DOS_Shell::CMD_RENAME(char * args){ } void DOS_Shell::CMD_ECHO(char * args){ + HELP("ECHO"); if (!*args) { if (echo) { WriteOut(MSG_Get("SHELL_CMD_ECHO_ON"));} else { WriteOut(MSG_Get("SHELL_CMD_ECHO_OFF"));} @@ -212,7 +232,7 @@ void DOS_Shell::CMD_ECHO(char * args){ } char buffer[512]; char* pbuffer = buffer; - strcpy(buffer,args); + safe_strncpy(buffer,args,512); StripSpaces(pbuffer); if (strcasecmp(pbuffer,"OFF")==0) { echo=false; @@ -228,10 +248,12 @@ void DOS_Shell::CMD_ECHO(char * args){ void DOS_Shell::CMD_EXIT(char * args) { - exit=true; + HELP("EXIT"); + exit = true; }; void DOS_Shell::CMD_CHDIR(char * args) { + HELP("CHDIR"); StripSpaces(args); if (!*args) { Bit8u drive=DOS_GetDefaultDrive()+'A'; @@ -246,6 +268,7 @@ void DOS_Shell::CMD_CHDIR(char * args) { }; void DOS_Shell::CMD_MKDIR(char * args) { + HELP("MKDIR"); StripSpaces(args); char * rem=ScanCMDRemain(args); if (rem) { @@ -258,6 +281,7 @@ void DOS_Shell::CMD_MKDIR(char * args) { }; void DOS_Shell::CMD_RMDIR(char * args) { + HELP("RMDIR"); StripSpaces(args); char * rem=ScanCMDRemain(args); if (rem) { @@ -294,6 +318,7 @@ static void FormatNumber(Bitu num,char * buf) { } void DOS_Shell::CMD_DIR(char * args) { + HELP("DIR"); char numformat[16]; char path[DOS_PATHLENGTH]; @@ -410,7 +435,7 @@ void DOS_Shell::CMD_DIR(char * args) { } if(optP) { if(!(++p_count%(22*w_size))) { - CMD_PAUSE(args); + CMD_PAUSE(""); } } } while ( (ret=DOS_FindNext()) ); @@ -433,8 +458,17 @@ void DOS_Shell::CMD_DIR(char * args) { WriteOut(MSG_Get("SHELL_CMD_DIR_BYTES_FREE"),dir_count,numformat); dos.dta(save_dta); } +struct copysource { + std::string filename; + bool concat; + copysource(std::string filein,bool concatin): + filename(filein),concat(concatin){ }; + copysource():filename(""),concat(false){ }; +}; + void DOS_Shell::CMD_COPY(char * args) { + HELP("COPY"); static char defaulttarget[] = "."; StripSpaces(args); /* Command uses dta so set it to our internal dta */ @@ -443,10 +477,13 @@ void DOS_Shell::CMD_COPY(char * args) { DOS_DTA dta(dos.dta()); Bit32u size;Bit16u date;Bit16u time;Bit8u attr; char name[DOS_NAMELENGTH_ASCII]; - + std::vector sources; // ignore /b and /t switches: always copy binary - ScanCMDBool(args,"B"); - ScanCMDBool(args,"T"); + while(ScanCMDBool(args,"B")) ; + while(ScanCMDBool(args,"T")) ; //Shouldn't this be A ? + while(ScanCMDBool(args,"A")) ; + ScanCMDBool(args,"Y"); + ScanCMDBool(args,"-Y"); char * rem=ScanCMDRemain(args); if (rem) { @@ -454,100 +491,143 @@ void DOS_Shell::CMD_COPY(char * args) { dos.dta(save_dta); return; } - // source/target - char* source = StripWord(args); - char* target = NULL; - if (args && *args) target = StripWord(args); - if (!target || !*target) target = defaulttarget; - - // Target and Source have to be there - if (!source || !strlen(source)) { - WriteOut(MSG_Get("SHELL_CMD_FILE_NOT_FOUND"),args); + // Gather all sources (extension to copy more then 1 file specified at commandline) + // Concatating files go as follows: All parts except for the last bear the concat flag. + // This construction allows them to be counted (only the non concat set) + char* source_p = NULL; + while ( (source_p = StripWord(args)) && *source_p ) { + do { + char* plus = strchr(source_p,'+'); + if(plus) *plus++ = 0; + sources.push_back(copysource(source_p,(plus)?true:false)); + source_p = plus; + } while(source_p && *source_p); + } + // At least one source has to be there + if (!sources.size() || !sources[0].filename.size()) { + WriteOut(MSG_Get("SHELL_MISSING_PARAMETER")); dos.dta(save_dta); - return; + return; }; - /* Make a full path in the args */ - char pathSource[DOS_PATHLENGTH]; - char pathTarget[DOS_PATHLENGTH]; - - if (!DOS_Canonicalize(source,pathSource)) { - WriteOut(MSG_Get("SHELL_ILLEGAL_PATH")); - dos.dta(save_dta); - return; - } - // cut search pattern - char* pos = strrchr(pathSource,'\\'); - if (pos) *(pos+1) = 0; - - if (!DOS_Canonicalize(target,pathTarget)) { - WriteOut(MSG_Get("SHELL_ILLEGAL_PATH")); - dos.dta(save_dta); - return; - } - char* temp = strstr(pathTarget,"*.*"); - if(temp) *temp = 0;//strip off *.* from target - - // add '\\' if target is a directoy - if (pathTarget[strlen(pathTarget)-1]!='\\') { - if (DOS_FindFirst(pathTarget,0xffff & ~DOS_ATTR_VOLUME)) { - dta.GetResult(name,size,date,time,attr); - if (attr & DOS_ATTR_DIRECTORY) - strcat(pathTarget,"\\"); - } - }; - - bool ret=DOS_FindFirst(source,0xffff & ~DOS_ATTR_VOLUME); - if (!ret) { - WriteOut(MSG_Get("SHELL_CMD_FILE_NOT_FOUND"),args); - dos.dta(save_dta); - return; + copysource target; + // If more then one object exists and last target is not part of a + // concat sequence then make it the target. + if(sources.size()>1 && !sources[sources.size()-2].concat){ + target = sources.back(); + sources.pop_back(); } + //If no target => default target with concat flag true to detect a+b+c + if(target.filename.size() == 0) target = copysource(defaulttarget,true); + copysource oldsource; + copysource source; Bit32u count = 0; + while(sources.size()) { + /* Get next source item and keep track of old source for concat start end */ + oldsource = source; + source = sources[0]; + sources.erase(sources.begin()); - Bit16u sourceHandle,targetHandle; - char nameTarget[DOS_PATHLENGTH]; - char nameSource[DOS_PATHLENGTH]; + //Skip first file if doing a+b+c. Set target to first file + if(!oldsource.concat && source.concat && target.concat) { + target = source; + continue; + } - while (ret) { - dta.GetResult(name,size,date,time,attr); + /* Make a full path in the args */ + char pathSource[DOS_PATHLENGTH]; + char pathTarget[DOS_PATHLENGTH]; - if ((attr & DOS_ATTR_DIRECTORY)==0) { - strcpy(nameSource,pathSource); - strcat(nameSource,name); - // Open Source - if (DOS_OpenFile(nameSource,0,&sourceHandle)) { - // Create Target - strcpy(nameTarget,pathTarget); - if (nameTarget[strlen(nameTarget)-1]=='\\') strcat(nameTarget,name); - - if (DOS_CreateFile(nameTarget,0,&targetHandle)) { - // Copy - static Bit8u buffer[0x8000]; // static, otherwise stack overflow possible. - bool failed = false; - Bit16u toread = 0x8000; - do { - failed |= DOS_ReadFile(sourceHandle,buffer,&toread); - failed |= DOS_WriteFile(targetHandle,buffer,&toread); - } while (toread==0x8000); - failed |= DOS_CloseFile(sourceHandle); - failed |= DOS_CloseFile(targetHandle); - WriteOut(" %s\n",name); - count++; - } else { - DOS_CloseFile(sourceHandle); - WriteOut(MSG_Get("SHELL_CMD_COPY_FAILURE"),target); - } - } else WriteOut(MSG_Get("SHELL_CMD_COPY_FAILURE"),source); + if (!DOS_Canonicalize(const_cast(source.filename.c_str()),pathSource)) { + WriteOut(MSG_Get("SHELL_ILLEGAL_PATH")); + dos.dta(save_dta); + return; + } + // cut search pattern + char* pos = strrchr(pathSource,'\\'); + if (pos) *(pos+1) = 0; + + if (!DOS_Canonicalize(const_cast(target.filename.c_str()),pathTarget)) { + WriteOut(MSG_Get("SHELL_ILLEGAL_PATH")); + dos.dta(save_dta); + return; + } + char* temp = strstr(pathTarget,"*.*"); + if(temp) *temp = 0;//strip off *.* from target + + // add '\\' if target is a directoy + if (pathTarget[strlen(pathTarget)-1]!='\\') { + if (DOS_FindFirst(pathTarget,0xffff & ~DOS_ATTR_VOLUME)) { + dta.GetResult(name,size,date,time,attr); + if (attr & DOS_ATTR_DIRECTORY) + strcat(pathTarget,"\\"); + } }; - ret=DOS_FindNext(); - }; + + //Find first sourcefile + bool ret = DOS_FindFirst(const_cast(source.filename.c_str()),0xffff & ~DOS_ATTR_VOLUME); + if (!ret) { + WriteOut(MSG_Get("SHELL_CMD_FILE_NOT_FOUND"),const_cast(source.filename.c_str())); + dos.dta(save_dta); + return; + } + + Bit16u sourceHandle,targetHandle; + char nameTarget[DOS_PATHLENGTH]; + char nameSource[DOS_PATHLENGTH]; + + while (ret) { + dta.GetResult(name,size,date,time,attr); + + if ((attr & DOS_ATTR_DIRECTORY)==0) { + strcpy(nameSource,pathSource); + strcat(nameSource,name); + // Open Source + if (DOS_OpenFile(nameSource,0,&sourceHandle)) { + // Create Target or open it if in concat mode + strcpy(nameTarget,pathTarget); + if (nameTarget[strlen(nameTarget)-1]=='\\') strcat(nameTarget,name); + + //Don't create a newfile when in concat mode + if (oldsource.concat || DOS_CreateFile(nameTarget,0,&targetHandle)) { + Bit32u dummy=0; + //In concat mode. Open the target and seek to the eof + if (!oldsource.concat || (DOS_OpenFile(nameTarget,OPEN_READWRITE,&targetHandle) && + DOS_SeekFile(targetHandle,&dummy,DOS_SEEK_END))) { + // Copy + static Bit8u buffer[0x8000]; // static, otherwise stack overflow possible. + bool failed = false; + Bit16u toread = 0x8000; + do { + failed |= DOS_ReadFile(sourceHandle,buffer,&toread); + failed |= DOS_WriteFile(targetHandle,buffer,&toread); + } while (toread==0x8000); + failed |= DOS_CloseFile(sourceHandle); + failed |= DOS_CloseFile(targetHandle); + WriteOut(" %s\n",name); + if(!source.concat) count++; //Only count concat files once + } else { + DOS_CloseFile(sourceHandle); + WriteOut(MSG_Get("SHELL_CMD_COPY_FAILURE"),const_cast(target.filename.c_str())); + } + } else { + DOS_CloseFile(sourceHandle); + WriteOut(MSG_Get("SHELL_CMD_COPY_FAILURE"),const_cast(target.filename.c_str())); + } + } else WriteOut(MSG_Get("SHELL_CMD_COPY_FAILURE"),const_cast(source.filename.c_str())); + }; + //On the next file + ret = DOS_FindNext(); + }; + } + WriteOut(MSG_Get("SHELL_CMD_COPY_SUCCESS"),count); dos.dta(save_dta); } void DOS_Shell::CMD_SET(char * args) { + HELP("SET"); StripSpaces(args); std::string line; if (!*args) { @@ -593,6 +673,7 @@ void DOS_Shell::CMD_SET(char * args) { } void DOS_Shell::CMD_IF(char * args) { + HELP("IF"); StripSpaces(args); bool has_not=false; char * comp=strchr(args,'='); @@ -657,6 +738,7 @@ void DOS_Shell::CMD_IF(char * args) { } void DOS_Shell::CMD_GOTO(char * args) { + HELP("GOTO"); StripSpaces(args); if (!bf) return; if (*args &&(*args==':')) args++; @@ -670,8 +752,13 @@ void DOS_Shell::CMD_GOTO(char * args) { } } +void DOS_Shell::CMD_SHIFT(char * args ) { + HELP("SHIFT"); + if(bf) bf->Shift(); +} void DOS_Shell::CMD_TYPE(char * args) { + HELP("TYPE"); StripSpaces(args); if (!*args) { WriteOut(MSG_Get("SHELL_SYNTAXERROR")); @@ -696,15 +783,18 @@ nextfile: } void DOS_Shell::CMD_REM(char * args) { + HELP("REM"); } void DOS_Shell::CMD_PAUSE(char * args){ + HELP("PAUSE"); WriteOut(MSG_Get("SHELL_CMD_PAUSE")); Bit8u c;Bit16u n=1; DOS_ReadFile (STDIN,&c,&n); } void DOS_Shell::CMD_CALL(char * args){ + HELP("CALL"); this->call=true; /* else the old batchfile will be closed first */ this->ParseLine(args); this->call=false; @@ -714,6 +804,7 @@ void DOS_Shell::CMD_SUBST (char * args) { /* If more that one type can be substed think of something else * E.g. make basedir member dos_drive instead of localdrive */ + HELP("SUBST"); localDrive* ldp=0; char mountstring[DOS_PATHLENGTH+CROSS_LEN+20]; char temp_str[2] = { 0,0 }; @@ -766,6 +857,7 @@ void DOS_Shell::CMD_SUBST (char * args) { } void DOS_Shell::CMD_LOADHIGH(char *args){ + HELP("LOADHIGH"); Bit16u umb_start=dos_infoblock.GetStartOfUMBChain(); Bit8u umb_flag=dos_infoblock.GetUMBChainState(); Bit8u old_memstrat=DOS_GetMemAllocStrategy()&0xff; @@ -780,47 +872,65 @@ void DOS_Shell::CMD_LOADHIGH(char *args){ } void DOS_Shell::CMD_CHOICE(char * args){ - static char defargs[] = "[YN]"; - static char defchoice[] = "yn"; + HELP("CHOICE"); + static char defchoice[3] = {'y','n',0}; char *rem = NULL, *ptr; - bool optN = false; + bool optN = ScanCMDBool(args,"N"); + bool optS = ScanCMDBool(args,"S"); //Case-sensitive matching + ScanCMDBool(args,"T"); //Default Choice after timeout if (args) { char *last = strchr(args,0); StripSpaces(args); - optN=ScanCMDBool(args,"N"); - rem=ScanCMDRemain(args); - if (rem && *rem && (tolower(rem[1]) != 'c' || rem[2] != ':')) { + rem = ScanCMDRemain(args); + if (rem && *rem && (tolower(rem[1]) != 'c')) { WriteOut(MSG_Get("SHELL_ILLEGAL_SWITCH"),rem); return; } if (args == rem) args = strchr(rem,0)+1; - if (rem) rem += 3; + if (rem) rem += 2; + if(rem && rem[0]==':') rem++; /* optional : after /c */ if (args > last) args = NULL; } - if (!args || !*args) args = defargs; - if (!rem || !*rem) rem = defchoice; + if (!rem || !*rem) rem = defchoice; /* No choices specified use YN */ ptr = rem; Bit8u c; - while ((c = *ptr)) *ptr++ = tolower(c); + if(!optS) while ((c = *ptr)) *ptr++ = toupper(c); /* When in no case-sensitive mode. make everything upcase */ + if(args && *args ) { + StripSpaces(args); + size_t argslen = strlen(args); + if(argslen>1 && args[0] == '"' && args[argslen-1] =='"') { + args[argslen-1] = 0; //Remove quotes + args++; + } + WriteOut(args); + } + /* Show question prompt of the form [a,b]? where a b are the choice values */ + if (!optN) { + if(args && *args) WriteOut(" "); + WriteOut("["); + size_t len = strlen(rem); + for(size_t t = 1; t < len; t++) { + WriteOut("%c,",rem[t-1]); + } + WriteOut("%c]?",rem[len-1]); + } - WriteOut(args); - if (!optN) WriteOut("\r\n"); Bit16u n=1; do { DOS_ReadFile (STDIN,&c,&n); - } while (!c || !(ptr = strchr(rem,tolower(c)))); - if (optN) { - DOS_WriteFile (STDOUT,&c, &n); - WriteOut("\r\n"); - } + } while (!c || !(ptr = strchr(rem,(optS?c:toupper(c))))); + c = optS?c:toupper(c); + DOS_WriteFile (STDOUT,&c, &n); dos.return_code = ptr-rem+1; } void DOS_Shell::CMD_ATTRIB(char *args){ + HELP("ATTRIB"); // No-Op for now. } void DOS_Shell::CMD_PATH(char *args){ + HELP("PATH"); if(args && *args && strlen(args)){ char pathstring[DOS_PATHLENGTH+CROSS_LEN+20]={ 0 }; strcpy(pathstring,"set PATH="); @@ -838,3 +948,14 @@ void DOS_Shell::CMD_PATH(char *args){ } } } + +void DOS_Shell::CMD_VER(char *args) { + HELP("VER"); + if(args && *args) { + char* word = StripWord(args); + if(strcasecmp(word,"set")) return; + word = StripWord(args); + dos.version.major = atoi(word); + dos.version.minor = atoi(args); + } else WriteOut(MSG_Get("SHELL_CMD_VER_VER"),VERSION,dos.version.major,dos.version.minor); +} diff --git a/src/shell/shell_misc.cpp b/src/shell/shell_misc.cpp index fc8a06f..2ca403d 100644 --- a/src/shell/shell_misc.cpp +++ b/src/shell/shell_misc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002-2006 The DOSBox Team + * Copyright (C) 2002-2007 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell_misc.cpp,v 1.43 2006/02/28 19:41:27 qbix79 Exp $ */ +/* $Id: shell_misc.cpp,v 1.49 2007/02/03 14:04:23 qbix79 Exp $ */ #include #include @@ -39,16 +39,12 @@ static void outc(Bit8u c) { DOS_WriteFile(STDOUT,&c,&n); } -static void outs(char * str) { - Bit16u n=strlen(str); - DOS_WriteFile(STDOUT,(Bit8u *)str,&n); -} - void DOS_Shell::InputCommand(char * line) { Bitu size=CMD_MAXLINE-2; //lastcharacter+0 Bit8u c;Bit16u n=1; Bitu str_len=0;Bitu str_index=0; - Bit16u len; + Bit16u len=0; + bool current_hist=false; // current command stored in history? line[0] = '\0'; @@ -116,6 +112,12 @@ void DOS_Shell::InputCommand(char * line) { case 0x48: /* UP */ if (l_history.empty() || it_history == l_history.end()) break; + // store current command in history if we are at beginning + if (it_history == l_history.begin() && !current_hist) { + current_hist=true; + l_history.push_front(line); + } + for (;str_index>0; str_index--) { // removes all characters outc(8); outc(' '); outc(8); @@ -136,6 +138,12 @@ void DOS_Shell::InputCommand(char * line) { if (it_history == l_history.begin()) { // no previous commands in history it_history ++; + + // remove current command from history + if (current_hist) { + current_hist=false; + l_history.pop_front(); + } break; } else it_history --; @@ -207,15 +215,17 @@ void DOS_Shell::InputCommand(char * line) { if (it_completion == l_completion.end()) it_completion = l_completion.begin(); } else { // build new completion list + // Lines starting with CD will only get directories in the list + bool dir_only = (strncasecmp(line,"CD ",3)==0); // get completion mask - char *completion_start = strrchr(line, ' '); + char *p_completion_start = strrchr(line, ' '); - if (completion_start) { - completion_start ++; - completion_index = str_index - strlen(completion_start); + if (p_completion_start) { + p_completion_start ++; + completion_index = str_index - strlen(p_completion_start); } else { - completion_start = line; + p_completion_start = line; completion_index = 0; } @@ -225,8 +235,8 @@ void DOS_Shell::InputCommand(char * line) { // build the completion list char mask[DOS_PATHLENGTH]; - if (completion_start) { - strcpy(mask, completion_start); + if (p_completion_start) { + strcpy(mask, p_completion_start); char* dot_pos=strrchr(mask,'.'); char* bs_pos=strrchr(mask,'\\'); char* fs_pos=strrchr(mask,'/'); @@ -249,23 +259,26 @@ void DOS_Shell::InputCommand(char * line) { } DOS_DTA dta(dos.dta()); - char name[DOS_NAMELENGTH_ASCII];Bit32u size;Bit16u date;Bit16u time;Bit8u attr; + char name[DOS_NAMELENGTH_ASCII];Bit32u sz;Bit16u date;Bit16u time;Bit8u att; std::list executable; while (res) { - dta.GetResult(name,size,date,time,attr); + dta.GetResult(name,sz,date,time,att); // add result to completion list char *ext; // file extension if (strcmp(name, ".") && strcmp(name, "..")) { - ext = strrchr(name, '.'); - if (ext && (strcmp(ext, ".BAT") == 0 || strcmp(ext, ".COM") == 0 || strcmp(ext, ".EXE") == 0)) - // we add executables to the a seperate list and place that list infront of the normal files - executable.push_front(name); - else - l_completion.push_back(name); + if (dir_only) { //Handle the dir only case different (line starts with cd) + if(att & DOS_ATTR_DIRECTORY) l_completion.push_back(name); + } else { + ext = strrchr(name, '.'); + if (ext && (strcmp(ext, ".BAT") == 0 || strcmp(ext, ".COM") == 0 || strcmp(ext, ".EXE") == 0)) + // we add executables to the a seperate list and place that list infront of the normal files + executable.push_front(name); + else + l_completion.push_back(name); + } } - res=DOS_FindNext(); } /* Add excutable list to front of completion list. */ @@ -329,6 +342,12 @@ void DOS_Shell::InputCommand(char * line) { if (!str_len) return; str_len++; + // remove current command from history if it's there + if (current_hist) { + current_hist=false; + l_history.pop_front(); + } + // add command line to history l_history.push_front(line); it_history = l_history.begin(); if (l_completion.size()) l_completion.clear(); @@ -337,7 +356,8 @@ void DOS_Shell::InputCommand(char * line) { bool DOS_Shell::Execute(char * name,char * args) { /* return true => don't check for hardware changes in do_command * return false => check for hardware changes in do_command */ - char * fullname; + char fullname[DOS_PATHLENGTH+4]; //stores results from Which + char* p_fullname; char line[CMD_MAXLINE]; if(strlen(args)!= 0){ if(*args != ' '){ //put a space in front @@ -354,7 +374,7 @@ bool DOS_Shell::Execute(char * name,char * args) { }; /* check for a drive change */ - if ((strcmp(name + 1, ":") == 0) && isalpha(*name)) + if (((strcmp(name + 1, ":") == 0) || (strcmp(name + 1, ":\\") == 0)) && isalpha(*name)) { if (!DOS_SetDrive(toupper(name[0])-'A')) { WriteOut(MSG_Get("SHELL_EXECUTE_DRIVE_NOT_FOUND"),toupper(name[0])); @@ -362,15 +382,17 @@ bool DOS_Shell::Execute(char * name,char * args) { return true; } /* Check for a full name */ - fullname=Which(name); - if (!fullname) return false; - - char* extension =strrchr(fullname,'.'); + p_fullname = Which(name); + if (!p_fullname) return false; + strcpy(fullname,p_fullname); + const char* extension = strrchr(fullname,'.'); /*always disallow files without extension from being executed. */ /*only internal commands can be run this way and they never get in this handler */ if(extension == 0) { + //Check if the result will fit in the parameters. Else abort + if(strlen(fullname) >( DOS_PATHLENGTH - 1) ) return false; char temp_name[DOS_PATHLENGTH+4],* temp_fullname; //try to add .com, .exe and .bat extensions to filename @@ -426,17 +448,19 @@ bool DOS_Shell::Execute(char * name,char * args) { RealPt file_name=RealMakeSeg(ss,reg_sp+0x20); MEM_BlockWrite(Real2Phys(file_name),fullname,strlen(fullname)+1); /* Fill the command line */ - CommandTail cmd; + CommandTail cmdtail; + cmdtail.count = 0; + memset(&cmdtail.buffer,0,126); //Else some part of the string is unitialized (valgrind) if (strlen(line)>126) line[126]=0; - cmd.count=strlen(line); - memcpy(cmd.buffer,line,strlen(line)); - cmd.buffer[strlen(line)]=0xd; + cmdtail.count=strlen(line); + memcpy(cmdtail.buffer,line,strlen(line)); + cmdtail.buffer[strlen(line)]=0xd; /* Copy command line in stack block too */ - MEM_BlockWrite(SegPhys(ss)+reg_sp+0x100,&cmd,128); + MEM_BlockWrite(SegPhys(ss)+reg_sp+0x100,&cmdtail,128); /* Parse FCB (first two parameters) and put them into the current DOS_PSP */ Bit8u add; - FCB_Parsename(dos.psp(),0x5C,0x00,cmd.buffer,&add); - FCB_Parsename(dos.psp(),0x6C,0x00,&cmd.buffer[add],&add); + FCB_Parsename(dos.psp(),0x5C,0x00,cmdtail.buffer,&add); + FCB_Parsename(dos.psp(),0x6C,0x00,&cmdtail.buffer[add],&add); block.exec.fcb1=RealMake(dos.psp(),0x5C); block.exec.fcb2=RealMake(dos.psp(),0x6C); /* Set the command line in the block and save it */ @@ -473,9 +497,9 @@ bool DOS_Shell::Execute(char * name,char * args) { -static char * bat_ext=".BAT"; -static char * com_ext=".COM"; -static char * exe_ext=".EXE"; +static const char * bat_ext=".BAT"; +static const char * com_ext=".COM"; +static const char * exe_ext=".EXE"; static char which_ret[DOS_PATHLENGTH+4]; char * DOS_Shell::Which(char * name) { diff --git a/visualc/Makefile.am b/visualc/Makefile.am deleted file mode 100644 index f484b93..0000000 --- a/visualc/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = dosbox.dsw dosbox.dsp \ No newline at end of file diff --git a/visualc/Makefile.in b/visualc/Makefile.in deleted file mode 100644 index 363b8d5..0000000 --- a/visualc/Makefile.in +++ /dev/null @@ -1,305 +0,0 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -top_builddir = .. -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -INSTALL = @INSTALL@ -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = visualc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ALSA_CFLAGS = @ALSA_CFLAGS@ -ALSA_LIBS = @ALSA_LIBS@ -AMDEP_FALSE = @AMDEP_FALSE@ -AMDEP_TRUE = @AMDEP_TRUE@ -AMTAR = @AMTAR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ -HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SDL_CFLAGS = @SDL_CFLAGS@ -SDL_CONFIG = @SDL_CONFIG@ -SDL_LIBS = @SDL_LIBS@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -WINDRES = @WINDRES@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ -am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ -am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -datadir = @datadir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -EXTRA_DIST = dosbox.dsw dosbox.dsp -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits visualc/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits visualc/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -uninstall-info-am: -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ - list='$(DISTFILES)'; for file in $$list; do \ - case $$file in \ - $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ - $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ - esac; \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test "$$dir" != "$$file" && test "$$dir" != "."; then \ - dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ - else \ - dir=''; \ - fi; \ - if test -d $$d/$$file; then \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-exec-am: - -install-info: install-info-am - -install-man: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-info-am - -.PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ - install-exec-am install-info install-info-am install-man \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-info-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/visualc/dosbox.dsp b/visualc/dosbox.dsp deleted file mode 100644 index 306f9f7..0000000 --- a/visualc/dosbox.dsp +++ /dev/null @@ -1,779 +0,0 @@ -# Microsoft Developer Studio Project File - Name="dosbox" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=dosbox - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "dosbox.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "dosbox.mak" CFG="dosbox - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "dosbox - Win32 Release" (based on "Win32 (x86) Console Application") -!MESSAGE "dosbox - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "dosbox - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MD /W3 /GX /O1 /Op /Ob2 /I "../include" /I "../src/platform/visualc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FAs /FR /FD /QxMi /bQipo /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 winmm.lib zlib.lib libpng.lib sdl_net.lib sdlmain.lib sdl.lib curses.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 - -!ELSEIF "$(CFG)" == "dosbox - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../include" /I "../src/platform/visualc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 sdl_net.lib winmm.lib zlib.lib libpng.lib sdlmain.lib sdl.lib curses.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "dosbox - Win32 Release" -# Name "dosbox - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Group "cpu" - -# PROP Default_Filter "" -# Begin Group "core_full" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\cpu\core_full\ea_lookup.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_full\load.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_full\loadwrite.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_full\main.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_full\op.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_full\optable.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_full\save.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_full\string.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_full\support.h -# End Source File -# End Group -# Begin Group "core_normal" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\cpu\core_normal\helpers.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_normal\prefix_0f.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_normal\prefix_66.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_normal\prefix_66_0f.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_normal\prefix_none.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_normal\string.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_normal\support.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_normal\table_ea.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\src\cpu\callback.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_full.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\core_normal.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\cpu.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\flags.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\instructions.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\lazyflags.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\modrm.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\modrm.h -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\paging.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\cpu\slow_16.cpp -# End Source File -# End Group -# Begin Group "debug" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\debug\debug.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\debug\debug_disasm.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\debug\debug_gui.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\debug\debug_inc.h -# End Source File -# Begin Source File - -SOURCE=..\src\debug\debug_win32.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\debug\disasm_tables.h -# End Source File -# End Group -# Begin Group "dos" - -# PROP Default_Filter "" -# Begin Group "devices" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\dos\dev_con.h -# End Source File -# End Group -# Begin Group "drives" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\dos\drive_cache.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\drive_local.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\drive_virtual.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\drives.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\drives.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\src\dos\cdrom.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\cdrom.h -# End Source File -# Begin Source File - -SOURCE=..\src\dos\cdrom_aspi_win32.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\cdrom_ioctl_win32.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_classes.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_devices.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_execute.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_files.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_ioctl.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_memory.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_misc.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_mscdex.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_programs.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\dos_tables.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\dos\scsidefs.h -# End Source File -# Begin Source File - -SOURCE=..\src\dos\wnaspi32.h -# End Source File -# End Group -# Begin Group "gui" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\gui\midi.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\gui\midi_win32.h -# End Source File -# Begin Source File - -SOURCE=..\src\gui\render.cpp -# End Source File -# Begin Source File - -SOURCE=..\include\render.h -# End Source File -# Begin Source File - -SOURCE=..\src\gui\render_normal.h -# End Source File -# Begin Source File - -SOURCE=..\src\gui\render_scale2x.h -# End Source File -# Begin Source File - -SOURCE=..\src\gui\sdlmain.cpp -# End Source File -# Begin Source File - -SOURCE=..\include\video.h -# End Source File -# End Group -# Begin Group "hardware" - -# PROP Default_Filter "" -# Begin Group "vga" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\hardware\vga.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\vga.h -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\vga_attr.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\vga_crtc.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\vga_dac.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\vga_draw.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\vga_gfx.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\vga_memory.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\vga_misc.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\vga_seq.cpp -# End Source File -# End Group -# Begin Source File - -SOURCE=..\src\hardware\adlib.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\cmos.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\disney.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\dma.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\gameblaster.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\gus.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\hardware.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\iohandler.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\joystick.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\keyboard.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\memory.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\mixer.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\mpu401.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\pcspeaker.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\pic.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\sblaster.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\serialport.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\softmodem.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\tandy_sound.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\hardware\timer.cpp -# End Source File -# End Group -# Begin Group "ints" - -# PROP Default_Filter "" -# Begin Group "int10" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\ints\int10.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\int10.h -# End Source File -# Begin Source File - -SOURCE=..\src\ints\int10_char.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\int10_memory.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\int10_misc.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\int10_modes.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\int10_pal.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\int10_put_pixel.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\int10_vesa.cpp -# End Source File -# End Group -# Begin Source File - -SOURCE=..\src\ints\bios.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\bios_disk.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\bios_keyboard.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\dpmi.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\ems.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\mouse.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\xms.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\ints\xms.h -# End Source File -# End Group -# Begin Group "misc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\misc\messages.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\misc\programs.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\misc\setup.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\misc\support.cpp -# End Source File -# End Group -# Begin Group "shell" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\shell\shell.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\shell\shell_batch.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\shell\shell_cmds.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\shell\shell_inc.h -# End Source File -# Begin Source File - -SOURCE=..\src\shell\shell_misc.cpp -# End Source File -# End Group -# Begin Group "fpu" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\fpu\fpu.cpp -# End Source File -# Begin Source File - -SOURCE=..\src\fpu\fpu_instructions.h -# End Source File -# Begin Source File - -SOURCE=..\src\fpu\fpu_instructions_x86.h -# End Source File -# Begin Source File - -SOURCE=..\src\fpu\fpu_types.h -# End Source File -# End Group -# Begin Group "visualc" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\src\platform\visualc\config.h -# End Source File -# Begin Source File - -SOURCE=..\src\platform\visualc\dirent.c -# End Source File -# Begin Source File - -SOURCE=..\src\platform\visualc\dirent.h -# End Source File -# Begin Source File - -SOURCE=..\src\platform\visualc\unistd.h -# End Source File -# End Group -# Begin Source File - -SOURCE=..\src\dosbox.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\include\bios.h -# End Source File -# Begin Source File - -SOURCE=..\include\callback.h -# End Source File -# Begin Source File - -SOURCE=..\include\cpu.h -# End Source File -# Begin Source File - -SOURCE=..\include\cross.h -# End Source File -# Begin Source File - -SOURCE=..\include\debug.h -# End Source File -# Begin Source File - -SOURCE=..\include\dma.h -# End Source File -# Begin Source File - -SOURCE=..\include\dos_inc.h -# End Source File -# Begin Source File - -SOURCE=..\include\dos_system.h -# End Source File -# Begin Source File - -SOURCE=..\include\dosbox.h -# End Source File -# Begin Source File - -SOURCE=..\include\fpu.h -# End Source File -# Begin Source File - -SOURCE=..\include\hardware.h -# End Source File -# Begin Source File - -SOURCE=..\include\inout.h -# End Source File -# Begin Source File - -SOURCE=..\include\joystick.h -# End Source File -# Begin Source File - -SOURCE=..\include\keyboard.h -# End Source File -# Begin Source File - -SOURCE=..\include\logging.h -# End Source File -# Begin Source File - -SOURCE=..\include\mem.h -# End Source File -# Begin Source File - -SOURCE=..\include\mixer.h -# End Source File -# Begin Source File - -SOURCE=..\include\mouse.h -# End Source File -# Begin Source File - -SOURCE=..\include\paging.h -# End Source File -# Begin Source File - -SOURCE=..\include\pic.h -# End Source File -# Begin Source File - -SOURCE=..\include\programs.h -# End Source File -# Begin Source File - -SOURCE=..\include\regs.h -# End Source File -# Begin Source File - -SOURCE=..\include\setup.h -# End Source File -# Begin Source File - -SOURCE=..\include\support.h -# End Source File -# Begin Source File - -SOURCE=..\include\timer.h -# End Source File -# End Group -# End Target -# End Project diff --git a/visualc/dosbox.dsw b/visualc/dosbox.dsw deleted file mode 100644 index a17f1dd..0000000 --- a/visualc/dosbox.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "dosbox"=".\dosbox.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/visualc_net/Makefile.in b/visualc_net/Makefile.in index 5664a0d..f6cb06e 100644 --- a/visualc_net/Makefile.in +++ b/visualc_net/Makefile.in @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005 Free Software Foundation, Inc. +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -20,6 +21,7 @@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 @@ -33,22 +35,7 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ host_triplet = @host@ -target_triplet = @target@ -subdir = visualc_net -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALSA_CFLAGS = @ALSA_CFLAGS@ ALSA_LIBS = @ALSA_LIBS@ @@ -75,6 +62,7 @@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ +GREP = @GREP@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -105,9 +93,6 @@ VERSION = @VERSION@ WINDRES = @WINDRES@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_ct_WINDRES = @ac_ct_WINDRES@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ @@ -115,8 +100,6 @@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -124,23 +107,29 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ -mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -150,38 +139,21 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ EXTRA_DIST = dosbox.sln dosbox.vcproj +subdir = visualc_net +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits visualc_net/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && \ - $(AUTOMAKE) --gnits visualc_net/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(AUTOMAKE) --gnu visualc_net/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: tags: TAGS TAGS: @@ -189,6 +161,10 @@ TAGS: ctags: CTAGS CTAGS: +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ @@ -202,7 +178,7 @@ distdir: $(DISTFILES) dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkdir_p) "$(distdir)$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -220,6 +196,7 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile + installdirs: install: install-am install-exec: install-exec-am @@ -240,7 +217,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -257,8 +234,6 @@ dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: @@ -292,8 +267,8 @@ ps-am: uninstall-am: uninstall-info-am .PHONY: all all-am check check-am clean clean-generic distclean \ - distclean-generic distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-exec \ + distclean-generic distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ diff --git a/visualc_net/dosbox.vcproj b/visualc_net/dosbox.vcproj index cafb898..9c7bef8 100644 --- a/visualc_net/dosbox.vcproj +++ b/visualc_net/dosbox.vcproj @@ -39,7 +39,7 @@ Name="VCCustomBuildTool"/> + + + + @@ -298,21 +304,6 @@ - - - - - - - - - - @@ -334,6 +325,9 @@ + + @@ -349,24 +343,6 @@ - - - - - - - - - - - - @@ -392,10 +368,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + @@ -678,9 +717,6 @@ - -