DOSBox 0.72

This commit is contained in:
Carl.Kenner 2009-05-02 22:44:30 +00:00
parent 5d0f3a05e8
commit 4aae6033fc
52 changed files with 6146 additions and 1124 deletions

View File

@ -1,3 +1,23 @@
0.72
- Fixed unitialized variable in joystick. (Fixes crashes on Vista and
Mac OS X)
- Some bugfixes and speedups to the 64 bit recompiling core.
- Fixed sign flag on soundblaster dma transfers (Space Quest 6 intro)
- Fixed a bug in keyboard layout processing code and fixed certain
layouts.
- Fixed Dreamweb.
- Improved speed unlocking when running cycles=max.
- Fixed a crash related to the tab completion in the shell.
- Improved aspect correction code. Should now be like how a real monitor
handles it.
- Fixed a bug in the xms status report code. (Blake Stone 1.0 shareware)
- Added a lot more keyboard layouts.
- Fix crash related to changing the scaler before a screen was created.
- Hopefully fixed compilation on *bsd.
- Enabled auto cpu core selection for recompiling core as well.
- Made the used joystick selectable when 4axis is specified.
- Added some hints for inexperienced DOS users to the shell.
0.71
- Add a new recompiling cpu core, which should be easier to port.
- Add 64 bit version of the recompiling core.

33
INSTALL
View File

@ -2,31 +2,44 @@ Things needed for compilation.
SDL
The Simple DirectMedia Library available at http://www.libsdl.org
The dll distributed with the windows version of DOSBox is slightly
modified. You can find the changes in the sourcepackage of DOSBox
(src/platform/sdl-win32.diff). If you want the patched sourcetree
send us an email. (see README)
Licensed under LGPL
Curses
(optional)
Curses (optional)
If you want to enable the debugger you need a curses library.
ncurses should be installed on just about every unix distro.
For win32 get pdcurses at http://pdcurses.sourceforge.net
License: Open source
Libpng
Needed for the screenshots. (optional)
For win32 get libpng from http://www.sourceforge.net/projects/gnuwin32
Libpng (optional)
Needed for the screenshots.
For win32 get libpng from http://gnuwin32.sourceforge.net/packages.html
See http://www.libpng.org/pub/png/ for more details.
License: Open Source
Zlib
Needed by libpng. (optional)
For win32 get libz (rename to zlib) from http://www.sourceforge.net/projects/gnuwin32
Zlib (optional)
Needed by libpng.
For win32 get libz (rename to zlib) from http://gnuwin32.sourceforge.net/packages.html
See http://www.zlib.net for more details.
License: Open Source
SDL_Net
For modem/ipx support(optional). Get it from http://www.libsdl.org
SDL_Net (optional)
For modem/ipx support. Get it from http://www.libsdl.org/projects/SDL_net/
Licensed under LGPL
SDL_Sound
For compressed audio on diskimages. (optional)
This is for cue/bin cdrom images with compressed (mp3/ogg) audio tracks.
Get it from http://icculus.org/SDL_sound
Licenced under LGPL
ALSA_Headers
(optional)
for Alsa support under linux. Part of the linux kernel sources
Licensed under LGPL
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

View File

@ -157,8 +157,8 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-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.in \
depcomp install-sh missing mkinstalldirs
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

20
NEWS
View File

@ -1,3 +1,23 @@
0.72
- Fixed unitialized variable in joystick. (Fixes crashes on Vista and
Mac OS X)
- Some bugfixes and speedups to the 64 bit recompiling core.
- Fixed sign flag on soundblaster dma transfers (Space Quest 6 intro)
- Fixed a bug in keyboard layout processing code and fixed certain
layouts.
- Fixed Dreamweb.
- Improved speed unlocking when running cycles=max.
- Fixed a crash related to the tab completion in the shell.
- Improved aspect correction code. Should now be like how a real monitor
handles it.
- Fixed a bug in the xms status report code. (Blake Stone 1.0 shareware)
- Added a lot more keyboard layouts.
- Fix crash related to changing the scaler before a screen was created.
- Hopefully fixed compilation on *bsd.
- Enabled auto cpu core selection for recompiling core as well.
- Made the used joystick selectable when 4axis is specified.
- Added some hints for inexperienced DOS users to the shell.
0.71
- Add a new recompiling cpu core, which should be easier to port.
- Add 64 bit version of the recompiling core.

13
README
View File

@ -1,4 +1,4 @@
DOSBox v0.71
DOSBox v0.72
=====
@ -909,12 +909,6 @@ Layout switching
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)
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.
@ -923,7 +917,9 @@ 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.
See http://projects.freedos.net/keyb/ for precompiled keyboard layouts if
the DOSBox-integrated layouts don't work for some reason, or updated or
new layouts become available.
Both .CPI (MSDOS/compatible codepage files) and .CPX (freedos UPX-compressed
codepage files) can be used. Some codepages are compiled into DOSBox, so it
@ -936,6 +932,7 @@ Supported external files
language code.
Example: For the file UZ.KL (keyboard layout for Uzbekistan) specify
"keyboardlayout=uz" in dosbox.conf.
The integration of keyboard layout packages (like keybrd2.sys) works similar.
Note that the keyboard layout allows foreign characters to be entered, but

21
config.guess vendored
View File

@ -1,10 +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, 2005, 2006 Free Software Foundation,
# Inc.
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
timestamp='2006-07-02'
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
@ -211,7 +210,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
@ -771,8 +770,6 @@ EOF
case ${UNAME_MACHINE} in
pc98)
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
@ -783,6 +780,9 @@ EOF
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:MSYS_NT-*:*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
@ -790,10 +790,10 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
x86:Interix*:[3456]*)
x86:Interix*:[345]*)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
EM64T:Interix*:[3456]*)
EM64T:Interix*:[345]*)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
@ -831,9 +831,6 @@ EOF
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
exit ;;
@ -992,7 +989,7 @@ EOF
LIBC=gnulibc1
# endif
#else
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun)
LIBC=gnu
#else
LIBC=gnuaout

View File

@ -137,7 +137,7 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Compiling on GNU/Linux or *BSD */
/* Compiling on GNU/Linux */
#undef LINUX
/* Compiling on Mac OS X */

40
config.sub vendored
View File

@ -1,10 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
timestamp='2006-07-02'
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
@ -241,7 +240,7 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| 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 | avr32 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
@ -249,8 +248,7 @@ case $basic_machine in
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore \
| m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@ -276,11 +274,11 @@ case $basic_machine in
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | 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 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu | strongarm \
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
@ -288,6 +286,9 @@ case $basic_machine in
| z8k)
basic_machine=$basic_machine-unknown
;;
m32c)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
@ -317,7 +318,7 @@ case $basic_machine in
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| avr-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
| clipper-* | craynv-* | cydra-* \
@ -328,7 +329,7 @@ case $basic_machine in
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| m32c-* | m32r-* | m32rle-* \
| m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
@ -357,11 +358,11 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
@ -372,6 +373,8 @@ case $basic_machine in
| 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)
@ -1125,7 +1128,7 @@ case $basic_machine in
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
@ -1214,7 +1217,7 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers*)
| -skyos* | -haiku* | -rdos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@ -1366,9 +1369,6 @@ else
# system, and we'll never get to this point.
case $basic_machine in
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;

29
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.60a for dosbox 0.71.
# Generated by GNU Autoconf 2.60a for dosbox 0.72.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@ -557,8 +557,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='dosbox'
PACKAGE_TARNAME='dosbox'
PACKAGE_VERSION='0.71'
PACKAGE_STRING='dosbox 0.71'
PACKAGE_VERSION='0.72'
PACKAGE_STRING='dosbox 0.72'
PACKAGE_BUGREPORT=''
ac_unique_file="README"
@ -1215,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.71 to adapt to many kinds of systems.
\`configure' configures dosbox 0.72 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1286,7 +1286,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of dosbox 0.71:";;
short | recursive ) echo "Configuration of dosbox 0.72:";;
esac
cat <<\_ACEOF
@ -1391,7 +1391,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
dosbox configure 0.71
dosbox configure 0.72
generated by GNU Autoconf 2.60a
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1405,7 +1405,7 @@ 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.71, which was
It was created by dosbox $as_me 0.72, which was
generated by GNU Autoconf 2.60a. Invocation command line was
$ $0 $@
@ -2173,7 +2173,7 @@ fi
# Define the identity of the package.
PACKAGE='dosbox'
VERSION='0.71'
VERSION='0.72'
cat >>confdefs.h <<_ACEOF
@ -12440,8 +12440,13 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
LIBS="$LIBS -framework AudioUnit"
cat >>confdefs.h <<\_ACEOF
#define C_DIRECTSERIAL 1
_ACEOF
;;
*-*-freebsd* | *-*-linux* | *-*-dragonfly* | *-*-netbsd* | *-*-openbsd*)
*-*-linux*)
cat >>confdefs.h <<\_ACEOF
#define LINUX 1
@ -12452,6 +12457,8 @@ cat >>confdefs.h <<\_ACEOF
#define C_DIRECTSERIAL 1
_ACEOF
;;
*-*-freebsd* | *-*-dragonfly* | *-*-netbsd* | *-*-openbsd*)
;;
*-*-os2-emx*)
@ -12996,7 +13003,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by dosbox $as_me 0.71, which was
This file was extended by dosbox $as_me 0.72, which was
generated by GNU Autoconf 2.60a. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -13049,7 +13056,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
dosbox config.status 0.71
dosbox config.status 0.72
configured by $0, generated by GNU Autoconf 2.60a,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -1,5 +1,5 @@
dnl Init.
AC_INIT(dosbox,0.71)
AC_INIT(dosbox,0.72)
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(README)
@ -405,11 +405,20 @@ case "$target" in
dnl For now I am lazy and do not add proper detection code.
AC_DEFINE(MACOSX, 1, [Compiling on Mac OS X])
LIBS="$LIBS -framework AudioUnit"
;;
*-*-freebsd* | *-*-linux* | *-*-dragonfly* | *-*-netbsd* | *-*-openbsd*)
AC_DEFINE(LINUX, 1, [Compiling on GNU/Linux or *BSD])
AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32, Posix and OS/2).])
;;
*-*-linux*)
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).])
;;
*-*-freebsd* | *-*-dragonfly* | *-*-netbsd* | *-*-openbsd*)
dnl Disabled directserial for now. It doesn't do anything without
dnl specifying an extra ifdef in directserial_posix.*
dnl directserial detection should be rewritten to test for the needed
dnl functions and headers. I currently do not know
dnl which ones are needed for BSD
dnl 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, Posix and OS/2).])

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: joystick.h,v 1.11 2007/02/22 08:44:06 qbix79 Exp $ */
/* $Id: joystick.h,v 1.12 2007/08/12 10:23:35 c2woody Exp $ */
#ifndef DOSBOX_JOYSTICK_H
#define DOSBOX_JOYSTICK_H
void JOYSTICK_Enable(Bitu which,bool enabled);
@ -40,6 +40,7 @@ enum JoystickType {
JOY_AUTO,
JOY_2AXIS,
JOY_4AXIS,
JOY_4AXIS_2,
JOY_FCS,
JOY_CH
};

View File

@ -52,6 +52,7 @@ struct LOG
void operator()(char const* , char const* , double ) { }
void operator()(char const* , char const* , double ,double ) { }
void operator()(char const* , double , char const* ) { }
void operator()(char const* , double , double, char const* ) { }

View File

@ -69,12 +69,12 @@ public:
Bitu freq_add,freq_index;
Bitu done,needed;
Bits last[2];
char * name;
const char * name;
bool enabled;
MixerChannel * next;
};
MixerChannel * MIXER_AddChannel(MIXER_Handler handler,Bitu freq,char * name);
MixerChannel * MIXER_AddChannel(MIXER_Handler handler,Bitu freq,const char * name);
MixerChannel * MIXER_FindChannel(const char * name);
/* Find the device you want to delete with findchannel "delchan gets deleted" */
void MIXER_DelChannel(MixerChannel* delchan);
@ -87,7 +87,7 @@ private:
char m_name[32];
public:
MixerObject():installed(false){};
MixerChannel* Install(MIXER_Handler handler,Bitu freq,char * name);
MixerChannel* Install(MIXER_Handler handler,Bitu freq,const char * name);
~MixerObject();
};

View File

@ -130,6 +130,7 @@ typedef struct {
double hdend, htotal;
double parts;
} delay;
double aspect_ratio;
bool double_scan;
bool doublewidth,doubleheight;
Bit8u font[64*1024];

View File

@ -50,7 +50,7 @@
#include "inout.h"
#include "lazyflags.h"
#define CACHE_MAXSIZE (4096)
#define CACHE_MAXSIZE (4096*2)
#define CACHE_TOTAL (1024*1024*8)
#define CACHE_PAGES (512)
#define CACHE_BLOCKS (128*1024)
@ -135,13 +135,13 @@ static struct {
#define X86 0x01
#define X86_64 0x02
#define MIPSEL32 0x03
#define MIPSEL 0x03
#if C_TARGETCPU == X86_64
#include "core_dynrec/risc_x64.h"
#elif C_TARGETCPU == X86
#include "core_dynrec/risc_x86.h"
#elif C_TARGETCPU == MIPSEL32
#elif C_TARGETCPU == MIPSEL
#include "core_dynrec/risc_mipsel32.h"
#endif

View File

@ -70,8 +70,16 @@ static struct {
CodePageHandlerDynRec * last_page; // the last used page
} cache;
// cache memory pointers, to be malloc'd later
static Bit8u * cache_code_start_ptr=NULL;
static Bit8u * cache_code=NULL;
static Bit8u * cache_code_link_blocks=NULL;
static CacheBlockDynRec * cache_blocks=NULL;
static CacheBlockDynRec link_blocks[2]; // default linking (specially marked)
// the CodePageHandlerDynRec class provides access to the contained
// cache blocks and intercepts writes to the code for special treatment
class CodePageHandlerDynRec : public PageHandler {
@ -490,7 +498,7 @@ static void cache_closeblock(void) {
}
}
// advance the active block pointer
if (!block->cache.next) {
if (!block->cache.next || (block->cache.next->cache.start>(cache_code_start_ptr + CACHE_TOTAL - CACHE_MAXSIZE))) {
// LOG_MSG("Cache full restarting");
cache.block.active=cache.block.first;
} else {
@ -526,11 +534,6 @@ static INLINE void cache_addq(Bit64u val) {
static void dyn_return(BlockReturn retcode,bool ret_exception);
static void dyn_run_code(void);
// cache memory pointers, to be malloc'd later
static Bit8u * cache_code_start_ptr=NULL;
static Bit8u * cache_code=NULL;
static Bit8u * cache_code_link_blocks=NULL;
static CacheBlockDynRec * cache_blocks=NULL;
/* Define temporary pagesize so the MPROTECT case and the regular case share as much code as possible */
#if (C_HAVE_MPROTECT)

View File

@ -26,7 +26,7 @@
// try to use non-flags generating functions if possible
#define DRC_FLAGS_INVALIDATION
// try to replace _simple functions by code
// #define DRC_FLAGS_INVALIDATION_DCODE
#define DRC_FLAGS_INVALIDATION_DCODE
// type with the same size as a pointer
#define DRC_PTR_SIZE_IM Bit64u
@ -593,6 +593,81 @@ static void gen_return_function(void) {
// called when a call to a function can be replaced by a
// call to a simpler function
static void gen_fill_function_ptr(Bit8u * pos,void* fct_ptr,Bitu flags_type) {
#ifdef DRC_FLAGS_INVALIDATION_DCODE
// try to avoid function calls but rather directly fill in code
switch (flags_type) {
case t_ADDb:
case t_ADDw:
case t_ADDd:
*(Bit32u*)(pos+0)=0xf001f889; // mov eax,edi; add eax,esi
*(Bit32u*)(pos+4)=0x909006eb; // skip
*(Bit32u*)(pos+8)=0x90909090;
break;
case t_ORb:
case t_ORw:
case t_ORd:
*(Bit32u*)(pos+0)=0xf009f889; // mov eax,edi; or eax,esi
*(Bit32u*)(pos+4)=0x909006eb; // skip
*(Bit32u*)(pos+8)=0x90909090;
break;
case t_ANDb:
case t_ANDw:
case t_ANDd:
*(Bit32u*)(pos+0)=0xf021f889; // mov eax,edi; and eax,esi
*(Bit32u*)(pos+4)=0x909006eb; // skip
*(Bit32u*)(pos+8)=0x90909090;
break;
case t_SUBb:
case t_SUBw:
case t_SUBd:
*(Bit32u*)(pos+0)=0xf029f889; // mov eax,edi; sub eax,esi
*(Bit32u*)(pos+4)=0x909006eb; // skip
*(Bit32u*)(pos+8)=0x90909090;
break;
case t_XORb:
case t_XORw:
case t_XORd:
*(Bit32u*)(pos+0)=0xf031f889; // mov eax,edi; xor eax,esi
*(Bit32u*)(pos+4)=0x909006eb; // skip
*(Bit32u*)(pos+8)=0x90909090;
break;
case t_CMPb:
case t_CMPw:
case t_CMPd:
case t_TESTb:
case t_TESTw:
case t_TESTd:
*(Bit32u*)(pos+0)=0x90900aeb; // skip
*(Bit32u*)(pos+4)=0x90909090;
*(Bit32u*)(pos+8)=0x90909090;
break;
case t_INCb:
case t_INCw:
case t_INCd:
*(Bit32u*)(pos+0)=0xc0fff889; // mov eax,edi; inc eax
*(Bit32u*)(pos+4)=0x909006eb; // skip
*(Bit32u*)(pos+8)=0x90909090;
break;
case t_DECb:
case t_DECw:
case t_DECd:
*(Bit32u*)(pos+0)=0xc8fff889; // mov eax,edi; dec eax
*(Bit32u*)(pos+4)=0x909006eb; // skip
*(Bit32u*)(pos+8)=0x90909090;
break;
case t_NEGb:
case t_NEGw:
case t_NEGd:
*(Bit32u*)(pos+0)=0xd8f7f889; // mov eax,edi; neg eax
*(Bit32u*)(pos+4)=0x909006eb; // skip
*(Bit32u*)(pos+8)=0x90909090;
break;
default:
*(Bit64u*)(pos+2)=(Bit64u)fct_ptr; // fill function pointer
break;
}
#else
*(Bit64u*)(pos+2)=(Bit64u)fct_ptr;
#endif
}
#endif

View File

@ -442,31 +442,31 @@ static void gen_fill_function_ptr(Bit8u * pos,void* fct_ptr,Bitu flags_type) {
case t_ADDb:
case t_ADDw:
case t_ADDd:
*(Bit32u*)pos=0xc203c18b;
*(Bit32u*)pos=0xc203c18b; // mov eax,ecx; add eax,edx
*(pos+4)=0x90;
break;
case t_ORb:
case t_ORw:
case t_ORd:
*(Bit32u*)pos=0xc20bc18b;
*(Bit32u*)pos=0xc20bc18b; // mov eax,ecx; or eax,edx
*(pos+4)=0x90;
break;
case t_ANDb:
case t_ANDw:
case t_ANDd:
*(Bit32u*)pos=0xc223c18b;
*(Bit32u*)pos=0xc223c18b; // mov eax,ecx; and eax,edx
*(pos+4)=0x90;
break;
case t_SUBb:
case t_SUBw:
case t_SUBd:
*(Bit32u*)pos=0xc22bc18b;
*(Bit32u*)pos=0xc22bc18b; // mov eax,ecx; sub eax,edx
*(pos+4)=0x90;
break;
case t_XORb:
case t_XORw:
case t_XORd:
*(Bit32u*)pos=0xc233c18b;
*(Bit32u*)pos=0xc233c18b; // mov eax,ecx; xor eax,edx
*(pos+4)=0x90;
break;
case t_CMPb:
@ -475,33 +475,33 @@ static void gen_fill_function_ptr(Bit8u * pos,void* fct_ptr,Bitu flags_type) {
case t_TESTb:
case t_TESTw:
case t_TESTd:
*(Bit32u*)pos=0x909003eb;
*(Bit32u*)pos=0x909003eb; // skip
*(pos+4)=0x90;
break;
case t_INCb:
case t_INCw:
case t_INCd:
*(Bit32u*)pos=0x9040c18b;
*(Bit32u*)pos=0x9040c18b; // mov eax,ecx; inc eax
*(pos+4)=0x90;
break;
case t_DECb:
case t_DECw:
case t_DECd:
*(Bit32u*)pos=0x9048c18b;
*(Bit32u*)pos=0x9048c18b; // mov eax,ecx; dec eax
*(pos+4)=0x90;
break;
case t_NEGb:
case t_NEGw:
case t_NEGd:
*(Bit32u*)pos=0xd8f7c18b;
*(Bit32u*)pos=0xd8f7c18b; // mov eax,ecx; neg eax
*(pos+4)=0x90;
break;
default:
*(Bit32u*)(pos+1)=(Bit32u)((Bit8u*)fct_ptr - (pos+1+4));
*(Bit32u*)(pos+1)=(Bit32u)((Bit8u*)fct_ptr - (pos+1+4)); // fill function pointer
break;
}
#else
*(Bit32u*)(pos+1)=(Bit32u)((Bit8u*)fct_ptr - (pos+1+4));
*(Bit32u*)(pos+1)=(Bit32u)((Bit8u*)fct_ptr - (pos+1+4)); // fill function pointer
#endif
}
#endif

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: cpu.cpp,v 1.102 2007/06/12 20:22:07 c2woody Exp $ */
/* $Id: cpu.cpp,v 1.103 2007/08/09 19:52:32 c2woody Exp $ */
#include <assert.h>
#include <sstream>
@ -1487,11 +1487,16 @@ void CPU_SET_CRX(Bitu cr,Bitu value) {
} else {
GFX_SetTitle(-1,-1,false);
}
#if (C_DYNAMIC_X86)
#if (C_DYNAMIC_X86)
if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CORE) {
CPU_Core_Dyn_X86_Cache_Init(true);
cpudecoder=&CPU_Core_Dyn_X86_Run;
}
#elif (C_DYNREC)
if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CORE) {
CPU_Core_Dynrec_Cache_Init(true);
cpudecoder=&CPU_Core_Dynrec_Run;
}
#endif
CPU_AutoDetermineMode<<=CPU_AUTODETERMINE_SHIFT;
} else {
@ -2183,6 +2188,9 @@ public:
#elif (C_DYNREC)
else if (!strcasecmp(core,"dynamic")) {
cpudecoder=&CPU_Core_Dynrec_Run;
} else if (!strcasecmp(core,"auto")) {
cpudecoder=&CPU_Core_Normal_Run;
CPU_AutoDetermineMode|=CPU_AUTODETERMINE_CORE;
}
#endif
else {

View File

@ -169,6 +169,7 @@ public:
bool ReadSectors (PhysPt buffer, bool raw, unsigned long sector, unsigned long num);
bool LoadUnloadMedia (bool unload);
bool ReadSector (Bit8u *buffer, bool raw, unsigned long sector);
bool HasDataTrack (void);
static CDROM_Interface_Image* images[26];
@ -202,6 +203,7 @@ static struct imagePlayer {
static int refCount;
std::vector<Track> tracks;
typedef std::vector<Track>::iterator track_it;
std::string mcn;
Bit8u subUnit;
};

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: cdrom_image.cpp,v 1.16 2007/06/12 20:22:08 c2woody Exp $ */
/* $Id: cdrom_image.cpp,v 1.17 2007/08/22 11:54:35 qbix79 Exp $ */
#include <cctype>
#include <cmath>
@ -575,6 +575,16 @@ bool CDROM_Interface_Image::AddTrack(Track &curr, int &shift, int prestart, int
return true;
}
bool CDROM_Interface_Image::HasDataTrack(void)
{
//Data track has attribute 0x40
for(track_it it = tracks.begin(); it != tracks.end(); it++) {
if ((*it).attr == 0x40) return true;
}
return false;
}
bool CDROM_Interface_Image::GetRealFileName(string &filename, string &pathname)
{
// check if file exists

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_execute.cpp,v 1.60 2007/01/11 16:31:10 c2woody Exp $ */
/* $Id: dos_execute.cpp,v 1.61 2007/08/09 19:52:33 c2woody Exp $ */
#include <string.h>
#include <ctype.h>
@ -151,7 +151,7 @@ bool DOS_Terminate(bool tsr) {
} else {
GFX_SetTitle(-1,-1,false);
}
#if (C_DYNAMIC_X86)
#if (C_DYNAMIC_X86) || (C_DYNREC)
if (CPU_AutoDetermineMode&CPU_AUTODETERMINE_CORE) {
cpudecoder=&CPU_Core_Normal_Run;
CPU_CycleLeft=0;

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_files.cpp,v 1.90 2007/06/29 10:24:43 qbix79 Exp $ */
/* $Id: dos_files.cpp,v 1.91 2007/08/22 07:34:57 qbix79 Exp $ */
#include <string.h>
#include <stdlib.h>
@ -94,7 +94,7 @@ bool DOS_MakeName(char const * const name,char * const fullname,Bit8u * drive) {
upname[w++]=c;
break;
default:
LOG(LOG_FILES,LOG_NORMAL)("Makename encountered an illegal char %c hex:%X !",c,c);
LOG(LOG_FILES,LOG_NORMAL)("Makename encountered an illegal char %c hex:%X in %s!",c,c,name);
DOS_SetError(DOSERR_PATH_NOT_FOUND);return false;
break;
}
@ -768,7 +768,7 @@ checkext:
index++;
}
savefcb:
if (!hasdrive & !(parser & PARSE_DFLT_DRIVE)) fcb_name.part.drive[0]=dos.current_drive+1;
if (!hasdrive & !(parser & PARSE_DFLT_DRIVE)) fcb_name.part.drive[0] = 0;
if (!hasname & !(parser & PARSE_BLNK_FNAME)) strcpy(fcb_name.part.name," ");
if (!hasext & !(parser & PARSE_BLNK_FEXT)) strcpy(fcb_name.part.ext," ");
fcb.SetName(fcb_name.part.drive[0],fcb_name.part.name,fcb_name.part.ext);

View File

@ -188,6 +188,46 @@ static Bit32u read_kcl_file(const char* kcl_file_name, const char* layout_id) {
return 0;
}
static Bit32u read_kcl_data(Bit8u * kcl_data, Bit32u kcl_data_size, const char* layout_id) {
// check ID-bytes
if ((kcl_data[0]!=0x4b) || (kcl_data[1]!=0x43) || (kcl_data[2]!=0x46)) {
return 0;
}
Bit32u dpos=7+kcl_data[6];
for (;;) {
if (dpos+5>kcl_data_size) break;
Bit32u cur_pos=dpos;
Bit16u len=host_readw(&kcl_data[dpos]);
Bit8u data_len=kcl_data[dpos+2];
dpos+=5;
char lng_codes[256];
// get all language codes for this layout
for (Bitu i=0; i<data_len;) {
i+=2;
Bitu lcpos=0;
for (;i<data_len;) {
if (dpos+1>kcl_data_size) break;
char lc=(char)kcl_data[dpos];
dpos++;
i++;
if (lc==',') break;
lng_codes[lcpos++]=lc;
}
lng_codes[lcpos]=0;
if (strcasecmp(lng_codes, layout_id)==0) {
// language ID found, return position
return cur_pos;
}
dpos+=2;
}
dpos=cur_pos+3+len;
}
return 0;
}
Bitu keyboard_layout::read_keyboard_file(const char* keyboard_file_name, Bit32s specific_layout, Bit32s requested_codepage) {
this->reset();
@ -202,72 +242,36 @@ Bitu keyboard_layout::read_keyboard_file(const char* keyboard_file_name, Bit32s
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<read_buf_size; i++) read_buf[i]=layout_BG[i];
} else if (!strncasecmp(keyboard_file_name,"CZ243",5)) {
read_buf_size=1003;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_CZ243[i];
} else if (!strncasecmp(keyboard_file_name,"FR",2)) {
read_buf_size=581;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_FR[i];
} else if (!strncasecmp(keyboard_file_name,"GK",2)) {
read_buf_size=1117;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_GK[i];
} else if (!strncasecmp(keyboard_file_name,"GR",2)) {
read_buf_size=596;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_GR[i];
} else if (!strncasecmp(keyboard_file_name,"HR",2)) {
read_buf_size=993;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_HR[i];
} else if (!strncasecmp(keyboard_file_name,"HU",2)) {
read_buf_size=964;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_HU[i];
} else if (!strncasecmp(keyboard_file_name,"IT",2)) {
read_buf_size=236;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_IT[i];
} else if (!strncasecmp(keyboard_file_name,"NL",2)) {
read_buf_size=552;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_NL[i];
} else if (!strncasecmp(keyboard_file_name,"NO",2)) {
read_buf_size=477;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_NO[i];
} else if (!strncasecmp(keyboard_file_name,"PL",2)) {
read_buf_size=261;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_PL[i];
} else if (!strncasecmp(keyboard_file_name,"RU",2)) {
read_buf_size=1130;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_RU[i];
} else if (!strncasecmp(keyboard_file_name,"SK",2)) {
read_buf_size=993;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_SK[i];
} else if (!strncasecmp(keyboard_file_name,"SP",2)) {
read_buf_size=471;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_SP[i];
} else if (!strncasecmp(keyboard_file_name,"SU",2)) {
read_buf_size=683;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_SU[i];
} else if (!strncasecmp(keyboard_file_name,"SV",2)) {
read_buf_size=683;
for (Bitu i=0; i<read_buf_size; i++) read_buf[i]=layout_SV[i];
} else {
// neither a matching .kl-file found, nor is the layout available internally
// try keyboard layout libraries next
if ((start_pos=read_kcl_file("keyboard.sys",keyboard_file_name))==0) {
if ((start_pos=read_kcl_file("keybrd2.sys",keyboard_file_name))==0) {
if ((start_pos=read_kcl_file("keybrd3.sys",keyboard_file_name))==0) {
LOG(LOG_BIOS,LOG_ERROR)("Keyboard layout file %s not found",keyboard_file_name);
return KEYB_FILENOTFOUND;
} else tempfile = OpenDosboxFile("keybrd3.sys");
} else tempfile = OpenDosboxFile("keybrd2.sys");
} else tempfile = OpenDosboxFile("keyboard.sys");
if (start_pos=read_kcl_file("keyboard.sys",keyboard_file_name)) {
tempfile = OpenDosboxFile("keyboard.sys");
fseek(tempfile, start_pos+2, SEEK_SET);
read_buf_size=(Bit32u)fread(read_buf, sizeof(Bit8u), 65535, tempfile);
fclose(tempfile);
start_pos=0;
} else if (start_pos=read_kcl_file("keybrd2.sys",keyboard_file_name)) {
tempfile = OpenDosboxFile("keybrd2.sys");
fseek(tempfile, start_pos+2, SEEK_SET);
read_buf_size=(Bit32u)fread(read_buf, sizeof(Bit8u), 65535, tempfile);
fclose(tempfile);
} else if (start_pos=read_kcl_file("keybrd3.sys",keyboard_file_name)) {
tempfile = OpenDosboxFile("keybrd3.sys");
fseek(tempfile, start_pos+2, SEEK_SET);
read_buf_size=(Bit32u)fread(read_buf, sizeof(Bit8u), 65535, tempfile);
fclose(tempfile);
} else if (start_pos=read_kcl_data(layout_keyboardsys,33196,keyboard_file_name)) {
read_buf_size=0;
for (Bitu ct=start_pos+2; ct<33196; ct++) read_buf[read_buf_size++]=layout_keyboardsys[ct];
} else if (start_pos=read_kcl_data(layout_keybrd2sys,25431,keyboard_file_name)) {
read_buf_size=0;
for (Bitu ct=start_pos+2; ct<25431; ct++) read_buf[read_buf_size++]=layout_keybrd2sys[ct];
} else if (start_pos=read_kcl_data(layout_keybrd3sys,27122,keyboard_file_name)) {
read_buf_size=0;
for (Bitu ct=start_pos+2; ct<27122; ct++) read_buf[read_buf_size++]=layout_keybrd3sys[ct];
} else {
LOG(LOG_BIOS,LOG_ERROR)("Keyboard layout file %s not found",keyboard_file_name);
return KEYB_FILENOTFOUND;
}
start_pos=0;
} else {
// check ID-bytes of file
Bit32u dr=(Bit32u)fread(read_buf, sizeof(Bit8u), 4, tempfile);
@ -386,9 +390,9 @@ Bitu keyboard_layout::read_keyboard_file(const char* keyboard_file_name, Bit32s
if (addmap>additional_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
if (read_buf[read_buf_pos-2]&0x80) kchar|=read_buf[charptr+1]<<8; // scancode/char pair
// overwrite mapping
current_layout[scan*layout_pages+addmap]=kchar;
// clear command bit
@ -572,53 +576,41 @@ Bit16u keyboard_layout::extract_codepage(const char* keyboard_file_name) {
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)) {
for (Bitu i=0; i<687; i++) read_buf[i]=layout_BG[i];
} else if (!strncasecmp(keyboard_file_name,"CZ243",5)) {
for (Bitu i=0; i<1003; i++) read_buf[i]=layout_CZ243[i];
} else if (!strncasecmp(keyboard_file_name,"FR",2)) {
for (Bitu i=0; i<581; i++) read_buf[i]=layout_FR[i];
} else if (!strncasecmp(keyboard_file_name,"GK",2)) {
for (Bitu i=0; i<1117; i++) read_buf[i]=layout_GK[i];
} else if (!strncasecmp(keyboard_file_name,"GR",2)) {
for (Bitu i=0; i<596; i++) read_buf[i]=layout_GR[i];
} else if (!strncasecmp(keyboard_file_name,"HR",2)) {
for (Bitu i=0; i<993; i++) read_buf[i]=layout_HR[i];
} else if (!strncasecmp(keyboard_file_name,"HU",2)) {
for (Bitu i=0; i<964; i++) read_buf[i]=layout_HU[i];
} else if (!strncasecmp(keyboard_file_name,"IT",2)) {
for (Bitu i=0; i<236; i++) read_buf[i]=layout_IT[i];
} else if (!strncasecmp(keyboard_file_name,"NL",2)) {
for (Bitu i=0; i<552; i++) read_buf[i]=layout_NL[i];
} else if (!strncasecmp(keyboard_file_name,"NO",2)) {
for (Bitu i=0; i<477; i++) read_buf[i]=layout_NO[i];
} else if (!strncasecmp(keyboard_file_name,"PL",2)) {
for (Bitu i=0; i<261; i++) read_buf[i]=layout_PL[i];
} else if (!strncasecmp(keyboard_file_name,"RU",2)) {
for (Bitu i=0; i<1130; i++) read_buf[i]=layout_RU[i];
} else if (!strncasecmp(keyboard_file_name,"SK",2)) {
for (Bitu i=0; i<993; i++) read_buf[i]=layout_SK[i];
} else if (!strncasecmp(keyboard_file_name,"SP",2)) {
for (Bitu i=0; i<471; i++) read_buf[i]=layout_SP[i];
} else if (!strncasecmp(keyboard_file_name,"SU",2)) {
for (Bitu i=0; i<683; i++) read_buf[i]=layout_SU[i];
} else if (!strncasecmp(keyboard_file_name,"SV",2)) {
for (Bitu i=0; i<683; i++) read_buf[i]=layout_SV[i];
} else {
if ((start_pos=read_kcl_file("keyboard.sys",keyboard_file_name))==0) {
if ((start_pos=read_kcl_file("keybrd2.sys",keyboard_file_name))==0) {
if ((start_pos=read_kcl_file("keybrd3.sys",keyboard_file_name))==0) {
LOG(LOG_BIOS,LOG_ERROR)("Keyboard layout file %s not found",keyboard_file_name);
return 437;
} else tempfile = OpenDosboxFile("keybrd3.sys");
} else tempfile = OpenDosboxFile("keybrd2.sys");
} else tempfile = OpenDosboxFile("keyboard.sys");
// try keyboard layout libraries next
if (start_pos=read_kcl_file("keyboard.sys",keyboard_file_name)) {
tempfile = OpenDosboxFile("keyboard.sys");
fseek(tempfile, start_pos+2, SEEK_SET);
read_buf_size=(Bit32u)fread(read_buf, sizeof(Bit8u), 65535, tempfile);
fclose(tempfile);
start_pos=0;
} else if (start_pos=read_kcl_file("keybrd2.sys",keyboard_file_name)) {
tempfile = OpenDosboxFile("keybrd2.sys");
fseek(tempfile, start_pos+2, SEEK_SET);
read_buf_size=(Bit32u)fread(read_buf, sizeof(Bit8u), 65535, tempfile);
fclose(tempfile);
start_pos=0;
} else if (start_pos=read_kcl_file("keybrd3.sys",keyboard_file_name)) {
tempfile = OpenDosboxFile("keybrd3.sys");
fseek(tempfile, start_pos+2, SEEK_SET);
read_buf_size=(Bit32u)fread(read_buf, sizeof(Bit8u), 65535, tempfile);
fclose(tempfile);
start_pos=0;
} else if (start_pos=read_kcl_data(layout_keyboardsys,33196,keyboard_file_name)) {
read_buf_size=0;
for (Bitu ct=start_pos+2; ct<33196; ct++) read_buf[read_buf_size++]=layout_keyboardsys[ct];
start_pos=0;
} else if (start_pos=read_kcl_data(layout_keybrd2sys,25431,keyboard_file_name)) {
read_buf_size=0;
for (Bitu ct=start_pos+2; ct<25431; ct++) read_buf[read_buf_size++]=layout_keybrd2sys[ct];
start_pos=0;
} else if (start_pos=read_kcl_data(layout_keybrd3sys,27122,keyboard_file_name)) {
read_buf_size=0;
for (Bitu ct=start_pos+2; ct<27122; ct++) read_buf[read_buf_size++]=layout_keybrd3sys[ct];
start_pos=0;
} else {
start_pos=0;
LOG(LOG_BIOS,LOG_ERROR)("Keyboard layout file %s not found",keyboard_file_name);
return 437;
}
} else {
// check ID-bytes of file

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dos_programs.cpp,v 1.76 2007/07/02 14:10:27 c2woody Exp $ */
/* $Id: dos_programs.cpp,v 1.77 2007/08/22 11:54:54 qbix79 Exp $ */
#include "dosbox.h"
#include <stdlib.h>
@ -528,9 +528,9 @@ public:
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;i<temp_line.size();i++) temp_line[i]=toupper(temp_line[i]);
cart_cmd=temp_line;
if(cmd->FindCommand(i + 1, temp_line)) {
for(size_t ct = 0;ct < temp_line.size();ct++) temp_line[ct] = toupper(temp_line[ct]);
cart_cmd = temp_line;
} else {
printError();
return;

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: drive_iso.cpp,v 1.20 2007/06/15 19:05:48 c2woody Exp $ */
/* $Id: drive_iso.cpp,v 1.21 2007/08/22 11:54:35 qbix79 Exp $ */
#include <cctype>
#include <cstring>
@ -182,7 +182,36 @@ isoDrive::isoDrive(char driveLetter, const char *fileName, Bit8u mediaid, int &e
//Remove trailing dot.
if((labelPos > 0) && (discLabel[labelPos - 1] == '.'))
discLabel[labelPos - 1] = 0;
} else error = 6;
} else if (CDROM_Interface_Image::images[subUnit]->HasDataTrack() == false) { //Audio only cdrom
strcpy(info, "isoDrive ");
strcat(info, fileName);
this->driveLetter = driveLetter;
this->mediaid = mediaid;
char buffer[32] = { 0 };
strcpy(buffer, "Audio CD");
//Code Copied from drive_cache. (convert mscdex label to a dos 8.3 file)
Bitu togo = 8;
Bitu bufPos = 0;
Bitu labelPos = 0;
bool point = false;
while (togo>0) {
if (buffer[bufPos]==0) break;
if (!point && (buffer[bufPos]=='.')) { togo=4; point=true; }
discLabel[labelPos] = toupper(buffer[bufPos]);
labelPos++; bufPos++;
togo--;
if ((togo==0) && !point) {
if (buffer[bufPos]=='.') bufPos++;
discLabel[labelPos]='.'; labelPos++; point=true; togo=3;
}
};
discLabel[labelPos]=0;
//Remove trailing dot.
if((labelPos > 0) && (discLabel[labelPos - 1] == '.'))
discLabel[labelPos - 1] = 0;
} else error = 6; //Corrupt image
}
}
@ -530,13 +559,19 @@ int isoDrive :: readDirEntry(isoDirEntry *de, Bit8u *data)
bool isoDrive :: loadImage()
{
isoPVD pvd;
dataCD = false;
readSector((Bit8u*)(&pvd), ISO_FIRST_VD);
if (pvd.type != 1 || strncmp((char*)pvd.standardIdent, "CD001", 5) || pvd.version != 1) return false;
return (readDirEntry(&this->rootEntry, pvd.rootEntry)>0);
if (readDirEntry(&this->rootEntry, pvd.rootEntry)>0) {
dataCD = true;
return true;
}
return false;
}
bool isoDrive :: lookup(isoDirEntry *de, const char *path)
{
if (!dataCD) return false;
*de = this->rootEntry;
if (!strcmp(path, "")) return true;

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: drives.h,v 1.37 2007/06/14 08:23:46 qbix79 Exp $ */
/* $Id: drives.h,v 1.38 2007/08/22 11:54:35 qbix79 Exp $ */
#ifndef _DRIVES_H__
#define _DRIVES_H__
@ -357,6 +357,7 @@ private:
Bit8u data[ISO_FRAMESIZE];
} sectorHashEntries[ISO_MAX_HASH_TABLE_SIZE];
bool dataCD;
isoDirEntry rootEntry;
Bit8u mediaid;
char fileName[CROSS_LEN];

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dosbox.cpp,v 1.118 2007/07/02 20:06:59 c2woody Exp $ */
/* $Id: dosbox.cpp,v 1.121 2007/08/16 07:50:31 c2woody Exp $ */
#include <stdlib.h>
#include <stdarg.h>
@ -221,10 +221,22 @@ void DOSBOX_RunMachine(void){
}
static void DOSBOX_UnlockSpeed( bool pressed ) {
if (pressed)
static bool autoadjust = false;
if (pressed) {
ticksLocked = true;
else
if (CPU_CycleAutoAdjust) {
autoadjust = true;
CPU_CycleAutoAdjust = false;
CPU_CycleMax /= 3;
if (CPU_CycleMax<1000) CPU_CycleMax=1000;
}
} else {
ticksLocked = false;
if (autoadjust) {
autoadjust = false;
CPU_CycleAutoAdjust = true;
}
}
}
static void DOSBOX_RealInit(Section * sec) {
@ -287,7 +299,7 @@ void DOSBOX_Init(void) {
MSG_Add("DOSBOX_CONFIGFILE_HELP",
"language -- Select another language file.\n"
"memsize -- Amount of memory dosbox has in megabytes.\n"
"memsize -- Amount of memory DOSBox has in megabytes.\n"
"machine -- The type of machine tries to emulate:hercules,cga,tandy,pcjr,vga.\n"
"captures -- Directory where things like wave,midi,screenshot get captured.\n"
);
@ -297,7 +309,7 @@ void DOSBOX_Init(void) {
secprop->Add_bool("aspect",false);
secprop->Add_string("scaler","normal2x");
MSG_Add("RENDER_CONFIGFILE_HELP",
"frameskip -- How many frames dosbox skips before drawing one.\n"
"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,hq2x,hq3x,\n"
@ -308,7 +320,7 @@ void DOSBOX_Init(void) {
);
secprop=control->AddSection_prop("cpu",&CPU_Init,true);//done
#if (C_DYNAMIC_X86)
#if (C_DYNAMIC_X86) || (C_DYNREC)
secprop->Add_string("core","auto");
#else
secprop->Add_string("core","normal");
@ -318,12 +330,12 @@ void DOSBOX_Init(void) {
secprop->Add_int("cycledown",20);
MSG_Add("CPU_CONFIGFILE_HELP",
"core -- CPU Core used in emulation: normal,simple"
#if (C_DYNAMIC_X86)
#if (C_DYNAMIC_X86) || (C_DYNREC)
",dynamic,auto.\n"
" auto switches from normal to dynamic if appropriate"
#endif
".\n"
"cycles -- Amount of instructions dosbox tries to emulate each millisecond.\n"
"cycles -- Amount of instructions DOSBox tries to emulate each millisecond.\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"
@ -383,7 +395,7 @@ void DOSBOX_Init(void) {
MSG_Add("SBLASTER_CONFIGFILE_HELP",
"sbtype -- Type of sblaster to emulate:none,sb1,sb2,sbpro1,sbpro2,sb16.\n"
"sbbase,irq,dma,hdma -- The IO/IRQ/DMA/High DMA address of the soundblaster.\n"
"mixer -- Allow the soundblaster mixer to modify the dosbox mixer.\n"
"mixer -- Allow the soundblaster mixer to modify the DOSBox mixer.\n"
"oplmode -- Type of OPL emulation: auto,cms,opl2,dualopl2,opl3.\n"
" On auto the mode is determined by sblaster type.\n"
" All OPL modes are 'Adlib', except for CMS.\n"
@ -432,7 +444,9 @@ void DOSBOX_Init(void) {
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"
" 2axis (supports two joysticks,\n"
" 4axis (supports one joystick, first joystick used),\n"
" 4axis_2 (supports one joystick, second joystick used),\n"
" fcs (Thrustmaster), ch (CH Flightstick).\n"
" none disables joystick emulation.\n"
" auto chooses emulation depending on real joystick(s).\n"

View File

@ -1 +1,37 @@
dosbox_ico ICON dosbox.ico
#include "afxres.h"
// icon resource
dosbox_ico ICON "dosbox.ico"
// version resource
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,72,0,0
PRODUCTVERSION 0,72,0,0
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "© 2002-2007 DOSBox Team, published under GNU GPL"
VALUE "CompanyName", "DOSBox Team"
VALUE "FileDescription", "DOSBox DOS Emulator"
VALUE "FileVersion", "0, 72, 0, 0"
VALUE "InternalName", "DOSBox"
VALUE "LegalCopyright", "Copyright © 2002-2007 DOSBox Team"
VALUE "OriginalFilename", "dosbox.exe"
VALUE "ProductName", "DOSBox DOS Emulator"
VALUE "ProductVersion", "0, 72, 0, 0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: midi_alsa.h,v 1.16 2007/06/14 08:23:46 qbix79 Exp $ */
/* $Id: midi_alsa.h,v 1.17 2007/08/08 08:04:53 qbix79 Exp $ */
#define ALSA_PCM_OLD_HW_PARAMS_API
#define ALSA_PCM_OLD_SW_PARAMS_API
@ -125,6 +125,7 @@ public:
bool Open(const char * conf) {
char var[10];
unsigned int caps;
bool defaultport = true; //try 17:0 as well. Seems to be default nowadays
// try to use port specified in config file
if (conf && conf[0]) {
@ -133,6 +134,7 @@ public:
LOG_MSG("ALSA:Invalid alsa port %s", var);
return false;
}
defaultport = false;
}
// default port if none specified
else if (parse_addr("65:0", &seq_client, &seq_port) < 0) {
@ -164,11 +166,20 @@ public:
if (seq_client != SND_SEQ_ADDRESS_SUBSCRIBERS) {
/* subscribe to MIDI port */
if (snd_seq_connect_to(seq_handle, my_port, seq_client, seq_port) < 0) {
if (defaultport) { //if port "65:0" (default) try "17:0" as well
seq_client = 17; seq_port = 0; //Update reported values
if(snd_seq_connect_to(seq_handle,my_port,seq_client,seq_port) < 0) {
snd_seq_close(seq_handle);
LOG_MSG("ALSA:Can't subscribe to MIDI port (65:0) nor (17:0)");
return false;
}
} else {
snd_seq_close(seq_handle);
LOG_MSG("ALSA:Can't subscribe to MIDI port (%d:%d)", seq_client, seq_port);
return false;
}
}
}
LOG_MSG("ALSA:Client initialised [%d:%d]", seq_client, seq_port);
return true;

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: render.cpp,v 1.54 2007/07/05 16:03:49 c2woody Exp $ */
/* $Id: render.cpp,v 1.55 2007/08/11 12:19:00 qbix79 Exp $ */
#include <sys/types.h>
#include <dirent.h>
@ -620,7 +620,8 @@ void RENDER_Init(Section * sec) {
}
//If something changed that needs a ReInit
if(running &&((render.aspect != aspect) || (render.scale.op != scaleOp) ||
// Only ReInit when there is a src.bpp (fixes crashes on startup and directly changing the scaler without a screen specified yet)
if(running && render.src.bpp && ((render.aspect != aspect) || (render.scale.op != scaleOp) ||
(render.scale.size != scalersize) || (render.scale.forced != scalerforced) ||
render.scale.forced))
RENDER_CallBack( GFX_CallBackReset );

View File

@ -80,7 +80,7 @@
#endif
#if SBPP == 32
#define RGBtoYUV(c) _RGBtoYUV[((c & 0xf80000) >> 8) | ((c & 0x00fc00) >> 12) | ((c & 0x0000f8) >> 3)]
#define RGBtoYUV(c) _RGBtoYUV[((c & 0xf80000) >> 8) | ((c & 0x00fc00) >> 5) | ((c & 0x0000f8) >> 3)]
#else
#define RGBtoYUV(c) _RGBtoYUV[c]
#endif

View File

@ -82,7 +82,7 @@
#endif
#if SBPP == 32
#define RGBtoYUV(c) _RGBtoYUV[((c & 0xf80000) >> 8) | ((c & 0x00fc00) >> 12) | ((c & 0x0000f8) >> 3)]
#define RGBtoYUV(c) _RGBtoYUV[((c & 0xf80000) >> 8) | ((c & 0x00fc00) >> 5) | ((c & 0x0000f8) >> 3)]
#else
#define RGBtoYUV(c) _RGBtoYUV[c]
#endif

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sdl_mapper.cpp,v 1.39 2007/07/17 13:50:27 c2woody Exp $ */
/* $Id: sdl_mapper.cpp,v 1.44 2007/08/17 18:49:56 qbix79 Exp $ */
#include <vector>
#include <list>
@ -597,22 +597,21 @@ bool autofire = false;
class CStickBindGroup : public CBindGroup {
public:
CStickBindGroup(Bitu _stick,bool _dummy=false) : CBindGroup (){
stick=_stick;
sprintf(configname,"stick_%d",stick);
is_dummy=_dummy;
if (_dummy) {
CStickBindGroup(Bitu _stick,Bitu _emustick,bool _dummy=false) : CBindGroup (){
stick=_stick; // the number of the physical device (SDL numbering|)
emustick=_emustick; // the number of the emulated device
sprintf(configname,"stick_%d",emustick);
sdl_joystick=NULL;
axes=0; buttons=0; hats=0;
button_wrap=0;
button_cap=0; axes_cap=0; hats_cap=0;
return;
}
emulated_buttons=0; emulated_axes=0; emulated_hats=0;
// initialize emulated joystick state
emulated_axes=2;
emulated_buttons=2;
emulated_hats=0;
is_dummy=_dummy;
if (_dummy) return;
// initialize binding lists and position data
pos_axis_lists=new CBindList[4];
neg_axis_lists=new CBindList[4];
button_lists=new CBindList[MAXBUTTON];
@ -628,18 +627,18 @@ public:
old_neg_axis_state[i]=false;
}
//if the first stick is set, we must be the second
// emustick=JOYSTICK_IsEnabled(0);
emustick=stick;
// initialize emulated joystick state
emulated_axes=2;
emulated_buttons=2;
emulated_hats=0;
JOYSTICK_Enable(emustick,true);
sdl_joystick=SDL_JoystickOpen(_stick);
if (sdl_joystick==NULL) {
axes=0; buttons=0; hats=0;
button_wrap=0;
button_cap=0; axes_cap=0; hats_cap=0;
button_wrap=emulated_buttons;
return;
}
axes=SDL_JoystickNumAxes(sdl_joystick);
buttons=SDL_JoystickNumButtons(sdl_joystick);
hats=SDL_JoystickNumHats(sdl_joystick);
@ -883,7 +882,7 @@ protected:
class C4AxisBindGroup : public CStickBindGroup {
public:
C4AxisBindGroup(Bitu _stick) : CStickBindGroup (_stick){
C4AxisBindGroup(Bitu _stick,Bitu _emustick) : CStickBindGroup (_stick,_emustick){
emulated_axes=4;
emulated_buttons=4;
if (button_wrapping_enabled) button_wrap=emulated_buttons;
@ -953,7 +952,7 @@ public:
class CFCSBindGroup : public CStickBindGroup {
public:
CFCSBindGroup(Bitu _stick) : CStickBindGroup (_stick){
CFCSBindGroup(Bitu _stick,Bitu _emustick) : CStickBindGroup (_stick,_emustick){
emulated_axes=4;
emulated_buttons=4;
old_hat_position=0;
@ -1090,7 +1089,7 @@ private:
class CCHBindGroup : public CStickBindGroup {
public:
CCHBindGroup(Bitu _stick) : CStickBindGroup (_stick){
CCHBindGroup(Bitu _stick,Bitu _emustick) : CStickBindGroup (_stick,_emustick){
emulated_axes=4;
emulated_buttons=6;
emulated_hats=1;
@ -1907,13 +1906,13 @@ static void CreateLayout(void) {
}
}
/* Create some text buttons */
new CTextButton(PX(6),00,124,20,"Keyboard Layout");
new CTextButton(PX(17),00,124,20,"Joystick Layout");
new CTextButton(PX(6),0,124,20,"Keyboard Layout");
new CTextButton(PX(17),0,124,20,"Joystick Layout");
bind_but.action=new CCaptionButton(185,330,0,0);
bind_but.action=new CCaptionButton(180,330,0,0);
bind_but.event_title=new CCaptionButton(0,350,0,0);
bind_but.bind_title=new CCaptionButton(00,365,0,0);
bind_but.bind_title=new CCaptionButton(0,365,0,0);
/* Create binding support buttons */
@ -2096,6 +2095,7 @@ static void MAPPER_SaveBinds(void) {
fprintf(savefile,"\n");
}
fclose(savefile);
change_action_text("Mapper file saved.",CLR_WHITE);
}
static bool MAPPER_LoadBinds(void) {
@ -2106,6 +2106,7 @@ static bool MAPPER_LoadBinds(void) {
CreateStringBind(linein);
}
fclose(loadfile);
LOG_MSG("MAPPER: Loading mapper settings from %s", mapper.filename);
return true;
}
@ -2149,9 +2150,15 @@ static void InitializeJoysticks(void) {
if (joytype != JOY_NONE) {
mapper.sticks.num=SDL_NumJoysticks();
if (joytype==JOY_AUTO) {
if (mapper.sticks.num>1) joytype=JOY_2AXIS;
else if (mapper.sticks.num) joytype=JOY_4AXIS;
else joytype=JOY_NONE;
if (mapper.sticks.num>1) {
joytype=JOY_2AXIS;
LOG_MSG("Two or more joysticks reported, initializing with 2axis");
} else if (mapper.sticks.num) {
joytype=JOY_4AXIS;
LOG_MSG("One joystick reported, initializing with 4axis");
} else {
joytype=JOY_NONE;
}
}
}
}
@ -2173,24 +2180,28 @@ static void CreateBindGroups(void) {
case JOY_NONE:
break;
case JOY_4AXIS:
mapper.sticks.stick[mapper.sticks.num_groups++]=new C4AxisBindGroup(joyno);
new CStickBindGroup(joyno+1U,true);
mapper.sticks.stick[mapper.sticks.num_groups++]=new C4AxisBindGroup(joyno,joyno);
new CStickBindGroup(joyno+1U,joyno+1U,true);
break;
case JOY_4AXIS_2:
mapper.sticks.stick[mapper.sticks.num_groups++]=new C4AxisBindGroup(joyno+1U,joyno);
new CStickBindGroup(joyno,joyno+1U,true);
break;
case JOY_FCS:
mapper.sticks.stick[mapper.sticks.num_groups++]=new CFCSBindGroup(joyno);
new CStickBindGroup(joyno+1U,true);
mapper.sticks.stick[mapper.sticks.num_groups++]=new CFCSBindGroup(joyno,joyno);
new CStickBindGroup(joyno+1U,joyno+1U,true);
break;
case JOY_CH:
mapper.sticks.stick[mapper.sticks.num_groups++]=new CCHBindGroup(joyno);
new CStickBindGroup(joyno+1U,true);
mapper.sticks.stick[mapper.sticks.num_groups++]=new CCHBindGroup(joyno,joyno);
new CStickBindGroup(joyno+1U,joyno+1U,true);
break;
case JOY_2AXIS:
default:
mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(joyno);
mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(joyno,joyno);
if((joyno+1U) < mapper.sticks.num) {
mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(joyno+1U);
mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(joyno+1U,joyno+1U);
} else {
new CStickBindGroup(joyno+1U,true);
new CStickBindGroup(joyno+1U,joyno+1U,true);
}
break;
}
@ -2232,7 +2243,10 @@ void MAPPER_Run(bool pressed) {
/* Set some palette entries */
SDL_SetPalette(mapper.surface, SDL_LOGPAL|SDL_PHYSPAL, map_pal, 0, 5);
if (last_clicked) {
last_clicked->SetColor(CLR_WHITE);
last_clicked=NULL;
}
/* Go in the event loop */
mapper.exit=false;
mapper.redraw=true;

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sdlmain.cpp,v 1.131 2007/06/12 20:22:08 c2woody Exp $ */
/* $Id: sdlmain.cpp,v 1.134 2007/08/26 18:03:25 qbix79 Exp $ */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
@ -948,13 +948,16 @@ static void GUI_StartUp(Section * sec) {
sdl.active=false;
sdl.updating=false;
#if !defined(MACOSX)
/* Set Icon (must be done before any sdl_setvideomode call) */
/* But don't set it on OS X, as we use a nicer external icon there. */
#if WORDS_BIGENDIAN
SDL_Surface* logos= SDL_CreateRGBSurfaceFrom((void*)logo,32,32,32,128,0xff000000,0x00ff0000,0x0000ff00,0);
#else
SDL_Surface* logos= SDL_CreateRGBSurfaceFrom((void*)logo,32,32,32,128,0x000000ff,0x0000ff00,0x00ff0000,0);
#endif
SDL_WM_SetIcon(logos,NULL);
#endif
sdl.desktop.fullscreen=section->Get_bool("fullscreen");
sdl.wait_on_error=section->Get_bool("waitonerror");
@ -1347,12 +1350,6 @@ int main(int argc, char* argv[]) {
CommandLine com_line(argc,argv);
Config myconf(&com_line);
control=&myconf;
if (control->cmdline->FindExist("-version") ||
control->cmdline->FindExist("--version") ) {
printf(VERSION "\n");
return 0;
}
/* Can't disable the console with debugger enabled */
#if defined(WIN32) && !(C_DEBUG)
@ -1369,13 +1366,23 @@ int main(int argc, char* argv[]) {
fclose(stdin);
fclose(stdout);
fclose(stderr);
freopen("CONIN$","w",stdin);
freopen("CONIN$","r",stdin);
freopen("CONOUT$","w",stdout);
freopen("CONOUT$","w",stderr);
}
SetConsoleTitle("DOSBox Status Window");
}
#endif //defined(WIN32) && !(C_DEBUG)
if (control->cmdline->FindExist("-version") ||
control->cmdline->FindExist("--version") ) {
printf("\nDOSBox version %s, copyright 2002-2007 DOSBox Team.\n\n",VERSION);
printf("DOSBox is written by the DOSBox Team (See AUTHORS file))\n");
printf("DOSBox comes with ABSOLUTELY NO WARRANTY. This is free software,\n");
printf("and you are welcome to redistribute it under certain conditions;\n");
printf("please read the COPYING file thoroughly before doing so.\n\n");
return 0;
}
#if C_DEBUG
DEBUG_SetupConsole();
#endif
@ -1393,6 +1400,12 @@ int main(int argc, char* argv[]) {
setbuf(stderr, NULL);
#endif
/* Display Welcometext in the console */
LOG_MSG("DOSBox version %s",VERSION);
LOG_MSG("Copyright 2002-2007 DOSBox Team, published under GNU GPL.");
LOG_MSG("---");
/* Init SDL */
if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM
|SDL_INIT_NOPARACHUTE
) < 0 ) E_Exit("Can't init SDL %s",SDL_GetError());

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: joystick.cpp,v 1.18 2007/02/22 08:44:07 qbix79 Exp $ */
/* $Id: joystick.cpp,v 1.19 2007/08/12 10:23:36 c2woody Exp $ */
#include <string.h>
#include "dosbox.h"
@ -201,6 +201,7 @@ public:
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,"4axis_2")) joytype = JOY_4AXIS_2;
else if (!strcasecmp(type,"fcs")) joytype = JOY_FCS;
else if (!strcasecmp(type,"ch")) joytype = JOY_CH;
else joytype = JOY_AUTO;

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: mixer.cpp,v 1.46 2007/06/12 20:22:08 c2woody Exp $ */
/* $Id: mixer.cpp,v 1.47 2007/08/12 19:16:01 c2woody Exp $ */
/*
Remove the sdl code from here and have it handeld in the sdlmain.
@ -91,7 +91,7 @@ static struct {
Bit8u MixTemp[MIXER_BUFSIZE];
MixerChannel * MIXER_AddChannel(MIXER_Handler handler,Bitu freq,char * name) {
MixerChannel * MIXER_AddChannel(MIXER_Handler handler,Bitu freq,const char * name) {
MixerChannel * chan=new MixerChannel();
chan->handler=handler;
chan->name=name;
@ -526,7 +526,7 @@ public:
ShowVolume(chan->name,chan->volmain[0],chan->volmain[1]);
}
private:
void ShowVolume(char * name,float vol0,float vol1) {
void ShowVolume(const char * name,float vol0,float vol1) {
WriteOut("%-8s %3.0f:%-3.0f %+3.2f:%-+3.2f \n",name,
vol0*100,vol1*100,
20*log(vol0)/log(10.0f),20*log(vol1)/log(10.0f)
@ -551,7 +551,7 @@ static void MIXER_ProgramStart(Program * * make) {
*make=new MIXER;
}
MixerChannel* MixerObject::Install(MIXER_Handler handler,Bitu freq,char * name){
MixerChannel* MixerObject::Install(MIXER_Handler handler,Bitu freq,const char * name){
if(!installed) {
if(strlen(name) > 31) E_Exit("Too long mixer channel name");
safe_strncpy(m_name,name,32);

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: sblaster.cpp,v 1.65 2007/06/14 18:06:59 qbix79 Exp $ */
/* $Id: sblaster.cpp,v 1.66 2007/08/08 08:03:48 qbix79 Exp $ */
#include <iomanip>
#include <sstream>
@ -590,8 +590,9 @@ static void DSP_DoDMATransfer(DMA_MODES mode,Bitu freq,bool stereo) {
#endif
}
static void DSP_PrepareDMA_Old(DMA_MODES mode,bool autoinit) {
static void DSP_PrepareDMA_Old(DMA_MODES mode,bool autoinit,bool sign) {
sb.dma.autoinit=autoinit;
sb.dma.sign=sign;
if (!autoinit) sb.dma.total=1+sb.dsp.in.data[0]+(sb.dsp.in.data[1] << 8);
sb.dma.chan=GetDMAChannel(sb.hw.dma8);
DSP_DoDMATransfer(mode,sb.freq / (sb.mixer.stereo ? 2 : 1),sb.mixer.stereo);
@ -716,18 +717,19 @@ static void DSP_DoCommand(void) {
break;
case 0x24: /* Singe Cycle 8-Bit DMA ADC */
sb.dma.left=sb.dma.total=1+sb.dsp.in.data[0]+(sb.dsp.in.data[1] << 8);
sb.dma.sign=false;
LOG(LOG_SB,LOG_ERROR)("DSP:Faked ADC for %d bytes",sb.dma.total);
GetDMAChannel(sb.hw.dma8)->Register_Callback(DSP_ADC_CallBack);
break;
case 0x14: /* Singe Cycle 8-Bit DMA DAC */
case 0x91: /* Singe Cycle 8-Bit DMA High speed DAC */
/* Note: 0x91 is documented only for DSP ver.2.x and 3.x, not 4.x */
DSP_PrepareDMA_Old(DSP_DMA_8,false);
DSP_PrepareDMA_Old(DSP_DMA_8,false,false);
break;
case 0x90: /* Auto Init 8-bit DMA High Speed */
case 0x1c: /* Auto Init 8-bit DMA */
DSP_SB2_ABOVE; /* Note: 0x90 is documented only for DSP ver.2.x and 3.x, not 4.x */
DSP_PrepareDMA_Old(DSP_DMA_8,true);
DSP_PrepareDMA_Old(DSP_DMA_8,true,false);
break;
case 0x38: /* Write to SB MIDI Output */
if (sb.midi == true) MIDI_RawOutByte(sb.dsp.in.data[0]);
@ -736,7 +738,7 @@ static void DSP_DoCommand(void) {
sb.freq=(1000000 / (256 - sb.dsp.in.data[0]));
/* Nasty kind of hack to allow runtime changing of frequency */
if (sb.dma.mode != DSP_DMA_NONE && sb.dma.autoinit) {
DSP_PrepareDMA_Old(sb.dma.mode,sb.dma.autoinit);
DSP_PrepareDMA_Old(sb.dma.mode,sb.dma.autoinit,sb.dma.sign);
}
break;
case 0x41: /* Set Output Samplerate */
@ -752,17 +754,17 @@ static void DSP_DoCommand(void) {
case 0x75: /* 075h : Single Cycle 4-bit ADPCM Reference */
sb.adpcm.haveref=true;
case 0x74: /* 074h : Single Cycle 4-bit ADPCM */
DSP_PrepareDMA_Old(DSP_DMA_4,false);
DSP_PrepareDMA_Old(DSP_DMA_4,false,false);
break;
case 0x77: /* 077h : Single Cycle 3-bit(2.6bit) ADPCM Reference*/
sb.adpcm.haveref=true;
case 0x76: /* 074h : Single Cycle 3-bit(2.6bit) ADPCM */
DSP_PrepareDMA_Old(DSP_DMA_3,false);
DSP_PrepareDMA_Old(DSP_DMA_3,false,false);
break;
case 0x17: /* 017h : Single Cycle 2-bit ADPCM Reference*/
sb.adpcm.haveref=true;
case 0x16: /* 074h : Single Cycle 2-bit ADPCM */
DSP_PrepareDMA_Old(DSP_DMA_2,false);
DSP_PrepareDMA_Old(DSP_DMA_2,false,false);
break;
case 0x80: /* Silence DAC */
PIC_AddEvent(&DSP_RaiseIRQEvent,

View File

@ -16,14 +16,14 @@
* 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 $ */
/* $Id: directserial_posix.cpp,v 1.2 2007/08/26 17:19:46 qbix79 Exp $ */
#include "dosbox.h"
#if C_DIRECTSERIAL
// Posix version
#if defined (LINUX)
#if defined (LINUX) || defined (MACOSX)
#include "serialport.h"
#include "directserial_posix.h"

View File

@ -16,7 +16,7 @@
* 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 $ */
/* $Id: directserial_posix.h,v 1.2 2007/08/26 17:19:46 qbix79 Exp $ */
// include guard
#ifndef DOSBOX_DIRECTSERIAL_POSIX_H
@ -25,7 +25,7 @@
#include "dosbox.h"
#if C_DIRECTSERIAL
#ifdef LINUX
#if defined (LINUX) || defined (MACOSX)

View File

@ -650,7 +650,7 @@ void VGA_SetupDrawing(Bitu val) {
return;
}
/* Calculate the FPS for this screen */
float fps;Bitu clock;
float fps; Bitu clock;
Bitu htotal, hdend, hbstart, hbend, hrstart, hrend;
Bitu vtotal, vdend, vbstart, vbend, vrstart, vrend;
if (machine==MCH_VGA) {
@ -710,6 +710,7 @@ void VGA_SetupDrawing(Bitu val) {
}
break;
}
/* Check for 8 for 9 character clock mode */
if (vga.seq.clocking_mode & 1 ) clock/=8; else clock/=9;
/* Check for pixel doubling, master clock/2 */
@ -796,8 +797,44 @@ void VGA_SetupDrawing(Bitu val) {
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);
/*
6 Horizontal Sync Polarity. Negative if set
7 Vertical Sync Polarity. Negative if set
Bit 6-7 indicates the number of lines on the display:
1: 400, 2: 350, 3: 480
*/
//Try to determine the pixel size, aspect correct is based around square pixels
//Base pixel width around 100 clocks horizontal
//For 9 pixel text modes this should be changed, but we don't support that anyway :)
//Seems regular vga only listens to the 9 char pixel mode with character mode enabled
double pwidth = 100.0 / htotal;
//Base pixel height around vertical totals of modes that have 100 clocks horizontal
//Different sync values gives different scaling of the whole vertical range
//VGA monitor just seems to thighten or widen the whole vertical range
double pheight;
Bitu sync = vga.misc_output >> 6;
switch ( sync ) {
case 0: // This is not defined in vga specs,
// Kiet, seems to be slightly less than 350 on my monitor
//340 line mode, filled with 449 total
pheight = (480.0 / 340.0) * ( 449.0 / vtotal );
break;
case 1: //400 line mode, filled with 449 total
pheight = (480.0 / 400.0) * ( 449.0 / vtotal );
break;
case 2: //350 line mode, filled with 449 total
//This mode seems to get regular 640x400 timing and goes for a loong retrace
//Depends on the monitor to stretch the screen
pheight = (480.0 / 350.0) * ( 449.0 / vtotal );
break;
case 3: //480 line mode, filled with 525 total
pheight = (480.0 / 480.0) * ( 525.0 / vtotal );
break;
}
double aspect_ratio = pheight / pwidth;
vga.draw.delay.parts = vga.draw.delay.vdend/vga.draw.parts_total;
vga.draw.resizing=false;
@ -965,15 +1002,26 @@ void VGA_SetupDrawing(Bitu val) {
vga.changes.frame = 0;
vga.changes.writeMask = 1;
#endif
if (( width != vga.draw.width) || (height != vga.draw.height) || (vga.mode != vga.lastmode)) {
/*
Cheap hack to just make all > 640x480 modes have 4:3 aspect ratio
*/
if ( width >= 640 && height >= 480 ) {
aspect_ratio = ((float)width / (float)height) * ( 3.0 / 4.0);
}
// LOG_MSG("ht %d vt %d ratio %f", htotal, vtotal, aspect_ratio );
if (( width != vga.draw.width) || (height != vga.draw.height) ||
(aspect_ratio != vga.draw.aspect_ratio) ||
(vga.mode != vga.lastmode)) {
vga.lastmode = vga.mode;
PIC_RemoveEvents(VGA_VerticalTimer);
PIC_RemoveEvents(VGA_VerticalDisplayEnd);
PIC_RemoveEvents(VGA_DrawPart);
vga.draw.width=width;
vga.draw.height=height;
vga.draw.doublewidth=doublewidth;
vga.draw.doubleheight=doubleheight;
vga.draw.width = width;
vga.draw.height = height;
vga.draw.doublewidth = doublewidth;
vga.draw.doubleheight = doubleheight;
vga.draw.aspect_ratio = aspect_ratio;
if (doubleheight) vga.draw.lines_scaled=2;
else vga.draw.lines_scaled=1;
#if C_DEBUG

View File

@ -936,6 +936,11 @@ dac_text16:
}
}
} else {
for (i=0x10;i<ATT_REGS;i++) {
if (i==0x11) continue; // skip overscan register
IO_Write(0x3c0,i);
IO_Write(0x3c0,att_data[i]);
}
IO_Write(0x3c0,0x20); //Disable palette access
}
/* Setup some special stuff for different modes */

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: xms.cpp,v 1.49 2007/06/25 18:45:48 qbix79 Exp $ */
/* $Id: xms.cpp,v 1.50 2007/08/15 19:09:25 qbix79 Exp $ */
#include <stdlib.h>
#include <string.h>
@ -262,15 +262,13 @@ static bool multiplex_xms(void) {
return false;
};
#define SET_RESULT(caller) { \
res = caller; \
if(res) reg_bl = (Bit8u)res; \
reg_ax = (res==0); \
INLINE void SET_RESULT(Bitu res,bool touch_bl_on_succes=true) {
if(touch_bl_on_succes || res) reg_bl = (Bit8u)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 */
@ -315,12 +313,12 @@ Bitu XMS_Handler(void) {
SET_RESULT(XMS_FreeMemory(reg_dx));
break;
case XMS_MOVE_EXTENDED_MEMORY_BLOCK: /* 0b */
SET_RESULT(XMS_MoveMemory(SegPhys(ds)+reg_si));
SET_RESULT(XMS_MoveMemory(SegPhys(ds)+reg_si),false);
break;
case XMS_LOCK_EXTENDED_MEMORY_BLOCK: { /* 0c */
Bit32u address;
res = XMS_LockMemory(reg_dx, address);
if(res) reg_bl = res;
Bitu res = XMS_LockMemory(reg_dx, address);
if(res) reg_bl = (Bit8u)res;
reg_ax = (res==0);
if (res==0) { // success
reg_bx=(Bit16u)(address & 0xFFFF);

View File

@ -1 +1,3 @@
SUBDIRS = visualc
EXTRA_DIST = sdl-win32.diff

View File

@ -139,6 +139,8 @@ target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
SUBDIRS = visualc
EXTRA_DIST = sdl-win32.diff
subdir = src/platform
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs

View File

@ -0,0 +1,55 @@
diff -ru SDL-1.2.12/src/main/win32/version.rc SDL-1.2.12release/src/main/win32/version.rc
--- SDL-1.2.12/src/main/win32/version.rc 2007-07-20 07:52:05.000000000 +0200
+++ SDL-1.2.12release/src/main/win32/version.rc 2007-08-17 19:03:42.000000000 +0200
@@ -13,7 +13,7 @@
FILEVERSION 1,2,12,0
PRODUCTVERSION 1,2,12,0
FILEFLAGSMASK 0x3fL
- FILEFLAGS 0x0L
+ FILEFLAGS 0x4L
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
diff -ru SDL-1.2.12/src/video/SDL_video.c SDL-1.2.12release/src/video/SDL_video.c
--- SDL-1.2.12/src/video/SDL_video.c 2007-07-20 07:52:25.000000000 +0200
+++ SDL-1.2.12release/src/video/SDL_video.c 2007-08-17 02:51:52.000000000 +0200
@@ -75,12 +75,12 @@
#if SDL_VIDEO_DRIVER_GAPI
&GAPI_bootstrap,
#endif
-#if SDL_VIDEO_DRIVER_WINDIB
- &WINDIB_bootstrap,
-#endif
#if SDL_VIDEO_DRIVER_DDRAW
&DIRECTX_bootstrap,
#endif
+#if SDL_VIDEO_DRIVER_WINDIB
+ &WINDIB_bootstrap,
+#endif
#if SDL_VIDEO_DRIVER_BWINDOW
&BWINDOW_bootstrap,
#endif
diff -ru SDL-1.2.12/src/video/windx5/SDL_dx5events.c SDL-1.2.12release/src/video/windx5/SDL_dx5events.c
--- SDL-1.2.12/src/video/windx5/SDL_dx5events.c 2007-07-20 07:52:25.000000000 +0200
+++ SDL-1.2.12release/src/video/windx5/SDL_dx5events.c 2007-08-17 02:51:52.000000000 +0200
@@ -519,7 +519,7 @@
case WM_SYSKEYDOWN: {
/* Pass syskey to DefWindwoProc (ALT-F4, etc.) */
}
- break;
+// break;
case WM_KEYUP:
case WM_KEYDOWN: {
/* Ignore windows keyboard messages */;
diff -ru SDL-1.2.12/src/video/windx5/SDL_dx5video.c SDL-1.2.12release/src/video/windx5/SDL_dx5video.c
--- SDL-1.2.12/src/video/windx5/SDL_dx5video.c 2007-07-20 07:52:25.000000000 +0200
+++ SDL-1.2.12release/src/video/windx5/SDL_dx5video.c 2007-08-17 02:51:52.000000000 +0200
@@ -1496,7 +1496,7 @@
}
}
dd_surface3 = NULL;
-#if 0 /* FIXME: enable this when SDL consistently reports lost surfaces */
+#if 1 /* FIXME: enable this when SDL consistently reports lost surfaces */
if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
video->flags |= SDL_HWSURFACE;
} else {

View File

@ -1,6 +1,6 @@
#define INLINE __forceinline
#define VERSION "0.71"
#define VERSION "0.72"
/* Define to 1 to enable internal debugger, requires libcurses */

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: shell.cpp,v 1.86 2007/07/03 17:32:14 qbix79 Exp $ */
/* $Id: shell.cpp,v 1.88 2007/08/17 17:58:46 qbix79 Exp $ */
#include <stdlib.h>
#include <stdarg.h>
@ -439,6 +439,8 @@ void SHELL_Init() {
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_CHDIR_HINT_2","directoryname is longer than 8 charachters and/or contains spaces.\nTry \033[31mcd %s\033[0m\n");
MSG_Add("SHELL_CMD_CHDIR_HINT_3","You are still on drive Z:, change to a mounted drive with \033[31mC:\033[0m.\n");
MSG_Add("SHELL_CMD_MKDIR_ERROR","Unable to make: %s.\n");
MSG_Add("SHELL_CMD_RMDIR_ERROR","Unable to remove: %s.\n");
MSG_Add("SHELL_CMD_DEL_ERROR","Unable to delete: %s.\n");

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: shell_cmds.cpp,v 1.76 2007/06/14 08:23:46 qbix79 Exp $ */
/* $Id: shell_cmds.cpp,v 1.78 2007/08/17 17:58:46 qbix79 Exp $ */
#include <string.h>
#include <ctype.h>
@ -268,8 +268,30 @@ void DOS_Shell::CMD_CHDIR(char * args) {
} else if(strlen(args) == 2 && args[1]==':') {
WriteOut(MSG_Get("SHELL_CMD_CHDIR_HINT"),toupper(*reinterpret_cast<unsigned char*>(&args[0])));
} else if (!DOS_ChangeDir(args)) {
/* Changedir failed. Check if the filename is longer then 8 and/or contains spaces */
char temp[DOS_PATHLENGTH];
safe_strncpy(temp,args,DOS_PATHLENGTH);
char* dot = strrchr(temp,'.');
if(dot) *dot = 0;
dot = strrchr(temp,' ');
if(dot) { /* Contains spaces */
*dot = 0;
if(strlen(temp) > 6) temp[6] = 0;
strcat(temp,"~1");
WriteOut(MSG_Get("SHELL_CMD_CHDIR_HINT_2"),temp);
} else if(strlen(temp) >8) {
temp[6] = 0;
strcat(temp,"~1");
WriteOut(MSG_Get("SHELL_CMD_CHDIR_HINT_2"),temp);
} else {
Bit8u drive=DOS_GetDefaultDrive()+'A';
if (drive=='Z') {
WriteOut(MSG_Get("SHELL_CMD_CHDIR_HINT_3"));
} else {
WriteOut(MSG_Get("SHELL_CMD_CHDIR_ERROR"),args);
}
}
}
};
void DOS_Shell::CMD_MKDIR(char * args) {

View File

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: shell_misc.cpp,v 1.49 2007/02/03 14:04:23 qbix79 Exp $ */
/* $Id: shell_misc.cpp,v 1.51 2007/08/22 11:21:28 qbix79 Exp $ */
#include <stdlib.h>
#include <string.h>
@ -30,6 +30,7 @@
void DOS_Shell::ShowPrompt(void) {
Bit8u drive=DOS_GetDefaultDrive()+'A';
char dir[DOS_PATHLENGTH];
dir[0] = 0; //DOS_GetCurrentDir doesn't always return something. (if drive is messed up)
DOS_GetCurrentDir(0,dir);
WriteOut("%c:\\%s>",drive,dir);
}
@ -223,7 +224,7 @@ void DOS_Shell::InputCommand(char * line) {
if (p_completion_start) {
p_completion_start ++;
completion_index = str_index - strlen(p_completion_start);
completion_index = str_len - strlen(p_completion_start);
} else {
p_completion_start = line;
completion_index = 0;

View File

@ -158,6 +158,9 @@
<File
RelativePath="..\src\dosbox.cpp">
</File>
<File
RelativePath="..\src\dosbox.rc">
</File>
<Filter
Name="cpu"
Filter="">
@ -847,6 +850,9 @@
RelativePath="..\include\video.h">
</File>
</Filter>
<File
RelativePath="..\src\dosbox.ico">
</File>
</Files>
<Globals>
</Globals>