mirror of
https://github.com/retro100/dosbox-wii.git
synced 2025-01-12 10:19:11 +01:00
DOSBox 0.65
This commit is contained in:
parent
9ae8458414
commit
6ca1ff8d7f
84
ChangeLog
84
ChangeLog
@ -1,3 +1,87 @@
|
|||||||
|
0.65
|
||||||
|
- Fixed FAT writing.
|
||||||
|
- Added some more missing DOS functions.
|
||||||
|
- Improved PIC so that it actually honours irq 2/9.
|
||||||
|
- Improved intelligent MPU-401 mode so that more games work with it.
|
||||||
|
- Some mouse fixes.
|
||||||
|
- Changed DMA transfers a bit so they bypass the paging tables.
|
||||||
|
- Added S3 XGA functionality.
|
||||||
|
- Improved paging so that read and write faults are handled differently.
|
||||||
|
- Rewrote exception handling a bit (no exception 0x0B with dos4gw anymore).
|
||||||
|
- Added IO exceptions in all but the dynamic core.
|
||||||
|
- Some ems improvements.
|
||||||
|
- Added midi-device selection code for the windows hosts.
|
||||||
|
- Fix crashes/segfaults related to the disabling of the pcspeaker.
|
||||||
|
- Added some more FILES=XX detection tricks.
|
||||||
|
- Fixed some vga detection schemes.
|
||||||
|
- Fixed screenshot corruption when using -noconsole in a read-only directory.
|
||||||
|
- Fix wrong scaled screenshots.
|
||||||
|
- Added some hidden file functions when using diskimages. (helps with cdrom
|
||||||
|
detection schemes)
|
||||||
|
- Fixed a bug in the mixer code, that muted the music in certain games.
|
||||||
|
- Added an assembly fpu core.
|
||||||
|
- Made the shell more flexible for batch files.
|
||||||
|
- Check for unaligned memory acces fixes hangups on ARM processors.
|
||||||
|
- Some 64 bit fixes.
|
||||||
|
- Added code to change configuration at runtime.
|
||||||
|
- Improved ADPCM emulation.
|
||||||
|
- Fixed a few cpu instructions.
|
||||||
|
- Always report vesa 2.0 and fix some colour issues with vesa games.
|
||||||
|
- Fix video mode 0x06 and 0x0a.
|
||||||
|
- Improvements to the joystick emulation. 4 buttons are supported as well.
|
||||||
|
- Add VCPI emulation for Origin games.
|
||||||
|
- Fixed a lot of things in the boot code. Most booters work now.
|
||||||
|
- Lots of improvements to the IPX emulation.
|
||||||
|
- Rewritten modem emulation. Should work with more games.
|
||||||
|
- Improvements to the dos memory managment routines.
|
||||||
|
- Add UMB (upper memory blocks) support.
|
||||||
|
- Emulate the pause key.
|
||||||
|
- Improve Composite CGA mode emulation.
|
||||||
|
- Lots of vga compatibility changes.
|
||||||
|
- Improved support for chained video modes.
|
||||||
|
- Improved mode and palette handling in cga modes.
|
||||||
|
- Mount accepts ~ now.
|
||||||
|
- Added a few of the EGA RIL functions.
|
||||||
|
- Added TandyDAC emulation.
|
||||||
|
- OS/2 support.
|
||||||
|
- Improved and speed up the dynamic cpu core.
|
||||||
|
- Fix some errors in the CD-ROM emulation layer.
|
||||||
|
- Added an automatic work-around for some graphics chipsets.
|
||||||
|
- Add PCjr support.
|
||||||
|
- Allow mousedriver to be replaced. Fixes a few games that come with their
|
||||||
|
own (internal) driver.
|
||||||
|
- Improved dynamic cpu core so it can handle pagefaults and some obscure
|
||||||
|
types of self-modifying code.
|
||||||
|
- Added -noautoexec switch to skip the contents of [autoexec] in the
|
||||||
|
configuration file.
|
||||||
|
- Improved v86 mode emulation (mainly for Strike Commander).
|
||||||
|
- Improved timer behavior.
|
||||||
|
- Improved extended keyboard support.
|
||||||
|
- Enhanced and added several DOS tables.
|
||||||
|
- Made core_full endian safe.
|
||||||
|
- Made pagefaults endian safe.
|
||||||
|
- Add support for moviecapturing
|
||||||
|
- Add support for 15/16/32 bit videomodes.
|
||||||
|
- Add some more VESA modi (4 bit).
|
||||||
|
- Add 1024x768 output.
|
||||||
|
- Changed screenrendering so it only draws changes to the screen.
|
||||||
|
- Allow remapping of the EMS page when the dma transfer was started from
|
||||||
|
the page frame
|
||||||
|
- Made EMS and DMA work together when playing from a mapped memory page.
|
||||||
|
- Renamed several configuration options, so that they are unique.
|
||||||
|
- Merged mpu and intelligent into one option.
|
||||||
|
- Merged fullfixed and fullresolution.
|
||||||
|
- Extended keys should be handled better.
|
||||||
|
- F11 and F12 work.
|
||||||
|
- Compilation fixes for various platforms.
|
||||||
|
- Fix a few crashes when giving bad input.
|
||||||
|
- Removed interp2x and added few new scalers.
|
||||||
|
- Reintroduce the lockfree mouse. (autolock=false)
|
||||||
|
- Add a larger cache for the dynamic cpu core.
|
||||||
|
- Improved soundblaster DSP, so it gets detected by creative tools.
|
||||||
|
- Lots of bugfixes.
|
||||||
|
- Even more bugfixes.
|
||||||
|
|
||||||
0.63
|
0.63
|
||||||
- Fixed crash with keymapper (ctrl-f1) and output=surface.
|
- Fixed crash with keymapper (ctrl-f1) and output=surface.
|
||||||
- Added unmounting.
|
- Added unmounting.
|
||||||
|
10
INSTALL
10
INSTALL
@ -50,8 +50,18 @@ In step 1 you could add the following switches:
|
|||||||
enables some memory increasing inlines. This greatly increases
|
enables some memory increasing inlines. This greatly increases
|
||||||
compiletime for maybe a increase in speed.
|
compiletime for maybe a increase in speed.
|
||||||
|
|
||||||
|
--disable-dynamic-x86
|
||||||
|
disables the dynamic cpu core. Although it's unstable it can greatly
|
||||||
|
improve the speed of dosbox on x86 hosts.
|
||||||
|
|
||||||
|
--disable-fpu-x86
|
||||||
|
disables the assembly fpu core. Although relatively new the x86 fpu
|
||||||
|
core has more accuracy then the regular fpu core.
|
||||||
|
|
||||||
Check the src subdir for the binary.
|
Check the src subdir for the binary.
|
||||||
|
|
||||||
|
NOTE: If capslock and numlock appear to be broken. open
|
||||||
|
src/ints/bios_keyboard.cpp and go to line 30 and read there how to fix it.
|
||||||
|
|
||||||
|
|
||||||
Build instructions for VC++6
|
Build instructions for VC++6
|
||||||
|
30
Makefile.in
30
Makefile.in
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -41,7 +41,7 @@ target_triplet = @target@
|
|||||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||||
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
|
$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
|
||||||
THANKS config.guess config.sub depcomp install-sh missing
|
THANKS TODO config.guess config.sub depcomp install-sh missing
|
||||||
subdir = .
|
subdir = .
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||||
@ -101,6 +101,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -126,10 +128,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
@ -236,7 +240,13 @@ uninstall-info-am:
|
|||||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||||
# (2) otherwise, pass the desired values on the `make' command line.
|
# (2) otherwise, pass the desired values on the `make' command line.
|
||||||
$(RECURSIVE_TARGETS):
|
$(RECURSIVE_TARGETS):
|
||||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
dot_seen=no; \
|
dot_seen=no; \
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
@ -248,7 +258,7 @@ $(RECURSIVE_TARGETS):
|
|||||||
local_target="$$target"; \
|
local_target="$$target"; \
|
||||||
fi; \
|
fi; \
|
||||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
|| eval $$failcom; \
|
||||||
done; \
|
done; \
|
||||||
if test "$$dot_seen" = "no"; then \
|
if test "$$dot_seen" = "no"; then \
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||||
@ -256,7 +266,13 @@ $(RECURSIVE_TARGETS):
|
|||||||
|
|
||||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||||
maintainer-clean-recursive:
|
maintainer-clean-recursive:
|
||||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
dot_seen=no; \
|
dot_seen=no; \
|
||||||
case "$@" in \
|
case "$@" in \
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||||
@ -277,7 +293,7 @@ maintainer-clean-recursive:
|
|||||||
local_target="$$target"; \
|
local_target="$$target"; \
|
||||||
fi; \
|
fi; \
|
||||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
|| eval $$failcom; \
|
||||||
done && test -z "$$fail"
|
done && test -z "$$fail"
|
||||||
tags-recursive:
|
tags-recursive:
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
84
NEWS
84
NEWS
@ -1,3 +1,87 @@
|
|||||||
|
0.65
|
||||||
|
- Fixed FAT writing.
|
||||||
|
- Added some more missing DOS functions.
|
||||||
|
- Improved PIC so that it actually honours irq 2/9.
|
||||||
|
- Improved intelligent MPU-401 mode so that more games work with it.
|
||||||
|
- Some mouse fixes.
|
||||||
|
- Changed DMA transfers a bit so they bypass the paging tables.
|
||||||
|
- Added S3 XGA functionality.
|
||||||
|
- Improved paging so that read and write faults are handled differently.
|
||||||
|
- Rewrote exception handling a bit (no exception 0x0B with dos4gw anymore).
|
||||||
|
- Added IO exceptions in all but the dynamic core.
|
||||||
|
- Some ems improvements.
|
||||||
|
- Added midi-device selection code for the windows hosts.
|
||||||
|
- Fix crashes/segfaults related to the disabling of the pcspeaker.
|
||||||
|
- Added some more FILES=XX detection tricks.
|
||||||
|
- Fixed some vga detection schemes.
|
||||||
|
- Fixed screenshot corruption when using -noconsole in a read-only directory.
|
||||||
|
- Fix wrong scaled screenshots.
|
||||||
|
- Added some hidden file functions when using diskimages. (helps with cdrom
|
||||||
|
detection schemes)
|
||||||
|
- Fixed a bug in the mixer code, that muted the music in certain games.
|
||||||
|
- Added an assembly fpu core.
|
||||||
|
- Made the shell more flexible for batch files.
|
||||||
|
- Check for unaligned memory acces fixes hangups on ARM processors.
|
||||||
|
- Some 64 bit fixes.
|
||||||
|
- Added code to change configuration at runtime.
|
||||||
|
- Improved ADPCM emulation.
|
||||||
|
- Fixed a few cpu instructions.
|
||||||
|
- Always report vesa 2.0 and fix some colour issues with vesa games.
|
||||||
|
- Fix video mode 0x06 and 0x0a.
|
||||||
|
- Improvements to the joystick emulation. 4 buttons are supported as well.
|
||||||
|
- Add VCPI emulation for Origin games.
|
||||||
|
- Fixed a lot of things in the boot code. Most booters work now.
|
||||||
|
- Lots of improvements to the IPX emulation.
|
||||||
|
- Rewritten modem emulation. Should work with more games.
|
||||||
|
- Improvements to the dos memory managment routines.
|
||||||
|
- Add UMB (upper memory blocks) support.
|
||||||
|
- Emulate the pause key.
|
||||||
|
- Improve Composite CGA mode emulation.
|
||||||
|
- Lots of vga compatibility changes.
|
||||||
|
- Improved support for chained video modes.
|
||||||
|
- Improved mode and palette handling in cga modes.
|
||||||
|
- Mount accepts ~ now.
|
||||||
|
- Added a few of the EGA RIL functions.
|
||||||
|
- Added TandyDAC emulation.
|
||||||
|
- OS/2 support.
|
||||||
|
- Improved and speed up the dynamic cpu core.
|
||||||
|
- Fix some errors in the CD-ROM emulation layer.
|
||||||
|
- Added an automatic work-around for some graphics chipsets.
|
||||||
|
- Add PCjr support.
|
||||||
|
- Allow mousedriver to be replaced. Fixes a few games that come with their
|
||||||
|
own (internal) driver.
|
||||||
|
- Improved dynamic cpu core so it can handle pagefaults and some obscure
|
||||||
|
types of self-modifying code.
|
||||||
|
- Added -noautoexec switch to skip the contents of [autoexec] in the
|
||||||
|
configuration file.
|
||||||
|
- Improved v86 mode emulation (mainly for Strike Commander).
|
||||||
|
- Improved timer behavior.
|
||||||
|
- Improved extended keyboard support.
|
||||||
|
- Enhanced and added several DOS tables.
|
||||||
|
- Made core_full endian safe.
|
||||||
|
- Made pagefaults endian safe.
|
||||||
|
- Add support for moviecapturing
|
||||||
|
- Add support for 15/16/32 bit videomodes.
|
||||||
|
- Add some more VESA modi (4 bit).
|
||||||
|
- Add 1024x768 output.
|
||||||
|
- Changed screenrendering so it only draws changes to the screen.
|
||||||
|
- Allow remapping of the EMS page when the dma transfer was started from
|
||||||
|
the page frame
|
||||||
|
- Made EMS and DMA work together when playing from a mapped memory page.
|
||||||
|
- Renamed several configuration options, so that they are unique.
|
||||||
|
- Merged mpu and intelligent into one option.
|
||||||
|
- Merged fullfixed and fullresolution.
|
||||||
|
- Extended keys should be handled better.
|
||||||
|
- F11 and F12 work.
|
||||||
|
- Compilation fixes for various platforms.
|
||||||
|
- Fix a few crashes when giving bad input.
|
||||||
|
- Removed interp2x and added few new scalers.
|
||||||
|
- Reintroduce the lockfree mouse. (autolock=false)
|
||||||
|
- Add a larger cache for the dynamic cpu core.
|
||||||
|
- Improved soundblaster DSP, so it gets detected by creative tools.
|
||||||
|
- Lots of bugfixes.
|
||||||
|
- Even more bugfixes.
|
||||||
|
|
||||||
0.63
|
0.63
|
||||||
- Fixed crash with keymapper (ctrl-f1) and output=surface.
|
- Fixed crash with keymapper (ctrl-f1) and output=surface.
|
||||||
- Added unmounting.
|
- Added unmounting.
|
||||||
|
324
README
324
README
@ -1,19 +1,19 @@
|
|||||||
DOSBox v0.63
|
DOSBox v0.65
|
||||||
|
|
||||||
|
|
||||||
=====
|
=====
|
||||||
NOTE:
|
NOTE:
|
||||||
=====
|
=====
|
||||||
|
|
||||||
While we hope that, one day, DOSBox will run virtually all programs
|
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 run on a high-
|
ever made for the PC, we are not there yet. At present, DOSBox running on a
|
||||||
end machine will roughly be the equivalent of a 486 PC. The 0.60
|
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
|
release has added support for "protected mode" allowing for more complex and
|
||||||
recent programs, but note that this support is early in development and
|
recent programs, but note that this support is still in an early stage of
|
||||||
nowhere near as complete as the support for 386 real-mode games (or
|
development and unlike the support for 386 real-mode games (or earlier) hasn't
|
||||||
earlier). Also note that "protected mode" games need substantially more
|
been completed yet. Also note that "protected mode" games need substantially
|
||||||
resources and may require a much faster processor for you to run it properly
|
more resources and may require a much faster processor for you to run them
|
||||||
in DOSBox.
|
properly in DOSBox.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -49,9 +49,10 @@ Type INTRO in DOSBox. That's it.
|
|||||||
Some Frequently Asked Questions:
|
Some Frequently Asked Questions:
|
||||||
|
|
||||||
Q: I've got a Z instead of a C at the prompt.
|
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: My CD-ROM doesn't work.
|
Q: My CD-ROM doesn't work.
|
||||||
Q: The mouse doesn't work.
|
Q: The mouse doesn't work.
|
||||||
Q: The sound stutters.
|
Q: The sound stutters or sounds stretched/weird.
|
||||||
Q: I can't type \ or : in DOSBox.
|
Q: I can't type \ or : in DOSBox.
|
||||||
Q: The game/application can't find its CD-ROM.
|
Q: The game/application can't find its CD-ROM.
|
||||||
Q: The game/application runs much too slow!
|
Q: The game/application runs much too slow!
|
||||||
@ -66,16 +67,21 @@ Q: Great README, but I still don't get it.
|
|||||||
|
|
||||||
Q: I've got a Z instead of a C at the prompt.
|
Q: I've got a Z instead of a C at the prompt.
|
||||||
A: You have to make your directories available as drives in DOSBox by using
|
A: You have to make your directories available as drives in DOSBox by using
|
||||||
the "mount" command. For example, in Windows "mount C D:\" would give
|
the "mount" command. For example, in Windows "mount C D:\GAMES" will give
|
||||||
you a C in DOSBox which points at your Windows D:\ drive.
|
you a C drive in DOSBox which points to your Windows D:\GAMES directory.
|
||||||
In Linux, "mount c /home/username" would give you a C in DOSBox
|
In Linux, "mount c /home/username" will give you a C drive in DOSBox
|
||||||
which points at /home/username in Linux.
|
which points to /home/username in Linux.
|
||||||
|
|
||||||
|
|
||||||
|
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: My CD-ROM doesn't work.
|
Q: My CD-ROM doesn't work.
|
||||||
A: To mount your cdrom in DOSBox you have to specify some additional options
|
A: To mount your CD-ROM in DOSBox you have to specify some additional options
|
||||||
when mounting the cdrom.
|
when mounting the CD-ROM.
|
||||||
To enable the most basic cdrom support:
|
To enable the most basic CD-ROM support:
|
||||||
- mount d f:\ -t cdrom
|
- mount d f:\ -t cdrom
|
||||||
To enable low-level SDL-support:
|
To enable low-level SDL-support:
|
||||||
- mount d f:\ -t cdrom -usecd 0
|
- mount d f:\ -t cdrom -usecd 0
|
||||||
@ -84,23 +90,23 @@ A: To mount your cdrom in DOSBox you have to specify some additional options
|
|||||||
To enable low-level aspi-support (win98 with aspi-layer installed):
|
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 -apsi
|
||||||
|
|
||||||
In the commands: - d driveletter you in DOSBox
|
In the commands: - d driveletter you will get in DOSBox
|
||||||
- f:\ location of cdrom on your PC.
|
- f:\ location of cdrom on your PC.
|
||||||
- 0 The number of the cdrom drive, reported by mount -cd
|
- 0 The number of the CD-ROM drive, reported by mount -cd
|
||||||
See also the question: The game/application can't find its CD-ROM.
|
See also the question: The game/application can't find its CD-ROM.
|
||||||
|
|
||||||
|
|
||||||
Q: The mouse doesn't work.
|
Q: The mouse doesn't work.
|
||||||
A: Normally DOSBox detects the mouse being used by a game. If you click on
|
A: Usually, DOSBox detects when a game uses mouse control. When you click on
|
||||||
the screen then it should get locked (confined to the DOSBox window)
|
the screen it should get locked (confined to the DOSBox window) and work.
|
||||||
and work. Sometimes the DOSBox mouse detection doesn't work with certain
|
With certain games, the DOSBox mouse detection doesn't work. In that case
|
||||||
games. You might have to force to lock the mouse then with ctrl-F10.
|
you will have to lock the mouse manually by pressing CTRL-F10.
|
||||||
|
|
||||||
|
|
||||||
Q: The sound stutters.
|
Q: The sound stutters or sounds stretched/weird.
|
||||||
A: You're using too much cpu power to keep DOSBox running at the current speed.
|
A: You're using too much cpu power to keep DOSBox running at the current speed.
|
||||||
You can either lower the cycles or skip frames or get a faster machine.
|
You can lower the cycles, skip frames or get a faster machine.
|
||||||
You can also increase the prebuffer in the configfile
|
You can also increase the prebuffer in the configfile.
|
||||||
|
|
||||||
|
|
||||||
Q: I can't type \ or : in DOSBox.
|
Q: I can't type \ or : in DOSBox.
|
||||||
@ -108,16 +114,18 @@ A: This is a known problem. It only occurs if your keyboard layout isn't US.
|
|||||||
Some possible fixes:
|
Some possible fixes:
|
||||||
1. Switch your keyboard layout.
|
1. Switch your keyboard layout.
|
||||||
2. Use / instead.
|
2. Use / instead.
|
||||||
3. Add the commands you want to execute to the "configfile".
|
3. Open dosbox.conf and change usescancodes=false to usescancodes=true.
|
||||||
4. Start the keymapper (CTRL-F1 or add -startmapper switch to dosbox)
|
4. Add the commands you want to execute to the "configfile".
|
||||||
5. for \ try the keys around "enter". For ":" try shift and the keys between
|
5. Start the keymapper (CTRL-F1 or add -startmapper switch to DOSBox).
|
||||||
"enter" and "l" (US keyboard layout).
|
6. Use ALT-58 for : and ALT-92 for \.
|
||||||
6. Use keyb.com from FreeDOS (http://projects.freedos.net/keyb/).
|
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/).
|
||||||
|
|
||||||
|
|
||||||
Q: The game/application can't find its CD-ROM.
|
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
|
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
|
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
|
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
|
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
|
or -aspi. Look at the description elsewhere in this document for their
|
||||||
@ -145,26 +153,26 @@ A: DOSBox emulates several legacy sound devices:
|
|||||||
this with the Adlib emulation may result in conflicts.
|
this with the Adlib emulation may result in conflicts.
|
||||||
- Tandy 3 voice
|
- Tandy 3 voice
|
||||||
The emulation of this sound hardware is complete with the exception of
|
The emulation of this sound hardware is complete with the exception of
|
||||||
the noise channel, which is not very well documented and as such is only
|
the noise channel. The noise channel is not very well documented and as
|
||||||
a best guess as to the sound's accuracy.
|
such is only a best guess as to the sound's accuracy.
|
||||||
- Adlib
|
- Adlib
|
||||||
Borrowed from MAME, this emulation is almost perfect and includes the
|
Borrowed from MAME, this emulation is almost perfect and includes the
|
||||||
Adlib's ability to almost play digitized sound.
|
Adlib's ability to almost play digitized sound.
|
||||||
- SoundBlaster 16/ SoundBlaster Pro I & II /SoundBlaster I & II
|
- SoundBlaster 16/ SoundBlaster Pro I & II /SoundBlaster I & II
|
||||||
Coupled with the Adlib, by default DOSBox provides Soundblaster 16
|
By default DOSBox provides Soundblaster 16 level 16-bit stereo sound.
|
||||||
level 16-bit stereo sound. You can select a different SoundBlaster
|
You can select a different SoundBlaster version in the configfile of
|
||||||
version in the configfile of DOSBox (See Internal Commands: CONFIG).
|
DOSBox (See Internal Commands: CONFIG).
|
||||||
- Disney Soundsource
|
- Disney Soundsource
|
||||||
Using the printer port, this sound device outputs digital sound only.
|
Using the printer port, this sound device outputs digital sound only.
|
||||||
- Gravis Ultrasound
|
- Gravis Ultrasound
|
||||||
The emulation of this hardware is nearly complete, though the MIDI
|
The emulation of this hardware is nearly complete, though the MIDI
|
||||||
capabilities have been left out since an MPU-401 has been
|
capabilities have been left out, since an MPU-401 has been
|
||||||
emulated in other code.
|
emulated in other code.
|
||||||
- MPU-401
|
- MPU-401
|
||||||
A MIDI passthrough interface is also emulated. This method of sound
|
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.
|
output will only work when used with a General Midi or MT-32 device.
|
||||||
|
|
||||||
Q: DOSBox crashes on startup and I'm running arts
|
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
|
A: This isn't really a DOSBox problem, but the solution is to set the
|
||||||
environment variable SDL_AUDIODRIVER to alsa or oss.
|
environment variable SDL_AUDIODRIVER to alsa or oss.
|
||||||
|
|
||||||
@ -189,67 +197,70 @@ http://dosbox.sourceforge.net
|
|||||||
|
|
||||||
An overview of the command line options you can give to DOSBox.
|
An overview of the command line options you can give to DOSBox.
|
||||||
Windows Users must open cmd.exe or command.com or edit the shortcut to
|
Windows Users must open cmd.exe or command.com or edit the shortcut to
|
||||||
dosbox.exe for this.
|
DOSBox.exe for this.
|
||||||
The options are valid for all operating systems unless noted in the option
|
The options are valid for all operating systems unless noted in the option
|
||||||
description:
|
description:
|
||||||
|
|
||||||
dosbox [name] [-exit] [-c command] [-fullscreen] [-conf congfigfile]
|
dosbox [name] [-exit] [-c command] [-fullscreen] [-conf congfigfile]
|
||||||
[-lang languagefile] [-machine machinetype] [-noconsole]
|
[-lang languagefile] [-machine machinetype] [-noconsole]
|
||||||
[-startmapper]
|
[-startmapper] [-noautoexec]
|
||||||
|
|
||||||
dosbox -version
|
dosbox -version
|
||||||
|
|
||||||
name
|
name
|
||||||
If "name" is a directory it'll mount that as the C: drive.
|
If "name" is a directory it will mount that as the C: drive.
|
||||||
If "name" is an executable it'll mount the directory of "name"
|
If "name" is an executable it will mount the directory of "name"
|
||||||
as the C: drive and execute "name".
|
as the C: drive and execute "name".
|
||||||
|
|
||||||
-exit
|
-exit
|
||||||
dosbox will close itself when the DOS application "name" ends.
|
DOSBox will close itself when the DOS application "name" ends.
|
||||||
|
|
||||||
-c command
|
-c command
|
||||||
Runs the specified command before running "name". Multiple commands
|
Runs the specified command before running "name". Multiple commands
|
||||||
can be specified. Each command should start with -c though.
|
can be specified. Each command should start with "-c", though.
|
||||||
A command can be: an Internal Program, a DOS command or an executable
|
A command can be: an Internal Program, a DOS command or an executable
|
||||||
on a mounted drive.
|
on a mounted drive.
|
||||||
|
|
||||||
-fullscreen
|
-fullscreen
|
||||||
Starts dosbox in fullscreen mode.
|
Starts DOSBox in fullscreen mode.
|
||||||
|
|
||||||
-conf configfile
|
-conf configfile
|
||||||
Start dosbox with the options specified in "configfile".
|
Start DOSBox with the options specified in "configfile".
|
||||||
See Chapter 9 for more details.
|
See Chapter 9 for more details.
|
||||||
|
|
||||||
-lang languagefile
|
-lang languagefile
|
||||||
Start dosbox using the language specified in "languagefile".
|
Start DOSBox using the language specified in "languagefile".
|
||||||
|
|
||||||
-noconsole (Windows Only)
|
-noconsole (Windows Only)
|
||||||
Start dosbox without showing the console window. Output will
|
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
|
-machine machinetype
|
||||||
Setup dosbox to emulate a specific type of machine. Valid choices are:
|
Setup DOSBox to emulate a specific type of machine. Valid choices are:
|
||||||
hercules, cga, tandy, vga (default). The machinetype has influence on
|
hercules, cga, pcjr, tandy, vga (default). The machinetype affects
|
||||||
both the videocard and the available soundcards.
|
both the videocard and the available soundcards.
|
||||||
|
|
||||||
-startmapper
|
-startmapper
|
||||||
Enter the keymapper directly on startup. Useful for people with
|
Enter the keymapper directly on startup. Useful for people with
|
||||||
keyboard problems.
|
keyboard problems.
|
||||||
|
|
||||||
|
-noautoexec
|
||||||
|
Skips the [autoexec] section of the loaded configuration file.
|
||||||
|
|
||||||
-version
|
-version
|
||||||
output version information and exit. Useful for frontends.
|
output version information and exit. Useful for frontends.
|
||||||
|
|
||||||
Note: If a name/command/configfile/languagefile contains a space in it, put
|
Note: If a name/command/configfile/languagefile contains a space, put
|
||||||
the whole name/command/configfile/languagefile between quotes
|
the whole name/command/configfile/languagefile between quotes
|
||||||
("command or file name").
|
("command or file name").
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
dosbox c:\atlantis\atlantis.exe -c "MOUNT D C:\SAVES"
|
dosbox c:\atlantis\atlantis.exe -c "MOUNT D C:\SAVES"
|
||||||
This would mount c:\atlantis as c:\ and run atlantis.exe.
|
This mounts c:\atlantis as c:\ and runs atlantis.exe.
|
||||||
Before it does that it would first mount C:\SAVES as the D drive.
|
Before it does that it would first mount C:\SAVES as the D drive.
|
||||||
|
|
||||||
In Windows you can also drag directories/files onto the dosbox executable.
|
In Windows, you can also drag directories/files onto the DOSBox executable.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -285,7 +296,7 @@ MOUNT -u "Emulated Drive letter"
|
|||||||
|
|
||||||
-freesize size_in_mb
|
-freesize size_in_mb
|
||||||
Sets the amount of free space available on a drive in MB's. This
|
Sets the amount of free space available on a drive in MB's. This
|
||||||
is a more simple version of -size.
|
is a simpler version of -size.
|
||||||
|
|
||||||
-label drivelabel
|
-label drivelabel
|
||||||
Sets the name of the drive to "drivelabel". Needed on some
|
Sets the name of the drive to "drivelabel". Needed on some
|
||||||
@ -295,19 +306,19 @@ MOUNT -u "Emulated Drive letter"
|
|||||||
For win32: label is extracted from "Real Drive".
|
For win32: label is extracted from "Real Drive".
|
||||||
For Linux: label is set to NO_LABEL.
|
For Linux: label is set to NO_LABEL.
|
||||||
|
|
||||||
If you do specify a label this label will be kept as long as the drive
|
If you do specify a label, this label will be kept as long as the drive
|
||||||
is mounted. It will not be updated !!
|
is mounted. It will not be updated !!
|
||||||
|
|
||||||
-aspi
|
-aspi
|
||||||
Forces to use the aspi layer. Only valid if mounting a cdrom under
|
Forces use of the aspi layer. Only valid if mounting a cdrom under
|
||||||
Windows systems with an ASPI-Layer.
|
Windows systems with an ASPI-Layer.
|
||||||
|
|
||||||
-ioctl
|
-ioctl
|
||||||
Forces to use ioctl commands. Only valid if mounting a cdrom under
|
Forces use of ioctl commands. Only valid if mounting a cdrom under
|
||||||
a Windows OS which support them (Win2000/XP/NT).
|
a Windows OS which support them (Win2000/XP/NT).
|
||||||
|
|
||||||
-usecd number
|
-usecd number
|
||||||
Forces to use SDL cdrom support for drive number.
|
Forces use of SDL cdrom support for drive number.
|
||||||
Number can be found by -cd. Valid on all systems.
|
Number can be found by -cd. Valid on all systems.
|
||||||
|
|
||||||
-cd
|
-cd
|
||||||
@ -320,16 +331,20 @@ MOUNT -u "Emulated Drive letter"
|
|||||||
Hardware support is then missing.
|
Hardware support is then missing.
|
||||||
|
|
||||||
Basically, MOUNT allows you to connect real hardware to DOSBox's "emulated"
|
Basically, MOUNT allows you to connect real hardware to DOSBox's "emulated"
|
||||||
PC. So MOUNT C C:\ tells DOSBox to use your real C: drive as drive C: in
|
PC. So MOUNT C C:\GAMES tells DOSBox to use your C:\GAMES directory as drive
|
||||||
DOSBox. It also allows you to change the drive's letter identification for
|
C: in DOSBox. It also allows you to change the drive's letter identification
|
||||||
programs that demand specific drive letters.
|
for programs that demand specific drive letters.
|
||||||
|
|
||||||
For example: Touche: Adventures of The Fifth Musketeer must be run on your C:
|
For example: Touche: Adventures of The Fifth Musketeer must be run on your C:
|
||||||
drive. Using DOSBox and its mount command, you can trick into thinking it
|
drive. Using DOSBox and its mount command, you can trick the game into
|
||||||
is on C drive while placing it where you want it. For example, if the game
|
believing it is on the C drive, while you can still place it where you
|
||||||
were in D:\TOUCHE, you can use the command MOUNT C D:\ would allow you to
|
want it. For example, if the game is in D:\TOUCHE, the command MOUNT C D:\
|
||||||
run Touche from the D drive.
|
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.
|
||||||
|
|
||||||
General MOUNT Examples:
|
General MOUNT Examples:
|
||||||
1. To mount c:\DirX as a floppy :
|
1. To mount c:\DirX as a floppy :
|
||||||
@ -350,21 +365,49 @@ MEM
|
|||||||
Program to display the amount of free memory.
|
Program to display the amount of free memory.
|
||||||
|
|
||||||
CONFIG [-writeconf] [-writelang] localfile
|
CONFIG [-writeconf] [-writelang] localfile
|
||||||
Write the current configuration or language settings to file.
|
CONFIG -set "section property=value"
|
||||||
"localfile" is located on the local drive. Not a mounted drive in DOSBox.
|
CONFIG -get "section property"
|
||||||
|
|
||||||
The configuration file controls various settings of DOSBox: The amount
|
CONFIG can be used to change or query various settings of DOSBox
|
||||||
of emulated memory, the emulated soundcards and many more things. It
|
during runtime. It can save the current settings and language strings to
|
||||||
allows acces to AUTOEXEC.BAT as well.
|
disk. Information about all possible sections and properties can
|
||||||
|
be found in section 9 (The Config File).
|
||||||
|
|
||||||
|
-writeconf localfile
|
||||||
|
Write the current configuration settings to file. "localfile" is
|
||||||
|
located on the local drive, not a mounted drive in DOSBox.
|
||||||
|
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 9 (The Config File) for more information.
|
||||||
|
|
||||||
|
-writelang localfile
|
||||||
|
Write the current language settings to file. "localfile" is
|
||||||
|
located on the local drive, not a mounted drive in DOSBox.
|
||||||
The language file controls all visible ouput of the internal commands
|
The language file controls all visible ouput of the internal commands
|
||||||
and the internal dos.
|
and the internal dos.
|
||||||
|
|
||||||
Example:
|
-set "section property=value"
|
||||||
To create a configfile in your current directory:
|
CONFIG will attempt to set the property to new value. At this moment
|
||||||
config -writeconf dosbox.conf
|
CONFIG can not report whether the command succeeded or not.
|
||||||
|
|
||||||
|
-get "section property"
|
||||||
|
The current value of the property is reported and stored in the
|
||||||
|
environment variable %CONFIG%. This can be used to store the value
|
||||||
|
when using batch files.
|
||||||
|
|
||||||
|
Both "-set" and "-get" work from batch files and can be used to set up your
|
||||||
|
own preferences for each game.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
1. To create a configfile in your current directory:
|
||||||
|
config -writeconf dosbox.conf
|
||||||
|
2. To set the cpu cycles to 10000:
|
||||||
|
config -set "cpu cycles=10000"
|
||||||
|
3. To turn ems memory emulation off:
|
||||||
|
config -set "dos ems=off"
|
||||||
|
4. To check which cpu core is being used.
|
||||||
|
config -get "cpu core"
|
||||||
|
|
||||||
LOADFIX [-size] [program] [program-parameters]
|
LOADFIX [-size] [program] [program-parameters]
|
||||||
LOADFIX -f
|
LOADFIX -f
|
||||||
@ -395,9 +438,9 @@ RESCAN
|
|||||||
|
|
||||||
MIXER
|
MIXER
|
||||||
Makes DOSBox display its current volume settings.
|
Makes DOSBox display its current volume settings.
|
||||||
You can change this way:
|
Here's how you can change them:
|
||||||
|
|
||||||
mixer channel left:right [/NOSHOW]
|
mixer channel left:right [/NOSHOW] [/LISTMIDI]
|
||||||
|
|
||||||
channel
|
channel
|
||||||
Can be one of the following: MASTER, DISNEY, SPKR, GUS, SB, FM.
|
Can be one of the following: MASTER, DISNEY, SPKR, GUS, SB, FM.
|
||||||
@ -410,6 +453,12 @@ MIXER
|
|||||||
Prevents DOSBox from showing the result if you set one
|
Prevents DOSBox from showing the result if you set one
|
||||||
of the volume levels.
|
of the volume levels.
|
||||||
|
|
||||||
|
/LISTMIDI
|
||||||
|
Lists the available midi devices on your pc (Windows). To select a
|
||||||
|
device other than the Windows default midi-mapper, add a line
|
||||||
|
'config=id' to the [midi] section in the configuration file, where
|
||||||
|
'id' is the number for the device as listed by LISTMIDI.
|
||||||
|
|
||||||
|
|
||||||
IMGMOUNT
|
IMGMOUNT
|
||||||
A utility to mount disk images and CD-ROM images in DOSBox.
|
A utility to mount disk images and CD-ROM images in DOSBox.
|
||||||
@ -418,9 +467,9 @@ IMGMOUNT
|
|||||||
-size [sectorsbytesize, sectorsperhead, heads, cylinders]
|
-size [sectorsbytesize, sectorsperhead, heads, cylinders]
|
||||||
|
|
||||||
imagefile
|
imagefile
|
||||||
location of the image files to mount in DOSBox. The location is on a
|
Location of the image files to mount in DOSBox. The location is on a
|
||||||
mounted drive inside DOSBox. CD-ROM images can be mounted
|
mounted drive inside DOSBox. CD-ROM images can be mounted
|
||||||
directly as well. They don't need to be a mounted drive.
|
directly as well. They don't have to be on a mounted drive.
|
||||||
|
|
||||||
-t
|
-t
|
||||||
The following are valid image types:
|
The following are valid image types:
|
||||||
@ -434,16 +483,16 @@ IMGMOUNT
|
|||||||
-fs
|
-fs
|
||||||
The following are valid file system formats:
|
The following are valid file system formats:
|
||||||
iso: Specifies the ISO 9660 CD-ROM format.
|
iso: Specifies the ISO 9660 CD-ROM format.
|
||||||
fat: Specifies the image uses the FAT file system. DOSBox will attempt
|
fat: Specifies that the image uses the FAT file system. DOSBox will attempt
|
||||||
to mount this image as a drive in DOSBox and make the files
|
to mount this image as a drive in DOSBox and make the files
|
||||||
available from inside DOSBox.
|
available from inside DOSBox.
|
||||||
none: DOSBox will make no attempt to read the file system on the disk.
|
none: DOSBox will make no attempt to read the file system on the disk.
|
||||||
This is useful if one needs to format it or one wants to boot
|
This is useful if you need to format it or if you want to boot
|
||||||
off of the disk using the BOOT command. When using the "none"
|
the disk using the BOOT command. When using the "none"
|
||||||
filesystem, one must specify the drive number (2 or 3,
|
filesystem, you must specify the drive number (2 or 3,
|
||||||
where 2 = master, 3 = slave) rather than a drive letter.
|
where 2 = master, 3 = slave) rather than a drive letter.
|
||||||
For example, to mount a 70MB image as the slave drive device,
|
For example, to mount a 70MB image as the slave drive device,
|
||||||
one would type:
|
you would type:
|
||||||
"imgmount 3 d:\test.img -size 512,63,16,142 -fs none"
|
"imgmount 3 d:\test.img -size 512,63,16,142 -fs none"
|
||||||
(without the quotes) Compare this with a mount to read the
|
(without the quotes) Compare this with a mount to read the
|
||||||
drive in DOSBox, which would read as:
|
drive in DOSBox, which would read as:
|
||||||
@ -470,13 +519,13 @@ BOOT
|
|||||||
diskimgN.img
|
diskimgN.img
|
||||||
This can be any number of floppy disk images one wants mounted after
|
This can be any number of floppy disk images one wants mounted after
|
||||||
DOSBox boots the specified drive letter.
|
DOSBox boots the specified drive letter.
|
||||||
To swap between images, one hits CTRL+F4 to swap out the current disk
|
To swap between images, hit CTRL-F4 to change from the current disk
|
||||||
and swap in the next disk in the list. Once the last disk in the list is
|
to the next disk in the list. The list will loop back from the last
|
||||||
swapped out, the list loops back to the beginning.
|
disk image to the beginning.
|
||||||
|
|
||||||
[-l driveletter]
|
[-l driveletter]
|
||||||
This parameter allows one to specify the drive to boot from.
|
This parameter allows you to specify the drive to boot from.
|
||||||
The default is the A drive, the floppy drive. One can also boot off of
|
The default is the A drive, the floppy drive. You can also boot
|
||||||
a hard drive image mounted as master by specifying "-l C"
|
a hard drive image mounted as master by specifying "-l C"
|
||||||
without the quotes, or the drive as slave by specifying "-l D"
|
without the quotes, or the drive as slave by specifying "-l D"
|
||||||
|
|
||||||
@ -487,14 +536,14 @@ IPX
|
|||||||
|
|
||||||
All of the IPX networking is managed through the internal DOSBox program
|
All of the IPX networking is managed through the internal DOSBox program
|
||||||
IPXNET. For help on the IPX networking from inside DOSBox, type
|
IPXNET. For help on the IPX networking from inside DOSBox, type
|
||||||
"IPXNET HELP" (without quotes) and the program will list out the commands
|
"IPXNET HELP" (without quotes) and the program will list the commands
|
||||||
and relevant documentation.
|
and relevant documentation.
|
||||||
|
|
||||||
With regard to actually setting up a network, one system needs to be
|
With regard to actually setting up a network, one system needs to be
|
||||||
the server. To set this up, in a DOSBox session, one should type
|
the server. To set this up, type "IPXNET STARTSERVER" (without the quotes)
|
||||||
"IPXNET STARTSERVER" (without the quotes). The server DOSBox session will
|
in a DOSBox session. The server DOSBox session will
|
||||||
automatically add itself to the virtual IPX network. In turn, for every
|
automatically add itself to the virtual IPX network. For every
|
||||||
other computer that should be part of the virtual IPX network,
|
additional computer that should be part of the virtual IPX network,
|
||||||
you'll need to type "IPXNET CONNECT <computer host name or IP>".
|
you'll need to type "IPXNET CONNECT <computer host name or IP>".
|
||||||
For example, if your server is at bob.dosbox.com,
|
For example, if your server is at bob.dosbox.com,
|
||||||
you would type "IPXNET CONNECT bob.dosbox.com" on every non-server system.
|
you would type "IPXNET CONNECT bob.dosbox.com" on every non-server system.
|
||||||
@ -503,18 +552,18 @@ IPX
|
|||||||
|
|
||||||
IPXNET CONNECT
|
IPXNET CONNECT
|
||||||
|
|
||||||
IPXNET CONNECT opens a connection to an IPX tunneling server
|
IPXNET CONNECT opens a connection to an IPX tunnelling server
|
||||||
running on another DOSBox session. The "address" parameter specifies
|
running on another DOSBox session. The "address" parameter specifies
|
||||||
the IP address or host name of the server computer. One can also
|
the IP address or host name of the server computer. You can also
|
||||||
specify the UDP port to use. By default IPXNET uses port 213, the
|
specify the UDP port to use. By default IPXNET uses port 213 - the
|
||||||
assigned IANA port for IPX tunneling, for its connection.
|
assigned IANA port for IPX tunnelling - for its connection.
|
||||||
|
|
||||||
The syntax for IPXNET CONNECT is:
|
The syntax for IPXNET CONNECT is:
|
||||||
IPXNET CONNECT address <port>
|
IPXNET CONNECT address <port>
|
||||||
|
|
||||||
IPXNET DISCONNECT
|
IPXNET DISCONNECT
|
||||||
|
|
||||||
IPXNET DISCONNECT closes the connection to the IPX tunneling server.
|
IPXNET DISCONNECT closes the connection to the IPX tunnelling server.
|
||||||
|
|
||||||
The syntax for IPXNET DISCONNECT is:
|
The syntax for IPXNET DISCONNECT is:
|
||||||
IPXNET DISCONNECT
|
IPXNET DISCONNECT
|
||||||
@ -524,24 +573,24 @@ IPX
|
|||||||
IPXNET STARTSERVER starts and IPX tunneling server on this DOSBox
|
IPXNET STARTSERVER starts and IPX tunneling server on this DOSBox
|
||||||
session. By default, the server will accept connections on UDP port
|
session. By default, the server will accept connections on UDP port
|
||||||
213, though this can be changed. Once the server is started, DOSBox
|
213, though this can be changed. Once the server is started, DOSBox
|
||||||
will automatically start a client connection to the IPX tunneling server.
|
will automatically start a client connection to the IPX tunnelling server.
|
||||||
|
|
||||||
The syntax for IPXNET STARTSERVER is:
|
The syntax for IPXNET STARTSERVER is:
|
||||||
IPXNET STARTSERVER <port>
|
IPXNET STARTSERVER <port>
|
||||||
|
|
||||||
IPXNET STOPSERVER
|
IPXNET STOPSERVER
|
||||||
|
|
||||||
IPXNET STOPSERVER stops the IPX tunneling server running on this DOSBox
|
IPXNET STOPSERVER stops the IPX tunnelling server running on this DOSBox
|
||||||
session. Care should be taken to ensure that all other connections have
|
session. Care should be taken to ensure that all other connections have
|
||||||
terminated as well since stopping the server may cause lockups on other
|
terminated as well, since stopping the server may cause lockups on other
|
||||||
machines still using the IPX tunneling server.
|
machines that are still using the IPX tunnelling server.
|
||||||
|
|
||||||
The syntax for IPXNET STOPSERVER is:
|
The syntax for IPXNET STOPSERVER is:
|
||||||
IPXNET STOPSERVER
|
IPXNET STOPSERVER
|
||||||
|
|
||||||
IPXNET PING
|
IPXNET PING
|
||||||
|
|
||||||
IPXNET PING broadcasts a ping request through the IPX tunneled network.
|
IPXNET PING broadcasts a ping request through the IPX tunnelled network.
|
||||||
In response, all other connected computers will respond to the ping
|
In response, all other connected computers will respond to the ping
|
||||||
and report the time it took to receive and send the ping message.
|
and report the time it took to receive and send the ping message.
|
||||||
|
|
||||||
@ -550,8 +599,8 @@ IPX
|
|||||||
|
|
||||||
IPXNET STATUS
|
IPXNET STATUS
|
||||||
|
|
||||||
IPXNET STATUS reports the current state of this DOSBox's sessions
|
IPXNET STATUS reports the current state of this DOSBox session's
|
||||||
IPX tunneling network. For a list of the computers connected to the
|
IPX tunnelling network. For a list of all computers connected to the
|
||||||
network use the IPXNET PING command.
|
network use the IPXNET PING command.
|
||||||
|
|
||||||
The syntax for IPXNET STATUS is:
|
The syntax for IPXNET STATUS is:
|
||||||
@ -566,9 +615,11 @@ For more information use the /? command line switch with the programs.
|
|||||||
5. Special Keys:
|
5. Special Keys:
|
||||||
================
|
================
|
||||||
|
|
||||||
ALT-ENTER Go full screen and back.
|
ALT-ENTER Switch to full screen and back.
|
||||||
|
ALT-PAUSE Pause emulation.
|
||||||
CTRL-F1 Start the keymapper.
|
CTRL-F1 Start the keymapper.
|
||||||
CTRL-F4 Swap mounted disk-image. Update directory cache for all drives!
|
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-F5 Save a screenshot.(png)
|
||||||
CTRL-F6 Start/Stop recording sound output to a wave file.
|
CTRL-F6 Start/Stop recording sound output to a wave file.
|
||||||
CTRL-ALT-F7 Start/Stop recording of OPL commands.
|
CTRL-ALT-F7 Start/Stop recording of OPL commands.
|
||||||
@ -579,18 +630,19 @@ CTRL-F9 Kill dosbox.
|
|||||||
CTRL-F10 Capture/Release the mouse.
|
CTRL-F10 Capture/Release the mouse.
|
||||||
CTRL-F11 Slow down emulation (Decrease DOSBox Cycles).
|
CTRL-F11 Slow down emulation (Decrease DOSBox Cycles).
|
||||||
CTRL-F12 Speed up emulation (Increase DOSBox Cycles).
|
CTRL-F12 Speed up emulation (Increase DOSBox Cycles).
|
||||||
|
ALT-F12 Unlock speed (turbo button).
|
||||||
|
|
||||||
These are the default keybindings. They can be changed in the keymapper.
|
These are the default keybindings. They can be changed in the keymapper.
|
||||||
|
|
||||||
Saved/recorded files can be found in current_directory/capture
|
Saved/recorded files can be found in current_directory/capture
|
||||||
(can be changed in the configfile).
|
(can be changed in the configfile).
|
||||||
The directory has to exist prior to starting DOSBox else nothing
|
The directory has to exist prior to starting DOSBox, otherwise nothing
|
||||||
gets saved/recorded !
|
gets saved/recorded !
|
||||||
|
|
||||||
|
|
||||||
NOTE: Once you increase your DOSBox cycles beyond your computer's maximum
|
NOTE: Once you increase your DOSBox cycles beyond your computer's maximum
|
||||||
capacity, it will produce the same effect as slowing down the emulation.
|
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; there is no standard.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -602,9 +654,9 @@ When you start the keymapper (either with CTRL-F1 or -startmapper as a
|
|||||||
command line argument to the DOSBox executable) you are presented with
|
command line argument to the DOSBox executable) you are presented with
|
||||||
a virtual keyboard.
|
a virtual keyboard.
|
||||||
|
|
||||||
This virtual keyboard corresponds with the keys DOSBox will report to its
|
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
|
applications. If you click on a key with your mouse, you can see in the
|
||||||
lowerleft corner which key on your keyboard corresponds with it.
|
lower left corner which key on your keyboard corresponds to it.
|
||||||
|
|
||||||
Event: EVENT
|
Event: EVENT
|
||||||
BIND: BIND
|
BIND: BIND
|
||||||
@ -624,35 +676,35 @@ mod1,2,3
|
|||||||
BIND. mod1 = CTRL and mod2 = ALT. These are generally only used when you
|
BIND. mod1 = CTRL and mod2 = ALT. These are generally only used when you
|
||||||
want to change the special keys of DOSBox.
|
want to change the special keys of DOSBox.
|
||||||
Add
|
Add
|
||||||
Add a new BIND to this EVENT. Basicly add a key from your keyboard which
|
Add a new BIND to this EVENT. Basically add a key from your keyboard which
|
||||||
will produce the key EVENT in DOSBox.
|
will produce the key EVENT in DOSBox.
|
||||||
Del
|
Del
|
||||||
Delete the BIND to this EVENT. If an EVENT has no BINDS than it's not
|
Delete the BIND to this EVENT. If an EVENT has no BINDS, then it's not
|
||||||
possible to type this key in DOSBox.
|
possible to type this key in DOSBox.
|
||||||
Next
|
Next
|
||||||
Cycle through the list of keys(BINDS) which map to this EVENT.
|
Go through the list of keys(BINDS) which map to this EVENT.
|
||||||
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
Q1. You want to have the X on your keyboard to type a Z in DOSBox.
|
Q1. You want to have the X on your keyboard to type a Z in DOSBox.
|
||||||
A. With your mouse click on the Z on the keyboard mapper. Click "Add".
|
A. Click on the Z on the keyboard mapper. Click "Add".
|
||||||
Now press the X key on your keyboard.
|
Now press the X key on your keyboard.
|
||||||
|
|
||||||
Q2. If you click "Next" a few times you will notice that the Z on your
|
Q2. If you click "Next" a couple of times, you will notice that the Z on your
|
||||||
keyboard also produces an Z in DOSBox.
|
keyboard also produces an Z in DOSBox.
|
||||||
A. Therefore select the Z again and click "Next" till you have the Z on
|
A. Therefore select the Z again, and click "Next" until you have the Z on
|
||||||
your keyboard. Now click "Del".
|
your keyboard. Now click "Del".
|
||||||
|
|
||||||
Q3. If you try it out in DOSBox you will notice that pressing X makes ZX
|
Q3. If you try it out in DOSBox, you will notice that pressing X makes ZX
|
||||||
appear.
|
appear.
|
||||||
A. The X on your keyboard is still mapped to the X as well! Click on
|
A. The X on your keyboard is still mapped to the X as well! Click on
|
||||||
the X in the keyboard mapper and search with "Next" till you find the
|
the X in the keyboard mapper and search with "Next" until you find the
|
||||||
mapped key X. Click "Del".
|
mapped key X. Click "Del".
|
||||||
|
|
||||||
|
|
||||||
If you change the default mapping you can save your changes by pressing
|
If you change the default mapping, you can save your changes by pressing
|
||||||
"Save". DOSBox will save the mapping to location specified in the configfile
|
"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
|
(mapperfile=mapper.txt). At startup, DOSBox will load your mapperfile, if it's
|
||||||
present in the configfile.
|
present in the configfile.
|
||||||
|
|
||||||
|
|
||||||
@ -663,8 +715,8 @@ present in the configfile.
|
|||||||
|
|
||||||
Fast machine. My guess would be pentium-2 400+ to get decent emulation
|
Fast machine. My guess would be pentium-2 400+ to get decent emulation
|
||||||
of games written for an 286 machine.
|
of games written for an 286 machine.
|
||||||
For protected mode games a 1 Ghz machine is recommended and don't expect
|
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
|
them to run fast, though! Be sure to read the next section on how to speed
|
||||||
it up somewhat.
|
it up somewhat.
|
||||||
|
|
||||||
|
|
||||||
@ -674,7 +726,7 @@ it up somewhat.
|
|||||||
===================================
|
===================================
|
||||||
|
|
||||||
DOSBox emulates the CPU, the sound and graphic cards, and some other
|
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
|
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
|
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
|
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
|
the System Monitor in Windows 95/98/ME. Once 100% of your real CPU time is
|
||||||
@ -689,14 +741,14 @@ Overclock DOSBox until 100% of your CPU is used (use the utilities above to
|
|||||||
check)
|
check)
|
||||||
|
|
||||||
Since VGA emulation is the most demanding part of DOSBox in terms of actual
|
Since VGA emulation is the most demanding part of DOSBox in terms of actual
|
||||||
CPU usage, we'll start here. Increase the number of frames skipped (in
|
CPU usage, we'll start there. Increase the number of frames skipped (in
|
||||||
increments of one) by pressing CRTL+F8. Your CPU usage should decrease.
|
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.
|
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
|
Please note that this is a trade-off: you lose in fluidity of video what you
|
||||||
gain in speed
|
gain in speed
|
||||||
|
|
||||||
You can also try to disable the sound through the setup utility of the game
|
You can also try to disable the sound through the setup utility of the game
|
||||||
to further reduce load on your CPU.
|
to reduce load on your CPU further.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -710,7 +762,7 @@ programs section of the readme for usage of CONFIG.COM.
|
|||||||
You can edit the generated configfile to customize DOSBox.
|
You can edit the generated configfile to customize DOSBox.
|
||||||
|
|
||||||
The file is divided into several sections (the names have [] around it).
|
The file is divided into several sections (the names have [] around it).
|
||||||
Some sections have options which you can set.
|
Some sections have options you can set.
|
||||||
# and % indicate comment-lines.
|
# and % indicate comment-lines.
|
||||||
The generated configfile contains the current settings. You can alter them and
|
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.
|
start DOSBox with the -conf switch to load the file and use these settings.
|
||||||
@ -726,10 +778,10 @@ current directory for dosbox.conf. Then it will look for ~/.dosboxrc (Linux),
|
|||||||
======================
|
======================
|
||||||
|
|
||||||
A language file can be generated by CONFIG.COM.
|
A language file can be generated by CONFIG.COM.
|
||||||
Read it and you will hopefully understand how to change it.
|
Read it, and you will hopefully understand how to change it.
|
||||||
Start DOSBox with the -lang switch to use your new language file
|
Start DOSBox with the -lang switch to use your new language file.
|
||||||
or you can setup the filename in the config file in the [dosbox] section.
|
Alternatively, you can setup the filename in the config file in the [dosbox]
|
||||||
There's a language= entry that can be changed with the filename.
|
section. There's a language= entry that can be changed with the filename.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -746,9 +798,9 @@ Check the INSTALL in the source distribution.
|
|||||||
12. Special Thanks:
|
12. Special Thanks:
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Vlad R. of the vdmsound project for excellent sound blaster info.
|
Vlad R. of the VDMSound project for excellent SoundBlaster info.
|
||||||
Tatsuyuki Satoh of the Mame Team for making an excellent FM emulator.
|
Tatsuyuki Satoh of the Mame Team for making an excellent FM emulator.
|
||||||
The Bochs and DOSemu projects which I used for information.
|
The Bochs and DOSemu projects, which I used for information.
|
||||||
Freedos for ideas in making my shell.
|
Freedos for ideas in making my shell.
|
||||||
Pierre-Yves Gérardy for hosting the old Beta Board.
|
Pierre-Yves Gérardy for hosting the old Beta Board.
|
||||||
Colin Snover for hosting our forum.
|
Colin Snover for hosting our forum.
|
||||||
|
@ -305,7 +305,7 @@ AC_SUBST(ALSA_LIBS)
|
|||||||
|
|
||||||
AH_TOP([
|
AH_TOP([
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -331,6 +331,12 @@ AH_BOTTOM([#if C_HAS_ATTRIBUTE
|
|||||||
#define GCC_ATTRIBUTE(x) /* attribute not supported */
|
#define GCC_ATTRIBUTE(x) /* attribute not supported */
|
||||||
#endif])
|
#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([
|
AH_BOTTOM([
|
||||||
typedef double Real64;
|
typedef double Real64;
|
||||||
|
|
||||||
|
400
aclocal.m4
vendored
400
aclocal.m4
vendored
@ -1,7 +1,7 @@
|
|||||||
# generated automatically by aclocal 1.9.3 -*- Autoconf -*-
|
# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||||
# Free Software Foundation, Inc.
|
# 2005 Free Software Foundation, Inc.
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -11,23 +11,11 @@
|
|||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
# PARTICULAR PURPOSE.
|
# PARTICULAR PURPOSE.
|
||||||
|
|
||||||
# -*- Autoconf -*-
|
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
#
|
||||||
# Generated from amversion.in; do not edit by hand.
|
# This file is free software; the Free Software Foundation
|
||||||
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# with or without modifications, as long as this notice is preserved.
|
||||||
# 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)
|
# AM_AUTOMAKE_VERSION(VERSION)
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
@ -40,26 +28,15 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
|
|||||||
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
||||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||||
[AM_AUTOMAKE_VERSION([1.9.3])])
|
[AM_AUTOMAKE_VERSION([1.9.5])])
|
||||||
|
|
||||||
# AM_AUX_DIR_EXPAND
|
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
|
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This file is free software; the Free Software Foundation
|
||||||
# it under the terms of the GNU General Public License as published by
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
# with or without modifications, as long as this notice is preserved.
|
||||||
# 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
|
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||||
@ -108,24 +85,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
|
|||||||
|
|
||||||
# AM_CONDITIONAL -*- Autoconf -*-
|
# AM_CONDITIONAL -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
|
# 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.
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# serial 7
|
||||||
# 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 6
|
|
||||||
|
|
||||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
@ -149,26 +116,15 @@ AC_CONFIG_COMMANDS_PRE(
|
|||||||
Usually this means the macro was only invoked conditionally.]])
|
Usually this means the macro was only invoked conditionally.]])
|
||||||
fi])])
|
fi])])
|
||||||
|
|
||||||
# serial 7 -*- Autoconf -*-
|
|
||||||
|
|
||||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
|
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||||
# Free Software Foundation, Inc.
|
# 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
|
# serial 8
|
||||||
# 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.
|
|
||||||
|
|
||||||
|
|
||||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
# 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,
|
# written in clear, in which case automake, when reading aclocal.m4,
|
||||||
@ -177,7 +133,6 @@ fi])])
|
|||||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# _AM_DEPENDENCIES(NAME)
|
# _AM_DEPENDENCIES(NAME)
|
||||||
# ----------------------
|
# ----------------------
|
||||||
# See how the compiler implements dependency checking.
|
# See how the compiler implements dependency checking.
|
||||||
@ -319,25 +274,14 @@ 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
|
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||||
# Free Software Foundation, Inc.
|
# 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
|
#serial 3
|
||||||
# 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
|
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
@ -396,54 +340,31 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|||||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||||
])
|
])
|
||||||
|
|
||||||
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- 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.
|
||||||
|
|
||||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
|
# serial 8
|
||||||
|
|
||||||
# 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 7
|
|
||||||
|
|
||||||
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
|
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
|
||||||
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
|
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
|
||||||
|
|
||||||
# Do all the work for Automake. -*- Autoconf -*-
|
# Do all the work for Automake. -*- Autoconf -*-
|
||||||
|
|
||||||
# This macro actually does too much some checks are only needed if
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||||
# your package does certain things. But this isn't really a big deal.
|
|
||||||
|
|
||||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
|
||||||
# Free Software Foundation, Inc.
|
# 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
|
# serial 12
|
||||||
# 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,
|
# This macro actually does too much. Some checks are only needed if
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# your package does certain things. But this isn't really a big deal.
|
||||||
# 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 11
|
|
||||||
|
|
||||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||||
@ -545,51 +466,27 @@ for _am_header in $config_headers :; do
|
|||||||
done
|
done
|
||||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
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
|
# AM_PROG_INSTALL_SH
|
||||||
# ------------------
|
# ------------------
|
||||||
# Define $install_sh.
|
# Define $install_sh.
|
||||||
|
|
||||||
# Copyright (C) 2001, 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.
|
|
||||||
|
|
||||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||||
install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
||||||
AC_SUBST(install_sh)])
|
AC_SUBST(install_sh)])
|
||||||
|
|
||||||
# -*- Autoconf -*-
|
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||||
# Copyright (C) 2003 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
|
# serial 2
|
||||||
# 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
|
# Check whether the underlying file-system supports filenames
|
||||||
# with a leading dot. For instance MS-DOS doesn't.
|
# with a leading dot. For instance MS-DOS doesn't.
|
||||||
@ -606,24 +503,13 @@ AC_SUBST([am__leading_dot])])
|
|||||||
|
|
||||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
# 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 free software; you can redistribute it and/or modify
|
# serial 3
|
||||||
# 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_MAKE_INCLUDE()
|
# AM_MAKE_INCLUDE()
|
||||||
# -----------------
|
# -----------------
|
||||||
@ -667,27 +553,16 @@ AC_MSG_RESULT([$_am_result])
|
|||||||
rm -f confinc confmf
|
rm -f confinc confmf
|
||||||
])
|
])
|
||||||
|
|
||||||
# -*- Autoconf -*-
|
# Fake the existence of programs that GNU maintainers use. -*- 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 (C) 1997, 1999, 2000, 2001, 2003 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.
|
|
||||||
|
|
||||||
# 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)
|
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
@ -713,27 +588,16 @@ else
|
|||||||
fi
|
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.
|
||||||
|
|
||||||
# AM_PROG_MKDIR_P
|
# AM_PROG_MKDIR_P
|
||||||
# ---------------
|
# ---------------
|
||||||
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
|
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
|
||||||
|
#
|
||||||
# Copyright (C) 2003, 2004 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.
|
|
||||||
|
|
||||||
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
|
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
|
||||||
# created by `make install' are always world readable, even if the
|
# created by `make install' are always world readable, even if the
|
||||||
# installer happens to have an overly restrictive umask (e.g. 077).
|
# installer happens to have an overly restrictive umask (e.g. 077).
|
||||||
@ -789,24 +653,13 @@ AC_SUBST([mkdir_p])])
|
|||||||
|
|
||||||
# Helper functions for option handling. -*- Autoconf -*-
|
# Helper functions for option handling. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
# 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 free software; you can redistribute it and/or modify
|
# serial 3
|
||||||
# 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)
|
# _AM_MANGLE_OPTION(NAME)
|
||||||
# -----------------------
|
# -----------------------
|
||||||
@ -831,28 +684,16 @@ AC_DEFUN([_AM_SET_OPTIONS],
|
|||||||
AC_DEFUN([_AM_IF_OPTION],
|
AC_DEFUN([_AM_IF_OPTION],
|
||||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
[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.
|
||||||
#
|
#
|
||||||
# Check to make sure that the build environment is sane.
|
# 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 (C) 1996, 1997, 2000, 2001, 2003 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.
|
|
||||||
|
|
||||||
# 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
|
# AM_SANITY_CHECK
|
||||||
# ---------------
|
# ---------------
|
||||||
@ -895,25 +736,14 @@ Check your system clock])
|
|||||||
fi
|
fi
|
||||||
AC_MSG_RESULT(yes)])
|
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
|
# AM_PROG_INSTALL_STRIP
|
||||||
|
# ---------------------
|
||||||
# Copyright (C) 2001, 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.
|
|
||||||
|
|
||||||
# One issue with vendor `install' (even GNU) is that you can't
|
# One issue with vendor `install' (even GNU) is that you can't
|
||||||
# specify the program used to strip binaries. This is especially
|
# specify the program used to strip binaries. This is especially
|
||||||
# annoying in cross-compiling environments, where the build's strip
|
# annoying in cross-compiling environments, where the build's strip
|
||||||
@ -936,25 +766,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
|||||||
|
|
||||||
# Check how to create a tarball. -*- Autoconf -*-
|
# Check how to create a tarball. -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This file is free software; the Free Software Foundation
|
||||||
# it under the terms of the GNU General Public License as published by
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
# with or without modifications, as long as this notice is preserved.
|
||||||
# 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
|
|
||||||
|
|
||||||
|
# serial 2
|
||||||
|
|
||||||
# _AM_PROG_TAR(FORMAT)
|
# _AM_PROG_TAR(FORMAT)
|
||||||
# --------------------
|
# --------------------
|
||||||
|
27
config.h.in
27
config.h.in
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -26,7 +26,8 @@
|
|||||||
/* Define to 1 to enable internal debugger, requires libcurses */
|
/* Define to 1 to enable internal debugger, requires libcurses */
|
||||||
#undef C_DEBUG
|
#undef C_DEBUG
|
||||||
|
|
||||||
/* Define to 1 if you want serial passthrough support (Win32 only). */
|
/* Define to 1 if you want serial passthrough support (Win32 and OS/2 only).
|
||||||
|
*/
|
||||||
#undef C_DIRECTSERIAL
|
#undef C_DIRECTSERIAL
|
||||||
|
|
||||||
/* Define to 1 to use x86 dynamic cpu core */
|
/* Define to 1 to use x86 dynamic cpu core */
|
||||||
@ -35,9 +36,19 @@
|
|||||||
/* Define to 1 to enable floating point emulation */
|
/* Define to 1 to enable floating point emulation */
|
||||||
#undef C_FPU
|
#undef C_FPU
|
||||||
|
|
||||||
|
/* Define to 1 to use a x86 assembly fpu core */
|
||||||
|
#undef C_FPU_X86
|
||||||
|
|
||||||
/* Determines if the compilers supports attributes for structures. */
|
/* Determines if the compilers supports attributes for structures. */
|
||||||
#undef C_HAS_ATTRIBUTE
|
#undef C_HAS_ATTRIBUTE
|
||||||
|
|
||||||
|
/* Determines if the compilers supports __builtin_expect for branch
|
||||||
|
prediction. */
|
||||||
|
#undef C_HAS_BUILTIN_EXPECT
|
||||||
|
|
||||||
|
/* Define to 1 if you have the mprotect function */
|
||||||
|
#undef C_HAVE_MPROTECT
|
||||||
|
|
||||||
/* Define to 1 to enable heavy debugging, also have to enable C_DEBUG */
|
/* Define to 1 to enable heavy debugging, also have to enable C_DEBUG */
|
||||||
#undef C_HEAVY_DEBUG
|
#undef C_HEAVY_DEBUG
|
||||||
|
|
||||||
@ -62,6 +73,9 @@
|
|||||||
/* Define to 1 to enable screenshots, requires libpng */
|
/* Define to 1 to enable screenshots, requires libpng */
|
||||||
#undef C_SSHOT
|
#undef C_SSHOT
|
||||||
|
|
||||||
|
/* Define to 1 to use a unaligned memory access */
|
||||||
|
#undef C_UNALIGNED_MEMORY
|
||||||
|
|
||||||
/* environ can be included */
|
/* environ can be included */
|
||||||
#undef ENVIRON_INCLUDED
|
#undef ENVIRON_INCLUDED
|
||||||
|
|
||||||
@ -110,6 +124,9 @@
|
|||||||
/* Compiling on Mac OS X */
|
/* Compiling on Mac OS X */
|
||||||
#undef MACOSX
|
#undef MACOSX
|
||||||
|
|
||||||
|
/* Compiling on OS/2 EMX */
|
||||||
|
#undef OS2
|
||||||
|
|
||||||
/* Name of package */
|
/* Name of package */
|
||||||
#undef PACKAGE
|
#undef PACKAGE
|
||||||
|
|
||||||
@ -179,6 +196,12 @@
|
|||||||
#define GCC_ATTRIBUTE(x) /* attribute not supported */
|
#define GCC_ATTRIBUTE(x) /* attribute not supported */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if C_HAS_BUILTIN_EXPECT
|
||||||
|
#define GCC_UNLIKELY(x) __builtin_expect((x),0)
|
||||||
|
#else
|
||||||
|
#define GCC_UNLIKELY(x) (x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef double Real64;
|
typedef double Real64;
|
||||||
|
|
||||||
|
599
configure
vendored
599
configure
vendored
@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.59 for dosbox 0.63.
|
# Generated by GNU Autoconf 2.59 for dosbox 0.65.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2003 Free Software Foundation, Inc.
|
# Copyright (C) 2003 Free Software Foundation, Inc.
|
||||||
# This configure script is free software; the Free Software Foundation
|
# This configure script is free software; the Free Software Foundation
|
||||||
@ -267,8 +267,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='dosbox'
|
PACKAGE_NAME='dosbox'
|
||||||
PACKAGE_TARNAME='dosbox'
|
PACKAGE_TARNAME='dosbox'
|
||||||
PACKAGE_VERSION='0.63'
|
PACKAGE_VERSION='0.65'
|
||||||
PACKAGE_STRING='dosbox 0.63'
|
PACKAGE_STRING='dosbox 0.65'
|
||||||
PACKAGE_BUGREPORT=''
|
PACKAGE_BUGREPORT=''
|
||||||
|
|
||||||
ac_unique_file="README"
|
ac_unique_file="README"
|
||||||
@ -309,7 +309,7 @@ ac_includes_default="\
|
|||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif"
|
#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 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 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_files=''
|
ac_subst_files=''
|
||||||
|
|
||||||
# Initialize some variables set by options.
|
# Initialize some variables set by options.
|
||||||
@ -786,7 +786,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# 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.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures dosbox 0.63 to adapt to many kinds of systems.
|
\`configure' configures dosbox 0.65 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@ -853,7 +853,7 @@ fi
|
|||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of dosbox 0.63:";;
|
short | recursive ) echo "Configuration of dosbox 0.65:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
@ -868,6 +868,9 @@ Optional Features:
|
|||||||
--enable-core-inline Enable inlined memory handling in CPU Core
|
--enable-core-inline Enable inlined memory handling in CPU Core
|
||||||
--disable-dynamic-x86 Disable x86 dynamic cpu core
|
--disable-dynamic-x86 Disable x86 dynamic cpu core
|
||||||
--disable-fpu Disable fpu support
|
--disable-fpu Disable fpu support
|
||||||
|
--disable-fpu-x86 Disable x86 assembly fpu core
|
||||||
|
--disable-unaligned-memory
|
||||||
|
Disable unaligned memory access
|
||||||
--disable-opengl Disable opengl support
|
--disable-opengl Disable opengl support
|
||||||
|
|
||||||
Optional Packages:
|
Optional Packages:
|
||||||
@ -987,7 +990,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit 0
|
test -n "$ac_init_help" && exit 0
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
dosbox configure 0.63
|
dosbox configure 0.65
|
||||||
generated by GNU Autoconf 2.59
|
generated by GNU Autoconf 2.59
|
||||||
|
|
||||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||||
@ -1001,7 +1004,7 @@ cat >&5 <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by dosbox $as_me 0.63, which was
|
It was created by dosbox $as_me 0.65, which was
|
||||||
generated by GNU Autoconf 2.59. Invocation command line was
|
generated by GNU Autoconf 2.59. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
@ -1730,7 +1733,7 @@ fi
|
|||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='dosbox'
|
PACKAGE='dosbox'
|
||||||
VERSION='0.63'
|
VERSION='0.65'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
@ -3844,6 +3847,12 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if test x$target = xi386-pc-os2-emx ; then
|
||||||
|
CXXFLAGS="$CXXFLAGS -Zmt"
|
||||||
|
LDFLAGS="$LDFLAGS -Zomf -Zmt"
|
||||||
|
LIBS="$LIBS -los2me"
|
||||||
|
fi
|
||||||
|
|
||||||
SDL_VERSION=1.2.0
|
SDL_VERSION=1.2.0
|
||||||
|
|
||||||
|
|
||||||
@ -7292,6 +7301,67 @@ echo "${ECHO_T}no" >&6
|
|||||||
fi
|
fi
|
||||||
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
|
#Check if the compiler supports __builtin_expect
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
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
|
||||||
|
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
|
||||||
|
echo "$as_me:$LINENO: result: yes" >&5
|
||||||
|
echo "${ECHO_T}yes" >&6;cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define C_HAS_BUILTIN_EXPECT 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
|
|
||||||
alsa_save_CFLAGS="$CFLAGS"
|
alsa_save_CFLAGS="$CFLAGS"
|
||||||
alsa_save_LDFLAGS="$LDFLAGS"
|
alsa_save_LDFLAGS="$LDFLAGS"
|
||||||
alsa_save_LIBS="$LIBS"
|
alsa_save_LIBS="$LIBS"
|
||||||
@ -7558,7 +7628,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Check for big endian machine, should #define WORD_BIGENDIAN if so
|
#Check for big endian machine, should #define WORDS_BIGENDIAN if so
|
||||||
echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
|
echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
|
||||||
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
|
echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
|
||||||
if test "${ac_cv_c_bigendian+set}" = set; then
|
if test "${ac_cv_c_bigendian+set}" = set; then
|
||||||
@ -8072,7 +8142,10 @@ if test $ac_cv_lib_pdcurses_initscr = yes; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if test x$have_curses_lib = xyes -a x$have_curses_h = xyes ; then
|
if test x$enable_debug = xno; then
|
||||||
|
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"
|
LIBS="$LIBS -lcurses"
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
#define C_DEBUG 1
|
#define C_DEBUG 1
|
||||||
@ -8126,7 +8199,7 @@ fi;
|
|||||||
echo "$as_me:$LINENO: checking for target cpu type" >&5
|
echo "$as_me:$LINENO: checking for target cpu type" >&5
|
||||||
echo $ECHO_N "checking for target cpu type... $ECHO_C" >&6
|
echo $ECHO_N "checking for target cpu type... $ECHO_C" >&6
|
||||||
case "$target_cpu" in
|
case "$target_cpu" in
|
||||||
i386|i486|i586|i686)
|
i?86)
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
#define C_HOSTCPU X86
|
#define C_HOSTCPU X86
|
||||||
_ACEOF
|
_ACEOF
|
||||||
@ -8134,6 +8207,27 @@ _ACEOF
|
|||||||
echo "$as_me:$LINENO: result: x86 compatible" >&5
|
echo "$as_me:$LINENO: result: x86 compatible" >&5
|
||||||
echo "${ECHO_T}x86 compatible" >&6
|
echo "${ECHO_T}x86 compatible" >&6
|
||||||
c_hostcpu="x86"
|
c_hostcpu="x86"
|
||||||
|
c_unalignedmemory=yes
|
||||||
|
;;
|
||||||
|
powerpc*)
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define C_HOSTCPU POWERPC
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: result: Power PC" >&5
|
||||||
|
echo "${ECHO_T}Power PC" >&6
|
||||||
|
c_hostcpu="powerpc"
|
||||||
|
c_unalignedmemory=yes
|
||||||
|
;;
|
||||||
|
m68k*)
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define C_HOSTCPU M68K
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: result: Motorola 68000" >&5
|
||||||
|
echo "${ECHO_T}Motorola 68000" >&6
|
||||||
|
c_hostcpu="m68k"
|
||||||
|
c_unalignedmemory=yes
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
cat >>confdefs.h <<\_ACEOF
|
cat >>confdefs.h <<\_ACEOF
|
||||||
@ -8142,10 +8236,12 @@ _ACEOF
|
|||||||
|
|
||||||
echo "$as_me:$LINENO: result: unknown" >&5
|
echo "$as_me:$LINENO: result: unknown" >&5
|
||||||
echo "${ECHO_T}unknown" >&6
|
echo "${ECHO_T}unknown" >&6
|
||||||
|
c_unalignedmemory=no
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check whether --enable-dynamic-x86 or --disable-dynamic-x86 was given.
|
# Check whether --enable-dynamic-x86 or --disable-dynamic-x86 was given.
|
||||||
if test "${enable_dynamic_x86+set}" = set; then
|
if test "${enable_dynamic_x86+set}" = set; then
|
||||||
enableval="$enable_dynamic_x86"
|
enableval="$enable_dynamic_x86"
|
||||||
@ -8174,8 +8270,6 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check whether --enable-fpu or --disable-fpu was given.
|
# Check whether --enable-fpu or --disable-fpu was given.
|
||||||
if test "${enable_fpu+set}" = set; then
|
if test "${enable_fpu+set}" = set; then
|
||||||
enableval="$enable_fpu"
|
enableval="$enable_fpu"
|
||||||
@ -8199,6 +8293,62 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Check whether --enable-fpu-x86 or --disable-fpu-x86 was given.
|
||||||
|
if test "${enable_fpu_x86+set}" = set; then
|
||||||
|
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
|
||||||
|
if test x$enable_fpu_x86 = xno ; then
|
||||||
|
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
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define C_FPU_X86 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
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.
|
||||||
|
if test "${enable_unaligned_memory+set}" = set; then
|
||||||
|
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
|
||||||
|
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
|
||||||
|
else
|
||||||
|
echo "$as_me:$LINENO: result: no" >&5
|
||||||
|
echo "${ECHO_T}no" >&6
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if test "${ac_cv_header_png_h+set}" = set; then
|
if test "${ac_cv_header_png_h+set}" = set; then
|
||||||
echo "$as_me:$LINENO: checking for png.h" >&5
|
echo "$as_me:$LINENO: checking for png.h" >&5
|
||||||
echo $ECHO_N "checking for png.h... $ECHO_C" >&6
|
echo $ECHO_N "checking for png.h... $ECHO_C" >&6
|
||||||
@ -8563,6 +8713,54 @@ if test $ac_cv_header_SDL_net_h = yes; then
|
|||||||
fi
|
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;
|
||||||
|
LIBS_BACKUP=$LIBS;
|
||||||
|
LIBS="$LIBS -lSDL_Net";
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
|
||||||
|
#include <SDL_Net.h>
|
||||||
|
int main(int argc,char * argv) {
|
||||||
|
return SDLNet_Init ();
|
||||||
|
};
|
||||||
|
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||||
|
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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_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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
rm -f conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS=$LIBS_BACKUP
|
||||||
|
else
|
||||||
echo "$as_me:$LINENO: checking for SDLNet_Init in -lSDL_net" >&5
|
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 $ECHO_N "checking for SDLNet_Init in -lSDL_net... $ECHO_C" >&6
|
||||||
if test "${ac_cv_lib_SDL_net_SDLNet_Init+set}" = set; then
|
if test "${ac_cv_lib_SDL_net_SDLNet_Init+set}" = set; then
|
||||||
@ -8630,6 +8828,7 @@ if test $ac_cv_lib_SDL_net_SDLNet_Init = yes; then
|
|||||||
have_sdl_net_lib=yes
|
have_sdl_net_lib=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
if test x$have_sdl_net_lib = xyes -a x$have_sdl_net_h = xyes ; then
|
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
|
cat >>confdefs.h <<\_ACEOF
|
||||||
@ -9241,6 +9440,247 @@ 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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
#include <sys/mman.h>
|
||||||
|
_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
|
||||||
|
ac_header_compiler=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
# 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
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#include <sys/mman.h>
|
||||||
|
_ACEOF
|
||||||
|
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
|
||||||
|
(eval $ac_cpp conftest.$ac_ext) 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); } >/dev/null; then
|
||||||
|
if test -s conftest.err; then
|
||||||
|
ac_cpp_err=$ac_c_preproc_warn_flag
|
||||||
|
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
|
||||||
|
else
|
||||||
|
ac_cpp_err=
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ac_cpp_err=yes
|
||||||
|
fi
|
||||||
|
if test -z "$ac_cpp_err"; then
|
||||||
|
ac_header_preproc=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
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
|
||||||
|
|
||||||
|
# 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: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&5
|
||||||
|
echo "$as_me: WARNING: sys/mman.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
|
||||||
|
{ echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the compiler's result" >&5
|
||||||
|
echo "$as_me: WARNING: sys/mman.h: proceeding with the compiler's result" >&2;}
|
||||||
|
ac_header_preproc=yes
|
||||||
|
;;
|
||||||
|
no:yes:* )
|
||||||
|
{ echo "$as_me:$LINENO: WARNING: sys/mman.h: present but cannot be compiled" >&5
|
||||||
|
echo "$as_me: WARNING: sys/mman.h: present but cannot be compiled" >&2;}
|
||||||
|
{ echo "$as_me:$LINENO: WARNING: sys/mman.h: check for missing prerequisite headers?" >&5
|
||||||
|
echo "$as_me: WARNING: sys/mman.h: check for missing prerequisite headers?" >&2;}
|
||||||
|
{ echo "$as_me:$LINENO: WARNING: sys/mman.h: see the Autoconf documentation" >&5
|
||||||
|
echo "$as_me: WARNING: sys/mman.h: see the Autoconf documentation" >&2;}
|
||||||
|
{ echo "$as_me:$LINENO: WARNING: sys/mman.h: section \"Present But Cannot Be Compiled\"" >&5
|
||||||
|
echo "$as_me: WARNING: sys/mman.h: section \"Present But Cannot Be Compiled\"" >&2;}
|
||||||
|
{ echo "$as_me:$LINENO: WARNING: sys/mman.h: proceeding with the preprocessor's result" >&5
|
||||||
|
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
|
||||||
|
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
|
||||||
|
|
||||||
|
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
|
||||||
|
if test "${ac_cv_func_mprotect+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
/* Define mprotect to an innocuous variant, in case <limits.h> declares mprotect.
|
||||||
|
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
||||||
|
#define mprotect innocuous_mprotect
|
||||||
|
|
||||||
|
/* System header to define __stub macros and hopefully few prototypes,
|
||||||
|
which can conflict with char mprotect (); below.
|
||||||
|
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
||||||
|
<limits.h> exists even on freestanding compilers. */
|
||||||
|
|
||||||
|
#ifdef __STDC__
|
||||||
|
# include <limits.h>
|
||||||
|
#else
|
||||||
|
# include <assert.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef mprotect
|
||||||
|
|
||||||
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
|
#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)
|
||||||
|
choke me
|
||||||
|
#else
|
||||||
|
char (*f) () = mprotect;
|
||||||
|
#endif
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return f != 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
|
||||||
|
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_exeext'
|
||||||
|
{ (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
|
||||||
|
ac_cv_func_mprotect=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
ac_cv_func_mprotect=no
|
||||||
|
fi
|
||||||
|
rm -f conftest.err conftest.$ac_objext \
|
||||||
|
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
|
||||||
|
if test $ac_cv_func_mprotect = yes; then
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define C_HAVE_MPROTECT 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "$as_me:$LINENO: checking for setpriority support" >&5
|
echo "$as_me:$LINENO: checking for setpriority support" >&5
|
||||||
echo $ECHO_N "checking for setpriority support... $ECHO_C" >&6
|
echo $ECHO_N "checking for setpriority support... $ECHO_C" >&6
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
@ -9461,10 +9901,121 @@ cat >>confdefs.h <<\_ACEOF
|
|||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
*-*-os2-emx*)
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define OS2 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define C_DIRECTSERIAL 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$target" in
|
||||||
|
*-*-cygwin* | *-*-mingw32*)
|
||||||
|
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
|
||||||
|
if test "${ac_cv_prog_WINDRES+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
if test -n "$WINDRES"; then
|
||||||
|
ac_cv_prog_WINDRES="$WINDRES" # 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_WINDRES="${ac_tool_prefix}windres"
|
||||||
|
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||||
|
break 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
WINDRES=$ac_cv_prog_WINDRES
|
||||||
|
if test -n "$WINDRES"; then
|
||||||
|
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
|
||||||
|
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
|
||||||
|
if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
if test -n "$ac_ct_WINDRES"; then
|
||||||
|
ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # 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_WINDRES="windres"
|
||||||
|
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||||
|
break 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
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
|
||||||
|
else
|
||||||
|
echo "$as_me:$LINENO: result: no" >&5
|
||||||
|
echo "${ECHO_T}no" >&6
|
||||||
|
fi
|
||||||
|
|
||||||
|
WINDRES=$ac_ct_WINDRES
|
||||||
|
else
|
||||||
|
WINDRES="$ac_cv_prog_WINDRES"
|
||||||
|
fi
|
||||||
|
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
WINDRES=":"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
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/ints/Makefile src/misc/Makefile src/shell/Makefile src/platform/Makefile src/platform/visualc/Makefile visualc/Makefile visualc_net/Makefile include/Makefile docs/Makefile"
|
if test "x$WINDRES" != "x:"; then
|
||||||
|
HAVE_WINDRES_TRUE=
|
||||||
|
HAVE_WINDRES_FALSE='#'
|
||||||
|
else
|
||||||
|
HAVE_WINDRES_TRUE='#'
|
||||||
|
HAVE_WINDRES_FALSE=
|
||||||
|
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"
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
# tests run on this system so they can be shared between configure
|
# tests run on this system so they can be shared between configure
|
||||||
@ -9577,6 +10128,13 @@ echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
|
|||||||
Usually this means the macro was only invoked conditionally." >&2;}
|
Usually this means the macro was only invoked conditionally." >&2;}
|
||||||
{ (exit 1); exit 1; }; }
|
{ (exit 1); exit 1; }; }
|
||||||
fi
|
fi
|
||||||
|
if test -z "${HAVE_WINDRES_TRUE}" && test -z "${HAVE_WINDRES_FALSE}"; then
|
||||||
|
{ { echo "$as_me:$LINENO: error: conditional \"HAVE_WINDRES\" was never defined.
|
||||||
|
Usually this means the macro was only invoked conditionally." >&5
|
||||||
|
echo "$as_me: error: conditional \"HAVE_WINDRES\" was never defined.
|
||||||
|
Usually this means the macro was only invoked conditionally." >&2;}
|
||||||
|
{ (exit 1); exit 1; }; }
|
||||||
|
fi
|
||||||
|
|
||||||
: ${CONFIG_STATUS=./config.status}
|
: ${CONFIG_STATUS=./config.status}
|
||||||
ac_clean_files_save=$ac_clean_files
|
ac_clean_files_save=$ac_clean_files
|
||||||
@ -9848,7 +10406,7 @@ _ASBOX
|
|||||||
} >&5
|
} >&5
|
||||||
cat >&5 <<_CSEOF
|
cat >&5 <<_CSEOF
|
||||||
|
|
||||||
This file was extended by dosbox $as_me 0.63, which was
|
This file was extended by dosbox $as_me 0.65, which was
|
||||||
generated by GNU Autoconf 2.59. Invocation command line was
|
generated by GNU Autoconf 2.59. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@ -9911,7 +10469,7 @@ _ACEOF
|
|||||||
|
|
||||||
cat >>$CONFIG_STATUS <<_ACEOF
|
cat >>$CONFIG_STATUS <<_ACEOF
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
dosbox config.status 0.63
|
dosbox config.status 0.65
|
||||||
configured by $0, generated by GNU Autoconf 2.59,
|
configured by $0, generated by GNU Autoconf 2.59,
|
||||||
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
||||||
|
|
||||||
@ -10032,7 +10590,10 @@ do
|
|||||||
"src/fpu/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/fpu/Makefile" ;;
|
"src/fpu/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/fpu/Makefile" ;;
|
||||||
"src/gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/gui/Makefile" ;;
|
"src/gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/gui/Makefile" ;;
|
||||||
"src/hardware/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/hardware/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/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/misc/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/misc/Makefile" ;;
|
||||||
"src/shell/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/shell/Makefile" ;;
|
"src/shell/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/shell/Makefile" ;;
|
||||||
"src/platform/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/platform/Makefile" ;;
|
"src/platform/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/platform/Makefile" ;;
|
||||||
@ -10193,6 +10754,10 @@ s,@SDL_LIBS@,$SDL_LIBS,;t t
|
|||||||
s,@EGREP@,$EGREP,;t t
|
s,@EGREP@,$EGREP,;t t
|
||||||
s,@ALSA_CFLAGS@,$ALSA_CFLAGS,;t t
|
s,@ALSA_CFLAGS@,$ALSA_CFLAGS,;t t
|
||||||
s,@ALSA_LIBS@,$ALSA_LIBS,;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,@LIBOBJS@,$LIBOBJS,;t t
|
||||||
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
|
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
|
||||||
CEOF
|
CEOF
|
||||||
|
117
configure.in
117
configure.in
@ -1,5 +1,5 @@
|
|||||||
dnl Init.
|
dnl Init.
|
||||||
AC_INIT(dosbox,0.63)
|
AC_INIT(dosbox,0.65)
|
||||||
AC_PREREQ(2.50)
|
AC_PREREQ(2.50)
|
||||||
AC_CONFIG_SRCDIR(README)
|
AC_CONFIG_SRCDIR(README)
|
||||||
|
|
||||||
@ -19,6 +19,14 @@ AC_PROG_CXX
|
|||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_RANLIB
|
AC_PROG_RANLIB
|
||||||
|
|
||||||
|
dnl Some needed libaries for OS2
|
||||||
|
dnl perharps join this with the other host depended checks. move them upwards
|
||||||
|
if test x$target = xi386-pc-os2-emx ; then
|
||||||
|
CXXFLAGS="$CXXFLAGS -Zmt"
|
||||||
|
LDFLAGS="$LDFLAGS -Zomf -Zmt"
|
||||||
|
LIBS="$LIBS -los2me"
|
||||||
|
fi
|
||||||
|
|
||||||
dnl Check for SDL
|
dnl Check for SDL
|
||||||
SDL_VERSION=1.2.0
|
SDL_VERSION=1.2.0
|
||||||
AM_PATH_SDL($SDL_VERSION,
|
AM_PATH_SDL($SDL_VERSION,
|
||||||
@ -58,9 +66,20 @@ AC_MSG_CHECKING(if compiler allows __attribute__)
|
|||||||
AC_TRY_COMPILE([], [typedef struct { } __attribute__ ((packed)) junk;],
|
AC_TRY_COMPILE([], [typedef struct { } __attribute__ ((packed)) junk;],
|
||||||
[ AC_MSG_RESULT(yes);AC_DEFINE(C_HAS_ATTRIBUTE)],AC_MSG_RESULT(no))
|
[ AC_MSG_RESULT(yes);AC_DEFINE(C_HAS_ATTRIBUTE)],AC_MSG_RESULT(no))
|
||||||
|
|
||||||
|
#Check if the compiler supports __builtin_expect
|
||||||
|
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[]){
|
||||||
|
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))
|
||||||
|
|
||||||
|
|
||||||
AM_PATH_ALSA(0.9.0, AC_DEFINE(HAVE_ALSA,1,[Define to 1 to use ALSA for MIDI]) , : )
|
AM_PATH_ALSA(0.9.0, AC_DEFINE(HAVE_ALSA,1,[Define to 1 to use ALSA for MIDI]) , : )
|
||||||
|
|
||||||
#Check for big endian machine, should #define WORD_BIGENDIAN if so
|
#Check for big endian machine, should #define WORDS_BIGENDIAN if so
|
||||||
AC_C_BIGENDIAN
|
AC_C_BIGENDIAN
|
||||||
|
|
||||||
#Features to enable/disable
|
#Features to enable/disable
|
||||||
@ -71,7 +90,9 @@ AC_ARG_ENABLE(debug,AC_HELP_STRING([--enable-debug],[Enable debug mode]),[
|
|||||||
AC_CHECK_LIB(curses, initscr, have_curses_lib=yes, , )
|
AC_CHECK_LIB(curses, initscr, have_curses_lib=yes, , )
|
||||||
AC_CHECK_LIB(pdcurses, initscr, have_pdcurses_lib=yes, , )
|
AC_CHECK_LIB(pdcurses, initscr, have_pdcurses_lib=yes, , )
|
||||||
|
|
||||||
if test x$have_curses_lib = xyes -a x$have_curses_h = xyes ; then
|
if test x$enable_debug = xno; then
|
||||||
|
AC_MSG_RESULT([Debugger not enabled])
|
||||||
|
elif test x$have_curses_lib = xyes -a x$have_curses_h = xyes ; then
|
||||||
LIBS="$LIBS -lcurses"
|
LIBS="$LIBS -lcurses"
|
||||||
AC_DEFINE(C_DEBUG,1)
|
AC_DEFINE(C_DEBUG,1)
|
||||||
if test x$enable_debug = xheavy ; then
|
if test x$enable_debug = xheavy ; then
|
||||||
@ -101,16 +122,31 @@ dnl The target cpu checks for dynamic cores
|
|||||||
AH_TEMPLATE(C_HOSTCPU,[The type of cpu this host has])
|
AH_TEMPLATE(C_HOSTCPU,[The type of cpu this host has])
|
||||||
AC_MSG_CHECKING(for target cpu type)
|
AC_MSG_CHECKING(for target cpu type)
|
||||||
case "$target_cpu" in
|
case "$target_cpu" in
|
||||||
i386|i486|i586|i686)
|
i?86)
|
||||||
AC_DEFINE(C_HOSTCPU,X86)
|
AC_DEFINE(C_HOSTCPU,X86)
|
||||||
AC_MSG_RESULT(x86 compatible)
|
AC_MSG_RESULT(x86 compatible)
|
||||||
c_hostcpu="x86"
|
c_hostcpu="x86"
|
||||||
|
c_unalignedmemory=yes
|
||||||
|
;;
|
||||||
|
powerpc*)
|
||||||
|
AC_DEFINE(C_HOSTCPU,POWERPC)
|
||||||
|
AC_MSG_RESULT(Power PC)
|
||||||
|
c_hostcpu="powerpc"
|
||||||
|
c_unalignedmemory=yes
|
||||||
|
;;
|
||||||
|
m68k*)
|
||||||
|
AC_DEFINE(C_HOSTCPU,M68K)
|
||||||
|
AC_MSG_RESULT(Motorola 68000)
|
||||||
|
c_hostcpu="m68k"
|
||||||
|
c_unalignedmemory=yes
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_DEFINE(C_HOSTCPU,UNKOWN)
|
AC_DEFINE(C_HOSTCPU,UNKOWN)
|
||||||
AC_MSG_RESULT(unknown)
|
AC_MSG_RESULT(unknown)
|
||||||
|
c_unalignedmemory=no
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
AH_TEMPLATE(C_DYNAMIC_X86,[Define to 1 to use x86 dynamic cpu core])
|
AH_TEMPLATE(C_DYNAMIC_X86,[Define to 1 to use x86 dynamic cpu core])
|
||||||
AC_ARG_ENABLE(dynamic-x86,AC_HELP_STRING([--disable-dynamic-x86],[Disable x86 dynamic cpu core]),,enable_dynamic_x86=yes)
|
AC_ARG_ENABLE(dynamic-x86,AC_HELP_STRING([--disable-dynamic-x86],[Disable x86 dynamic cpu core]),,enable_dynamic_x86=yes)
|
||||||
AC_MSG_CHECKING(whether x86 dynamic cpu core will be enabled)
|
AC_MSG_CHECKING(whether x86 dynamic cpu core will be enabled)
|
||||||
@ -125,8 +161,6 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AH_TEMPLATE(C_FPU,[Define to 1 to enable floating point emulation])
|
AH_TEMPLATE(C_FPU,[Define to 1 to enable floating point emulation])
|
||||||
AC_ARG_ENABLE(fpu,AC_HELP_STRING([--disable-fpu],[Disable fpu support]),,enable_fpu=yes)
|
AC_ARG_ENABLE(fpu,AC_HELP_STRING([--disable-fpu],[Disable fpu support]),,enable_fpu=yes)
|
||||||
AC_MSG_CHECKING(whether fpu emulation will be enabled)
|
AC_MSG_CHECKING(whether fpu emulation will be enabled)
|
||||||
@ -137,6 +171,34 @@ else
|
|||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AH_TEMPLATE(C_FPU_X86,[Define to 1 to use a x86 assembly fpu core])
|
||||||
|
AC_ARG_ENABLE(fpu-x86,AC_HELP_STRING([--disable-fpu-x86],[Disable x86 assembly fpu core]),,enable_fpu_x86=yes)
|
||||||
|
AC_MSG_CHECKING(whether x86 assembly fpu core will be enabled)
|
||||||
|
if test x$enable_fpu_x86 = xno ; then
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
else
|
||||||
|
if test x$enable_fpu = xyes; then
|
||||||
|
if test x$c_hostcpu = xx86 ; then
|
||||||
|
AC_DEFINE(C_FPU_X86,1)
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
AH_TEMPLATE(C_UNALIGNED_MEMORY,[Define to 1 to use a unaligned memory access])
|
||||||
|
AC_ARG_ENABLE(unaligned_memory,AC_HELP_STRING([--disable-unaligned-memory],[Disable unaligned memory access]),,enable_unaligned_memory=yes)
|
||||||
|
AC_MSG_CHECKING(whether to enable unaligned memory access)
|
||||||
|
if test x$enable_unaligned_memory = xyes -a x$c_unalignedmemory = xyes; then
|
||||||
|
AC_DEFINE(C_UNALIGNED_MEMORY,1)
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
fi
|
||||||
|
|
||||||
AH_TEMPLATE(C_SSHOT,[Define to 1 to enable screenshots, requires libpng])
|
AH_TEMPLATE(C_SSHOT,[Define to 1 to enable screenshots, requires libpng])
|
||||||
AC_CHECK_HEADER(png.h,have_png_h=yes,)
|
AC_CHECK_HEADER(png.h,have_png_h=yes,)
|
||||||
AC_CHECK_LIB(png, png_check_sig, have_png_lib=yes, ,-lz)
|
AC_CHECK_LIB(png, png_check_sig, have_png_lib=yes, ,-lz)
|
||||||
@ -150,7 +212,21 @@ fi
|
|||||||
AH_TEMPLATE(C_MODEM,[Define to 1 to enable internal modem support, requires SDL_net])
|
AH_TEMPLATE(C_MODEM,[Define to 1 to enable internal modem support, requires SDL_net])
|
||||||
AH_TEMPLATE(C_IPX,[Define to 1 to enable IPX over Internet networking, requires SDL_net])
|
AH_TEMPLATE(C_IPX,[Define to 1 to enable IPX over Internet networking, requires SDL_net])
|
||||||
AC_CHECK_HEADER(SDL_net.h,have_sdl_net_h=yes,)
|
AC_CHECK_HEADER(SDL_net.h,have_sdl_net_h=yes,)
|
||||||
|
|
||||||
|
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 <SDL_Net.h>
|
||||||
|
int main(int argc,char * argv[]) {
|
||||||
|
return 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, , )
|
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
|
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_MODEM,1)
|
||||||
@ -192,6 +268,13 @@ else
|
|||||||
AC_MSG_WARN([Can't find libSDL_sound, libSDL_sound support disabled])
|
AC_MSG_WARN([Can't find libSDL_sound, libSDL_sound support disabled])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl Check for mprotect. Needed for 64 bits linux
|
||||||
|
AH_TEMPLATE(C_HAVE_MPROTECT,[Define to 1 if you have the mprotect function])
|
||||||
|
AC_CHECK_HEADER([sys/mman.h], [
|
||||||
|
AC_CHECK_FUNC([mprotect],[AC_DEFINE(C_HAVE_MPROTECT,1)])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl Setpriority
|
||||||
AH_TEMPLATE(C_SET_PRIORITY,[Define to 1 if you have setpriority support])
|
AH_TEMPLATE(C_SET_PRIORITY,[Define to 1 if you have setpriority support])
|
||||||
AC_MSG_CHECKING(for setpriority support)
|
AC_MSG_CHECKING(for setpriority support)
|
||||||
AC_LINK_IFELSE([
|
AC_LINK_IFELSE([
|
||||||
@ -207,7 +290,7 @@ case "$target" in
|
|||||||
*-*-cygwin* | *-*-mingw32*)
|
*-*-cygwin* | *-*-mingw32*)
|
||||||
LIBS="$LIBS -lwinmm"
|
LIBS="$LIBS -lwinmm"
|
||||||
AC_CHECK_HEADERS(ddraw.h)
|
AC_CHECK_HEADERS(ddraw.h)
|
||||||
AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32 only).])
|
AC_DEFINE(C_DIRECTSERIAL, 1, [ Define to 1 if you want serial passthrough support (Win32 and OS/2 only).])
|
||||||
;;
|
;;
|
||||||
*-*-darwin*)
|
*-*-darwin*)
|
||||||
dnl We have a problem here: both MacOS X and Darwin report
|
dnl We have a problem here: both MacOS X and Darwin report
|
||||||
@ -220,8 +303,25 @@ case "$target" in
|
|||||||
*-*-linux-gnu*)
|
*-*-linux-gnu*)
|
||||||
AC_DEFINE(LINUX, 1, [Compiling on GNU/Linux])
|
AC_DEFINE(LINUX, 1, [Compiling on GNU/Linux])
|
||||||
;;
|
;;
|
||||||
|
*-*-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).])
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
dnl Some stuff for the icon.
|
||||||
|
case "$target" in
|
||||||
|
*-*-cygwin* | *-*-mingw32*)
|
||||||
|
dnl Some stuff for the ico
|
||||||
|
AC_CHECK_TOOL(WINDRES, windres, :)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
WINDRES=":"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
AM_CONDITIONAL(HAVE_WINDRES, test "x$WINDRES" != "x:")
|
||||||
|
AC_SUBST(WINDRES)
|
||||||
|
|
||||||
|
|
||||||
AC_OUTPUT([
|
AC_OUTPUT([
|
||||||
Makefile
|
Makefile
|
||||||
@ -235,7 +335,10 @@ src/dos/Makefile
|
|||||||
src/fpu/Makefile
|
src/fpu/Makefile
|
||||||
src/gui/Makefile
|
src/gui/Makefile
|
||||||
src/hardware/Makefile
|
src/hardware/Makefile
|
||||||
|
src/hardware/serialport/Makefile
|
||||||
src/ints/Makefile
|
src/ints/Makefile
|
||||||
|
src/libs/Makefile
|
||||||
|
src/libs/zmbv/Makefile
|
||||||
src/misc/Makefile
|
src/misc/Makefile
|
||||||
src/shell/Makefile
|
src/shell/Makefile
|
||||||
src/platform/Makefile
|
src/platform/Makefile
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Main Makefile for DOSBox
|
# Main Makefile for DOSBox
|
||||||
|
|
||||||
man_MANS = dosbox.1
|
man_MANS = dosbox.1
|
||||||
EXTRA_DIST = $(man_MANS)
|
EXTRA_DIST = $(man_MANS) README.video
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -81,6 +81,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -106,10 +108,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
@ -152,7 +156,7 @@ target_cpu = @target_cpu@
|
|||||||
target_os = @target_os@
|
target_os = @target_os@
|
||||||
target_vendor = @target_vendor@
|
target_vendor = @target_vendor@
|
||||||
man_MANS = dosbox.1
|
man_MANS = dosbox.1
|
||||||
EXTRA_DIST = $(man_MANS)
|
EXTRA_DIST = $(man_MANS) README.video
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
32
docs/README.video
Normal file
32
docs/README.video
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
Starting with version 0.65, DOSBox allows you to create movies out of screen
|
||||||
|
output.
|
||||||
|
|
||||||
|
To record a movie, you have to press CTRL-ALT-F5.
|
||||||
|
To stop/end the recording, you have to press CTRL-ALT-F5 again.
|
||||||
|
|
||||||
|
To play the recorded movie, you need a movie player which can handle the
|
||||||
|
ZMBV codec. MS Windows users can find this codec in the start menu entry of
|
||||||
|
DOSBox. Users of Linux and other OSes should look for a movie player that
|
||||||
|
uses the ffmpeg libary (you may need to update or ask your distribution to
|
||||||
|
upgrade).
|
||||||
|
|
||||||
|
FAQ:
|
||||||
|
Q: During the display of the movies the sound is lagging.
|
||||||
|
A: Check your display properties to see whether your refresh rate is set to
|
||||||
|
at least 70 hz. Try playing the movie in virtualdub (http://virtualdub.sf.net)
|
||||||
|
|
||||||
|
Q: Why does the resulting movie consist of multiple files?
|
||||||
|
A: Each time the game changes resolution, DOSBox creates a new movie file,
|
||||||
|
because a movie file can only contain one resolution.
|
||||||
|
|
||||||
|
Q: Can I set the cycles higher than my PC can handle during recording?
|
||||||
|
A: Yes. During recording, the game might play slowly and stuttering, but the
|
||||||
|
resulting movie should play at the intended speed and have no stuttering.
|
||||||
|
|
||||||
|
Q: CTRL-ALT-F5 switches to the console under linux.
|
||||||
|
A: 1. Start DOSBox like this: dosbox -startmapper
|
||||||
|
2. Click on Video, click on Add
|
||||||
|
3. Press the key you want (for example scroll lock or printscreen)
|
||||||
|
4. Click exit.
|
||||||
|
5. You can make movies by pressing scroll lock or whichever key you
|
||||||
|
selected.
|
@ -1,5 +1,5 @@
|
|||||||
.\" Hey, EMACS: -*- nroff -*-
|
.\" Hey, EMACS: -*- nroff -*-
|
||||||
.TH DOSBOX 1 "Nov 18, 2004"
|
.TH DOSBOX 1 "Mar 28, 2006"
|
||||||
.\" Please adjust this date whenever revising the manpage.
|
.\" Please adjust this date whenever revising the manpage.
|
||||||
.SH NAME
|
.SH NAME
|
||||||
dosbox \- an x86/DOS emulator with sound/graphics
|
dosbox \- an x86/DOS emulator with sound/graphics
|
||||||
@ -7,6 +7,7 @@ dosbox \- an x86/DOS emulator with sound/graphics
|
|||||||
.B dosbox
|
.B dosbox
|
||||||
.B [\-fullscreen]
|
.B [\-fullscreen]
|
||||||
.B [\-startmapper]
|
.B [\-startmapper]
|
||||||
|
.B [\-noautoexec]
|
||||||
.BI "[\-conf " configfile ]
|
.BI "[\-conf " configfile ]
|
||||||
.BI "[\-lang " langfile ]
|
.BI "[\-lang " langfile ]
|
||||||
.B [file]
|
.B [file]
|
||||||
@ -35,6 +36,9 @@ A summary of options is included below.
|
|||||||
.B \-startmapper
|
.B \-startmapper
|
||||||
.RB "Start the internal keymapper on startup of " dosbox ". You can use it to change the keys " dosbox " uses."
|
.RB "Start the internal keymapper on startup of " dosbox ". You can use it to change the keys " dosbox " uses."
|
||||||
.TP
|
.TP
|
||||||
|
.B \-noautoexec
|
||||||
|
Skips the [autoexec] section of the loaded configuration file.
|
||||||
|
.TP
|
||||||
.BI \-c " command"
|
.BI \-c " command"
|
||||||
.RI "Runs the specified " command " before running "
|
.RI "Runs the specified " command " before running "
|
||||||
.BR file .
|
.BR file .
|
||||||
@ -56,7 +60,7 @@ wish to execute on startup.
|
|||||||
.TP
|
.TP
|
||||||
.BI \-machine " machinetype
|
.BI \-machine " machinetype
|
||||||
.RB "Setup " dosbox " to emulate a specific type of machine."
|
.RB "Setup " dosbox " to emulate a specific type of machine."
|
||||||
.RI "Valid choices are: " "hercules, cga, tandy, vga(default)".
|
.RI "Valid choices are: " "hercules, cga, pcjr, tandy, vga(default)".
|
||||||
The machinetype has influence on both the videocard and the available
|
The machinetype has influence on both the videocard and the available
|
||||||
soundcards.
|
soundcards.
|
||||||
.TP
|
.TP
|
||||||
@ -214,8 +218,12 @@ automatically loaded, else ~/.dosboxrc (if present) will be loaded.
|
|||||||
.TP 12m
|
.TP 12m
|
||||||
.IP ALT\-ENTER
|
.IP ALT\-ENTER
|
||||||
Go full screen and back.
|
Go full screen and back.
|
||||||
|
.IP ALT\-PAUSE
|
||||||
|
Pause emulation.
|
||||||
.IP CTRL\-F1
|
.IP CTRL\-F1
|
||||||
Start the keymapper.
|
Start the keymapper.
|
||||||
|
.IP CTRL\-ALT\-F5
|
||||||
|
Start/Stop creating a movie of the screen.
|
||||||
.IP CTRL\-F4
|
.IP CTRL\-F4
|
||||||
Swap mounted disk-image (Only used with imgmount). Update directory cache
|
Swap mounted disk-image (Only used with imgmount). Update directory cache
|
||||||
for all drives!
|
for all drives!
|
||||||
@ -239,6 +247,8 @@ Capture/Release the mouse.
|
|||||||
Slow down emulation (Increase dosbox Cycles).
|
Slow down emulation (Increase dosbox Cycles).
|
||||||
.IP CTRL\-F12
|
.IP CTRL\-F12
|
||||||
Speed up emulation (Decrease dosbox Cycles).
|
Speed up emulation (Decrease dosbox Cycles).
|
||||||
|
.IP ALT\-F12
|
||||||
|
Unlock speed (turbo button).
|
||||||
.PP
|
.PP
|
||||||
These are the default keybindings. They can be changed in the keymapper.
|
These are the default keybindings. They can be changed in the keymapper.
|
||||||
.PP
|
.PP
|
||||||
@ -268,11 +278,11 @@ So:
|
|||||||
.PP
|
.PP
|
||||||
.RB "Close every program but " dosbox .
|
.RB "Close every program but " dosbox .
|
||||||
.PP
|
.PP
|
||||||
.RB "Overclock " dosbox " until 100% of your CPU is used.(CTR\-+F12)"
|
.RB "Overclock " dosbox " until 100% of your CPU is used.(CTRL\-F12)"
|
||||||
.PP
|
.PP
|
||||||
.RB "Since VGA emulation is the most demanding part of " dosbox " in terms of actual"
|
.RB "Since VGA emulation is the most demanding part of " dosbox " in terms of actual"
|
||||||
CPU usage, we'll start here. Increase the number of frames skipped (in
|
CPU usage, we'll start here. Increase the number of frames skipped (in
|
||||||
increments of one) by pressing CRTL\-F8. Your CPU usage should decrease.
|
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.
|
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
|
Please note that this is a trade off: you lose in fluidity of video what you
|
||||||
gain in speed.
|
gain in speed.
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -80,6 +80,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -105,10 +107,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,8 +16,8 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _BIOS_H_
|
#ifndef DOSBOX_BIOS_H
|
||||||
#define _BIOS_H_
|
#define DOSBOX_BIOS_H
|
||||||
|
|
||||||
#define BIOS_BASE_ADDRESS_COM1 0x400
|
#define BIOS_BASE_ADDRESS_COM1 0x400
|
||||||
#define BIOS_BASE_ADDRESS_COM2 0x402
|
#define BIOS_BASE_ADDRESS_COM2 0x402
|
||||||
@ -30,6 +30,7 @@
|
|||||||
#define BIOS_CONFIGURATION 0x410
|
#define BIOS_CONFIGURATION 0x410
|
||||||
/* 0x412 is reserved */
|
/* 0x412 is reserved */
|
||||||
#define BIOS_MEMORY_SIZE 0x413
|
#define BIOS_MEMORY_SIZE 0x413
|
||||||
|
#define BIOS_TRUE_MEMORY_SIZE 0x415
|
||||||
/* #define bios_expansion_memory_size (*(unsigned int *) 0x415) */
|
/* #define bios_expansion_memory_size (*(unsigned int *) 0x415) */
|
||||||
#define BIOS_KEYBOARD_STATE 0x417
|
#define BIOS_KEYBOARD_STATE 0x417
|
||||||
#define BIOS_KEYBOARD_FLAGS1 BIOS_KEYBOARD_STATE
|
#define BIOS_KEYBOARD_FLAGS1 BIOS_KEYBOARD_STATE
|
||||||
@ -72,7 +73,9 @@
|
|||||||
/* 0x47b is reserved */
|
/* 0x47b is reserved */
|
||||||
#define BIOS_COM1_TIMEOUT 0x47c
|
#define BIOS_COM1_TIMEOUT 0x47c
|
||||||
#define BIOS_COM2_TIMEOUT 0x47d
|
#define BIOS_COM2_TIMEOUT 0x47d
|
||||||
/* 0x47e is reserved */
|
#define BIOS_COM3_TIMEOUT 0x47e
|
||||||
|
#define BIOS_COM4_TIMEOUT 0x47f
|
||||||
|
/* 0x47e is reserved */ //<- why that?
|
||||||
/* 0x47f-0x4ff is unknow for me */
|
/* 0x47f-0x4ff is unknow for me */
|
||||||
#define BIOS_KEYBOARD_BUFFER_START 0x480
|
#define BIOS_KEYBOARD_BUFFER_START 0x480
|
||||||
#define BIOS_KEYBOARD_BUFFER_END 0x482
|
#define BIOS_KEYBOARD_BUFFER_END 0x482
|
||||||
@ -112,8 +115,12 @@ struct diskGeo {
|
|||||||
extern diskGeo DiskGeometryList[];
|
extern diskGeo DiskGeometryList[];
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#ifndef DOSBOX_MEM_H
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_DOS_INC_H
|
||||||
#include "dos_inc.h"
|
#include "dos_inc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class imageDisk {
|
class imageDisk {
|
||||||
public:
|
public:
|
||||||
@ -153,7 +160,7 @@ extern DOS_DTA *imgDTA;
|
|||||||
void swapInDisks(void);
|
void swapInDisks(void);
|
||||||
void swapInNextDisk(void);
|
void swapInNextDisk(void);
|
||||||
|
|
||||||
void BIOS_ZeroExtendedSize(void);
|
void BIOS_ZeroExtendedSize(bool in);
|
||||||
void char_out(Bit8u chr,Bit32u att,Bit8u page);
|
void char_out(Bit8u chr,Bit32u att,Bit8u page);
|
||||||
void INT10_StartUp(void);
|
void INT10_StartUp(void);
|
||||||
void INT16_StartUp(void);
|
void INT16_StartUp(void);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,17 +16,21 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CALLBACK_H
|
/* $Id: callback.h,v 1.16 2006/02/09 11:47:47 qbix79 Exp $ */
|
||||||
#define __CALLBACK_H
|
|
||||||
|
|
||||||
#include <mem.h>
|
#ifndef DOSBOX_CALLBACK_H
|
||||||
|
#define DOSBOX_CALLBACK_H
|
||||||
|
|
||||||
|
#ifndef DOSBOX_MEM_H
|
||||||
|
#include "mem.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef Bitu (*CallBack_Handler)(void);
|
typedef Bitu (*CallBack_Handler)(void);
|
||||||
extern CallBack_Handler CallBack_Handlers[];
|
extern CallBack_Handler CallBack_Handlers[];
|
||||||
|
|
||||||
enum { CB_RETF,CB_IRET,CB_IRET_STI };
|
enum { CB_RETN, CB_RETF,CB_IRET,CB_IRET_STI };
|
||||||
|
|
||||||
#define CB_MAX 1024
|
#define CB_MAX 144
|
||||||
#define CB_SEG 0xC800
|
#define CB_SEG 0xC800
|
||||||
#define CB_BASE (CB_SEG << 4)
|
#define CB_BASE (CB_SEG << 4)
|
||||||
|
|
||||||
@ -48,12 +52,37 @@ void CALLBACK_RunRealInt(Bit8u intnum);
|
|||||||
void CALLBACK_RunRealFar(Bit16u seg,Bit16u off);
|
void CALLBACK_RunRealFar(Bit16u seg,Bit16u off);
|
||||||
|
|
||||||
bool CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,const char* description=0);
|
bool CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,const char* description=0);
|
||||||
bool CALLBACK_SetupAt(Bitu callback,CallBack_Handler handler,Bitu type,Bitu linearAddress, const char* description=0);
|
/* Returns with the size of the extra callback */
|
||||||
|
Bitu CALLBACK_SetupExtra(Bitu callback, Bitu type, PhysPt physAddress);
|
||||||
|
|
||||||
const char* CALLBACK_GetDescription(Bitu callback);
|
const char* CALLBACK_GetDescription(Bitu callback);
|
||||||
bool CALLBACK_Free(Bitu callback);
|
bool CALLBACK_Free(Bitu callback);
|
||||||
|
|
||||||
void CALLBACK_SCF(bool val);
|
void CALLBACK_SCF(bool val);
|
||||||
void CALLBACK_SZF(bool val);
|
void CALLBACK_SZF(bool val);
|
||||||
#endif
|
|
||||||
|
|
||||||
|
extern Bitu call_priv_io;
|
||||||
|
|
||||||
|
|
||||||
|
class CALLBACK_HandlerObject{
|
||||||
|
private:
|
||||||
|
bool installed;
|
||||||
|
Bit16u m_callback;
|
||||||
|
enum {NONE,SETUP,SETUPAT} m_type;
|
||||||
|
struct {
|
||||||
|
RealPt old_vector;
|
||||||
|
Bit8u interrupt;
|
||||||
|
bool installed;
|
||||||
|
} vectorhandler;
|
||||||
|
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);
|
||||||
|
//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);}
|
||||||
|
void Set_RealVec(Bit8u vec);
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,17 +16,24 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CPU_H
|
#ifndef DOSBOX_CPU_H
|
||||||
#define __CPU_H
|
#define DOSBOX_CPU_H
|
||||||
|
|
||||||
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_REGS_H
|
||||||
#include "regs.h"
|
#include "regs.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_MEM_H
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* CPU Cycle Timing */
|
/* CPU Cycle Timing */
|
||||||
extern Bits CPU_Cycles;
|
extern Bits CPU_Cycles;
|
||||||
extern Bits CPU_CycleLeft;
|
extern Bits CPU_CycleLeft;
|
||||||
extern Bits CPU_CycleMax;
|
extern Bits CPU_CycleMax;
|
||||||
|
extern bool CPU_CycleAuto;
|
||||||
|
|
||||||
/* Some common Defines */
|
/* Some common Defines */
|
||||||
/* A CPU Handler */
|
/* A CPU Handler */
|
||||||
@ -43,8 +50,8 @@ Bits CPU_Core_Dyn_X86_Run(void);
|
|||||||
|
|
||||||
extern Bit16u parity_lookup[256];
|
extern Bit16u parity_lookup[256];
|
||||||
|
|
||||||
void CPU_LLDT(Bitu selector);
|
bool CPU_LLDT(Bitu selector);
|
||||||
void CPU_LTR(Bitu selector);
|
bool CPU_LTR(Bitu selector);
|
||||||
void CPU_LIDT(Bitu limit,Bitu base);
|
void CPU_LIDT(Bitu limit,Bitu base);
|
||||||
void CPU_LGDT(Bitu limit,Bitu base);
|
void CPU_LGDT(Bitu limit,Bitu base);
|
||||||
|
|
||||||
@ -57,8 +64,13 @@ void CPU_ARPL(Bitu & dest_sel,Bitu src_sel);
|
|||||||
void CPU_LAR(Bitu selector,Bitu & ar);
|
void CPU_LAR(Bitu selector,Bitu & ar);
|
||||||
void CPU_LSL(Bitu selector,Bitu & limit);
|
void CPU_LSL(Bitu selector,Bitu & limit);
|
||||||
|
|
||||||
bool CPU_SET_CRX(Bitu cr,Bitu value);
|
void CPU_SET_CRX(Bitu cr,Bitu value);
|
||||||
|
bool CPU_WRITE_CRX(Bitu cr,Bitu value);
|
||||||
Bitu CPU_GET_CRX(Bitu cr);
|
Bitu CPU_GET_CRX(Bitu cr);
|
||||||
|
bool CPU_READ_CRX(Bitu cr,Bit32u & retvalue);
|
||||||
|
|
||||||
|
bool CPU_WRITE_DRX(Bitu dr,Bitu value);
|
||||||
|
bool CPU_READ_DRX(Bitu dr,Bit32u & retvalue);
|
||||||
|
|
||||||
void CPU_SMSW(Bitu & word);
|
void CPU_SMSW(Bitu & word);
|
||||||
Bitu CPU_LMSW(Bitu word);
|
Bitu CPU_LMSW(Bitu word);
|
||||||
@ -85,6 +97,7 @@ void CPU_ENTER(bool use32,Bitu bytes,Bitu level);
|
|||||||
#define CPU_INT_SOFTWARE 0x1
|
#define CPU_INT_SOFTWARE 0x1
|
||||||
#define CPU_INT_EXCEPTION 0x2
|
#define CPU_INT_EXCEPTION 0x2
|
||||||
#define CPU_INT_HAS_ERROR 0x4
|
#define CPU_INT_HAS_ERROR 0x4
|
||||||
|
#define CPU_INT_NOIOPLCHECK 0x8
|
||||||
|
|
||||||
void CPU_Interrupt(Bitu num,Bitu type,Bitu oldeip);
|
void CPU_Interrupt(Bitu num,Bitu type,Bitu oldeip);
|
||||||
INLINE void CPU_HW_Interrupt(Bitu num) {
|
INLINE void CPU_HW_Interrupt(Bitu num) {
|
||||||
@ -93,6 +106,9 @@ INLINE void CPU_HW_Interrupt(Bitu num) {
|
|||||||
INLINE void CPU_SW_Interrupt(Bitu num,Bitu oldeip) {
|
INLINE void CPU_SW_Interrupt(Bitu num,Bitu oldeip) {
|
||||||
CPU_Interrupt(num,CPU_INT_SOFTWARE,oldeip);
|
CPU_Interrupt(num,CPU_INT_SOFTWARE,oldeip);
|
||||||
}
|
}
|
||||||
|
INLINE void CPU_SW_Interrupt_NoIOPLCheck(Bitu num,Bitu oldeip) {
|
||||||
|
CPU_Interrupt(num,CPU_INT_SOFTWARE|CPU_INT_NOIOPLCHECK,oldeip);
|
||||||
|
}
|
||||||
|
|
||||||
bool CPU_PrepareException(Bitu which,Bitu error);
|
bool CPU_PrepareException(Bitu which,Bitu error);
|
||||||
void CPU_Exception(Bitu which,Bitu error=0);
|
void CPU_Exception(Bitu which,Bitu error=0);
|
||||||
@ -108,18 +124,25 @@ void CPU_Push32(Bitu value);
|
|||||||
|
|
||||||
void CPU_SetFlags(Bitu word,Bitu mask);
|
void CPU_SetFlags(Bitu word,Bitu mask);
|
||||||
|
|
||||||
// *********************************************************************
|
|
||||||
// Descriptor
|
#define EXCEPTION_UD 6
|
||||||
// *********************************************************************
|
#define EXCEPTION_TS 10
|
||||||
|
#define EXCEPTION_NP 11
|
||||||
|
#define EXCEPTION_SS 12
|
||||||
|
#define EXCEPTION_GP 13
|
||||||
|
|
||||||
#define CR0_PROTECTION 0x00000001
|
#define CR0_PROTECTION 0x00000001
|
||||||
#define CR0_FPUENABLED 0x00000002
|
#define CR0_MONITORPROCESSOR 0x00000002
|
||||||
#define CR0_FPUMONITOR 0x00000004
|
#define CR0_FPUEMULATION 0x00000004
|
||||||
#define CR0_TASKSWITCH 0x00000008
|
#define CR0_TASKSWITCH 0x00000008
|
||||||
#define CR0_FPUPRESENT 0x00000010
|
#define CR0_FPUPRESENT 0x00000010
|
||||||
#define CR0_PAGING 0x80000000
|
#define CR0_PAGING 0x80000000
|
||||||
|
|
||||||
|
|
||||||
|
// *********************************************************************
|
||||||
|
// Descriptor
|
||||||
|
// *********************************************************************
|
||||||
|
|
||||||
#define DESC_INVALID 0x00
|
#define DESC_INVALID 0x00
|
||||||
#define DESC_286_TSS_A 0x01
|
#define DESC_286_TSS_A 0x01
|
||||||
#define DESC_LDT 0x02
|
#define DESC_LDT 0x02
|
||||||
@ -352,9 +375,16 @@ public:
|
|||||||
return ldt_value;
|
return ldt_value;
|
||||||
}
|
}
|
||||||
bool LLDT(Bitu value) {
|
bool LLDT(Bitu value) {
|
||||||
//TODO checking
|
if ((value&0xfffc)==0) {
|
||||||
|
ldt_value=0;
|
||||||
|
ldt_base=0;
|
||||||
|
ldt_limit=0;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Descriptor desc;
|
Descriptor desc;
|
||||||
GetDescriptor(value,desc);
|
if (!GetDescriptor(value,desc)) return !CPU_PrepareException(EXCEPTION_GP,value);
|
||||||
|
if (desc.Type()!=DESC_LDT) return !CPU_PrepareException(EXCEPTION_GP,value);
|
||||||
|
if (!desc.saved.seg.p) return !CPU_PrepareException(EXCEPTION_NP,value);
|
||||||
ldt_base=desc.GetBase();
|
ldt_base=desc.GetBase();
|
||||||
ldt_limit=desc.GetLimit();
|
ldt_limit=desc.GetLimit();
|
||||||
ldt_value=value;
|
ldt_value=value;
|
||||||
@ -402,6 +432,7 @@ struct CPUBlock {
|
|||||||
Bitu which,error;
|
Bitu which,error;
|
||||||
} exception;
|
} exception;
|
||||||
Bits direction;
|
Bits direction;
|
||||||
|
Bit32u drx[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
extern CPUBlock cpu;
|
extern CPUBlock cpu;
|
||||||
@ -418,4 +449,3 @@ INLINE void CPU_SetFlagsw(Bitu word) {
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,10 +16,10 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: cross.h,v 1.11 2004/09/16 21:46:03 qbix79 Exp $ */
|
/* $Id: cross.h,v 1.16 2006/02/09 11:47:47 qbix79 Exp $ */
|
||||||
|
|
||||||
#ifndef _CROSS_H
|
#ifndef DOSBOX_CROSS_H
|
||||||
#define _CROSS_H
|
#define DOSBOX_CROSS_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
#define CROSS_LEN 512 /* Maximum filename size */
|
#define CROSS_LEN 512 /* Maximum filename size */
|
||||||
|
|
||||||
|
|
||||||
#if defined (WIN32) /* Win 32 */
|
#if defined (WIN32) || defined (OS2) /* Win 32 & OS/2*/
|
||||||
#define CROSS_FILENAME(blah)
|
#define CROSS_FILENAME(blah)
|
||||||
#define CROSS_FILESPLIT '\\'
|
#define CROSS_FILESPLIT '\\'
|
||||||
#define F_OK 0
|
#define F_OK 0
|
||||||
@ -57,4 +57,3 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -20,7 +20,7 @@ void DEBUG_SetupConsole(void);
|
|||||||
void DEBUG_DrawScreen(void);
|
void DEBUG_DrawScreen(void);
|
||||||
bool DEBUG_Breakpoint(void);
|
bool DEBUG_Breakpoint(void);
|
||||||
bool DEBUG_IntBreakpoint(Bit8u intNum);
|
bool DEBUG_IntBreakpoint(Bit8u intNum);
|
||||||
void DEBUG_Enable(void);
|
void DEBUG_Enable(bool pressed);
|
||||||
void DEBUG_CheckExecuteBreakpoint(Bit16u seg, Bit32u off);
|
void DEBUG_CheckExecuteBreakpoint(Bit16u seg, Bit32u off);
|
||||||
bool DEBUG_ExitLoop(void);
|
bool DEBUG_ExitLoop(void);
|
||||||
void DEBUG_RefreshPage(char scroll);
|
void DEBUG_RefreshPage(char scroll);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,10 +16,10 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dma.h,v 1.12 2004/08/04 09:12:50 qbix79 Exp $ */
|
/* $Id: dma.h,v 1.16 2006/02/09 11:47:47 qbix79 Exp $ */
|
||||||
|
|
||||||
#ifndef __DMA_H
|
#ifndef DOSBOX_DMA_H
|
||||||
#define __DMA_H
|
#define DOSBOX_DMA_H
|
||||||
|
|
||||||
enum DMAEvent {
|
enum DMAEvent {
|
||||||
DMA_REACHED_TC,
|
DMA_REACHED_TC,
|
||||||
@ -31,19 +31,6 @@ enum DMAEvent {
|
|||||||
class DmaChannel;
|
class DmaChannel;
|
||||||
typedef void (* DMA_CallBack)(DmaChannel * chan,DMAEvent event);
|
typedef void (* DMA_CallBack)(DmaChannel * chan,DMAEvent event);
|
||||||
|
|
||||||
class DmaController {
|
|
||||||
public:
|
|
||||||
bool flipflop;
|
|
||||||
Bit8u ctrlnum;
|
|
||||||
Bit8u chanbase;
|
|
||||||
public:
|
|
||||||
DmaController(Bit8u num) {
|
|
||||||
flipflop = false;
|
|
||||||
ctrlnum = num;
|
|
||||||
chanbase = num * 4;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class DmaChannel {
|
class DmaChannel {
|
||||||
public:
|
public:
|
||||||
Bit32u pagebase;
|
Bit32u pagebase;
|
||||||
@ -85,9 +72,37 @@ public:
|
|||||||
Bitu Write(Bitu size, Bit8u * buffer);
|
Bitu Write(Bitu size, Bit8u * buffer);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern DmaChannel *DmaChannels[8];
|
class DmaController {
|
||||||
extern DmaController *DmaControllers[2];
|
private:
|
||||||
|
Bit8u ctrlnum;
|
||||||
|
bool flipflop;
|
||||||
|
DmaChannel *DmaChannels[4];
|
||||||
|
public:
|
||||||
|
IO_ReadHandleObject DMA_ReadHandler[0x11];
|
||||||
|
IO_WriteHandleObject DMA_WriteHandler[0x11];
|
||||||
|
DmaController(Bit8u num) {
|
||||||
|
flipflop = false;
|
||||||
|
ctrlnum = num; /* first or second DMA controller */
|
||||||
|
for(Bit8u i=0;i<4;i++) {
|
||||||
|
DmaChannels[i] = new DmaChannel(i+ctrlnum*4,ctrlnum==1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
~DmaController(void) {
|
||||||
|
for(Bit8u i=0;i<4;i++) {
|
||||||
|
delete DmaChannels[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DmaChannel * GetChannel(Bit8u chan) {
|
||||||
|
if (chan<4) return DmaChannels[chan];
|
||||||
|
else return NULL;
|
||||||
|
}
|
||||||
|
void WriteControllerReg(Bitu reg,Bitu val,Bitu len);
|
||||||
|
Bitu ReadControllerReg(Bitu reg,Bitu len);
|
||||||
|
};
|
||||||
|
|
||||||
|
DmaChannel * GetDMAChannel(Bit8u chan);
|
||||||
|
|
||||||
|
void CloseSecondDMAController(void);
|
||||||
|
bool SecondDMAControllerAvailable(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,13 +16,17 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dos_inc.h,v 1.51 2004/11/16 14:28:15 qbix79 Exp $ */
|
/* $Id: dos_inc.h,v 1.59 2006/02/09 11:47:47 qbix79 Exp $ */
|
||||||
|
|
||||||
#ifndef DOS_H_
|
#ifndef DOSBOX_DOS_INC_H
|
||||||
#define DOS_H_
|
#define DOSBOX_DOS_INC_H
|
||||||
|
|
||||||
#include <dos_system.h>
|
#ifndef DOSBOX_DOS_SYSTEM_H
|
||||||
#include <mem.h>
|
#include "dos_system.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_MEM_H
|
||||||
|
#include "mem.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma pack (1)
|
#pragma pack (1)
|
||||||
@ -72,6 +76,15 @@ enum { RETURN_EXIT=0,RETURN_CTRLC=1,RETURN_ABORT=2,RETURN_TSR=3};
|
|||||||
#define DOS_DRIVES 26
|
#define DOS_DRIVES 26
|
||||||
#define DOS_DEVICES 10
|
#define DOS_DEVICES 10
|
||||||
|
|
||||||
|
|
||||||
|
#define DOS_INFOBLOCK_SEG 0x80
|
||||||
|
#define DOS_CDS_SEG 0x90
|
||||||
|
#define DOS_CONSTRING_SEG 0xa0
|
||||||
|
#define DOS_CONDRV_SEG 0xa4
|
||||||
|
#define DOS_SDA_SEG 0xb2
|
||||||
|
#define DOS_SDA_OFS 0
|
||||||
|
#define DOS_MEM_START 0x102 //First Segment that DOS can use
|
||||||
|
|
||||||
/* internal Dos Tables */
|
/* internal Dos Tables */
|
||||||
|
|
||||||
extern DOS_File * Files[DOS_FILES];
|
extern DOS_File * Files[DOS_FILES];
|
||||||
@ -143,8 +156,10 @@ bool DOS_ResizeMemory(Bit16u segment,Bit16u * blocks);
|
|||||||
bool DOS_FreeMemory(Bit16u segment);
|
bool DOS_FreeMemory(Bit16u segment);
|
||||||
void DOS_FreeProcessMemory(Bit16u pspseg);
|
void DOS_FreeProcessMemory(Bit16u pspseg);
|
||||||
Bit16u DOS_GetMemory(Bit16u pages);
|
Bit16u DOS_GetMemory(Bit16u pages);
|
||||||
void DOS_SetMemAllocStrategy(Bit16u strat);
|
bool DOS_SetMemAllocStrategy(Bit16u strat);
|
||||||
Bit16u DOS_GetMemAllocStrategy(void);
|
Bit16u DOS_GetMemAllocStrategy(void);
|
||||||
|
void DOS_BuildUMBChain(const char* use_umbs,bool ems_active);
|
||||||
|
bool DOS_LinkUMBsToMemChain(Bit16u linkstate);
|
||||||
|
|
||||||
/* FCB stuff */
|
/* FCB stuff */
|
||||||
bool DOS_FCBOpen(Bit16u seg,Bit16u offset);
|
bool DOS_FCBOpen(Bit16u seg,Bit16u offset);
|
||||||
@ -208,6 +223,7 @@ INLINE Bit16u DOS_PackDate(Bit16u year,Bit16u mon,Bit16u day) {
|
|||||||
#define DOSERR_REMOVE_CURRENT_DIRECTORY 16
|
#define DOSERR_REMOVE_CURRENT_DIRECTORY 16
|
||||||
#define DOSERR_NOT_SAME_DEVICE 17
|
#define DOSERR_NOT_SAME_DEVICE 17
|
||||||
#define DOSERR_NO_MORE_FILES 18
|
#define DOSERR_NO_MORE_FILES 18
|
||||||
|
#define DOSERR_FILE_ALREADY_EXISTS 80
|
||||||
|
|
||||||
|
|
||||||
/* Remains some classes used to access certain things */
|
/* Remains some classes used to access certain things */
|
||||||
@ -341,18 +357,24 @@ public:
|
|||||||
DOS_InfoBlock () {};
|
DOS_InfoBlock () {};
|
||||||
void SetLocation(Bit16u seg);
|
void SetLocation(Bit16u seg);
|
||||||
void SetFirstMCB(Bit16u _first_mcb);
|
void SetFirstMCB(Bit16u _first_mcb);
|
||||||
void SetfirstFileTable(RealPt _first_table);
|
|
||||||
void SetBuffers(Bit16u x,Bit16u y);
|
void SetBuffers(Bit16u x,Bit16u y);
|
||||||
void SetCurDirStruct(Bit32u _curdirstruct);
|
void SetCurDirStruct(Bit32u _curdirstruct);
|
||||||
void SetFCBTable(Bit32u _fcbtable);
|
void SetFCBTable(Bit32u _fcbtable);
|
||||||
void SetDeviceChainStart(Bit32u _devchain);
|
void SetDeviceChainStart(Bit32u _devchain);
|
||||||
void SetDiskInfoBuffer(Bit32u _dinfobuf);
|
void SetDiskBufferHeadPt(Bit32u _dbheadpt);
|
||||||
|
void SetStartOfUMBChain(Bit16u _umbstartseg);
|
||||||
|
void SetUMBChainState(Bit8u _umbchaining);
|
||||||
|
Bit16u GetStartOfUMBChain(void);
|
||||||
|
Bit8u GetUMBChainState(void);
|
||||||
RealPt GetPointer(void);
|
RealPt GetPointer(void);
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
#endif
|
#endif
|
||||||
struct sDIB {
|
struct sDIB {
|
||||||
|
Bit8u unknown1[4];
|
||||||
|
Bit16u magicWord; // -0x22 needs to be 1
|
||||||
|
Bit8u unknown2[8];
|
||||||
Bit16u regCXfrom5e; // -0x18 CX from last int21/ah=5e
|
Bit16u regCXfrom5e; // -0x18 CX from last int21/ah=5e
|
||||||
Bit16u countLRUcache; // -0x16 LRU counter for FCB caching
|
Bit16u countLRUcache; // -0x16 LRU counter for FCB caching
|
||||||
Bit16u countLRUopens; // -0x14 LRU counter for FCB openings
|
Bit16u countLRUopens; // -0x14 LRU counter for FCB openings
|
||||||
@ -387,7 +409,17 @@ public:
|
|||||||
Bit8u bootDrive; // 0x43 boot drive
|
Bit8u bootDrive; // 0x43 boot drive
|
||||||
Bit8u useDwordMov; // 0x44 use dword moves
|
Bit8u useDwordMov; // 0x44 use dword moves
|
||||||
Bit16u extendedSize; // 0x45 size of extended memory
|
Bit16u extendedSize; // 0x45 size of extended memory
|
||||||
// some more stuff, hopefully never used.
|
Bit32u diskBufferHeadPt; // 0x47 pointer to least-recently used buffer header
|
||||||
|
Bit16u dirtyDiskBuffers; // 0x4b number of dirty disk buffers
|
||||||
|
Bit32u lookaheadBufPt; // 0x4d pointer to lookahead buffer
|
||||||
|
Bit16u lookaheadBufNumber; // 0x51 number of lookahead buffers
|
||||||
|
Bit8u bufferLocation; // 0x53 workspace buffer location
|
||||||
|
Bit32u workspaceBuffer; // 0x54 pointer to workspace buffer
|
||||||
|
Bit8u unknown3[11]; // 0x58
|
||||||
|
Bit8u chainingUMB; // 0x63 bit0: UMB chain linked to MCB chain
|
||||||
|
Bit16u minMemForExec; // 0x64 minimum paragraphs needed for current program
|
||||||
|
Bit16u startOfUMBChain; // 0x66 segment of first UMB-MCB
|
||||||
|
Bit16u memAllocScanStart; // 0x68 start paragraph for memory allocation
|
||||||
} GCC_ATTRIBUTE(packed);
|
} GCC_ATTRIBUTE(packed);
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma pack ()
|
#pragma pack ()
|
||||||
@ -506,11 +538,6 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Bit16u sdaseg;
|
|
||||||
#define DOS_SDA_SEG sdaseg
|
|
||||||
#define DOS_SDA_OFS 0
|
|
||||||
|
|
||||||
|
|
||||||
class DOS_SDA : public MemStruct {
|
class DOS_SDA : public MemStruct {
|
||||||
public:
|
public:
|
||||||
DOS_SDA(Bit16u _seg,Bit16u _offs) { SetPt(_seg,_offs); }
|
DOS_SDA(Bit16u _seg,Bit16u _offs) { SetPt(_seg,_offs); }
|
||||||
@ -584,4 +611,3 @@ INLINE Bit8u RealHandle(Bit16u handle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,15 +16,19 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dos_system.h,v 1.28 2004/11/13 12:08:42 qbix79 Exp $ */
|
/* $Id: dos_system.h,v 1.31 2006/02/09 11:47:47 qbix79 Exp $ */
|
||||||
|
|
||||||
|
#ifndef DOSBOX_DOS_SYSTEM_H
|
||||||
|
#define DOSBOX_DOS_SYSTEM_H
|
||||||
|
|
||||||
#ifndef DOSSYSTEM_H_
|
|
||||||
#define DOSSYSTEM_H_
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_CROSS_H
|
||||||
#include "cross.h"
|
#include "cross.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DOS_NAMELENGTH 12
|
#define DOS_NAMELENGTH 12
|
||||||
#define DOS_NAMELENGTH_ASCII (DOS_NAMELENGTH+1)
|
#define DOS_NAMELENGTH_ASCII (DOS_NAMELENGTH+1)
|
||||||
@ -247,7 +251,8 @@ public:
|
|||||||
char * GetInfo(void);
|
char * GetInfo(void);
|
||||||
char curdir[DOS_PATHLENGTH];
|
char curdir[DOS_PATHLENGTH];
|
||||||
char info[256];
|
char info[256];
|
||||||
|
/* Can be overridden for example in iso images */
|
||||||
|
virtual char const * GetLabel(){return dirCache.GetLabel();};
|
||||||
DOS_Drive_Cache dirCache;
|
DOS_Drive_Cache dirCache;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -262,8 +267,12 @@ enum { DOS_SEEK_SET=0,DOS_SEEK_CUR=1,DOS_SEEK_END=2};
|
|||||||
|
|
||||||
typedef bool (MultiplexHandler)(void);
|
typedef bool (MultiplexHandler)(void);
|
||||||
void DOS_AddMultiplexHandler(MultiplexHandler * handler);
|
void DOS_AddMultiplexHandler(MultiplexHandler * handler);
|
||||||
|
void DOS_DelMultiplexHandler(MultiplexHandler * handler);
|
||||||
|
|
||||||
|
/* AddDevice stores the pointer to a created device */
|
||||||
void DOS_AddDevice(DOS_Device * adddev);
|
void DOS_AddDevice(DOS_Device * adddev);
|
||||||
|
/* DelDevice destroys the device that is pointed to. */
|
||||||
|
void DOS_DelDevice(DOS_Device * dev);
|
||||||
|
|
||||||
void VFILE_Register(const char * name,Bit8u * data,Bit32u size);
|
void VFILE_Register(const char * name,Bit8u * data,Bit32u size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,17 +16,16 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined __DOSBOX_H
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
#define __DOSBOX_H
|
#define DOSBOX_DOSBOX_H
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
void E_Exit(char * message,...);
|
void E_Exit(char * message,...);
|
||||||
|
|
||||||
void MSG_Add(const char*,const char*); //add messages to the internal langaugefile
|
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
|
const char* MSG_Get(char const *); //get messages from the internal langaugafile
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
class Section;
|
class Section;
|
||||||
|
|
||||||
typedef Bitu (LoopHandler)(void);
|
typedef Bitu (LoopHandler)(void);
|
||||||
@ -44,15 +43,24 @@ enum MachineType {
|
|||||||
MCH_HERC,
|
MCH_HERC,
|
||||||
MCH_CGA,
|
MCH_CGA,
|
||||||
MCH_TANDY,
|
MCH_TANDY,
|
||||||
|
MCH_PCJR,
|
||||||
MCH_VGA
|
MCH_VGA
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum SVGACards {
|
||||||
|
SVGA_None,
|
||||||
|
SVGA_S3Trio
|
||||||
|
};
|
||||||
|
|
||||||
|
extern SVGACards svgaCard;
|
||||||
extern MachineType machine;
|
extern MachineType machine;
|
||||||
extern bool SDLNetInited;
|
extern bool SDLNetInited;
|
||||||
|
|
||||||
#ifndef __LOGGING_H_
|
#define IS_TANDY_ARCH ((machine==MCH_TANDY) || (machine==MCH_PCJR))
|
||||||
|
#define TANDY_ARCH_CASE MCH_TANDY: case MCH_PCJR
|
||||||
|
|
||||||
|
#ifndef DOSBOX_LOGGING_H
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#endif // the logging system.
|
#endif // the logging system.
|
||||||
|
|
||||||
#endif /* __DOSBOX_H */
|
#endif /* DOSBOX_DOSBOX_H */
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,10 +16,12 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __FPU_H
|
#ifndef DOSBOX_FPU_H
|
||||||
#define __FPU_H
|
#define DOSBOX_FPU_H
|
||||||
|
|
||||||
|
#ifndef DOSBOX_MEM_H
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
void FPU_ESC0_Normal(Bitu rm);
|
void FPU_ESC0_Normal(Bitu rm);
|
||||||
void FPU_ESC0_EA(Bitu func,PhysPt ea);
|
void FPU_ESC0_EA(Bitu func,PhysPt ea);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,8 +16,8 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _HARDWARE_H_
|
#ifndef DOSBOX_HARDWARE_H
|
||||||
#define _HARDWARE_H_
|
#define DOSBOX_HARDWARE_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
@ -25,13 +25,26 @@ class Section;
|
|||||||
enum OPL_Mode {
|
enum OPL_Mode {
|
||||||
OPL_none,OPL_cms,OPL_opl2,OPL_dualopl2,OPL_opl3
|
OPL_none,OPL_cms,OPL_opl2,OPL_dualopl2,OPL_opl3
|
||||||
};
|
};
|
||||||
|
#define CAPTURE_WAVE 0x01
|
||||||
|
#define CAPTURE_OPL 0x02
|
||||||
|
#define CAPTURE_MIDI 0x04
|
||||||
|
#define CAPTURE_IMAGE 0x08
|
||||||
|
#define CAPTURE_VIDEO 0x10
|
||||||
|
|
||||||
|
extern Bitu CaptureState;
|
||||||
|
|
||||||
|
void OPL_Init(Section* sec,OPL_Mode mode);
|
||||||
|
void CMS_Init(Section* sec);
|
||||||
|
void OPL_ShutDown(Section* sec);
|
||||||
|
void CMS_ShutDown(Section* sec);
|
||||||
|
|
||||||
void OPL_Init(Section* sec,Bitu base,OPL_Mode mode,Bitu rate);
|
|
||||||
void CMS_Init(Section* sec,Bitu base,Bitu rate);
|
|
||||||
extern Bit8u adlib_commandreg;
|
extern Bit8u adlib_commandreg;
|
||||||
FILE * OpenCaptureFile(const char * type,const char * ext);
|
FILE * OpenCaptureFile(const char * type,const char * ext);
|
||||||
|
|
||||||
|
void CAPTURE_AddWave(Bit32u freq, Bit32u len, Bit16s * data);
|
||||||
|
#define CAPTURE_FLAG_DBLW 0x1
|
||||||
|
#define CAPTURE_FLAG_DBLH 0x2
|
||||||
|
void CAPTURE_AddImage(Bitu width, Bitu height, Bitu bpp, Bitu pitch, Bitu flags, float fps, Bit8u * data, Bit8u * pal);
|
||||||
|
void CAPTURE_AddMidi(bool sysex, Bitu len, Bit8u * data);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,6 +16,11 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* 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 $ */
|
||||||
|
|
||||||
|
#ifndef DOSBOX_INOUT_H
|
||||||
|
#define DOSBOX_INOUT_H
|
||||||
|
|
||||||
#define IO_MAX (64*1024+3)
|
#define IO_MAX (64*1024+3)
|
||||||
|
|
||||||
#define IO_MB 0x1
|
#define IO_MB 0x1
|
||||||
@ -32,28 +37,36 @@ extern IO_ReadHandler * io_readhandlers[3][IO_MAX];
|
|||||||
void IO_RegisterReadHandler(Bitu port,IO_ReadHandler * handler,Bitu mask,Bitu range=1);
|
void IO_RegisterReadHandler(Bitu port,IO_ReadHandler * handler,Bitu mask,Bitu range=1);
|
||||||
void IO_RegisterWriteHandler(Bitu port,IO_WriteHandler * handler,Bitu mask,Bitu range=1);
|
void IO_RegisterWriteHandler(Bitu port,IO_WriteHandler * handler,Bitu mask,Bitu range=1);
|
||||||
|
|
||||||
void IO_FreeReadHandler(Bitu port,Bitu mask,Bitu range=0);
|
void IO_FreeReadHandler(Bitu port,Bitu mask,Bitu range=1);
|
||||||
void IO_FreeWriteHandler(Bitu port,Bitu mask,Bitu range=0);
|
void IO_FreeWriteHandler(Bitu port,Bitu mask,Bitu range=1);
|
||||||
|
|
||||||
INLINE void IO_WriteB(Bitu port,Bitu val) {
|
void IO_WriteB(Bitu port,Bitu val);
|
||||||
io_writehandlers[0][port](port,val,1);
|
void IO_WriteW(Bitu port,Bitu val);
|
||||||
};
|
void IO_WriteD(Bitu port,Bitu val);
|
||||||
INLINE void IO_WriteW(Bitu port,Bitu val) {
|
|
||||||
io_writehandlers[1][port](port,val,2);
|
|
||||||
};
|
|
||||||
INLINE void IO_WriteD(Bitu port,Bitu val) {
|
|
||||||
io_writehandlers[2][port](port,val,4);
|
|
||||||
};
|
|
||||||
|
|
||||||
INLINE Bitu IO_ReadB(Bitu port) {
|
Bitu IO_ReadB(Bitu port);
|
||||||
return io_readhandlers[0][port](port,1);
|
Bitu IO_ReadW(Bitu port);
|
||||||
}
|
Bitu IO_ReadD(Bitu port);
|
||||||
INLINE Bitu IO_ReadW(Bitu port) {
|
|
||||||
return io_readhandlers[1][port](port,2);
|
/* Classes to manage the IO objects created by the various devices.
|
||||||
}
|
* The io objects will remove itself on destruction.*/
|
||||||
INLINE Bitu IO_ReadD(Bitu port) {
|
class IO_Base{
|
||||||
return io_readhandlers[2][port](port,4);
|
protected:
|
||||||
}
|
bool installed;
|
||||||
|
Bitu m_port, m_mask,m_range;
|
||||||
|
public:
|
||||||
|
IO_Base():installed(false){};
|
||||||
|
};
|
||||||
|
class IO_ReadHandleObject: private IO_Base{
|
||||||
|
public:
|
||||||
|
void Install(Bitu port,IO_ReadHandler * handler,Bitu mask,Bitu range=1);
|
||||||
|
~IO_ReadHandleObject();
|
||||||
|
};
|
||||||
|
class IO_WriteHandleObject: private IO_Base{
|
||||||
|
public:
|
||||||
|
void Install(Bitu port,IO_WriteHandler * handler,Bitu mask,Bitu range=1);
|
||||||
|
~IO_WriteHandleObject();
|
||||||
|
};
|
||||||
|
|
||||||
INLINE void IO_Write(Bitu port,Bit8u val) {
|
INLINE void IO_Write(Bitu port,Bit8u val) {
|
||||||
IO_WriteB(port,val);
|
IO_WriteB(port,val);
|
||||||
@ -62,4 +75,4 @@ INLINE Bit8u IO_Read(Bitu port){
|
|||||||
return IO_ReadB(port);
|
return IO_ReadB(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,8 +16,20 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _IPX_H_
|
/* $Id: ipx.h,v 1.9 2006/02/26 13:46:31 qbix79 Exp $ */
|
||||||
#define _IPX_H_
|
|
||||||
|
#ifndef DOSBOX_IPX_H
|
||||||
|
#define DOSBOX_IPX_H
|
||||||
|
|
||||||
|
// Uncomment this for a lot of debug messages:
|
||||||
|
//#define IPX_DEBUGMSG
|
||||||
|
|
||||||
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_MEM_H
|
||||||
|
#include "mem.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// In Use Flag codes
|
// In Use Flag codes
|
||||||
#define USEFLAG_AVAILABLE 0x00
|
#define USEFLAG_AVAILABLE 0x00
|
||||||
@ -31,7 +43,6 @@
|
|||||||
#define USEFLAG_LISTENING 0xfe
|
#define USEFLAG_LISTENING 0xfe
|
||||||
#define USEFLAG_SENDING 0xff
|
#define USEFLAG_SENDING 0xff
|
||||||
|
|
||||||
|
|
||||||
// Completion codes
|
// Completion codes
|
||||||
#define COMP_SUCCESS 0x00
|
#define COMP_SUCCESS 0x00
|
||||||
#define COMP_REMOTETERM 0xec
|
#define COMP_REMOTETERM 0xec
|
||||||
@ -52,7 +63,6 @@
|
|||||||
// For Uint8 type
|
// For Uint8 type
|
||||||
#include "SDL_net.h"
|
#include "SDL_net.h"
|
||||||
|
|
||||||
|
|
||||||
struct PackedIP {
|
struct PackedIP {
|
||||||
Uint32 host;
|
Uint32 host;
|
||||||
Uint16 port;
|
Uint16 port;
|
||||||
@ -78,6 +88,48 @@ struct IPXHeader {
|
|||||||
} dest, src;
|
} dest, src;
|
||||||
} GCC_ATTRIBUTE(packed);
|
} GCC_ATTRIBUTE(packed);
|
||||||
|
|
||||||
|
struct fragmentDescriptor {
|
||||||
|
Bit16u offset;
|
||||||
|
Bit16u segment;
|
||||||
|
Bit16u size;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define IPXBUFFERSIZE 1424
|
||||||
|
|
||||||
|
class ECBClass {
|
||||||
|
public:
|
||||||
|
RealPt ECBAddr;
|
||||||
|
bool isInESRList;
|
||||||
|
ECBClass *prevECB;
|
||||||
|
ECBClass *nextECB;
|
||||||
|
Bit8u iuflag;
|
||||||
|
|
||||||
|
#ifdef IPX_DEBUGMSG
|
||||||
|
Bitu SerialNumber;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ECBClass(Bit16u segment, Bit16u offset);
|
||||||
|
Bit16u getSocket(void);
|
||||||
|
|
||||||
|
Bit8u getInUseFlag(void);
|
||||||
|
|
||||||
|
void setInUseFlag(Bit8u flagval);
|
||||||
|
|
||||||
|
void setCompletionFlag(Bit8u flagval);
|
||||||
|
|
||||||
|
Bit16u getFragCount(void);
|
||||||
|
|
||||||
|
void getFragDesc(Bit16u descNum, fragmentDescriptor *fragDesc);
|
||||||
|
RealPt getESRAddr(void);
|
||||||
|
|
||||||
|
void NotifyESR(void);
|
||||||
|
|
||||||
|
void setImmAddress(Bit8u *immAddr);
|
||||||
|
void getImmAddress(Bit8u* immAddr);
|
||||||
|
|
||||||
|
~ECBClass();
|
||||||
|
};
|
||||||
|
|
||||||
// The following routines may not be needed on all systems. On my build of SDL the IPaddress structure is 8 octects
|
// The following routines may not be needed on all systems. On my build of SDL the IPaddress structure is 8 octects
|
||||||
// and therefore screws up my IPXheader structure since it needs to be packed.
|
// and therefore screws up my IPXheader structure since it needs to be packed.
|
||||||
|
|
||||||
@ -89,4 +141,3 @@ void PackIP(IPaddress ipAddr, PackedIP *ipPack);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,8 +16,8 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _IPXSERVER_H_
|
#ifndef DOSBOX_IPXSERVER_H_
|
||||||
#define _IPXSERVER_H_
|
#define DOSBOX_IPXSERVER_H_
|
||||||
|
|
||||||
#if C_IPX
|
#if C_IPX
|
||||||
|
|
||||||
@ -33,7 +33,6 @@ struct packetBuffer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define SOCKETTABLESIZE 16
|
#define SOCKETTABLESIZE 16
|
||||||
#define IPXBUFFERSIZE 1024
|
|
||||||
#define CONVIP(hostvar) hostvar & 0xff, (hostvar >> 8) & 0xff, (hostvar >> 16) & 0xff, (hostvar >> 24) & 0xff
|
#define CONVIP(hostvar) hostvar & 0xff, (hostvar >> 8) & 0xff, (hostvar >> 16) & 0xff, (hostvar >> 24) & 0xff
|
||||||
#define CONVIPX(hostvar) hostvar[0], hostvar[1], hostvar[2], hostvar[3], hostvar[4], hostvar[5]
|
#define CONVIPX(hostvar) hostvar[0], hostvar[1], hostvar[2], hostvar[3], hostvar[4], hostvar[5]
|
||||||
|
|
||||||
@ -47,4 +46,3 @@ Bit8u packetCRC(Bit8u *buffer, Bit16u bufSize);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,6 +16,9 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* 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 $ */
|
||||||
|
#ifndef DOSBOX_JOYSTICK_H
|
||||||
|
#define DOSBOX_JOYSTICK_H
|
||||||
void JOYSTICK_Enable(Bitu which,bool enabled);
|
void JOYSTICK_Enable(Bitu which,bool enabled);
|
||||||
|
|
||||||
void JOYSTICK_Button(Bitu which,Bitu num,bool pressed);
|
void JOYSTICK_Button(Bitu which,Bitu num,bool pressed);
|
||||||
@ -31,3 +34,14 @@ bool JOYSTICK_GetButton(Bitu which, Bitu num);
|
|||||||
float JOYSTICK_GetMove_X(Bitu which);
|
float JOYSTICK_GetMove_X(Bitu which);
|
||||||
|
|
||||||
float JOYSTICK_GetMove_Y(Bitu which);
|
float JOYSTICK_GetMove_Y(Bitu which);
|
||||||
|
|
||||||
|
enum JoystickType {
|
||||||
|
JOY_NONE,
|
||||||
|
JOY_2AXIS,
|
||||||
|
JOY_4AXIS,
|
||||||
|
JOY_FCS,
|
||||||
|
JOY_CH
|
||||||
|
};
|
||||||
|
|
||||||
|
extern JoystickType joytype;
|
||||||
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,8 +16,8 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _KEYBOARD_H_
|
#ifndef DOSBOX_KEYBOARD_H
|
||||||
#define _KEYBOARD_H_
|
#define DOSBOX_KEYBOARD_H
|
||||||
|
|
||||||
enum KBD_KEYS {
|
enum KBD_KEYS {
|
||||||
KBD_NONE,
|
KBD_NONE,
|
||||||
@ -34,7 +34,7 @@ enum KBD_KEYS {
|
|||||||
KBD_capslock,KBD_scrolllock,KBD_numlock,
|
KBD_capslock,KBD_scrolllock,KBD_numlock,
|
||||||
|
|
||||||
KBD_grave,KBD_minus,KBD_equals,KBD_backslash,KBD_leftbracket,KBD_rightbracket,
|
KBD_grave,KBD_minus,KBD_equals,KBD_backslash,KBD_leftbracket,KBD_rightbracket,
|
||||||
KBD_semicolon,KBD_quote,KBD_period,KBD_comma,KBD_slash,
|
KBD_semicolon,KBD_quote,KBD_period,KBD_comma,KBD_slash,KBD_extra_lt_gt,
|
||||||
|
|
||||||
KBD_printscreen,KBD_pause,
|
KBD_printscreen,KBD_pause,
|
||||||
KBD_insert,KBD_home,KBD_pageup,KBD_delete,KBD_end,KBD_pagedown,
|
KBD_insert,KBD_home,KBD_pageup,KBD_delete,KBD_end,KBD_pagedown,
|
||||||
@ -47,6 +47,7 @@ enum KBD_KEYS {
|
|||||||
KBD_LAST
|
KBD_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void KEYBOARD_ClrBuffer(void);
|
||||||
void KEYBOARD_AddKey(KBD_KEYS keytype,bool pressed);
|
void KEYBOARD_AddKey(KBD_KEYS keytype,bool pressed);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef __LOGGING_H_
|
#ifndef DOSBOX_LOGGING_H
|
||||||
#define __LOGGING_H_
|
#define DOSBOX_LOGGING_H
|
||||||
enum LOG_TYPES {
|
enum LOG_TYPES {
|
||||||
LOG_ALL,
|
LOG_ALL,
|
||||||
LOG_VGA, LOG_VGAGFX,LOG_VGAMISC,LOG_INT10,
|
LOG_VGA, LOG_VGAGFX,LOG_VGAMISC,LOG_INT10,
|
||||||
@ -45,6 +45,8 @@ struct LOG
|
|||||||
void operator()(char const* buf, double f1) { 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) { return;}
|
||||||
void operator()(char const* buf, double f1, double f2, double f3) { 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;}
|
||||||
|
|
||||||
void operator()(char const* buf, char const* s1) { return;}
|
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) { return;}
|
||||||
@ -61,5 +63,4 @@ void GFX_ShowMsg(char * format,...);
|
|||||||
#endif //C_DEBUG
|
#endif //C_DEBUG
|
||||||
|
|
||||||
|
|
||||||
#endif //__LOGGING_H_
|
#endif //DOSBOX_LOGGING_H
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,8 +16,8 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MAPPER_H_
|
#ifndef DOSBOX_MAPPER_H
|
||||||
#define MAPPER_H_
|
#define DOSBOX_MAPPER_H
|
||||||
|
|
||||||
enum MapKeys {
|
enum MapKeys {
|
||||||
MK_f1,MK_f2,MK_f3,MK_f4,MK_f5,MK_f6,MK_f7,MK_f8,MK_f9,MK_f10,MK_f11,MK_f12,
|
MK_f1,MK_f2,MK_f3,MK_f4,MK_f5,MK_f6,MK_f7,MK_f8,MK_f9,MK_f10,MK_f11,MK_f12,
|
||||||
@ -25,13 +25,12 @@ enum MapKeys {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (MAPPER_Handler)(void);
|
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 * eventname,char * buttonname);
|
||||||
void MAPPER_Init(void);
|
void MAPPER_Init(void);
|
||||||
void MAPPER_StartUp(Section * sec);
|
void MAPPER_StartUp(Section * sec);
|
||||||
void MAPPER_Run(void);
|
void MAPPER_Run(bool pressed);
|
||||||
|
void MAPPER_LosingFocus(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MMOD1 0x1
|
#define MMOD1 0x1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,9 +16,12 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined __MEM_H
|
#ifndef DOSBOX_MEM_H
|
||||||
#define __MEM_H
|
#define DOSBOX_MEM_H
|
||||||
#include <dosbox.h>
|
|
||||||
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef Bit32u PhysPt;
|
typedef Bit32u PhysPt;
|
||||||
typedef Bit8u * HostPt;
|
typedef Bit8u * HostPt;
|
||||||
@ -29,6 +32,7 @@ typedef Bit32s MemHandle;
|
|||||||
#define MEM_PAGESIZE 4096
|
#define MEM_PAGESIZE 4096
|
||||||
|
|
||||||
extern HostPt MemBase;
|
extern HostPt MemBase;
|
||||||
|
HostPt GetMemBase(void);
|
||||||
|
|
||||||
bool MEM_A20_Enabled(void);
|
bool MEM_A20_Enabled(void);
|
||||||
void MEM_A20_Enable(bool enable);
|
void MEM_A20_Enable(bool enable);
|
||||||
@ -52,7 +56,7 @@ MemHandle MEM_NextHandleAt(MemHandle handle,Bitu where);
|
|||||||
Working on big or little endian machines
|
Working on big or little endian machines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#if defined(WORDS_BIGENDIAN) || !defined(C_UNALIGNED_MEMORY)
|
||||||
|
|
||||||
INLINE Bit8u host_readb(HostPt off) {
|
INLINE Bit8u host_readb(HostPt off) {
|
||||||
return off[0];
|
return off[0];
|
||||||
@ -77,10 +81,6 @@ INLINE void host_writed(HostPt off,Bit32u val) {
|
|||||||
off[3]=(Bit8u)(val >> 24);
|
off[3]=(Bit8u)(val >> 24);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MLEB(_MLE_VAL_) (_MLE_VAL_)
|
|
||||||
#define MLEW(_MLE_VAL_) ((_MLE_VAL_ >> 8) | (_MLE_VAL_ << 8))
|
|
||||||
#define MLED(_MLE_VAL_) ((_MLE_VAL_ >> 24)|((_MLE_VAL_ >> 8)&0xFF00)|((_MLE_VAL_ << 8)&0xFF0000)|((_MLE_VAL_ << 24)&0xFF000000))
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
INLINE Bit8u host_readb(HostPt off) {
|
INLINE Bit8u host_readb(HostPt off) {
|
||||||
@ -102,16 +102,20 @@ INLINE void host_writed(HostPt off,Bit32u val) {
|
|||||||
*(Bit32u *)(off)=val;
|
*(Bit32u *)(off)=val;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MLEB(_MLE_VAL_) (_MLE_VAL_)
|
|
||||||
#define MLEW(_MLE_VAL_) (_MLE_VAL_)
|
|
||||||
#define MLED(_MLE_VAL_) (_MLE_VAL_)
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define WLE(VAR_,VAL_) \
|
|
||||||
if (sizeof(VAR_)==1) VAR_=MLEB(VAL_); \
|
INLINE void var_write(Bit8u * var, Bit8u val) {
|
||||||
if (sizeof(VAR_)==2) VAR_=MLEW(VAL_); \
|
host_writeb((HostPt)var, val);
|
||||||
if (sizeof(VAR_)==4) VAR_=MLED(VAL_);
|
}
|
||||||
|
|
||||||
|
INLINE void var_write(Bit16u * var, Bit16u val) {
|
||||||
|
host_writew((HostPt)var, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE void var_write(Bit32u * var, Bit32u val) {
|
||||||
|
host_writed((HostPt)var, val);
|
||||||
|
}
|
||||||
|
|
||||||
/* The Folowing six functions are slower but they recognize the paged memory system */
|
/* The Folowing six functions are slower but they recognize the paged memory system */
|
||||||
|
|
||||||
@ -201,6 +205,11 @@ INLINE void RealSetVec(Bit8u vec,RealPt pt) {
|
|||||||
mem_writed(vec<<2,pt);
|
mem_writed(vec<<2,pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INLINE void RealSetVec(Bit8u vec,RealPt pt,RealPt &old) {
|
||||||
|
old = mem_readd(vec<<2);
|
||||||
|
mem_writed(vec<<2,pt);
|
||||||
|
}
|
||||||
|
|
||||||
INLINE RealPt RealGetVec(Bit8u vec) {
|
INLINE RealPt RealGetVec(Bit8u vec) {
|
||||||
return mem_readd(vec<<2);
|
return mem_readd(vec<<2);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,6 +16,13 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef DOSBOX_MIXER_H
|
||||||
|
#define DOSBOX_MIXER_H
|
||||||
|
|
||||||
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void (*MIXER_MixHandler)(Bit8u * sampdate,Bit32u len);
|
typedef void (*MIXER_MixHandler)(Bit8u * sampdate,Bit32u len);
|
||||||
typedef void (*MIXER_Handler)(Bitu len);
|
typedef void (*MIXER_Handler)(Bitu len);
|
||||||
|
|
||||||
@ -65,9 +72,24 @@ public:
|
|||||||
|
|
||||||
MixerChannel * MIXER_AddChannel(MIXER_Handler handler,Bitu freq,char * name);
|
MixerChannel * MIXER_AddChannel(MIXER_Handler handler,Bitu freq,char * name);
|
||||||
MixerChannel * MIXER_FindChannel(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);
|
||||||
|
|
||||||
|
/* Object to maintain a mixerchannel; As all objects it registers itself with create
|
||||||
|
* and removes itself when destroyed. */
|
||||||
|
class MixerObject{
|
||||||
|
private:
|
||||||
|
bool installed;
|
||||||
|
char m_name[32];
|
||||||
|
public:
|
||||||
|
MixerObject():installed(false){};
|
||||||
|
MixerChannel* Install(MIXER_Handler handler,Bitu freq,char * name);
|
||||||
|
~MixerObject();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/* PC Speakers functions, tightly related to the timer functions */
|
/* PC Speakers functions, tightly related to the timer functions */
|
||||||
|
|
||||||
void PCSPEAKER_SetCounter(Bitu cntr,Bitu mode);
|
void PCSPEAKER_SetCounter(Bitu cntr,Bitu mode);
|
||||||
void PCSPEAKER_SetType(Bitu mode);
|
void PCSPEAKER_SetType(Bitu mode);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,18 +16,18 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: mouse.h,v 1.7 2004/08/04 09:12:51 qbix79 Exp $ */
|
/* $Id: mouse.h,v 1.12 2006/02/09 11:47:48 qbix79 Exp $ */
|
||||||
|
|
||||||
#ifndef _MOUSE_H_
|
#ifndef DOSBOX_MOUSE_H
|
||||||
#define _MOUSE_H_
|
#define DOSBOX_MOUSE_H
|
||||||
|
|
||||||
void Mouse_ShowCursor(void);
|
void Mouse_ShowCursor(void);
|
||||||
void Mouse_HideCursor(void);
|
void Mouse_HideCursor(void);
|
||||||
|
|
||||||
void Mouse_SetPS2State(bool use);
|
bool Mouse_SetPS2State(bool use);
|
||||||
void Mouse_ChangePS2Callback(Bit16u pseg, Bit16u pofs);
|
void Mouse_ChangePS2Callback(Bit16u pseg, Bit16u pofs);
|
||||||
|
|
||||||
void Mouse_CursorMoved(float x,float y);
|
void Mouse_CursorMoved(float xrel,float yrel,float x,float y,bool emulate);
|
||||||
void Mouse_CursorSet(float x,float y);
|
void Mouse_CursorSet(float x,float y);
|
||||||
void Mouse_ButtonPressed(Bit8u button);
|
void Mouse_ButtonPressed(Bit8u button);
|
||||||
void Mouse_ButtonReleased(Bit8u button);
|
void Mouse_ButtonReleased(Bit8u button);
|
||||||
@ -36,4 +36,3 @@ void Mouse_AutoLock(bool enable);
|
|||||||
void Mouse_NewVideoMode(void);
|
void Mouse_NewVideoMode(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
188
include/paging.h
188
include/paging.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,13 +16,17 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: paging.h,v 1.12 2004/10/12 10:45:10 harekiet Exp $ */
|
/* $Id: paging.h,v 1.22 2006/02/09 11:47:48 qbix79 Exp $ */
|
||||||
|
|
||||||
#ifndef _PAGING_H_
|
#ifndef DOSBOX_PAGING_H
|
||||||
#define _PAGING_H_
|
#define DOSBOX_PAGING_H
|
||||||
|
|
||||||
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_MEM_H
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class PageDirectory;
|
class PageDirectory;
|
||||||
|
|
||||||
@ -50,7 +54,14 @@ public:
|
|||||||
virtual void writeb(PhysPt addr,Bitu val);
|
virtual void writeb(PhysPt addr,Bitu val);
|
||||||
virtual void writew(PhysPt addr,Bitu val);
|
virtual void writew(PhysPt addr,Bitu val);
|
||||||
virtual void writed(PhysPt addr,Bitu val);
|
virtual void writed(PhysPt addr,Bitu val);
|
||||||
virtual HostPt GetHostPt(Bitu phys_page);
|
virtual HostPt GetHostReadPt(Bitu phys_page);
|
||||||
|
virtual HostPt GetHostWritePt(Bitu phys_page);
|
||||||
|
virtual bool readb_checked(PhysPt addr, Bitu * val);
|
||||||
|
virtual bool readw_checked(PhysPt addr, Bitu * val);
|
||||||
|
virtual bool readd_checked(PhysPt addr, Bitu * val);
|
||||||
|
virtual bool writeb_checked(PhysPt addr,Bitu val);
|
||||||
|
virtual bool writew_checked(PhysPt addr,Bitu val);
|
||||||
|
virtual bool writed_checked(PhysPt addr,Bitu val);
|
||||||
Bitu flags;
|
Bitu flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -69,7 +80,7 @@ void PAGING_UnlinkPages(Bitu lin_page,Bitu pages);
|
|||||||
void PAGING_MapPage(Bitu lin_page,Bitu phys_page);
|
void PAGING_MapPage(Bitu lin_page,Bitu phys_page);
|
||||||
bool PAGING_MakePhysPage(Bitu & page);
|
bool PAGING_MakePhysPage(Bitu & page);
|
||||||
|
|
||||||
void MEM_SetLFB(Bitu _page,Bitu _pages,HostPt _pt);
|
void MEM_SetLFB( Bitu page, Bitu pages, PageHandler *handler);
|
||||||
void MEM_SetPageHandler(Bitu phys_page, Bitu pages, PageHandler * handler);
|
void MEM_SetPageHandler(Bitu phys_page, Bitu pages, PageHandler * handler);
|
||||||
void MEM_ResetPageHandler(Bitu phys_page, Bitu pages);
|
void MEM_ResetPageHandler(Bitu phys_page, Bitu pages);
|
||||||
|
|
||||||
@ -78,6 +89,19 @@ void MEM_ResetPageHandler(Bitu phys_page, Bitu pages);
|
|||||||
#pragma pack (1)
|
#pragma pack (1)
|
||||||
#endif
|
#endif
|
||||||
struct X86_PageEntryBlock{
|
struct X86_PageEntryBlock{
|
||||||
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
Bit32u base:20;
|
||||||
|
Bit32u avl:3;
|
||||||
|
Bit32u g:1;
|
||||||
|
Bit32u pat:1;
|
||||||
|
Bit32u d:1;
|
||||||
|
Bit32u a:1;
|
||||||
|
Bit32u pcd:1;
|
||||||
|
Bit32u pwt:1;
|
||||||
|
Bit32u us:1;
|
||||||
|
Bit32u wr:1;
|
||||||
|
Bit32u p:1;
|
||||||
|
#else
|
||||||
Bit32u p:1;
|
Bit32u p:1;
|
||||||
Bit32u wr:1;
|
Bit32u wr:1;
|
||||||
Bit32u us:1;
|
Bit32u us:1;
|
||||||
@ -89,6 +113,7 @@ struct X86_PageEntryBlock{
|
|||||||
Bit32u g:1;
|
Bit32u g:1;
|
||||||
Bit32u avl:3;
|
Bit32u avl:3;
|
||||||
Bit32u base:20;
|
Bit32u base:20;
|
||||||
|
#endif
|
||||||
} GCC_ATTRIBUTE(packed);
|
} GCC_ATTRIBUTE(packed);
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma pack ()
|
#pragma pack ()
|
||||||
@ -117,6 +142,7 @@ struct PagingBlock {
|
|||||||
Bitu used;
|
Bitu used;
|
||||||
Bit32u entries[PAGING_LINKS];
|
Bit32u entries[PAGING_LINKS];
|
||||||
} links;
|
} links;
|
||||||
|
Bit32u firstmb[LINK_START];
|
||||||
bool enabled;
|
bool enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -126,12 +152,27 @@ extern PagingBlock paging;
|
|||||||
|
|
||||||
PageHandler * MEM_GetPageHandler(Bitu phys_page);
|
PageHandler * MEM_GetPageHandler(Bitu phys_page);
|
||||||
|
|
||||||
|
/* Use this helper function to access linear addresses in readX/writeX functions */
|
||||||
|
INLINE PhysPt PAGING_GetPhysicalPage(PhysPt linePage) {
|
||||||
|
return (paging.tlb.phys_page[linePage>>12]<<12);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE PhysPt PAGING_GetPhysicalAddress(PhysPt linAddr) {
|
||||||
|
return (paging.tlb.phys_page[linAddr>>12]<<12)|(linAddr&0xfff);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Unaligned address handlers */
|
/* Unaligned address handlers */
|
||||||
Bit16u mem_unalignedreadw(PhysPt address);
|
Bit16u mem_unalignedreadw(PhysPt address);
|
||||||
Bit32u mem_unalignedreadd(PhysPt address);
|
Bit32u mem_unalignedreadd(PhysPt address);
|
||||||
void mem_unalignedwritew(PhysPt address,Bit16u val);
|
void mem_unalignedwritew(PhysPt address,Bit16u val);
|
||||||
void mem_unalignedwrited(PhysPt address,Bit32u val);
|
void mem_unalignedwrited(PhysPt address,Bit32u val);
|
||||||
|
|
||||||
|
bool mem_unalignedreadw_checked_x86(PhysPt address,Bit16u * val);
|
||||||
|
bool mem_unalignedreadd_checked_x86(PhysPt address,Bit32u * val);
|
||||||
|
bool mem_unalignedwritew_checked_x86(PhysPt address,Bit16u val);
|
||||||
|
bool mem_unalignedwrited_checked_x86(PhysPt address,Bit32u val);
|
||||||
|
|
||||||
/* Special inlined memory reading/writing */
|
/* Special inlined memory reading/writing */
|
||||||
|
|
||||||
INLINE Bit8u mem_readb_inline(PhysPt address) {
|
INLINE Bit8u mem_readb_inline(PhysPt address) {
|
||||||
@ -141,20 +182,21 @@ INLINE Bit8u mem_readb_inline(PhysPt address) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
INLINE Bit16u mem_readw_inline(PhysPt address) {
|
INLINE Bit16u mem_readw_inline(PhysPt address) {
|
||||||
if (address & 1) return mem_unalignedreadw(address);
|
if (!(address & 1)) {
|
||||||
|
|
||||||
Bitu index=(address>>12);
|
Bitu index=(address>>12);
|
||||||
|
|
||||||
if (paging.tlb.read[index]) return host_readw(paging.tlb.read[index]+address);
|
if (paging.tlb.read[index]) return host_readw(paging.tlb.read[index]+address);
|
||||||
else return paging.tlb.handler[index]->readw(address);
|
else return paging.tlb.handler[index]->readw(address);
|
||||||
|
} else return mem_unalignedreadw(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
INLINE Bit32u mem_readd_inline(PhysPt address) {
|
INLINE Bit32u mem_readd_inline(PhysPt address) {
|
||||||
if (address & 3) return mem_unalignedreadd(address);
|
if (!(address & 3)) {
|
||||||
|
|
||||||
Bitu index=(address>>12);
|
Bitu index=(address>>12);
|
||||||
|
|
||||||
if (paging.tlb.read[index]) return host_readd(paging.tlb.read[index]+address);
|
if (paging.tlb.read[index]) return host_readd(paging.tlb.read[index]+address);
|
||||||
else return paging.tlb.handler[index]->readd(address);
|
else return paging.tlb.handler[index]->readd(address);
|
||||||
|
} else return mem_unalignedreadd(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
|
INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
|
||||||
@ -165,21 +207,135 @@ INLINE void mem_writeb_inline(PhysPt address,Bit8u val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
|
INLINE void mem_writew_inline(PhysPt address,Bit16u val) {
|
||||||
if (address & 1) {mem_unalignedwritew(address,val);return;}
|
if (!(address & 1)) {
|
||||||
|
|
||||||
Bitu index=(address>>12);
|
Bitu index=(address>>12);
|
||||||
|
|
||||||
if (paging.tlb.write[index]) host_writew(paging.tlb.write[index]+address,val);
|
if (paging.tlb.write[index]) host_writew(paging.tlb.write[index]+address,val);
|
||||||
else paging.tlb.handler[index]->writew(address,val);
|
else paging.tlb.handler[index]->writew(address,val);
|
||||||
|
} else mem_unalignedwritew(address,val);
|
||||||
}
|
}
|
||||||
|
|
||||||
INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
|
INLINE void mem_writed_inline(PhysPt address,Bit32u val) {
|
||||||
if (address & 3) {mem_unalignedwrited(address,val);return;}
|
if (!(address & 3)) {
|
||||||
|
|
||||||
Bitu index=(address>>12);
|
Bitu index=(address>>12);
|
||||||
|
|
||||||
if (paging.tlb.write[index]) host_writed(paging.tlb.write[index]+address,val);
|
if (paging.tlb.write[index]) host_writed(paging.tlb.write[index]+address,val);
|
||||||
else paging.tlb.handler[index]->writed(address,val);
|
else paging.tlb.handler[index]->writed(address,val);
|
||||||
|
} else mem_unalignedwrited(address,val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
INLINE Bit16u mem_readw_dyncorex86(PhysPt address) {
|
||||||
|
if ((address & 0xfff)<0xfff) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
|
||||||
|
if (paging.tlb.read[index]) return host_readw(paging.tlb.read[index]+address);
|
||||||
|
else return paging.tlb.handler[index]->readw(address);
|
||||||
|
} else return mem_unalignedreadw(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE Bit32u mem_readd_dyncorex86(PhysPt address) {
|
||||||
|
if ((address & 0xfff)<0xffd) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
|
||||||
|
if (paging.tlb.read[index]) return host_readd(paging.tlb.read[index]+address);
|
||||||
|
else return paging.tlb.handler[index]->readd(address);
|
||||||
|
} else return mem_unalignedreadd(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE void mem_writew_dyncorex86(PhysPt address,Bit16u val) {
|
||||||
|
if ((address & 0xfff)<0xfff) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
|
||||||
|
if (paging.tlb.write[index]) host_writew(paging.tlb.write[index]+address,val);
|
||||||
|
else paging.tlb.handler[index]->writew(address,val);
|
||||||
|
} else mem_unalignedwritew(address,val);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE void mem_writed_dyncorex86(PhysPt address,Bit32u val) {
|
||||||
|
if ((address & 0xfff)<0xffd) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
|
||||||
|
if (paging.tlb.write[index]) host_writed(paging.tlb.write[index]+address,val);
|
||||||
|
else paging.tlb.handler[index]->writed(address,val);
|
||||||
|
} else mem_unalignedwrited(address,val);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
INLINE bool mem_readb_checked_x86(PhysPt address, Bit8u * val) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
if (paging.tlb.read[index]) {
|
||||||
|
*val=host_readb(paging.tlb.read[index]+address);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
Bitu uval;
|
||||||
|
bool retval;
|
||||||
|
retval=paging.tlb.handler[index]->readb_checked(address, &uval);
|
||||||
|
*val=(Bit8u)uval;
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE bool mem_readw_checked_x86(PhysPt address, Bit16u * val) {
|
||||||
|
if ((address & 0xfff)<0xfff) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
if (paging.tlb.read[index]) {
|
||||||
|
*val=host_readw(paging.tlb.read[index]+address);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
Bitu uval;
|
||||||
|
bool retval;
|
||||||
|
retval=paging.tlb.handler[index]->readw_checked(address, &uval);
|
||||||
|
*val=(Bit16u)uval;
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
} else return mem_unalignedreadw_checked_x86(address, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
INLINE bool mem_readd_checked_x86(PhysPt address, Bit32u * val) {
|
||||||
|
if ((address & 0xfff)<0xffd) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
if (paging.tlb.read[index]) {
|
||||||
|
*val=host_readd(paging.tlb.read[index]+address);
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
Bitu uval;
|
||||||
|
bool retval;
|
||||||
|
retval=paging.tlb.handler[index]->readd_checked(address, &uval);
|
||||||
|
*val=(Bit32u)uval;
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
} else return mem_unalignedreadd_checked_x86(address, val);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE bool mem_writeb_checked_x86(PhysPt address,Bit8u val) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
if (paging.tlb.write[index]) {
|
||||||
|
host_writeb(paging.tlb.write[index]+address,val);
|
||||||
|
return false;
|
||||||
|
} else return paging.tlb.handler[index]->writeb_checked(address,val);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE bool mem_writew_checked_x86(PhysPt address,Bit16u val) {
|
||||||
|
if ((address & 0xfff)<0xfff) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
if (paging.tlb.write[index]) {
|
||||||
|
host_writew(paging.tlb.write[index]+address,val);
|
||||||
|
return false;
|
||||||
|
} else return paging.tlb.handler[index]->writew_checked(address,val);
|
||||||
|
} else return mem_unalignedwritew_checked_x86(address,val);
|
||||||
|
}
|
||||||
|
|
||||||
|
INLINE bool mem_writed_checked_x86(PhysPt address,Bit32u val) {
|
||||||
|
if ((address & 0xfff)<0xffd) {
|
||||||
|
Bitu index=(address>>12);
|
||||||
|
if (paging.tlb.write[index]) {
|
||||||
|
host_writed(paging.tlb.write[index]+address,val);
|
||||||
|
return false;
|
||||||
|
} else return paging.tlb.handler[index]->writed_checked(address,val);
|
||||||
|
} else return mem_unalignedwrited_checked_x86(address,val);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,8 +16,8 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __PIC_H
|
#ifndef DOSBOX_PIC_H
|
||||||
#define __PIC_H
|
#define DOSBOX_PIC_H
|
||||||
|
|
||||||
|
|
||||||
/* CPU Cycle Timing */
|
/* CPU Cycle Timing */
|
||||||
@ -60,4 +60,3 @@ void PIC_RemoveEvents(PIC_EventHandler handler);
|
|||||||
|
|
||||||
void PIC_SetIRQMask(Bitu irq, bool masked);
|
void PIC_SetIRQMask(Bitu irq, bool masked);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,19 +16,20 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __PROGRAM_H
|
#ifndef DOSBOX_PROGRAMS_H
|
||||||
#define __PROGRAM_H
|
#define DOSBOX_PROGRAMS_H
|
||||||
|
|
||||||
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_DOS_INC_H
|
||||||
#include "dos_inc.h"
|
#include "dos_inc.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_SETUP_H
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Program;
|
|
||||||
|
|
||||||
typedef void (PROGRAMS_Main)(Program * * make);
|
|
||||||
void PROGRAMS_MakeFile(char * name,PROGRAMS_Main * main);
|
|
||||||
|
|
||||||
class Program {
|
class Program {
|
||||||
public:
|
public:
|
||||||
Program();
|
Program();
|
||||||
@ -40,7 +41,7 @@ public:
|
|||||||
CommandLine * cmd;
|
CommandLine * cmd;
|
||||||
DOS_PSP * psp;
|
DOS_PSP * psp;
|
||||||
virtual void Run(void)=0;
|
virtual void Run(void)=0;
|
||||||
bool Program::GetEnvStr(const char * entry,std::string & result);
|
bool GetEnvStr(const char * entry,std::string & result);
|
||||||
bool GetEnvNum(Bitu num,std::string & result);
|
bool GetEnvNum(Bitu num,std::string & result);
|
||||||
Bitu GetEnvCount(void);
|
Bitu GetEnvCount(void);
|
||||||
bool SetEnv(const char * entry,const char * new_string);
|
bool SetEnv(const char * entry,const char * new_string);
|
||||||
@ -48,12 +49,7 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void SHELL_AddAutoexec(char * line,...);
|
typedef void (PROGRAMS_Main)(Program * * make);
|
||||||
|
void PROGRAMS_MakeFile(char * name,PROGRAMS_Main * main);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,10 +16,12 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined __REGS_H
|
#ifndef DOSBOX_REGS_H
|
||||||
#define __REGS_H
|
#define DOSBOX_REGS_H
|
||||||
|
|
||||||
#include <mem.h>
|
#ifndef DOSBOX_MEM_H
|
||||||
|
#include "mem.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FLAG_CF 0x00000001
|
#define FLAG_CF 0x00000001
|
||||||
#define FLAG_PF 0x00000004
|
#define FLAG_PF 0x00000004
|
||||||
@ -165,4 +167,3 @@ enum {
|
|||||||
#define reg_flags cpu_regs.flags
|
#define reg_flags cpu_regs.flags
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,17 +16,69 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __RENDER_H
|
#ifndef DOSBOX_RENDER_H
|
||||||
#define __RENDER_H
|
#define DOSBOX_RENDER_H
|
||||||
|
|
||||||
typedef void (* RENDER_Line_Handler)(const Bit8u * src);
|
#include "../src/gui/render_scalers.h"
|
||||||
|
|
||||||
void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,double ratio,bool dblw,bool dblh);
|
typedef struct {
|
||||||
|
struct {
|
||||||
|
Bit8u red;
|
||||||
|
Bit8u green;
|
||||||
|
Bit8u blue;
|
||||||
|
Bit8u unused;
|
||||||
|
} rgb[256];
|
||||||
|
union {
|
||||||
|
Bit16u b16[256];
|
||||||
|
Bit32u b32[256];
|
||||||
|
} lut;
|
||||||
|
bool changed;
|
||||||
|
Bit8u modified[256];
|
||||||
|
Bitu first;
|
||||||
|
Bitu last;
|
||||||
|
} RenderPal_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
struct {
|
||||||
|
Bitu width;
|
||||||
|
Bitu height;
|
||||||
|
Bitu bpp;
|
||||||
|
bool dblw,dblh;
|
||||||
|
double ratio;
|
||||||
|
float fps;
|
||||||
|
} src;
|
||||||
|
struct {
|
||||||
|
Bitu count;
|
||||||
|
Bitu max;
|
||||||
|
} frameskip;
|
||||||
|
struct {
|
||||||
|
Bitu size;
|
||||||
|
scalerMode_t inMode;
|
||||||
|
scalerMode_t outMode;
|
||||||
|
scalerOperation_t op;
|
||||||
|
bool clearCache;
|
||||||
|
ScalerLineHandler_t lineHandler;
|
||||||
|
ScalerLineHandler_t linePalHandler;
|
||||||
|
ScalerComplexHandler_t complexHandler;
|
||||||
|
Bitu blocks, lastBlock;
|
||||||
|
Bitu outPitch;
|
||||||
|
Bit8u *outWrite;
|
||||||
|
Bitu cachePitch;
|
||||||
|
Bit8u *cacheRead;
|
||||||
|
Bitu inHeight, inLine, outLine;
|
||||||
|
} scale;
|
||||||
|
RenderPal_t pal;
|
||||||
|
bool updating;
|
||||||
|
bool active;
|
||||||
|
bool aspect;
|
||||||
|
} 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);
|
bool RENDER_StartUpdate(void);
|
||||||
void RENDER_EndUpdate(void);
|
void RENDER_EndUpdate( bool fullUpdate );
|
||||||
void RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue);
|
void RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue);
|
||||||
extern RENDER_Line_Handler RENDER_DrawLine;
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,140 +16,284 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined __SERIALPORT_H
|
/* $Id: serialport.h,v 1.12 2006/02/09 11:47:48 qbix79 Exp $ */
|
||||||
#define __SERIALPORT_H
|
|
||||||
|
|
||||||
#include <assert.h>
|
#ifndef DOSBOX_SERIALPORT_H
|
||||||
|
#define DOSBOX_SERIALPORT_H
|
||||||
|
|
||||||
|
// Uncomment this for a lot of debug messages:
|
||||||
|
// #define SERIALPORT_DEBUGMSG
|
||||||
|
|
||||||
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_INOUT_H
|
||||||
|
#include "inout.h"
|
||||||
|
#endif
|
||||||
|
#ifndef DOSBOX_TIMER_H
|
||||||
|
#include "timer.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//If it's too high you overflow terminal clients buffers i think
|
|
||||||
#define QUEUE_SIZE 1024
|
|
||||||
|
|
||||||
// Serial port interface //
|
// Serial port interface //
|
||||||
|
|
||||||
#define MS_CTS 0x01
|
|
||||||
#define MS_DSR 0x02
|
|
||||||
#define MS_RI 0x04
|
|
||||||
#define MS_DCD 0x08
|
|
||||||
|
|
||||||
#define MC_DTR 0x1
|
|
||||||
#define MC_RTS 0x2
|
|
||||||
|
|
||||||
|
|
||||||
class CFifo {
|
|
||||||
public:
|
|
||||||
CFifo(Bitu _size) {
|
|
||||||
size=_size;
|
|
||||||
pos=used=0;
|
|
||||||
data=new Bit8u[size];
|
|
||||||
}
|
|
||||||
~CFifo() {
|
|
||||||
delete[] data;
|
|
||||||
}
|
|
||||||
INLINE Bitu left(void) {
|
|
||||||
return size-used;
|
|
||||||
}
|
|
||||||
INLINE Bitu inuse(void) {
|
|
||||||
return used;
|
|
||||||
}
|
|
||||||
void clear(void) {
|
|
||||||
used=pos=0;
|
|
||||||
}
|
|
||||||
bool isFull() {
|
|
||||||
return (used >= size);
|
|
||||||
}
|
|
||||||
void addb(Bit8u _val) {
|
|
||||||
assert(used<size);
|
|
||||||
Bitu where=pos+used;
|
|
||||||
if (where>=size) where-=size;
|
|
||||||
data[where]=_val;
|
|
||||||
used++;
|
|
||||||
}
|
|
||||||
void adds(Bit8u * _str,Bitu _len) {
|
|
||||||
assert((used+_len)<=size);
|
|
||||||
Bitu where=pos+used;
|
|
||||||
used+=_len;
|
|
||||||
while (_len--) {
|
|
||||||
if (where>=size) where-=size;
|
|
||||||
data[where++]=*_str++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Bit8u getb(void) {
|
|
||||||
if (!used) return data[pos];
|
|
||||||
Bitu where=pos;
|
|
||||||
if (++pos>=size) pos-=size;
|
|
||||||
used--;
|
|
||||||
return data[where];
|
|
||||||
}
|
|
||||||
void gets(Bit8u * _str,Bitu _len) {
|
|
||||||
assert(used>=_len);
|
|
||||||
used-=_len;
|
|
||||||
while (_len--) {
|
|
||||||
*_str++=data[pos];
|
|
||||||
if (++pos>=size) pos-=size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
Bit8u * data;
|
|
||||||
Bitu size,pos,used;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CSerial {
|
class CSerial {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CSerial() {
|
// 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);
|
||||||
|
|
||||||
}
|
TIMER_TickHandler TimerHnd;
|
||||||
// Constructor takes base port (0x3f0, 0x2f0, 0x2e0, etc.), IRQ, and initial bps //
|
|
||||||
CSerial (Bit16u initbase, Bit8u initirq, Bit32u initbps);
|
|
||||||
virtual ~CSerial();
|
virtual ~CSerial();
|
||||||
|
void InstallTimerHandler(TIMER_TickHandler);
|
||||||
|
|
||||||
void write_reg(Bitu reg, Bitu val);
|
IO_ReadHandleObject ReadHandler[8];
|
||||||
Bitu read_reg(Bitu reg);
|
IO_WriteHandleObject WriteHandler[8];
|
||||||
|
|
||||||
void SetModemStatus(Bit8u status);
|
void Timer(void);
|
||||||
virtual bool CanRecv(void)=0;
|
virtual void Timer2(void)=0;
|
||||||
virtual bool CanSend(void)=0;
|
|
||||||
virtual void Send(Bit8u val)=0;
|
|
||||||
virtual Bit8u Recv(Bit8u val)=0;
|
|
||||||
virtual void Timer(void);
|
|
||||||
|
|
||||||
void checkint(void);
|
|
||||||
|
|
||||||
Bitu base;
|
Bitu base;
|
||||||
Bitu irq;
|
Bitu irq;
|
||||||
Bitu bps;
|
|
||||||
Bit8u mctrl;
|
|
||||||
|
|
||||||
CFifo *rqueue;
|
bool getDTR();
|
||||||
CFifo *tqueue;
|
bool getRTS();
|
||||||
|
|
||||||
|
bool getRI();
|
||||||
|
bool getCD();
|
||||||
|
bool getDSR();
|
||||||
|
bool getCTS();
|
||||||
|
|
||||||
|
void setRI(bool value);
|
||||||
|
void setDSR(bool value);
|
||||||
|
void setCD(bool value);
|
||||||
|
void setCTS(bool value);
|
||||||
|
|
||||||
|
void Write_THR(Bit8u data);
|
||||||
|
Bitu Read_RHR();
|
||||||
|
Bitu Read_IER();
|
||||||
|
void Write_IER(Bit8u data);
|
||||||
|
Bitu Read_ISR();
|
||||||
|
Bitu Read_LCR();
|
||||||
|
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);
|
||||||
|
|
||||||
|
// If a byte comes from wherever(loopback or real port or maybe
|
||||||
|
// that softmodem thingy), put it in here.
|
||||||
|
void receiveByte(Bit8u data);
|
||||||
|
|
||||||
|
// If an error was received, put it here (in LSR register format)
|
||||||
|
void receiveError(Bit8u errorword);
|
||||||
|
|
||||||
|
// connected device checks, if port can receive data:
|
||||||
|
bool CanReceiveByte();
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
// CSerial requests an update of the input lines
|
||||||
|
virtual void updateMSR()=0;
|
||||||
|
|
||||||
|
// 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:
|
private:
|
||||||
void UpdateBaudrate(void);
|
|
||||||
bool FIFOenabled;
|
|
||||||
Bit8u FIFOsize;
|
|
||||||
bool dotxint;
|
|
||||||
|
|
||||||
Bit8u scratch;
|
// I used this spec: http://www.exar.com/products/st16c450v420.pdf
|
||||||
Bit8u dlab;
|
|
||||||
Bit8u divisor_lsb;
|
void changeMSR_Loopback(Bit8u data);
|
||||||
Bit8u divisor_msb;
|
|
||||||
Bit8u local_loopback;
|
void WriteRealIER(Bit8u data);
|
||||||
Bit8u iir;
|
// reason for an interrupt has occured - functions triggers interrupt
|
||||||
Bit8u ier;
|
// if it is enabled and no higher-priority irq pending
|
||||||
Bit8u mstatus;
|
void rise(Bit8u priority);
|
||||||
|
|
||||||
|
// clears the pending interrupt
|
||||||
|
void clear(Bit8u priority);
|
||||||
|
|
||||||
|
#define ERROR_PRIORITY 4 // overrun, parity error, frame error, break
|
||||||
|
#define RX_PRIORITY 1 // a byte has been received
|
||||||
|
#define TX_PRIORITY 2 // tx buffer has become empty
|
||||||
|
#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
|
||||||
|
|
||||||
|
Bit8u RHR; // r Receive Holding Register, also LSB of Divisor Latch (r/w)
|
||||||
|
#define RHR_OFFSET 0
|
||||||
|
// Data: whole byte
|
||||||
|
|
||||||
|
Bit8u THR; // w Transmit Holding Register
|
||||||
|
#define THR_OFFSET 0
|
||||||
|
// Data: whole byte
|
||||||
|
|
||||||
|
Bit8u IER; // r/w Interrupt Enable Register, also MSB of Divisor Latch (r/w)
|
||||||
|
#define IER_OFFSET 1
|
||||||
|
// Data:
|
||||||
|
// bit0 receive holding register
|
||||||
|
// bit1 transmit holding register
|
||||||
|
// bit2 receive line status interrupt
|
||||||
|
// bit3 modem status interrupt
|
||||||
|
|
||||||
|
#define RHR_INT_Enable_MASK 0x1
|
||||||
|
#define THR_INT_Enable_MASK 0x2
|
||||||
|
#define Receive_Line_INT_Enable_MASK 0x4
|
||||||
|
#define Modem_Status_INT_Enable_MASK 0x8
|
||||||
|
|
||||||
|
Bit8u ISR; // r Interrupt Status Register
|
||||||
|
#define ISR_OFFSET 2
|
||||||
|
|
||||||
|
#define ISR_CLEAR_VAL 0x1
|
||||||
|
#define ISR_ERROR_VAL 0x6
|
||||||
|
#define ISR_RX_VAL 0x4
|
||||||
|
#define ISR_TX_VAL 0x2
|
||||||
|
#define ISR_MSR_VAL 0x0
|
||||||
|
public:
|
||||||
|
Bit8u LCR; // r/w Line Control Register
|
||||||
|
private:
|
||||||
|
#define LCR_OFFSET 3
|
||||||
|
// bit0: word length bit0
|
||||||
|
// bit1: word length bit1
|
||||||
|
// bit2: stop bits
|
||||||
|
// bit3: parity enable
|
||||||
|
// bit4: even parity
|
||||||
|
// bit5: set parity
|
||||||
|
// bit6: set break
|
||||||
|
// bit7: divisor latch enable
|
||||||
|
|
||||||
|
|
||||||
|
#define LCR_BREAK_MASK 0x40
|
||||||
|
#define LCR_DIVISOR_Enable_MASK 0x80
|
||||||
|
#define LCR_PORTCONFIG_MASK 0x3F
|
||||||
|
|
||||||
|
#define LCR_PARITY_NONE 0x0
|
||||||
|
#define LCR_PARITY_ODD 0x8
|
||||||
|
#define LCR_PARITY_EVEN 0x18
|
||||||
|
#define LCR_PARITY_MARK 0x28
|
||||||
|
#define LCR_PARITY_SPACE 0x38
|
||||||
|
|
||||||
|
#define LCR_DATABITS_5 0x0
|
||||||
|
#define LCR_DATABITS_6 0x1
|
||||||
|
#define LCR_DATABITS_7 0x2
|
||||||
|
#define LCR_DATABITS_8 0x3
|
||||||
|
|
||||||
|
#define LCR_STOPBITS_1 0x0
|
||||||
|
#define LCR_STOPBITS_MORE_THAN_1 0x4
|
||||||
|
|
||||||
|
Bit8u MCR; // r/w Modem Control Register
|
||||||
|
#define MCR_OFFSET 4
|
||||||
|
// bit0: DTR
|
||||||
|
// bit1: RTS
|
||||||
|
// bit2: OP1
|
||||||
|
// bit3: OP2
|
||||||
|
// 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
|
||||||
|
|
||||||
|
Bit8u LSR; // r Line Status Register
|
||||||
|
#define LSR_OFFSET 5
|
||||||
|
|
||||||
|
#define LSR_RX_DATA_READY_MASK 0x1
|
||||||
|
#define LSR_OVERRUN_ERROR_MASK 0x2
|
||||||
|
#define LSR_PARITY_ERROR_MASK 0x4
|
||||||
|
#define LSR_FRAMING_ERROR_MASK 0x8
|
||||||
|
#define LSR_RX_BREAK_MASK 0x10
|
||||||
|
#define LSR_TX_HOLDING_EMPTY_MASK 0x20
|
||||||
|
#define LSR_TX_EMPTY_MASK 0x40
|
||||||
|
|
||||||
|
#define LSR_ERROR_MASK 0x1e
|
||||||
|
|
||||||
|
|
||||||
|
Bit8u MSR; // r Modem Status Register
|
||||||
|
#define MSR_OFFSET 6
|
||||||
|
// bit0: deltaCTS
|
||||||
|
// bit1: deltaDSR
|
||||||
|
// bit2: deltaRI
|
||||||
|
// bit3: deltaCD
|
||||||
|
// bit4: CTS
|
||||||
|
// bit5: DSR
|
||||||
|
// bit6: RI
|
||||||
|
// bit7: CD
|
||||||
|
|
||||||
|
#define MSR_delta_MASK 0xf
|
||||||
|
#define MSR_LINE_MASK 0xf0
|
||||||
|
|
||||||
|
#define MSR_dCTS_MASK 0x1
|
||||||
|
#define MSR_dDSR_MASK 0x2
|
||||||
|
#define MSR_dRI_MASK 0x4
|
||||||
|
#define MSR_dCD_MASK 0x8
|
||||||
|
#define MSR_CTS_MASK 0x10
|
||||||
|
#define MSR_DSR_MASK 0x20
|
||||||
|
#define MSR_RI_MASK 0x40
|
||||||
|
#define MSR_CD_MASK 0x80
|
||||||
|
|
||||||
|
Bit8u SPR; // r/w Scratchpad Register
|
||||||
|
#define SPR_OFFSET 7
|
||||||
|
|
||||||
|
|
||||||
|
// For loopback purposes...
|
||||||
|
bool loopback_pending;
|
||||||
|
Bit8u loopback_data;
|
||||||
|
void transmitLoopbackByte(Bit8u val);
|
||||||
|
|
||||||
|
// 16C550 (FIFO)
|
||||||
|
// TODO
|
||||||
|
//Bit8u FCR; // FIFO Control Register
|
||||||
|
|
||||||
Bit8u linectrl;
|
|
||||||
Bit8u errors;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <list>
|
#define COM1_BASE 0x3f8
|
||||||
|
#define COM2_BASE 0x2f8
|
||||||
typedef std::list<CSerial *> CSerialList;
|
#define COM3_BASE 0x3e8
|
||||||
typedef std::list<CSerial *>::iterator CSerial_it;
|
#define COM4_BASE 0x2e8
|
||||||
|
|
||||||
extern CSerialList seriallist;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
116
include/setup.h
116
include/setup.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,16 +16,18 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: setup.h,v 1.16 2004/08/04 09:12:51 qbix79 Exp $ */
|
/* $Id: setup.h,v 1.22 2006/02/09 11:47:48 qbix79 Exp $ */
|
||||||
|
|
||||||
#ifndef _SETUP_H_
|
#ifndef DOSBOX_SETUP_H
|
||||||
#define _SETUP_H_
|
#define DOSBOX_SETUP_H
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning ( disable : 4786 )
|
#pragma warning ( disable : 4786 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef DOSBOX_CROSS_H
|
||||||
#include "cross.h"
|
#include "cross.h"
|
||||||
|
#endif
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
@ -42,6 +44,7 @@ public:
|
|||||||
bool FindCommand(unsigned int which,std::string & value);
|
bool FindCommand(unsigned int which,std::string & value);
|
||||||
bool FindStringBegin(char * begin,std::string & value, bool remove=false);
|
bool FindStringBegin(char * begin,std::string & value, bool remove=false);
|
||||||
bool FindStringRemain(char * name,std::string & value);
|
bool FindStringRemain(char * name,std::string & value);
|
||||||
|
bool GetStringRemain(std::string & value);
|
||||||
unsigned int GetCount(void);
|
unsigned int GetCount(void);
|
||||||
private:
|
private:
|
||||||
typedef std::list<std::string>::iterator cmd_it;
|
typedef std::list<std::string>::iterator cmd_it;
|
||||||
@ -63,16 +66,16 @@ public:
|
|||||||
Property(const char* _propname):propname(_propname) { }
|
Property(const char* _propname):propname(_propname) { }
|
||||||
virtual void SetValue(char* input)=0;
|
virtual void SetValue(char* input)=0;
|
||||||
virtual void GetValuestring(char* str)=0;
|
virtual void GetValuestring(char* str)=0;
|
||||||
Value GetValue() { return __value;}
|
Value GetValue() { return value;}
|
||||||
std::string propname;
|
|
||||||
Value __value;
|
|
||||||
virtual ~Property(){ }
|
virtual ~Property(){ }
|
||||||
|
std::string propname;
|
||||||
|
Value value;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Prop_int:public Property {
|
class Prop_int:public Property {
|
||||||
public:
|
public:
|
||||||
Prop_int(const char* _propname, int _value):Property(_propname) {
|
Prop_int(const char* _propname, int _value):Property(_propname) {
|
||||||
__value._int=_value;
|
value._int=_value;
|
||||||
}
|
}
|
||||||
void SetValue(char* input);
|
void SetValue(char* input);
|
||||||
void GetValuestring(char* str);
|
void GetValuestring(char* str);
|
||||||
@ -81,7 +84,7 @@ public:
|
|||||||
class Prop_float:public Property {
|
class Prop_float:public Property {
|
||||||
public:
|
public:
|
||||||
Prop_float(const char* _propname, float _value):Property(_propname){
|
Prop_float(const char* _propname, float _value):Property(_propname){
|
||||||
__value._float=_value;
|
value._float=_value;
|
||||||
}
|
}
|
||||||
void SetValue(char* input);
|
void SetValue(char* input);
|
||||||
void GetValuestring(char* str);
|
void GetValuestring(char* str);
|
||||||
@ -91,7 +94,7 @@ public:
|
|||||||
class Prop_bool:public Property {
|
class Prop_bool:public Property {
|
||||||
public:
|
public:
|
||||||
Prop_bool(const char* _propname, bool _value):Property(_propname) {
|
Prop_bool(const char* _propname, bool _value):Property(_propname) {
|
||||||
__value._bool=_value;
|
value._bool=_value;
|
||||||
}
|
}
|
||||||
void SetValue(char* input);
|
void SetValue(char* input);
|
||||||
void GetValuestring(char* str);
|
void GetValuestring(char* str);
|
||||||
@ -101,10 +104,10 @@ public:
|
|||||||
class Prop_string:public Property{
|
class Prop_string:public Property{
|
||||||
public:
|
public:
|
||||||
Prop_string(const char* _propname, char* _value):Property(_propname) {
|
Prop_string(const char* _propname, char* _value):Property(_propname) {
|
||||||
__value._string=new std::string(_value);
|
value._string=new std::string(_value);
|
||||||
}
|
}
|
||||||
~Prop_string(){
|
~Prop_string(){
|
||||||
delete __value._string;
|
delete value._string;
|
||||||
}
|
}
|
||||||
void SetValue(char* input);
|
void SetValue(char* input);
|
||||||
void GetValuestring(char* str);
|
void GetValuestring(char* str);
|
||||||
@ -112,7 +115,7 @@ public:
|
|||||||
class Prop_hex:public Property {
|
class Prop_hex:public Property {
|
||||||
public:
|
public:
|
||||||
Prop_hex(const char* _propname, int _value):Property(_propname) {
|
Prop_hex(const char* _propname, int _value):Property(_propname) {
|
||||||
__value._hex=_value;
|
value._hex=_value;
|
||||||
}
|
}
|
||||||
void SetValue(char* input);
|
void SetValue(char* input);
|
||||||
~Prop_hex(){ }
|
~Prop_hex(){ }
|
||||||
@ -120,37 +123,43 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Section {
|
class Section {
|
||||||
public:
|
private:
|
||||||
Section(const char* _sectionname) { sectionname=_sectionname; }
|
|
||||||
virtual ~Section(){ ExecuteDestroy();}
|
|
||||||
|
|
||||||
typedef void (*SectionFunction)(Section*);
|
typedef void (*SectionFunction)(Section*);
|
||||||
void AddInitFunction(SectionFunction func) {initfunctions.push_back(func);}
|
/* Wrapper class around startup and shutdown functions. the variable
|
||||||
void AddDestroyFunction(SectionFunction func) {destroyfunctions.push_front(func);}
|
* canchange indicates it can be called on configuration changes */
|
||||||
void ExecuteInit() {
|
struct Function_wrapper {
|
||||||
typedef std::list<SectionFunction>::iterator func_it;
|
SectionFunction function;
|
||||||
for (func_it tel=initfunctions.begin(); tel!=initfunctions.end(); tel++){
|
bool canchange;
|
||||||
(*tel)(this);
|
Function_wrapper(SectionFunction _fun,bool _ch){
|
||||||
|
function=_fun;
|
||||||
|
canchange=_ch;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
void ExecuteDestroy() {
|
std::list<Function_wrapper> initfunctions;
|
||||||
typedef std::list<SectionFunction>::iterator func_it;
|
std::list<Function_wrapper> destroyfunctions;
|
||||||
for (func_it tel=destroyfunctions.begin(); tel!=destroyfunctions.end(); tel++){
|
|
||||||
(*tel)(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
std::list<SectionFunction> initfunctions;
|
|
||||||
std::list<SectionFunction> destroyfunctions;
|
|
||||||
virtual void HandleInputline(char * _line){}
|
|
||||||
virtual void PrintData(FILE* outfile) {}
|
|
||||||
std::string sectionname;
|
std::string sectionname;
|
||||||
|
public:
|
||||||
|
Section(const char* _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();}
|
||||||
|
|
||||||
|
virtual char* GetPropValue(const char* _property)=0;
|
||||||
|
virtual void HandleInputline(char * _line)=0;
|
||||||
|
virtual void PrintData(FILE* outfile)=0;
|
||||||
|
virtual ~Section() { /*Children must call executedestroy ! */}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class Section_prop:public Section {
|
class Section_prop:public Section {
|
||||||
|
private:
|
||||||
|
std::list<Property*> properties;
|
||||||
|
typedef std::list<Property*>::iterator it;
|
||||||
public:
|
public:
|
||||||
Section_prop(const char* _sectionname):Section(_sectionname){}
|
Section_prop(const char* _sectionname):Section(_sectionname){}
|
||||||
|
|
||||||
void Add_int(const char* _propname, int _value=0);
|
void Add_int(const char* _propname, int _value=0);
|
||||||
void Add_string(const char* _propname, char* _value=NULL);
|
void Add_string(const char* _propname, char* _value=NULL);
|
||||||
void Add_bool(const char* _propname, bool _value=false);
|
void Add_bool(const char* _propname, bool _value=false);
|
||||||
@ -164,30 +173,38 @@ class Section_prop:public Section {
|
|||||||
float Get_float(const char* _propname);
|
float Get_float(const char* _propname);
|
||||||
void HandleInputline(char *gegevens);
|
void HandleInputline(char *gegevens);
|
||||||
void PrintData(FILE* outfile);
|
void PrintData(FILE* outfile);
|
||||||
|
virtual char* GetPropValue(const char* _property);
|
||||||
std::list<Property*> properties;
|
//ExecuteDestroy should be here else the destroy functions use destroyed properties
|
||||||
typedef std::list<Property*>::iterator it;
|
virtual ~Section_prop();
|
||||||
};
|
};
|
||||||
|
|
||||||
class Section_line: public Section{
|
class Section_line: public Section{
|
||||||
public:
|
public:
|
||||||
Section_line(const char* _sectionname):Section(_sectionname){}
|
Section_line(const char* _sectionname):Section(_sectionname){}
|
||||||
|
~Section_line(){ExecuteDestroy(true);}
|
||||||
void HandleInputline(char* gegevens);
|
void HandleInputline(char* gegevens);
|
||||||
void PrintData(FILE* outfile);
|
void PrintData(FILE* outfile);
|
||||||
|
virtual char* GetPropValue(const char* _property);
|
||||||
std::string data;
|
std::string data;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Config{
|
class Config{
|
||||||
|
public:
|
||||||
|
CommandLine * cmdline;
|
||||||
|
private:
|
||||||
|
std::list<Section*> sectionlist;
|
||||||
|
typedef std::list<Section*>::iterator it;
|
||||||
|
typedef std::list<Section*>::reverse_iterator reverse_it;
|
||||||
|
void (* _start_function)(void);
|
||||||
public:
|
public:
|
||||||
Config(CommandLine * cmd){ cmdline=cmd;}
|
Config(CommandLine * cmd){ cmdline=cmd;}
|
||||||
~Config();
|
~Config();
|
||||||
CommandLine * cmdline;
|
|
||||||
|
|
||||||
Section * AddSection(const char * _name,void (*_initfunction)(Section*));
|
|
||||||
Section_line * AddSection_line(const char * _name,void (*_initfunction)(Section*));
|
Section_line * AddSection_line(const char * _name,void (*_initfunction)(Section*));
|
||||||
Section_prop * AddSection_prop(const char * _name,void (*_initfunction)(Section*));
|
Section_prop * AddSection_prop(const char * _name,void (*_initfunction)(Section*),bool canchange=false);
|
||||||
|
|
||||||
Section* GetSection(const char* _sectionname);
|
Section* GetSection(const char* _sectionname);
|
||||||
|
Section* GetSectionFromProperty(const char* prop);
|
||||||
|
|
||||||
void SetStartUp(void (*_function)(void));
|
void SetStartUp(void (*_function)(void));
|
||||||
void Init();
|
void Init();
|
||||||
@ -196,12 +213,17 @@ public:
|
|||||||
void PrintConfig(const char* configfilename);
|
void PrintConfig(const char* configfilename);
|
||||||
bool ParseConfigFile(const char* configfilename);
|
bool ParseConfigFile(const char* configfilename);
|
||||||
void ParseEnv(char ** envp);
|
void ParseEnv(char ** envp);
|
||||||
|
|
||||||
std::list<Section*> sectionlist;
|
|
||||||
typedef std::list<Section*>::iterator it;
|
|
||||||
typedef std::list<Section*>::reverse_iterator reverse_it;
|
|
||||||
private:
|
|
||||||
void (* _start_function)(void);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Module_base {
|
||||||
|
/* Base for all hardware and software "devices" */
|
||||||
|
protected:
|
||||||
|
Section* m_configuration;
|
||||||
|
public:
|
||||||
|
Module_base(Section* configuration){m_configuration=configuration;};
|
||||||
|
// Module_base(Section* configuration, SaveState* state) {};
|
||||||
|
~Module_base(){/*LOG_MSG("executed")*/;};//Destructors are required
|
||||||
|
/* Returns true if succesful.*/
|
||||||
|
virtual bool Change_Config(Section* newconfig) {return false;} ;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,22 +16,18 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: shell.h,v 1.9 2004/11/13 12:06:39 qbix79 Exp $ */
|
/* $Id: shell.h,v 1.15 2006/02/09 11:47:48 qbix79 Exp $ */
|
||||||
|
|
||||||
#ifndef SHELL_H_
|
|
||||||
#define SHELL_H_
|
|
||||||
|
|
||||||
|
#ifndef DOSBOX_SHELL_H
|
||||||
|
#define DOSBOX_SHELL_H
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
#include "mem.h"
|
#endif
|
||||||
|
#ifndef DOSBOX_PROGRAMS_H
|
||||||
#include "programs.h"
|
#include "programs.h"
|
||||||
#include "dos_inc.h"
|
#endif
|
||||||
#include "regs.h"
|
|
||||||
#include "support.h"
|
|
||||||
#include "callback.h"
|
|
||||||
#include "setup.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
@ -40,6 +36,9 @@
|
|||||||
#define CMD_MAXCMDS 20
|
#define CMD_MAXCMDS 20
|
||||||
#define CMD_OLDSIZE 4096
|
#define CMD_OLDSIZE 4096
|
||||||
extern Bitu call_shellstop;
|
extern Bitu call_shellstop;
|
||||||
|
/* first_shell is used to add and delete stuff from the shell env
|
||||||
|
* by "external" programs. (config) */
|
||||||
|
extern Program * first_shell;
|
||||||
class DOS_Shell;
|
class DOS_Shell;
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +74,9 @@ public:
|
|||||||
void InputCommand(char * line);
|
void InputCommand(char * line);
|
||||||
void ShowPrompt();
|
void ShowPrompt();
|
||||||
void DoCommand(char * cmd);
|
void DoCommand(char * cmd);
|
||||||
void Execute(char * name,char * args);
|
bool Execute(char * name,char * args);
|
||||||
|
/* Checks if it matches a hardware-property */
|
||||||
|
bool CheckConfig(char* cmd,char*line);
|
||||||
/* Some internal used functions */
|
/* Some internal used functions */
|
||||||
char * Which(char * name);
|
char * Which(char * name);
|
||||||
/* Some supported commands */
|
/* Some supported commands */
|
||||||
@ -144,4 +145,20 @@ static inline char* ExpandDot(char*args, char* buffer) {
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Object to manage lines in the autoexec.bat The lines get removed from
|
||||||
|
* the file if the object gets destroyed. The environment is updated
|
||||||
|
* as well if the line set a a variable */
|
||||||
|
class AutoexecObject{
|
||||||
|
private:
|
||||||
|
bool installed;
|
||||||
|
char buf[256];
|
||||||
|
public:
|
||||||
|
AutoexecObject():installed(false){};
|
||||||
|
void Install(char * line,...);
|
||||||
|
void InstallBefore(char* line, ...);
|
||||||
|
~AutoexecObject();
|
||||||
|
private:
|
||||||
|
void CreateAutoexec(void);
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined __SUPPORT_H
|
#ifndef DOSBOX_SUPPORT_H
|
||||||
#define __SUPPORT_H
|
#define DOSBOX_SUPPORT_H
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (_MSC_VER) /* MS Visual C++ */
|
#if defined (_MSC_VER) /* MS Visual C++ */
|
||||||
#define strcasecmp(a,b) stricmp(a,b)
|
#define strcasecmp(a,b) stricmp(a,b)
|
||||||
@ -33,6 +34,8 @@
|
|||||||
//#define nocasestrcmp(a,b) stricmp(a,b)
|
//#define nocasestrcmp(a,b) stricmp(a,b)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define safe_strncpy(a,b,n) do { strncpy((a),(b),(n)-1); (a)[(n)-1] = 0; } while (0)
|
||||||
|
|
||||||
#ifdef HAVE_STRINGS_H
|
#ifdef HAVE_STRINGS_H
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
@ -62,4 +65,3 @@ INLINE char * lowcase(char * str) {
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,8 +16,9 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _TIMER_H_
|
#ifndef DOSBOX_TIMER_H
|
||||||
#define _TIMER_H_
|
#define DOSBOX_TIMER_H
|
||||||
|
|
||||||
/* underlying clock rate in HZ */
|
/* underlying clock rate in HZ */
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
@ -35,4 +36,3 @@ void TIMER_DelTickHandler(TIMER_TickHandler handler);
|
|||||||
void TIMER_AddTick(void);
|
void TIMER_AddTick(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,23 +16,26 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef VGA_H_
|
#ifndef DOSBOX_VGA_H
|
||||||
#define VGA_H_
|
#define DOSBOX_VGA_H
|
||||||
|
|
||||||
#include <mem.h>
|
#ifndef DOSBOX_DOSBOX_H
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class PageHandler;
|
||||||
|
|
||||||
enum VGAModes {
|
enum VGAModes {
|
||||||
M_CGA2, M_CGA4,
|
M_CGA2, M_CGA4,
|
||||||
M_EGA16,
|
M_EGA, M_VGA,
|
||||||
M_VGA,
|
M_LIN4, M_LIN8, M_LIN15, M_LIN16, M_LIN32,
|
||||||
M_LIN8,
|
|
||||||
M_TEXT,
|
M_TEXT,
|
||||||
M_HERC_GFX, M_HERC_TEXT,
|
M_HERC_GFX, M_HERC_TEXT,
|
||||||
M_CGA16, M_TANDY2, M_TANDY4, M_TANDY16, M_TANDY_TEXT,
|
M_CGA16, M_TANDY2, M_TANDY4, M_TANDY16, M_TANDY_TEXT,
|
||||||
M_ERROR,
|
M_ERROR,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define CLK_25 25175
|
#define CLK_25 25175
|
||||||
#define CLK_28 28322
|
#define CLK_28 28322
|
||||||
|
|
||||||
@ -61,6 +64,7 @@ typedef struct {
|
|||||||
/* Some other screen related variables */
|
/* Some other screen related variables */
|
||||||
Bitu line_compare;
|
Bitu line_compare;
|
||||||
bool chained; /* Enable or Disabled Chain 4 Mode */
|
bool chained; /* Enable or Disabled Chain 4 Mode */
|
||||||
|
bool compatible_chain4;
|
||||||
|
|
||||||
/* Pixel Scrolling */
|
/* Pixel Scrolling */
|
||||||
Bit8u pel_panning; /* Amount of pixels to skip when starting horizontal line */
|
Bit8u pel_panning; /* Amount of pixels to skip when starting horizontal line */
|
||||||
@ -84,7 +88,6 @@ typedef struct {
|
|||||||
Bit32u full_not_enable_set_reset;
|
Bit32u full_not_enable_set_reset;
|
||||||
Bit32u full_enable_set_reset;
|
Bit32u full_enable_set_reset;
|
||||||
Bit32u full_enable_and_set_reset;
|
Bit32u full_enable_and_set_reset;
|
||||||
|
|
||||||
} VGA_Config;
|
} VGA_Config;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -194,6 +197,8 @@ typedef struct {
|
|||||||
Bit8u gfx_control;
|
Bit8u gfx_control;
|
||||||
Bit8u palette_mask;
|
Bit8u palette_mask;
|
||||||
Bit8u border_color;
|
Bit8u border_color;
|
||||||
|
bool is_32k_mode;
|
||||||
|
bool pcjr_flipflop;
|
||||||
} VGA_TANDY;
|
} VGA_TANDY;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -289,8 +294,18 @@ union VGA_Memory {
|
|||||||
VGA_Latch latched[512*1024];
|
VGA_Latch latched[512*1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
Bit32u page;
|
||||||
|
Bit32u addr;
|
||||||
|
Bit32u mask;
|
||||||
|
PageHandler *handler;
|
||||||
|
} VGA_LFB;
|
||||||
|
|
||||||
|
#define VGA_CHANGE_SHIFT 9
|
||||||
|
typedef Bit8u VGA_Changed[(2*1024*1024) >> VGA_CHANGE_SHIFT];
|
||||||
typedef struct {
|
typedef struct {
|
||||||
VGAModes mode; /* The mode the vga system is in */
|
VGAModes mode; /* The mode the vga system is in */
|
||||||
|
VGAModes lastmode;
|
||||||
Bit8u misc_output;
|
Bit8u misc_output;
|
||||||
VGA_Draw draw;
|
VGA_Draw draw;
|
||||||
VGA_Config config;
|
VGA_Config config;
|
||||||
@ -307,6 +322,9 @@ typedef struct {
|
|||||||
VGA_TANDY tandy;
|
VGA_TANDY tandy;
|
||||||
VGA_OTHER other;
|
VGA_OTHER other;
|
||||||
VGA_Memory mem;
|
VGA_Memory mem;
|
||||||
|
VGA_LFB lfb;
|
||||||
|
VGA_Changed changed;
|
||||||
|
Bit8u * gfxmem_start;
|
||||||
} VGA_Type;
|
} VGA_Type;
|
||||||
|
|
||||||
|
|
||||||
@ -343,6 +361,15 @@ void VGA_StartUpdateLFB(void);
|
|||||||
void VGA_SetBlinking(Bitu enabled);
|
void VGA_SetBlinking(Bitu enabled);
|
||||||
void VGA_SetCGA2Table(Bit8u val0,Bit8u val1);
|
void VGA_SetCGA2Table(Bit8u val0,Bit8u val1);
|
||||||
void VGA_SetCGA4Table(Bit8u val0,Bit8u val1,Bit8u val2,Bit8u val3);
|
void VGA_SetCGA4Table(Bit8u val0,Bit8u val1,Bit8u val2,Bit8u val3);
|
||||||
|
void VGA_ActivateHardwareCursor(void);
|
||||||
|
void VGA_KillDrawing(void);
|
||||||
|
|
||||||
|
/* S3 Functions */
|
||||||
|
Bitu SVGA_S3_GetClock(void);
|
||||||
|
void SVGA_S3_WriteCRTC(Bitu reg,Bitu val,Bitu iolen);
|
||||||
|
Bitu SVGA_S3_ReadCRTC(Bitu reg,Bitu iolen);
|
||||||
|
void SVGA_S3_WriteSEQ(Bitu reg,Bitu val,Bitu iolen);
|
||||||
|
Bitu SVGA_S3_ReadSEQ(Bitu reg,Bitu iolen);
|
||||||
|
|
||||||
extern VGA_Type vga;
|
extern VGA_Type vga;
|
||||||
|
|
||||||
@ -350,6 +377,7 @@ extern Bit32u ExpandTable[256];
|
|||||||
extern Bit32u FillTable[16];
|
extern Bit32u FillTable[16];
|
||||||
extern Bit32u CGA_2_Table[16];
|
extern Bit32u CGA_2_Table[16];
|
||||||
extern Bit32u CGA_4_Table[256];
|
extern Bit32u CGA_4_Table[256];
|
||||||
|
extern Bit32u CGA_4_HiRes_Table[256];
|
||||||
extern Bit32u CGA_16_Table[256];
|
extern Bit32u CGA_16_Table[256];
|
||||||
extern Bit32u TXT_Font_Table[16];
|
extern Bit32u TXT_Font_Table[16];
|
||||||
extern Bit32u TXT_FG_Table[16];
|
extern Bit32u TXT_FG_Table[16];
|
||||||
@ -359,4 +387,3 @@ extern Bit32u Expand16BigTable[0x10000];
|
|||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,10 +16,16 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __VIDEO_H
|
#ifndef DOSBOX_VIDEO_H
|
||||||
#define __VIDEO_H
|
#define DOSBOX_VIDEO_H
|
||||||
|
|
||||||
typedef void (* GFX_ResetCallBack)(void);
|
typedef enum {
|
||||||
|
GFX_CallBackReset,
|
||||||
|
GFX_CallBackStop,
|
||||||
|
GFX_CallBackRedraw,
|
||||||
|
} GFX_CallBackFunctions_t;
|
||||||
|
|
||||||
|
typedef void (*GFX_CallBack_t)( GFX_CallBackFunctions_t function );
|
||||||
|
|
||||||
struct GFX_PalEntry {
|
struct GFX_PalEntry {
|
||||||
Bit8u r;
|
Bit8u r;
|
||||||
@ -28,43 +34,38 @@ struct GFX_PalEntry {
|
|||||||
Bit8u unused;
|
Bit8u unused;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define CAN_8 0x0001
|
#define GFX_CAN_8 0x0001
|
||||||
#define CAN_16 0x0002
|
#define GFX_CAN_15 0x0002
|
||||||
#define CAN_32 0x0004
|
#define GFX_CAN_16 0x0004
|
||||||
|
#define GFX_CAN_32 0x0008
|
||||||
|
|
||||||
#define CAN_ALL (CAN_8|CAN_16|CAN_32)
|
#define GFX_LOVE_8 0x0010
|
||||||
|
#define GFX_LOVE_15 0x0020
|
||||||
|
#define GFX_LOVE_16 0x0040
|
||||||
|
#define GFX_LOVE_32 0x0080
|
||||||
|
|
||||||
#define LOVE_8 0x0010
|
#define GFX_RGBONLY 0x0100
|
||||||
#define LOVE_16 0x0020
|
|
||||||
#define LOVE_32 0x0040
|
|
||||||
|
|
||||||
#define NEED_RGB 0x0100
|
#define GFX_SCALING 0x1000
|
||||||
#define DONT_ASPECT 0x0200
|
#define GFX_HARDWARE 0x2000
|
||||||
|
|
||||||
#define HAVE_SCALING 0x1000
|
#define GFX_CAN_RANDOM 0x4000 //If the interface can also do random access surface
|
||||||
|
|
||||||
|
|
||||||
enum GFX_Modes {
|
|
||||||
GFX_8,GFX_15,GFX_16,GFX_32,GFX_NONE,
|
|
||||||
};
|
|
||||||
|
|
||||||
void GFX_Events(void);
|
void GFX_Events(void);
|
||||||
void GFX_SetPalette(Bitu start,Bitu count,GFX_PalEntry * entries);
|
void GFX_SetPalette(Bitu start,Bitu count,GFX_PalEntry * entries);
|
||||||
Bitu GFX_GetBestMode(Bitu flags);
|
Bitu GFX_GetBestMode(Bitu flags);
|
||||||
|
|
||||||
Bitu GFX_GetRGB(Bit8u red,Bit8u green,Bit8u blue);
|
Bitu GFX_GetRGB(Bit8u red,Bit8u green,Bit8u blue);
|
||||||
GFX_Modes GFX_SetSize(Bitu width,Bitu height,Bitu flags,double scalex,double scaley,GFX_ResetCallBack cb_reset);
|
Bitu GFX_SetSize(Bitu width,Bitu height,Bitu flags,double scalex,double scaley,GFX_CallBack_t cb);
|
||||||
|
|
||||||
void GFX_ResetScreen(void);
|
void GFX_ResetScreen(void);
|
||||||
void GFX_Start(void);
|
void GFX_Start(void);
|
||||||
void GFX_Stop(void);
|
void GFX_Stop(void);
|
||||||
void GFX_SwitchFullScreen(void);
|
void GFX_SwitchFullScreen(void);
|
||||||
bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch);
|
bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch);
|
||||||
void GFX_EndUpdate(void);
|
void GFX_EndUpdate( const Bit16u *changedLines );
|
||||||
|
|
||||||
/* Mouse related */
|
/* Mouse related */
|
||||||
void GFX_CaptureMouse(void);
|
void GFX_CaptureMouse(void);
|
||||||
extern bool mouselocked; //true if mouse is confined to window
|
extern bool mouselocked; //true if mouse is confined to window
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# install - install a program, script, or datafile
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
scriptversion=2004-10-22.00
|
scriptversion=2004-09-10.20
|
||||||
|
|
||||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
@ -213,7 +213,7 @@ do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# This sed command emulates the dirname command.
|
# This sed command emulates the dirname command.
|
||||||
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
|
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||||
|
|
||||||
# Make sure that the destination directory exists.
|
# Make sure that the destination directory exists.
|
||||||
|
|
||||||
@ -226,8 +226,7 @@ do
|
|||||||
oIFS=$IFS
|
oIFS=$IFS
|
||||||
# Some sh's can't handle IFS=/ for some reason.
|
# Some sh's can't handle IFS=/ for some reason.
|
||||||
IFS='%'
|
IFS='%'
|
||||||
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||||
shift
|
|
||||||
IFS=$oIFS
|
IFS=$oIFS
|
||||||
|
|
||||||
pathcomp=
|
pathcomp=
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
AM_CPPFLAGS = -I$(top_srcdir)/include
|
||||||
|
|
||||||
SUBDIRS = cpu debug dos fpu gui hardware ints misc shell platform
|
SUBDIRS = cpu debug dos fpu gui hardware libs ints misc shell platform
|
||||||
|
|
||||||
bin_PROGRAMS = dosbox
|
bin_PROGRAMS = dosbox
|
||||||
|
|
||||||
dosbox_SOURCES = dosbox.cpp
|
dosbox_SOURCES = dosbox.cpp
|
||||||
dosbox_LDADD = cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a hardware/libhardware.a gui/libgui.a \
|
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
|
ints/libints.a misc/libmisc.a shell/libshell.a hardware/serialport/libserial.a
|
||||||
|
|
||||||
|
if HAVE_WINDRES
|
||||||
|
dosbox_LDADD += dosbox_ico.o
|
||||||
|
endif
|
||||||
|
|
||||||
|
EXTRA_DIST = dosbox.rc dosbox.ico
|
||||||
|
dosbox_ico.o: dosbox.rc dosbox.ico
|
||||||
|
$(WINDRES) dosbox.rc dosbox_ico.o
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -40,6 +40,7 @@ build_triplet = @build@
|
|||||||
host_triplet = @host@
|
host_triplet = @host@
|
||||||
target_triplet = @target@
|
target_triplet = @target@
|
||||||
bin_PROGRAMS = dosbox$(EXEEXT)
|
bin_PROGRAMS = dosbox$(EXEEXT)
|
||||||
|
@HAVE_WINDRES_TRUE@am__append_1 = dosbox_ico.o
|
||||||
subdir = src
|
subdir = src
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||||
@ -55,9 +56,11 @@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
|||||||
PROGRAMS = $(bin_PROGRAMS)
|
PROGRAMS = $(bin_PROGRAMS)
|
||||||
am_dosbox_OBJECTS = dosbox.$(OBJEXT)
|
am_dosbox_OBJECTS = dosbox.$(OBJEXT)
|
||||||
dosbox_OBJECTS = $(am_dosbox_OBJECTS)
|
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 \
|
dosbox_DEPENDENCIES = cpu/libcpu.a debug/libdebug.a dos/libdos.a \
|
||||||
fpu/libfpu.a hardware/libhardware.a gui/libgui.a \
|
fpu/libfpu.a hardware/libhardware.a gui/libgui.a \
|
||||||
ints/libints.a misc/libmisc.a shell/libshell.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)
|
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||||
am__depfiles_maybe = depfiles
|
am__depfiles_maybe = depfiles
|
||||||
@ -104,6 +107,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -129,10 +134,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
@ -175,11 +182,13 @@ target_cpu = @target_cpu@
|
|||||||
target_os = @target_os@
|
target_os = @target_os@
|
||||||
target_vendor = @target_vendor@
|
target_vendor = @target_vendor@
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/include
|
AM_CPPFLAGS = -I$(top_srcdir)/include
|
||||||
SUBDIRS = cpu debug dos fpu gui hardware ints misc shell platform
|
SUBDIRS = cpu debug dos fpu gui hardware libs ints misc shell platform
|
||||||
dosbox_SOURCES = dosbox.cpp
|
dosbox_SOURCES = dosbox.cpp
|
||||||
dosbox_LDADD = cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a hardware/libhardware.a gui/libgui.a \
|
dosbox_LDADD = cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a \
|
||||||
ints/libints.a misc/libmisc.a shell/libshell.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
|
||||||
all: all-recursive
|
all: all-recursive
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
@ -245,7 +254,8 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS)
|
|||||||
f=`echo "$$p" | \
|
f=`echo "$$p" | \
|
||||||
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||||
for opt in --help --version; do \
|
for opt in --help --version; do \
|
||||||
if "$(DESTDIR)$(bindir)/$$f" $$opt > c$${pid}_.out 2> c$${pid}_.err \
|
if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
|
||||||
|
2>c$${pid}_.err </dev/null \
|
||||||
&& test -n "`cat c$${pid}_.out`" \
|
&& test -n "`cat c$${pid}_.out`" \
|
||||||
&& test -z "`cat c$${pid}_.err`"; then :; \
|
&& test -z "`cat c$${pid}_.err`"; then :; \
|
||||||
else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
|
else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
|
||||||
@ -285,7 +295,13 @@ uninstall-info-am:
|
|||||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||||
# (2) otherwise, pass the desired values on the `make' command line.
|
# (2) otherwise, pass the desired values on the `make' command line.
|
||||||
$(RECURSIVE_TARGETS):
|
$(RECURSIVE_TARGETS):
|
||||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
dot_seen=no; \
|
dot_seen=no; \
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
@ -297,7 +313,7 @@ $(RECURSIVE_TARGETS):
|
|||||||
local_target="$$target"; \
|
local_target="$$target"; \
|
||||||
fi; \
|
fi; \
|
||||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
|| eval $$failcom; \
|
||||||
done; \
|
done; \
|
||||||
if test "$$dot_seen" = "no"; then \
|
if test "$$dot_seen" = "no"; then \
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||||
@ -305,7 +321,13 @@ $(RECURSIVE_TARGETS):
|
|||||||
|
|
||||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||||
maintainer-clean-recursive:
|
maintainer-clean-recursive:
|
||||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
dot_seen=no; \
|
dot_seen=no; \
|
||||||
case "$@" in \
|
case "$@" in \
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||||
@ -326,7 +348,7 @@ maintainer-clean-recursive:
|
|||||||
local_target="$$target"; \
|
local_target="$$target"; \
|
||||||
fi; \
|
fi; \
|
||||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
|| eval $$failcom; \
|
||||||
done && test -z "$$fail"
|
done && test -z "$$fail"
|
||||||
tags-recursive:
|
tags-recursive:
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
@ -537,6 +559,8 @@ uninstall-info: uninstall-info-recursive
|
|||||||
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
|
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
|
||||||
uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am
|
uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am
|
||||||
|
|
||||||
|
dosbox_ico.o: dosbox.rc dosbox.ico
|
||||||
|
$(WINDRES) dosbox.rc dosbox_ico.o
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# 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.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
.NOEXPORT:
|
.NOEXPORT:
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -109,6 +109,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -134,10 +136,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
@ -265,7 +269,13 @@ uninstall-info-am:
|
|||||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||||
# (2) otherwise, pass the desired values on the `make' command line.
|
# (2) otherwise, pass the desired values on the `make' command line.
|
||||||
$(RECURSIVE_TARGETS):
|
$(RECURSIVE_TARGETS):
|
||||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
dot_seen=no; \
|
dot_seen=no; \
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
target=`echo $@ | sed s/-recursive//`; \
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
@ -277,7 +287,7 @@ $(RECURSIVE_TARGETS):
|
|||||||
local_target="$$target"; \
|
local_target="$$target"; \
|
||||||
fi; \
|
fi; \
|
||||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
|| eval $$failcom; \
|
||||||
done; \
|
done; \
|
||||||
if test "$$dot_seen" = "no"; then \
|
if test "$$dot_seen" = "no"; then \
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||||
@ -285,7 +295,13 @@ $(RECURSIVE_TARGETS):
|
|||||||
|
|
||||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||||
maintainer-clean-recursive:
|
maintainer-clean-recursive:
|
||||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
@failcom='exit 1'; \
|
||||||
|
for f in x $$MAKEFLAGS; do \
|
||||||
|
case $$f in \
|
||||||
|
*=* | --[!k]*);; \
|
||||||
|
*k*) failcom='fail=yes';; \
|
||||||
|
esac; \
|
||||||
|
done; \
|
||||||
dot_seen=no; \
|
dot_seen=no; \
|
||||||
case "$@" in \
|
case "$@" in \
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||||
@ -306,7 +322,7 @@ maintainer-clean-recursive:
|
|||||||
local_target="$$target"; \
|
local_target="$$target"; \
|
||||||
fi; \
|
fi; \
|
||||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
|| eval $$failcom; \
|
||||||
done && test -z "$$fail"
|
done && test -z "$$fail"
|
||||||
tags-recursive:
|
tags-recursive:
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,28 +16,26 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: callback.cpp,v 1.22 2004/08/29 11:22:37 qbix79 Exp $ */
|
/* $Id: callback.cpp,v 1.31 2006/02/12 23:28:21 harekiet Exp $ */
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
#include "callback.h"
|
#include "callback.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "pic.h"
|
|
||||||
|
|
||||||
/* CallBack are located at 0xC800:0
|
/* CallBack are located at 0xC800:0
|
||||||
And they are 16 bytes each and you can define them to behave in certain ways like a
|
And they are 16 bytes each and you can define them to behave in certain ways like a
|
||||||
far return or and IRET
|
far return or and IRET
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
CallBack_Handler CallBack_Handlers[CB_MAX];
|
CallBack_Handler CallBack_Handlers[CB_MAX];
|
||||||
char* CallBack_Description[CB_MAX];
|
char* CallBack_Description[CB_MAX];
|
||||||
|
|
||||||
static Bitu call_stop,call_idle,call_default;
|
static Bitu call_stop,call_idle,call_default;
|
||||||
|
Bitu call_priv_io;
|
||||||
|
|
||||||
static Bitu illegal_handler(void) {
|
static Bitu illegal_handler(void) {
|
||||||
E_Exit("Illegal CallBack Called");
|
E_Exit("Illegal CallBack Called");
|
||||||
@ -55,6 +53,11 @@ Bitu CALLBACK_Allocate(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CALLBACK_DeAllocate(Bitu in) {
|
||||||
|
CallBack_Handlers[in]=&illegal_handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CALLBACK_Idle(void) {
|
void CALLBACK_Idle(void) {
|
||||||
/* this makes the cpu execute instructions to handle irq's and then come back */
|
/* this makes the cpu execute instructions to handle irq's and then come back */
|
||||||
Bitu oldIF=GETFLAG(IF);
|
Bitu oldIF=GETFLAG(IF);
|
||||||
@ -67,7 +70,8 @@ void CALLBACK_Idle(void) {
|
|||||||
reg_eip=oldeip;
|
reg_eip=oldeip;
|
||||||
SegSet16(cs,oldcs);
|
SegSet16(cs,oldcs);
|
||||||
SETFLAGBIT(IF,oldIF);
|
SETFLAGBIT(IF,oldIF);
|
||||||
if (CPU_Cycles>0) CPU_Cycles=0;
|
if (!CPU_CycleAuto && CPU_Cycles>0)
|
||||||
|
CPU_Cycles=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bitu default_handler(void) {
|
static Bitu default_handler(void) {
|
||||||
@ -104,8 +108,6 @@ void CALLBACK_RunRealInt(Bit8u intnum) {
|
|||||||
SegSet16(cs,oldcs);
|
SegSet16(cs,oldcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CALLBACK_SZF(bool val) {
|
void CALLBACK_SZF(bool val) {
|
||||||
Bit16u tempf=mem_readw(SegPhys(ss)+reg_sp+4) & 0xFFBF;
|
Bit16u tempf=mem_readw(SegPhys(ss)+reg_sp+4) & 0xFFBF;
|
||||||
Bit16u newZF=(val==true) << 6;
|
Bit16u newZF=(val==true) << 6;
|
||||||
@ -118,8 +120,7 @@ void CALLBACK_SCF(bool val) {
|
|||||||
mem_writew(SegPhys(ss)+reg_sp+4,(tempf | newCF));
|
mem_writew(SegPhys(ss)+reg_sp+4,(tempf | newCF));
|
||||||
};
|
};
|
||||||
|
|
||||||
void CALLBACK_SetDescription(Bitu nr, const char* descr)
|
void CALLBACK_SetDescription(Bitu nr, const char* descr) {
|
||||||
{
|
|
||||||
if (descr) {
|
if (descr) {
|
||||||
CallBack_Description[nr] = new char[strlen(descr)+1];
|
CallBack_Description[nr] = new char[strlen(descr)+1];
|
||||||
strcpy(CallBack_Description[nr],descr);
|
strcpy(CallBack_Description[nr],descr);
|
||||||
@ -127,8 +128,7 @@ void CALLBACK_SetDescription(Bitu nr, const char* descr)
|
|||||||
CallBack_Description[nr] = 0;
|
CallBack_Description[nr] = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* CALLBACK_GetDescription(Bitu nr)
|
const char* CALLBACK_GetDescription(Bitu nr) {
|
||||||
{
|
|
||||||
if (nr>=CB_MAX) return 0;
|
if (nr>=CB_MAX) return 0;
|
||||||
return CallBack_Description[nr];
|
return CallBack_Description[nr];
|
||||||
};
|
};
|
||||||
@ -155,44 +155,100 @@ bool CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,const char*
|
|||||||
phys_writew(CB_BASE+(callback<<4)+3,callback); //The immediate word
|
phys_writew(CB_BASE+(callback<<4)+3,callback); //The immediate word
|
||||||
phys_writeb(CB_BASE+(callback<<4)+5,(Bit8u)0xCF); //An IRET Instruction
|
phys_writeb(CB_BASE+(callback<<4)+5,(Bit8u)0xCF); //An IRET Instruction
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
E_Exit("CALLBACK:Setup:Illegal type %d",type);
|
E_Exit("CALLBACK:Setup:Illegal type %d",type);
|
||||||
|
|
||||||
}
|
}
|
||||||
CallBack_Handlers[callback]=handler;
|
CallBack_Handlers[callback]=handler;
|
||||||
CALLBACK_SetDescription(callback,descr);
|
CALLBACK_SetDescription(callback,descr);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CALLBACK_SetupAt(Bitu callback,CallBack_Handler handler,Bitu type,Bitu linearAddress,const char* descr) {
|
void CALLBACK_RemoveSetup(Bitu callback) {
|
||||||
if (callback>=CB_MAX) return false;
|
for (Bitu i = 0;i < 16;i++) {
|
||||||
|
phys_writeb(CB_BASE+(callback<<4)+i ,(Bit8u) 0x00);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Bitu CALLBACK_SetupExtra(Bitu callback, Bitu type, PhysPt physAddress) {
|
||||||
|
if (callback>=CB_MAX)
|
||||||
|
return 0;
|
||||||
switch (type) {
|
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:
|
case CB_RETF:
|
||||||
mem_writeb(linearAddress+0,(Bit8u)0xFE); //GRP 4
|
phys_writeb(physAddress+0,(Bit8u)0xFE); //GRP 4
|
||||||
mem_writeb(linearAddress+1,(Bit8u)0x38); //Extra Callback instruction
|
phys_writeb(physAddress+1,(Bit8u)0x38); //Extra Callback instruction
|
||||||
mem_writew(linearAddress+2, callback); //The immediate word
|
phys_writew(physAddress+2, callback); //The immediate word
|
||||||
mem_writeb(linearAddress+4,(Bit8u)0xCB); //A RETF Instruction
|
phys_writeb(physAddress+4,(Bit8u)0xCB); //A RETF Instruction
|
||||||
break;
|
return 5;
|
||||||
case CB_IRET:
|
case CB_IRET:
|
||||||
mem_writeb(linearAddress+0,(Bit8u)0xFE); //GRP 4
|
phys_writeb(physAddress+0,(Bit8u)0xFE); //GRP 4
|
||||||
mem_writeb(linearAddress+1,(Bit8u)0x38); //Extra Callback instruction
|
phys_writeb(physAddress+1,(Bit8u)0x38); //Extra Callback instruction
|
||||||
mem_writew(linearAddress+2,callback); //The immediate word
|
phys_writew(physAddress+2,callback); //The immediate word
|
||||||
mem_writeb(linearAddress+4,(Bit8u)0xCF); //An IRET Instruction
|
phys_writeb(physAddress+4,(Bit8u)0xCF); //An IRET Instruction
|
||||||
break;
|
return 5;
|
||||||
case CB_IRET_STI:
|
case CB_IRET_STI:
|
||||||
mem_writeb(linearAddress+0,(Bit8u)0xFB); //STI
|
phys_writeb(physAddress+0,(Bit8u)0xFB); //STI
|
||||||
mem_writeb(linearAddress+1,(Bit8u)0xFE); //GRP 4
|
phys_writeb(physAddress+1,(Bit8u)0xFE); //GRP 4
|
||||||
mem_writeb(linearAddress+2,(Bit8u)0x38); //Extra Callback instruction
|
phys_writeb(physAddress+2,(Bit8u)0x38); //Extra Callback instruction
|
||||||
mem_writew(linearAddress+3, callback); //The immediate word
|
phys_writew(physAddress+3, callback); //The immediate word
|
||||||
mem_writeb(linearAddress+5,(Bit8u)0xCF); //An IRET Instruction
|
phys_writeb(physAddress+5,(Bit8u)0xCF); //An IRET Instruction
|
||||||
break;
|
return 6;
|
||||||
default:
|
default:
|
||||||
E_Exit("CALLBACK:Setup:Illegal type %d",type);
|
E_Exit("CALLBACK:Setup:Illegal type %d",type);
|
||||||
}
|
}
|
||||||
CallBack_Handlers[callback]=handler;
|
return 0;
|
||||||
CALLBACK_SetDescription(callback,descr);
|
}
|
||||||
return true;
|
|
||||||
|
CALLBACK_HandlerObject::~CALLBACK_HandlerObject(){
|
||||||
|
if(!installed) return;
|
||||||
|
if(m_type == CALLBACK_HandlerObject::SETUP) {
|
||||||
|
if(vectorhandler.installed){
|
||||||
|
//See if we are the current handler. if so restore the old one
|
||||||
|
if(RealGetVec(vectorhandler.interrupt) == Get_RealPointer()) {
|
||||||
|
RealSetVec(vectorhandler.interrupt,vectorhandler.old_vector);
|
||||||
|
} else
|
||||||
|
LOG(LOG_MISC,LOG_WARN)("Interrupt vector changed on %X %s",vectorhandler.interrupt,CALLBACK_GetDescription(m_callback));
|
||||||
|
}
|
||||||
|
CALLBACK_RemoveSetup(m_callback);
|
||||||
|
} else if(m_type == CALLBACK_HandlerObject::SETUPAT){
|
||||||
|
E_Exit("Callback:SETUP at not handled yet.");
|
||||||
|
} else if(m_type == CALLBACK_HandlerObject::NONE){
|
||||||
|
//Do nothing. Merely DeAllocate the callback
|
||||||
|
} else E_Exit("what kind of callback is this!");
|
||||||
|
if(CallBack_Description[m_callback]) delete [] CallBack_Description[m_callback];
|
||||||
|
CallBack_Description[m_callback] = 0;
|
||||||
|
CALLBACK_DeAllocate(m_callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CALLBACK_HandlerObject::Install(CallBack_Handler handler,Bitu type,const char* description){
|
||||||
|
if(!installed) {
|
||||||
|
installed=true;
|
||||||
|
m_type=SETUP;
|
||||||
|
m_callback=CALLBACK_Allocate();
|
||||||
|
CALLBACK_Setup(m_callback,handler,type,description);
|
||||||
|
} else E_Exit("Allready installed");
|
||||||
|
}
|
||||||
|
void CALLBACK_HandlerObject::Allocate(CallBack_Handler handler,const char* description) {
|
||||||
|
if(!installed) {
|
||||||
|
installed=true;
|
||||||
|
m_type=NONE;
|
||||||
|
m_callback=CALLBACK_Allocate();
|
||||||
|
CALLBACK_SetDescription(m_callback,description);
|
||||||
|
CallBack_Handlers[m_callback]=handler;
|
||||||
|
} else E_Exit("Allready installed");
|
||||||
|
}
|
||||||
|
|
||||||
|
void CALLBACK_HandlerObject::Set_RealVec(Bit8u vec){
|
||||||
|
if(!vectorhandler.installed) {
|
||||||
|
vectorhandler.installed=true;
|
||||||
|
vectorhandler.interrupt=vec;
|
||||||
|
RealSetVec(vec,Get_RealPointer(),vectorhandler.old_vector);
|
||||||
|
} else E_Exit ("double usage of vector handler");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CALLBACK_Init(Section* sec) {
|
void CALLBACK_Init(Section* sec) {
|
||||||
@ -219,6 +275,7 @@ void CALLBACK_Init(Section* sec) {
|
|||||||
/* Setup all Interrupt to point to the default handler */
|
/* Setup all Interrupt to point to the default handler */
|
||||||
call_default=CALLBACK_Allocate();
|
call_default=CALLBACK_Allocate();
|
||||||
CALLBACK_Setup(call_default,&default_handler,CB_IRET,"default");
|
CALLBACK_Setup(call_default,&default_handler,CB_IRET,"default");
|
||||||
|
|
||||||
/* Only setup default handler for first half of interrupt table */
|
/* Only setup default handler for first half of interrupt table */
|
||||||
for (i=0;i<0x40;i++) {
|
for (i=0;i<0x40;i++) {
|
||||||
real_writed(0,i*4,CALLBACK_RealPointer(call_default));
|
real_writed(0,i*4,CALLBACK_RealPointer(call_default));
|
||||||
@ -237,6 +294,22 @@ void CALLBACK_Init(Section* sec) {
|
|||||||
real_writed(0,0x67*4,CALLBACK_RealPointer(call_default));
|
real_writed(0,0x67*4,CALLBACK_RealPointer(call_default));
|
||||||
real_writed(0,0x5c*4,CALLBACK_RealPointer(call_default)); //Network stuff
|
real_writed(0,0x5c*4,CALLBACK_RealPointer(call_default)); //Network stuff
|
||||||
//real_writed(0,0xf*4,0); some games don't like it
|
//real_writed(0,0xf*4,0); some games don't like it
|
||||||
|
|
||||||
|
call_priv_io=CALLBACK_Allocate();
|
||||||
|
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x00,(Bit8u)0xec); // in al, dx
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x01,(Bit8u)0xcb); // retf
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x02,(Bit8u)0xed); // in ax, dx
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x03,(Bit8u)0xcb); // retf
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x04,(Bit8u)0x66); // in eax, dx
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x05,(Bit8u)0xed);
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x06,(Bit8u)0xcb); // retf
|
||||||
|
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x08,(Bit8u)0xee); // out dx, al
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x09,(Bit8u)0xcb); // retf
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x0a,(Bit8u)0xef); // out dx, ax
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x0b,(Bit8u)0xcb); // retf
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x0c,(Bit8u)0x66); // out dx, eax
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x0d,(Bit8u)0xef);
|
||||||
|
phys_writeb(CB_BASE+(call_priv_io<<4)+0x0e,(Bit8u)0xcb); // retf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -20,10 +20,23 @@
|
|||||||
|
|
||||||
#if (C_DYNAMIC_X86)
|
#if (C_DYNAMIC_X86)
|
||||||
|
|
||||||
|
#define CHECKED_MEMORY_ACCESS
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#if (C_HAVE_MPROTECT)
|
||||||
|
#include <sys/mman.h>
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
#ifndef PAGESIZE
|
||||||
|
#define PAGESIZE 4096
|
||||||
|
#endif
|
||||||
|
#endif /* C_HAVE_MPROTECT */
|
||||||
|
|
||||||
#include "callback.h"
|
#include "callback.h"
|
||||||
#include "regs.h"
|
#include "regs.h"
|
||||||
@ -33,11 +46,15 @@
|
|||||||
#include "paging.h"
|
#include "paging.h"
|
||||||
#include "inout.h"
|
#include "inout.h"
|
||||||
|
|
||||||
#define CACHE_TOTAL (512*1024)
|
#ifdef CHECKED_MEMORY_ACCESS
|
||||||
|
#define CACHE_MAXSIZE (4096*2)
|
||||||
|
#else
|
||||||
#define CACHE_MAXSIZE (4096)
|
#define CACHE_MAXSIZE (4096)
|
||||||
#define CACHE_BLOCKS (32*1024)
|
#endif
|
||||||
|
#define CACHE_PAGES (128*8)
|
||||||
|
#define CACHE_TOTAL (CACHE_PAGES*4096)
|
||||||
|
#define CACHE_BLOCKS (64*1024)
|
||||||
#define CACHE_ALIGN (16)
|
#define CACHE_ALIGN (16)
|
||||||
#define CACHE_PAGES (128)
|
|
||||||
#define DYN_HASH_SHIFT (4)
|
#define DYN_HASH_SHIFT (4)
|
||||||
#define DYN_PAGE_HASH (4096>>DYN_HASH_SHIFT)
|
#define DYN_PAGE_HASH (4096>>DYN_HASH_SHIFT)
|
||||||
#define DYN_LINKS (16)
|
#define DYN_LINKS (16)
|
||||||
@ -48,6 +65,10 @@
|
|||||||
#define DYN_LOG
|
#define DYN_LOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if C_FPU
|
||||||
|
#define CPU_FPU 1 //Enable FPU escape instructions
|
||||||
|
#endif
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
G_EAX,G_ECX,G_EDX,G_EBX,
|
G_EAX,G_ECX,G_EDX,G_EBX,
|
||||||
G_ESP,G_EBP,G_ESI,G_EDI,
|
G_ESP,G_EBP,G_ESI,G_EDI,
|
||||||
@ -98,8 +119,12 @@ enum BlockReturn {
|
|||||||
BR_OpcodeFull,
|
BR_OpcodeFull,
|
||||||
#endif
|
#endif
|
||||||
BR_CallBack,
|
BR_CallBack,
|
||||||
|
BR_SMCBlock
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define SMC_CURRENT_BLOCK 0xffff
|
||||||
|
|
||||||
|
|
||||||
#define DYNFLG_HAS16 0x1 //Would like 8-bit host reg support
|
#define DYNFLG_HAS16 0x1 //Would like 8-bit host reg support
|
||||||
#define DYNFLG_HAS8 0x2 //Would like 16-bit host reg support
|
#define DYNFLG_HAS8 0x2 //Would like 16-bit host reg support
|
||||||
#define DYNFLG_LOAD 0x4 //Load value when accessed
|
#define DYNFLG_LOAD 0x4 //Load value when accessed
|
||||||
@ -133,14 +158,14 @@ static struct {
|
|||||||
Bitu ea,tmpb,tmpd,stack,shift;
|
Bitu ea,tmpb,tmpd,stack,shift;
|
||||||
} extra_regs;
|
} extra_regs;
|
||||||
|
|
||||||
static void IllegalOption(void) {
|
static void IllegalOption(const char* msg) {
|
||||||
E_Exit("Illegal option");
|
E_Exit("DynCore: illegal option in %s",msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "core_dyn_x86/cache.h"
|
#include "core_dyn_x86/cache.h"
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
Bitu callback;
|
Bitu callback,readdata;
|
||||||
} core_dyn;
|
} core_dyn;
|
||||||
|
|
||||||
|
|
||||||
@ -180,12 +205,23 @@ static void dyn_loadstate(DynState * state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void dyn_synchstate(DynState * state) {
|
static void dyn_synchstate(DynState * state) {
|
||||||
for (Bitu i=0;i<G_MAX;i++) {
|
for (Bitu i=0;i<G_MAX;i++) {
|
||||||
gen_synchreg(&DynRegs[i],&state->regs[i]);
|
gen_synchreg(&DynRegs[i],&state->regs[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void dyn_saveregister(DynReg * src_reg, DynReg * dst_reg) {
|
||||||
|
dst_reg->flags=src_reg->flags;
|
||||||
|
dst_reg->genreg=src_reg->genreg;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void dyn_restoreregister(DynReg * src_reg, DynReg * dst_reg) {
|
||||||
|
dst_reg->flags=src_reg->flags;
|
||||||
|
dst_reg->genreg=src_reg->genreg;
|
||||||
|
dst_reg->genreg->dynreg=dst_reg; // necessary when register has been released
|
||||||
|
}
|
||||||
|
|
||||||
#include "core_dyn_x86/decoder.h"
|
#include "core_dyn_x86/decoder.h"
|
||||||
|
|
||||||
Bits CPU_Core_Dyn_X86_Run(void) {
|
Bits CPU_Core_Dyn_X86_Run(void) {
|
||||||
@ -220,6 +256,10 @@ run_block:
|
|||||||
return CBRET_NONE;
|
return CBRET_NONE;
|
||||||
case BR_CallBack:
|
case BR_CallBack:
|
||||||
return core_dyn.callback;
|
return core_dyn.callback;
|
||||||
|
case BR_SMCBlock:
|
||||||
|
// LOG_MSG("selfmodification of running block at %x:%x",SegValue(cs),reg_eip);
|
||||||
|
cpu.exception.which=0;
|
||||||
|
// fallthrough, let the normal core handle the block-modifying instruction
|
||||||
case BR_Opcode:
|
case BR_Opcode:
|
||||||
CPU_CycleLeft+=CPU_Cycles;
|
CPU_CycleLeft+=CPU_Cycles;
|
||||||
CPU_Cycles=1;
|
CPU_Cycles=1;
|
||||||
@ -306,11 +346,14 @@ void CPU_Core_Dyn_X86_Init(void) {
|
|||||||
DynRegs[G_SHIFT].flags=DYNFLG_HAS8|DYNFLG_HAS16;
|
DynRegs[G_SHIFT].flags=DYNFLG_HAS8|DYNFLG_HAS16;
|
||||||
DynRegs[G_EXIT].data=0;
|
DynRegs[G_EXIT].data=0;
|
||||||
DynRegs[G_EXIT].flags=DYNFLG_HAS16;
|
DynRegs[G_EXIT].flags=DYNFLG_HAS16;
|
||||||
/* Initialize code cache and dynamic blocks */
|
|
||||||
cache_init();
|
|
||||||
/* Init the generator */
|
/* Init the generator */
|
||||||
gen_init();
|
gen_init();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPU_Core_Dyn_X86_Cache_Init(bool enable_cache) {
|
||||||
|
/* Initialize code cache and dynamic blocks */
|
||||||
|
cache_init(enable_cache);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -80,6 +80,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -105,10 +107,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
|
@ -42,10 +42,14 @@ static struct {
|
|||||||
CodePageHandler * last_page;
|
CodePageHandler * last_page;
|
||||||
} cache;
|
} 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];
|
static Bit8u cache_code_link_blocks[2][16];
|
||||||
static Bit8u cache_code[CACHE_TOTAL+CACHE_MAXSIZE];
|
#endif
|
||||||
static CacheBlock cache_blocks[CACHE_BLOCKS];
|
|
||||||
static CacheBlock link_blocks[2];
|
static CacheBlock link_blocks[2];
|
||||||
|
|
||||||
class CodePageHandler :public PageHandler {
|
class CodePageHandler :public PageHandler {
|
||||||
public:
|
public:
|
||||||
CodePageHandler() {}
|
CodePageHandler() {}
|
||||||
@ -59,21 +63,27 @@ public:
|
|||||||
memset(&hash_map,0,sizeof(hash_map));
|
memset(&hash_map,0,sizeof(hash_map));
|
||||||
memset(&write_map,0,sizeof(write_map));
|
memset(&write_map,0,sizeof(write_map));
|
||||||
}
|
}
|
||||||
void InvalidateRange(Bitu start,Bitu end) {
|
bool InvalidateRange(Bitu start,Bitu end) {
|
||||||
Bits index=1+(start>>DYN_HASH_SHIFT);
|
Bits index=1+(start>>DYN_HASH_SHIFT);
|
||||||
|
bool is_current_block=false;
|
||||||
|
Bit32u ip_point=SegPhys(cs)+reg_eip;
|
||||||
|
ip_point=((paging.tlb.phys_page[ip_point>>12]-phys_page)<<12)+(ip_point&0xfff);
|
||||||
while (index>=0) {
|
while (index>=0) {
|
||||||
Bitu map=0;
|
Bitu map=0;
|
||||||
for (Bitu count=start;count<=end;count++) map+=write_map[count];
|
for (Bitu count=start;count<=end;count++) map+=write_map[count];
|
||||||
if (!map) return;
|
if (!map) return is_current_block;
|
||||||
CacheBlock * block=hash_map[index];
|
CacheBlock * block=hash_map[index];
|
||||||
while (block) {
|
while (block) {
|
||||||
CacheBlock * nextblock=block->hash.next;
|
CacheBlock * nextblock=block->hash.next;
|
||||||
if (start<=block->page.end && end>=block->page.start)
|
if (start<=block->page.end && end>=block->page.start) {
|
||||||
|
if (ip_point<=block->page.end && ip_point>=block->page.start) is_current_block=true;
|
||||||
block->Clear();
|
block->Clear();
|
||||||
|
}
|
||||||
block=nextblock;
|
block=nextblock;
|
||||||
}
|
}
|
||||||
index--;
|
index--;
|
||||||
}
|
}
|
||||||
|
return is_current_block;
|
||||||
}
|
}
|
||||||
void writeb(PhysPt addr,Bitu val){
|
void writeb(PhysPt addr,Bitu val){
|
||||||
addr&=4095;
|
addr&=4095;
|
||||||
@ -102,6 +112,48 @@ public:
|
|||||||
if (!active_count) Release();
|
if (!active_count) Release();
|
||||||
} else InvalidateRange(addr,addr+3);
|
} else InvalidateRange(addr,addr+3);
|
||||||
}
|
}
|
||||||
|
bool writeb_checked(PhysPt addr,Bitu val) {
|
||||||
|
addr&=4095;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
host_writeb(hostmem+addr,val);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
bool writew_checked(PhysPt addr,Bitu val) {
|
||||||
|
addr&=4095;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
host_writew(hostmem+addr,val);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
bool writed_checked(PhysPt addr,Bitu val) {
|
||||||
|
addr&=4095;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
host_writed(hostmem+addr,val);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
void AddCacheBlock(CacheBlock * block) {
|
void AddCacheBlock(CacheBlock * block) {
|
||||||
Bitu index=1+(block->page.start>>DYN_HASH_SHIFT);
|
Bitu index=1+(block->page.start>>DYN_HASH_SHIFT);
|
||||||
block->hash.next=hash_map[index];
|
block->hash.next=hash_map[index];
|
||||||
@ -161,10 +213,13 @@ public:
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
HostPt GetHostPt(Bitu phys_page) {
|
HostPt GetHostReadPt(Bitu phys_page) {
|
||||||
hostmem=old_pagehandler->GetHostPt(phys_page);
|
hostmem=old_pagehandler->GetHostReadPt(phys_page);
|
||||||
return hostmem;
|
return hostmem;
|
||||||
}
|
}
|
||||||
|
HostPt GetHostWritePt(Bitu phys_page) {
|
||||||
|
return GetHostReadPt( phys_page );
|
||||||
|
}
|
||||||
public:
|
public:
|
||||||
Bit8u write_map[4096];
|
Bit8u write_map[4096];
|
||||||
CodePageHandler * next, * prev;
|
CodePageHandler * next, * prev;
|
||||||
@ -235,10 +290,13 @@ void CacheBlock::Clear(void) {
|
|||||||
}
|
}
|
||||||
if (link[ind].to!=&link_blocks[ind]) {
|
if (link[ind].to!=&link_blocks[ind]) {
|
||||||
CacheBlock * * wherelink=&link[ind].to->link[ind].from;
|
CacheBlock * * wherelink=&link[ind].to->link[ind].from;
|
||||||
while (*wherelink!=this) {
|
while (*wherelink != this && *wherelink) {
|
||||||
wherelink = &(*wherelink)->link[ind].next;
|
wherelink = &(*wherelink)->link[ind].next;
|
||||||
}
|
}
|
||||||
|
if(*wherelink)
|
||||||
*wherelink = (*wherelink)->link[ind].next;
|
*wherelink = (*wherelink)->link[ind].next;
|
||||||
|
else
|
||||||
|
LOG(LOG_CPU,LOG_ERROR)("Cache anomaly. please investigate");
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
cache_addunsedblock(this);
|
cache_addunsedblock(this);
|
||||||
@ -332,21 +390,54 @@ static INLINE void cache_addd(Bit32u val) {
|
|||||||
|
|
||||||
static void gen_return(BlockReturn retcode);
|
static void gen_return(BlockReturn retcode);
|
||||||
|
|
||||||
static void cache_init(void) {
|
static Bit8u * cache_code=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
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
static void cache_init(bool enable) {
|
||||||
|
static bool cache_initialized = false;
|
||||||
Bits i;
|
Bits i;
|
||||||
memset(&cache_blocks,0,sizeof(cache_blocks));
|
if (enable) {
|
||||||
|
if (cache_initialized) return;
|
||||||
|
cache_initialized = true;
|
||||||
|
if (cache_blocks == NULL) {
|
||||||
|
cache_blocks=(CacheBlock*)malloc(CACHE_BLOCKS*sizeof(CacheBlock));
|
||||||
|
if(!cache_blocks) E_Exit("Allocating cache_blocks has failed");
|
||||||
|
memset(cache_blocks,0,sizeof(CacheBlock)*CACHE_BLOCKS);
|
||||||
cache.block.free=&cache_blocks[0];
|
cache.block.free=&cache_blocks[0];
|
||||||
for (i=0;i<CACHE_BLOCKS-1;i++) {
|
for (i=0;i<CACHE_BLOCKS-1;i++) {
|
||||||
cache_blocks[i].link[0].to=(CacheBlock *)1;
|
cache_blocks[i].link[0].to=(CacheBlock *)1;
|
||||||
cache_blocks[i].link[1].to=(CacheBlock *)1;
|
cache_blocks[i].link[1].to=(CacheBlock *)1;
|
||||||
cache_blocks[i].cache.next=&cache_blocks[i+1];
|
cache_blocks[i].cache.next=&cache_blocks[i+1];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#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))
|
||||||
|
LOG_MSG("Setting excute permission on the code cache has failed!");
|
||||||
|
#endif
|
||||||
CacheBlock * block=cache_getblock();
|
CacheBlock * block=cache_getblock();
|
||||||
cache.block.first=block;
|
cache.block.first=block;
|
||||||
cache.block.active=block;
|
cache.block.active=block;
|
||||||
block->cache.start=&cache_code[0];
|
block->cache.start=&cache_code[0];
|
||||||
block->cache.size=CACHE_TOTAL;
|
block->cache.size=CACHE_TOTAL;
|
||||||
block->cache.next=0; //Last block in the list
|
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][0];
|
||||||
link_blocks[0].cache.start=cache.pos;
|
link_blocks[0].cache.start=cache.pos;
|
||||||
gen_return(BR_Link1);
|
gen_return(BR_Link1);
|
||||||
@ -363,3 +454,4 @@ static void cache_init(void) {
|
|||||||
cache.free_pages=newpage;
|
cache.free_pages=newpage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,22 @@
|
|||||||
static bool dyn_helper_divb(Bit8u val) {
|
static bool dyn_helper_divb(Bit8u val) {
|
||||||
if (!val) return CPU_PrepareException(0,0);
|
if (!val) return CPU_PrepareException(0,0);
|
||||||
Bitu quo=reg_ax / val;
|
Bitu quo=reg_ax / val;
|
||||||
reg_ah=(Bit8u)(reg_ax % val);
|
Bit8u rem=(Bit8u)(reg_ax % val);
|
||||||
reg_al=(Bit8u)quo;
|
Bit8u quo8=(Bit8u)(quo&0xff);
|
||||||
if (quo>0xff) return CPU_PrepareException(0,0);
|
if (quo>0xff) return CPU_PrepareException(0,0);
|
||||||
|
reg_ah=rem;
|
||||||
|
reg_al=quo8;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool dyn_helper_idivb(Bit8s val) {
|
static bool dyn_helper_idivb(Bit8s val) {
|
||||||
if (!val) return CPU_PrepareException(0,0);
|
if (!val) return CPU_PrepareException(0,0);
|
||||||
Bits quo=(Bit16s)reg_ax / val;
|
Bits quo=(Bit16s)reg_ax / val;
|
||||||
reg_ah=(Bit8s)((Bit16s)reg_ax % val);
|
Bit8s rem=(Bit8s)((Bit16s)reg_ax % val);
|
||||||
reg_al=(Bit8s)quo;
|
Bit8s quo8s=(Bit8s)(quo&0xff);
|
||||||
if (quo!=(Bit8s)reg_al) return CPU_PrepareException(0,0);
|
if (quo!=(Bit16s)quo8s) return CPU_PrepareException(0,0);
|
||||||
|
reg_ah=rem;
|
||||||
|
reg_al=quo8s;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,9 +24,11 @@ static bool dyn_helper_divw(Bit16u val) {
|
|||||||
if (!val) return CPU_PrepareException(0,0);
|
if (!val) return CPU_PrepareException(0,0);
|
||||||
Bitu num=(reg_dx<<16)|reg_ax;
|
Bitu num=(reg_dx<<16)|reg_ax;
|
||||||
Bitu quo=num/val;
|
Bitu quo=num/val;
|
||||||
reg_dx=(Bit16u)(num % val);
|
Bit16u rem=(Bit16u)(num % val);
|
||||||
reg_ax=(Bit16u)quo;
|
Bit16u quo16=(Bit16u)(quo&0xffff);
|
||||||
if (quo!=reg_ax) return CPU_PrepareException(0,0);
|
if (quo!=(Bit32u)quo16) return CPU_PrepareException(0,0);
|
||||||
|
reg_dx=rem;
|
||||||
|
reg_ax=quo16;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,9 +36,11 @@ static bool dyn_helper_idivw(Bit16s val) {
|
|||||||
if (!val) return CPU_PrepareException(0,0);
|
if (!val) return CPU_PrepareException(0,0);
|
||||||
Bits num=(reg_dx<<16)|reg_ax;
|
Bits num=(reg_dx<<16)|reg_ax;
|
||||||
Bits quo=num/val;
|
Bits quo=num/val;
|
||||||
reg_dx=(Bit16s)(num % val);
|
Bit16s rem=(Bit16s)(num % val);
|
||||||
reg_ax=(Bit16s)quo;
|
Bit16s quo16s=(Bit16s)quo;
|
||||||
if (quo!=(Bit16s)reg_ax) return CPU_PrepareException(0,0);
|
if (quo!=(Bit32s)quo16s) return CPU_PrepareException(0,0);
|
||||||
|
reg_dx=rem;
|
||||||
|
reg_ax=quo16s;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,9 +48,11 @@ static bool dyn_helper_divd(Bit32u val) {
|
|||||||
if (!val) return CPU_PrepareException(0,0);
|
if (!val) return CPU_PrepareException(0,0);
|
||||||
Bit64u num=(((Bit64u)reg_edx)<<32)|reg_eax;
|
Bit64u num=(((Bit64u)reg_edx)<<32)|reg_eax;
|
||||||
Bit64u quo=num/val;
|
Bit64u quo=num/val;
|
||||||
reg_edx=(Bit32u)(num % val);
|
Bit32u rem=(Bit32u)(num % val);
|
||||||
reg_eax=(Bit32u)quo;
|
Bit32u quo32=(Bit32u)(quo&0xffffffff);
|
||||||
if (quo!=(Bit64u)reg_eax) return CPU_PrepareException(0,0);
|
if (quo!=(Bit64u)quo32) return CPU_PrepareException(0,0);
|
||||||
|
reg_edx=rem;
|
||||||
|
reg_eax=quo32;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,8 +60,10 @@ static bool dyn_helper_idivd(Bit32s val) {
|
|||||||
if (!val) return CPU_PrepareException(0,0);
|
if (!val) return CPU_PrepareException(0,0);
|
||||||
Bit64s num=(((Bit64u)reg_edx)<<32)|reg_eax;
|
Bit64s num=(((Bit64u)reg_edx)<<32)|reg_eax;
|
||||||
Bit64s quo=num/val;
|
Bit64s quo=num/val;
|
||||||
reg_edx=(Bit32s)(num % val);
|
Bit32s rem=(Bit32s)(num % val);
|
||||||
reg_eax=(Bit32s)(quo);
|
Bit32s quo32s=(Bit32s)(quo&0xffffffff);
|
||||||
if (quo!=(Bit64s)((Bit32s)reg_eax)) return CPU_PrepareException(0,0);
|
if (quo!=(Bit64s)quo32s) return CPU_PrepareException(0,0);
|
||||||
|
reg_edx=rem;
|
||||||
|
reg_eax=quo32s;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -39,36 +39,35 @@ static struct {
|
|||||||
|
|
||||||
class GenReg {
|
class GenReg {
|
||||||
public:
|
public:
|
||||||
GenReg(Bit8u _index,bool _protect) {
|
GenReg(Bit8u _index) {
|
||||||
index=_index;protect=_protect;
|
index=_index;
|
||||||
notusable=false;dynreg=0;
|
notusable=false;dynreg=0;
|
||||||
}
|
}
|
||||||
DynReg * dynreg;
|
DynReg * dynreg;
|
||||||
Bitu last_used; //Keeps track of last assigned regs
|
Bitu last_used; //Keeps track of last assigned regs
|
||||||
Bit8u index;
|
Bit8u index;
|
||||||
bool notusable;
|
bool notusable;
|
||||||
bool protect;
|
void Load(DynReg * _dynreg,bool stale=false) {
|
||||||
void Load(DynReg * _dynreg) {
|
|
||||||
if (!_dynreg) return;
|
if (!_dynreg) return;
|
||||||
if (dynreg) Clear();
|
if (GCC_UNLIKELY((Bitu)dynreg)) Clear();
|
||||||
dynreg=_dynreg;
|
dynreg=_dynreg;
|
||||||
last_used=x86gen.last_used;
|
last_used=x86gen.last_used;
|
||||||
dynreg->flags&=~DYNFLG_CHANGED;
|
dynreg->flags&=~DYNFLG_CHANGED;
|
||||||
dynreg->genreg=this;
|
dynreg->genreg=this;
|
||||||
if (dynreg->flags & (DYNFLG_LOAD|DYNFLG_ACTIVE)) {
|
if ((!stale) && (dynreg->flags & (DYNFLG_LOAD|DYNFLG_ACTIVE))) {
|
||||||
cache_addw(0x058b+(index << (8+3))); //Mov reg,[data]
|
cache_addw(0x058b+(index << (8+3))); //Mov reg,[data]
|
||||||
cache_addd((Bit32u)dynreg->data);
|
cache_addd((Bit32u)dynreg->data);
|
||||||
}
|
}
|
||||||
dynreg->flags|=DYNFLG_ACTIVE;
|
dynreg->flags|=DYNFLG_ACTIVE;
|
||||||
}
|
}
|
||||||
void Save(void) {
|
void Save(void) {
|
||||||
if (!dynreg) IllegalOption();
|
if (GCC_UNLIKELY(!((Bitu)dynreg))) IllegalOption("GenReg->Save");
|
||||||
dynreg->flags&=~DYNFLG_CHANGED;
|
dynreg->flags&=~DYNFLG_CHANGED;
|
||||||
cache_addw(0x0589+(index << (8+3))); //Mov [data],reg
|
cache_addw(0x0589+(index << (8+3))); //Mov [data],reg
|
||||||
cache_addd((Bit32u)dynreg->data);
|
cache_addd((Bit32u)dynreg->data);
|
||||||
}
|
}
|
||||||
void Release(void) {
|
void Release(void) {
|
||||||
if (!dynreg) return;
|
if (GCC_UNLIKELY(!((Bitu)dynreg))) return;
|
||||||
if (dynreg->flags&DYNFLG_CHANGED && dynreg->flags&DYNFLG_SAVE) {
|
if (dynreg->flags&DYNFLG_CHANGED && dynreg->flags&DYNFLG_SAVE) {
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
@ -82,8 +81,6 @@ public:
|
|||||||
}
|
}
|
||||||
dynreg->genreg=0;dynreg=0;
|
dynreg->genreg=0;dynreg=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static BlockReturn gen_runcode(Bit8u * code) {
|
static BlockReturn gen_runcode(Bit8u * code) {
|
||||||
@ -131,7 +128,7 @@ return_address:
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GenReg * FindDynReg(DynReg * dynreg) {
|
static GenReg * FindDynReg(DynReg * dynreg,bool stale=false) {
|
||||||
x86gen.last_used++;
|
x86gen.last_used++;
|
||||||
if (dynreg->genreg) {
|
if (dynreg->genreg) {
|
||||||
dynreg->genreg->last_used=x86gen.last_used;
|
dynreg->genreg->last_used=x86gen.last_used;
|
||||||
@ -143,11 +140,11 @@ static GenReg * FindDynReg(DynReg * dynreg) {
|
|||||||
first_used=-1;
|
first_used=-1;
|
||||||
if (dynreg->flags & DYNFLG_HAS8) {
|
if (dynreg->flags & DYNFLG_HAS8) {
|
||||||
/* Has to be eax,ebx,ecx,edx */
|
/* Has to be eax,ebx,ecx,edx */
|
||||||
for (i=first_index=0;i<=X86_REG_EDX;i++) {
|
for (i=first_index=0;i<=X86_REG_EBX;i++) {
|
||||||
GenReg * genreg=x86gen.regs[i];
|
GenReg * genreg=x86gen.regs[i];
|
||||||
if (genreg->notusable) continue;
|
if (genreg->notusable) continue;
|
||||||
if (!(genreg->dynreg)) {
|
if (!(genreg->dynreg)) {
|
||||||
genreg->Load(dynreg);
|
genreg->Load(dynreg,stale);
|
||||||
return genreg;
|
return genreg;
|
||||||
}
|
}
|
||||||
if (genreg->last_used<first_used) {
|
if (genreg->last_used<first_used) {
|
||||||
@ -155,16 +152,12 @@ static GenReg * FindDynReg(DynReg * dynreg) {
|
|||||||
first_index=i;
|
first_index=i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* No free register found use earliest assigned one */
|
|
||||||
GenReg * newreg=x86gen.regs[first_index];
|
|
||||||
newreg->Load(dynreg);
|
|
||||||
return newreg;
|
|
||||||
} else {
|
} else {
|
||||||
for (i=first_index=X86_REGS-1;i>=0;i--) {
|
for (i=first_index=X86_REGS-1;i>=0;i--) {
|
||||||
GenReg * genreg=x86gen.regs[i];
|
GenReg * genreg=x86gen.regs[i];
|
||||||
if (genreg->notusable) continue;
|
if (genreg->notusable) continue;
|
||||||
if (!(genreg->dynreg)) {
|
if (!(genreg->dynreg)) {
|
||||||
genreg->Load(dynreg);
|
genreg->Load(dynreg,stale);
|
||||||
return genreg;
|
return genreg;
|
||||||
}
|
}
|
||||||
if (genreg->last_used<first_used) {
|
if (genreg->last_used<first_used) {
|
||||||
@ -172,12 +165,12 @@ static GenReg * FindDynReg(DynReg * dynreg) {
|
|||||||
first_index=i;
|
first_index=i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* No free register found use earliest assigned one */
|
/* No free register found use earliest assigned one */
|
||||||
GenReg * newreg=x86gen.regs[first_index];
|
GenReg * newreg=x86gen.regs[first_index];
|
||||||
newreg->Load(dynreg);
|
newreg->Load(dynreg,stale);
|
||||||
return newreg;
|
return newreg;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static GenReg * ForceDynReg(GenReg * genreg,DynReg * dynreg) {
|
static GenReg * ForceDynReg(GenReg * genreg,DynReg * dynreg) {
|
||||||
genreg->last_used=++x86gen.last_used;
|
genreg->last_used=++x86gen.last_used;
|
||||||
@ -242,6 +235,30 @@ static void gen_protectflags(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void gen_discardflags(void) {
|
||||||
|
if (!x86gen.flagsactive) {
|
||||||
|
x86gen.flagsactive=true;
|
||||||
|
cache_addw(0xc483); //ADD ESP,4
|
||||||
|
cache_addb(0x4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void gen_needcarry(void) {
|
||||||
|
if (!x86gen.flagsactive) {
|
||||||
|
x86gen.flagsactive=true;
|
||||||
|
cache_addw(0x2cd1); //SHR DWORD [ESP],1
|
||||||
|
cache_addb(0x24);
|
||||||
|
cache_addd(0x0424648d); //LEA ESP,[ESP+4]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool skip_flags=false;
|
||||||
|
|
||||||
|
static void set_skipflags(bool state) {
|
||||||
|
if (!state) gen_discardflags();
|
||||||
|
skip_flags=state;
|
||||||
|
}
|
||||||
|
|
||||||
static void gen_reinit(void) {
|
static void gen_reinit(void) {
|
||||||
x86gen.last_used=0;
|
x86gen.last_used=0;
|
||||||
x86gen.flagsactive=false;
|
x86gen.flagsactive=false;
|
||||||
@ -252,87 +269,72 @@ static void gen_reinit(void) {
|
|||||||
|
|
||||||
static void gen_dop_byte(DualOps op,DynReg * dr1,Bit8u di1,DynReg * dr2,Bit8u di2) {
|
static void gen_dop_byte(DualOps op,DynReg * dr1,Bit8u di1,DynReg * dr2,Bit8u di2) {
|
||||||
GenReg * gr1=FindDynReg(dr1);GenReg * gr2=FindDynReg(dr2);
|
GenReg * gr1=FindDynReg(dr1);GenReg * gr2=FindDynReg(dr2);
|
||||||
|
Bit8u tmp;
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case DOP_ADD:cache_addb(0x02);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_ADD: tmp=0x02; break;
|
||||||
case DOP_OR: cache_addb(0x0a);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_ADC: tmp=0x12; break;
|
||||||
case DOP_ADC:cache_addb(0x12);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_SUB: tmp=0x2a; break;
|
||||||
case DOP_SBB:cache_addb(0x1a);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_SBB: tmp=0x1a; break;
|
||||||
case DOP_AND:cache_addb(0x22);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_CMP: tmp=0x3a; goto nochange;
|
||||||
case DOP_SUB:cache_addb(0x2a);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_XOR: tmp=0x32; break;
|
||||||
case DOP_XOR:cache_addb(0x32);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_AND: tmp=0x22; if ((dr1==dr2) && (di1==di2)) goto nochange; break;
|
||||||
case DOP_CMP:cache_addb(0x3a);break;
|
case DOP_OR: tmp=0x0a; if ((dr1==dr2) && (di1==di2)) goto nochange; break;
|
||||||
case DOP_MOV:cache_addb(0x8a);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_TEST: tmp=0x84; goto nochange;
|
||||||
case DOP_XCHG:cache_addb(0x86);dr1->flags|=DYNFLG_CHANGED;dr2->flags|=DYNFLG_CHANGED;break;
|
case DOP_MOV: if ((dr1==dr2) && (di1==di2)) return; tmp=0x8a; break;
|
||||||
case DOP_TEST:cache_addb(0x84);break;
|
case DOP_XCHG: tmp=0x86; dr2->flags|=DYNFLG_CHANGED; break;
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("gen_dop_byte");
|
||||||
}
|
}
|
||||||
cache_addb(0xc0+((gr1->index+di1)<<3)+gr2->index+di2);
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
|
nochange:
|
||||||
|
cache_addw(tmp|(0xc0+((gr1->index+di1)<<3)+gr2->index+di2)<<8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_dop_byte_imm(DualOps op,DynReg * dr1,Bit8u di1,Bitu imm) {
|
static void gen_dop_byte_imm(DualOps op,DynReg * dr1,Bit8u di1,Bitu imm) {
|
||||||
GenReg * gr1=FindDynReg(dr1);
|
GenReg * gr1=FindDynReg(dr1);
|
||||||
|
Bit16u tmp;
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case DOP_ADD:
|
case DOP_ADD: tmp=0xc080; break;
|
||||||
cache_addw(0xc080+((gr1->index+di1)<<8));
|
case DOP_ADC: tmp=0xd080; break;
|
||||||
|
case DOP_SUB: tmp=0xe880; break;
|
||||||
|
case DOP_SBB: tmp=0xd880; break;
|
||||||
|
case DOP_CMP: tmp=0xf880; goto nochange; //Doesn't change
|
||||||
|
case DOP_XOR: tmp=0xf080; break;
|
||||||
|
case DOP_AND: tmp=0xe080; break;
|
||||||
|
case DOP_OR: tmp=0xc880; break;
|
||||||
|
case DOP_TEST: tmp=0xc0f6; goto nochange; //Doesn't change
|
||||||
|
case DOP_MOV: cache_addb(0xb0+gr1->index+di1);
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
break;
|
goto finish;
|
||||||
case DOP_OR:
|
|
||||||
cache_addw(0xc880+((gr1->index+di1)<<8));
|
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
|
||||||
break;
|
|
||||||
case DOP_ADC:
|
|
||||||
cache_addw(0xd080+((gr1->index+di1)<<8));
|
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
|
||||||
break;
|
|
||||||
case DOP_SBB:
|
|
||||||
cache_addw(0xd880+((gr1->index+di1)<<8));
|
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
|
||||||
break;
|
|
||||||
case DOP_AND:
|
|
||||||
cache_addw(0xe080+((gr1->index+di1)<<8));
|
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
|
||||||
break;
|
|
||||||
case DOP_SUB:
|
|
||||||
cache_addw(0xe880+((gr1->index+di1)<<8));
|
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
|
||||||
break;
|
|
||||||
case DOP_XOR:
|
|
||||||
cache_addw(0xf080+((gr1->index+di1)<<8));
|
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
|
||||||
break;
|
|
||||||
case DOP_CMP:
|
|
||||||
cache_addw(0xf880+((gr1->index+di1)<<8));
|
|
||||||
break;//Doesn't change
|
|
||||||
case DOP_MOV:
|
|
||||||
cache_addb(0xb0+gr1->index+di1);
|
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
|
||||||
break;
|
|
||||||
case DOP_TEST:
|
|
||||||
cache_addw(0xc0f6+((gr1->index+di1)<<8));
|
|
||||||
break;//Doesn't change
|
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("gen_dop_byte_imm");
|
||||||
}
|
}
|
||||||
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
|
nochange:
|
||||||
|
cache_addw(tmp+((gr1->index+di1)<<8));
|
||||||
|
finish:
|
||||||
cache_addb(imm);
|
cache_addb(imm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_sop_byte(SingleOps op,DynReg * dr1,Bit8u di1) {
|
static void gen_sop_byte(SingleOps op,DynReg * dr1,Bit8u di1) {
|
||||||
GenReg * gr1=FindDynReg(dr1);
|
GenReg * gr1=FindDynReg(dr1);
|
||||||
|
Bit16u tmp;
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case SOP_INC:cache_addw(0xc0FE + ((gr1->index+di1)<<8));break;
|
case SOP_INC: tmp=0xc0FE; break;
|
||||||
case SOP_DEC:cache_addw(0xc8FE + ((gr1->index+di1)<<8));break;
|
case SOP_DEC: tmp=0xc8FE; break;
|
||||||
case SOP_NOT:cache_addw(0xd0f6 + ((gr1->index+di1)<<8));break;
|
case SOP_NOT: tmp=0xd0f6; break;
|
||||||
case SOP_NEG:cache_addw(0xd8f6 + ((gr1->index+di1)<<8));break;
|
case SOP_NEG: tmp=0xd8f6; break;
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("gen_sop_byte");
|
||||||
}
|
}
|
||||||
|
cache_addw(tmp + ((gr1->index+di1)<<8));
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void gen_extend_word(bool sign,DynReg * ddr,DynReg * dsr) {
|
static void gen_extend_word(bool sign,DynReg * ddr,DynReg * dsr) {
|
||||||
GenReg * gdr=FindDynReg(ddr);GenReg * gsr=FindDynReg(dsr);
|
GenReg * gsr=FindDynReg(dsr);
|
||||||
|
GenReg * gdr=FindDynReg(ddr,true);
|
||||||
if (sign) cache_addw(0xbf0f);
|
if (sign) cache_addw(0xbf0f);
|
||||||
else cache_addw(0xb70f);
|
else cache_addw(0xb70f);
|
||||||
cache_addb(0xc0+(gdr->index<<3)+(gsr->index));
|
cache_addb(0xc0+(gdr->index<<3)+(gsr->index));
|
||||||
@ -340,7 +342,8 @@ static void gen_extend_word(bool sign,DynReg * ddr,DynReg * dsr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gen_extend_byte(bool sign,bool dword,DynReg * ddr,DynReg * dsr,Bit8u dsi) {
|
static void gen_extend_byte(bool sign,bool dword,DynReg * ddr,DynReg * dsr,Bit8u dsi) {
|
||||||
GenReg * gdr=FindDynReg(ddr);GenReg * gsr=FindDynReg(dsr);
|
GenReg * gsr=FindDynReg(dsr);
|
||||||
|
GenReg * gdr=FindDynReg(ddr,dword);
|
||||||
if (!dword) cache_addb(0x66);
|
if (!dword) cache_addb(0x66);
|
||||||
if (sign) cache_addw(0xbe0f);
|
if (sign) cache_addw(0xbe0f);
|
||||||
else cache_addw(0xb60f);
|
else cache_addw(0xb60f);
|
||||||
@ -368,6 +371,7 @@ static void gen_lea(DynReg * ddr,DynReg * dsr1,DynReg * dsr2,Bitu scale,Bits imm
|
|||||||
Bit8u sib=(gsr1->index)+(gsr2->index<<3)+(scale<<6);
|
Bit8u sib=(gsr1->index)+(gsr2->index<<3)+(scale<<6);
|
||||||
cache_addb(sib);
|
cache_addb(sib);
|
||||||
} else {
|
} else {
|
||||||
|
if ((ddr==dsr1) && !imm_size) return;
|
||||||
cache_addb(0x8d); //LEA
|
cache_addb(0x8d); //LEA
|
||||||
cache_addb(rm_base+gsr1->index);
|
cache_addb(rm_base+gsr1->index);
|
||||||
}
|
}
|
||||||
@ -394,53 +398,74 @@ static void gen_lea(DynReg * ddr,DynReg * dsr1,DynReg * dsr2,Bitu scale,Bits imm
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gen_dop_word(DualOps op,bool dword,DynReg * dr1,DynReg * dr2) {
|
static void gen_dop_word(DualOps op,bool dword,DynReg * dr1,DynReg * dr2) {
|
||||||
GenReg * gr1=FindDynReg(dr1);GenReg * gr2=FindDynReg(dr2);
|
GenReg * gr2=FindDynReg(dr2);
|
||||||
if (!dword) cache_addb(0x66);
|
GenReg * gr1=FindDynReg(dr1,dword && op==DOP_MOV);
|
||||||
|
Bit8u tmp;
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case DOP_ADD:cache_addb(0x03);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_ADD: tmp=0x03; break;
|
||||||
case DOP_OR: cache_addb(0x0b);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_ADC: tmp=0x13; break;
|
||||||
case DOP_ADC:cache_addb(0x13);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_SUB: tmp=0x2b; break;
|
||||||
case DOP_SBB:cache_addb(0x1b);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_SBB: tmp=0x1b; break;
|
||||||
case DOP_AND:cache_addb(0x23);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_CMP: tmp=0x3b; goto nochange;
|
||||||
case DOP_SUB:cache_addb(0x2b);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_XOR: tmp=0x33; break;
|
||||||
case DOP_XOR:cache_addb(0x33);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_AND: tmp=0x23; if (dr1==dr2) goto nochange; break;
|
||||||
case DOP_CMP:cache_addb(0x3b);break;
|
case DOP_OR: tmp=0x0b; if (dr1==dr2) goto nochange; break;
|
||||||
case DOP_MOV:cache_addb(0x8b);dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_TEST: tmp=0x85; goto nochange;
|
||||||
case DOP_XCHG:cache_addb(0x87);dr1->flags|=DYNFLG_CHANGED;dr2->flags|=DYNFLG_CHANGED;break;
|
case DOP_MOV: if (dr1==dr2) return; tmp=0x8b; break;
|
||||||
case DOP_TEST:cache_addb(0x85);break;
|
case DOP_XCHG:
|
||||||
default:
|
dr2->flags|=DYNFLG_CHANGED;
|
||||||
IllegalOption();
|
if (dword && !((dr1->flags&DYNFLG_HAS8) ^ (dr2->flags&DYNFLG_HAS8))) {
|
||||||
|
dr1->genreg=gr2;dr1->genreg->dynreg=dr1;
|
||||||
|
dr2->genreg=gr1;dr2->genreg->dynreg=dr2;
|
||||||
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
cache_addb(0xc0+(gr1->index<<3)+gr2->index);
|
tmp=0x87;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
IllegalOption("gen_dop_word");
|
||||||
|
}
|
||||||
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
|
nochange:
|
||||||
|
if (!dword) cache_addb(0x66);
|
||||||
|
cache_addw(tmp|(0xc0+(gr1->index<<3)+gr2->index)<<8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_dop_word_imm(DualOps op,bool dword,DynReg * dr1,Bits imm) {
|
static void gen_dop_word_imm(DualOps op,bool dword,DynReg * dr1,Bits imm) {
|
||||||
GenReg * gr1=FindDynReg(dr1);
|
GenReg * gr1=FindDynReg(dr1,dword && op==DOP_MOV);
|
||||||
|
Bit16u tmp;
|
||||||
if (!dword) cache_addb(0x66);
|
if (!dword) cache_addb(0x66);
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case DOP_ADD:cache_addw(0xc081+(gr1->index<<8));dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_ADD: tmp=0xc081; break;
|
||||||
case DOP_OR: cache_addw(0xc881+(gr1->index<<8));dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_ADC: tmp=0xd081; break;
|
||||||
case DOP_ADC:cache_addw(0xd081+(gr1->index<<8));dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_SUB: tmp=0xe881; break;
|
||||||
case DOP_SBB:cache_addw(0xd881+(gr1->index<<8));dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_SBB: tmp=0xd881; break;
|
||||||
case DOP_AND:cache_addw(0xe081+(gr1->index<<8));dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_CMP: tmp=0xf881; goto nochange; //Doesn't change
|
||||||
case DOP_SUB:cache_addw(0xe881+(gr1->index<<8));dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_XOR: tmp=0xf081; break;
|
||||||
case DOP_XOR:cache_addw(0xf081+(gr1->index<<8));dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_AND: tmp=0xe081; break;
|
||||||
case DOP_CMP:cache_addw(0xf881+(gr1->index<<8));break;//Doesn't change
|
case DOP_OR: tmp=0xc881; break;
|
||||||
case DOP_MOV:cache_addb(0xb8+(gr1->index));dr1->flags|=DYNFLG_CHANGED;break;
|
case DOP_TEST: tmp=0xc0f7; goto nochange; //Doesn't change
|
||||||
case DOP_TEST:cache_addw(0xc0f7+(gr1->index<<8));break;//Doesn't change
|
case DOP_MOV: cache_addb(0xb8+(gr1->index)); dr1->flags|=DYNFLG_CHANGED; goto finish;
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("gen_dop_word_imm");
|
||||||
}
|
}
|
||||||
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
|
nochange:
|
||||||
|
cache_addw(tmp+(gr1->index<<8));
|
||||||
|
finish:
|
||||||
if (dword) cache_addd(imm);
|
if (dword) cache_addd(imm);
|
||||||
else cache_addw(imm);
|
else cache_addw(imm);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_imul_word(bool dword,DynReg * dr1,DynReg * dr2) {
|
static void gen_imul_word(bool dword,DynReg * dr1,DynReg * dr2) {
|
||||||
GenReg * gr1=FindDynReg(dr1);GenReg * gr2=FindDynReg(dr2);
|
GenReg * gr1=FindDynReg(dr1);GenReg * gr2=FindDynReg(dr2);
|
||||||
if (!dword) cache_addb(0x66);
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
|
if (!dword) {
|
||||||
|
cache_addd(0xaf0f66|(0xc0+(gr1->index<<3)+gr2->index)<<24);
|
||||||
|
} else {
|
||||||
cache_addw(0xaf0f);
|
cache_addw(0xaf0f);
|
||||||
cache_addb(0xc0+(gr1->index<<3)+gr2->index);
|
cache_addb(0xc0+(gr1->index<<3)+gr2->index);
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_imul_word_imm(bool dword,DynReg * dr1,DynReg * dr2,Bits imm) {
|
static void gen_imul_word_imm(bool dword,DynReg * dr1,DynReg * dr2,Bits imm) {
|
||||||
@ -469,7 +494,7 @@ static void gen_sop_word(SingleOps op,bool dword,DynReg * dr1) {
|
|||||||
case SOP_NOT:cache_addw(0xd0f7+(gr1->index<<8));break;
|
case SOP_NOT:cache_addw(0xd0f7+(gr1->index<<8));break;
|
||||||
case SOP_NEG:cache_addw(0xd8f7+(gr1->index<<8));break;
|
case SOP_NEG:cache_addw(0xd8f7+(gr1->index<<8));break;
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("gen_sop_word");
|
||||||
}
|
}
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
}
|
}
|
||||||
@ -498,10 +523,13 @@ static void gen_shift_word_cl(Bitu op,bool dword,DynReg * dr1,DynReg * drecx) {
|
|||||||
|
|
||||||
static void gen_shift_word_imm(Bitu op,bool dword,DynReg * dr1,Bit8u imm) {
|
static void gen_shift_word_imm(Bitu op,bool dword,DynReg * dr1,Bit8u imm) {
|
||||||
GenReg * gr1=FindDynReg(dr1);
|
GenReg * gr1=FindDynReg(dr1);
|
||||||
if (!dword) cache_addb(0x66);
|
|
||||||
cache_addw(0xc0c1+(((Bit16u)op) << 11) + ((gr1->index)<<8));
|
|
||||||
cache_addb(imm);
|
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
dr1->flags|=DYNFLG_CHANGED;
|
||||||
|
if (!dword) {
|
||||||
|
cache_addd(0x66|((0xc0c1+((Bit16u)op << 11) + (gr1->index<<8))|imm<<16)<<8);
|
||||||
|
} else {
|
||||||
|
cache_addw(0xc0c1+((Bit16u)op << 11) + (gr1->index<<8));
|
||||||
|
cache_addb(imm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_cbw(bool dword,DynReg * dyn_ax) {
|
static void gen_cbw(bool dword,DynReg * dyn_ax) {
|
||||||
@ -514,10 +542,10 @@ static void gen_cbw(bool dword,DynReg * dyn_ax) {
|
|||||||
static void gen_cwd(bool dword,DynReg * dyn_ax,DynReg * dyn_dx) {
|
static void gen_cwd(bool dword,DynReg * dyn_ax,DynReg * dyn_dx) {
|
||||||
ForceDynReg(x86gen.regs[X86_REG_EAX],dyn_ax);
|
ForceDynReg(x86gen.regs[X86_REG_EAX],dyn_ax);
|
||||||
ForceDynReg(x86gen.regs[X86_REG_EDX],dyn_dx);
|
ForceDynReg(x86gen.regs[X86_REG_EDX],dyn_dx);
|
||||||
if (!dword) cache_addb(0x66);
|
|
||||||
cache_addb(0x99);
|
|
||||||
dyn_ax->flags|=DYNFLG_CHANGED;
|
dyn_ax->flags|=DYNFLG_CHANGED;
|
||||||
dyn_dx->flags|=DYNFLG_CHANGED;
|
dyn_dx->flags|=DYNFLG_CHANGED;
|
||||||
|
if (!dword) cache_addw(0x9966);
|
||||||
|
else cache_addb(0x99);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_mul_byte(bool imul,DynReg * dyn_ax,DynReg * dr1,Bit8u di1) {
|
static void gen_mul_byte(bool imul,DynReg * dyn_ax,DynReg * dr1,Bit8u di1) {
|
||||||
@ -563,6 +591,7 @@ static void gen_dshift_cl(bool dword,bool left,DynReg * dr1,DynReg * dr2,DynReg
|
|||||||
|
|
||||||
static void gen_call_function(void * func,char * ops,...) {
|
static void gen_call_function(void * func,char * ops,...) {
|
||||||
Bits paramcount=0;
|
Bits paramcount=0;
|
||||||
|
bool release_flags=false;
|
||||||
struct ParamInfo {
|
struct ParamInfo {
|
||||||
char * line;
|
char * line;
|
||||||
Bitu value;
|
Bitu value;
|
||||||
@ -570,9 +599,9 @@ static void gen_call_function(void * func,char * ops,...) {
|
|||||||
ParamInfo * retparam=0;
|
ParamInfo * retparam=0;
|
||||||
/* Clear the EAX Genreg for usage */
|
/* Clear the EAX Genreg for usage */
|
||||||
x86gen.regs[X86_REG_EAX]->Clear();
|
x86gen.regs[X86_REG_EAX]->Clear();
|
||||||
x86gen.regs[X86_REG_EAX]->notusable=true;;
|
x86gen.regs[X86_REG_EAX]->notusable=true;
|
||||||
/* Save the flags */
|
/* Save the flags */
|
||||||
gen_protectflags();
|
if (GCC_UNLIKELY(!skip_flags)) gen_protectflags();
|
||||||
/* Scan for the amount of params */
|
/* Scan for the amount of params */
|
||||||
if (ops) {
|
if (ops) {
|
||||||
va_list params;
|
va_list params;
|
||||||
@ -626,7 +655,7 @@ static void gen_call_function(void * func,char * ops,...) {
|
|||||||
release=true;
|
release=true;
|
||||||
goto scanagain;
|
goto scanagain;
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("gen_call_function param:DREG");
|
||||||
}
|
}
|
||||||
if (release) gen_releasereg(dynreg);
|
if (release) gen_releasereg(dynreg);
|
||||||
}
|
}
|
||||||
@ -635,8 +664,11 @@ static void gen_call_function(void * func,char * ops,...) {
|
|||||||
retparam =&pinfo[pindex];
|
retparam =&pinfo[pindex];
|
||||||
pinfo[pindex].line=scan;
|
pinfo[pindex].line=scan;
|
||||||
break;
|
break;
|
||||||
|
case 'F': /* Release flags from stack */
|
||||||
|
release_flags=true;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("gen_call_function unknown param");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -649,12 +681,16 @@ static void gen_call_function(void * func,char * ops,...) {
|
|||||||
/* Restore the params of the stack */
|
/* Restore the params of the stack */
|
||||||
if (paramcount) {
|
if (paramcount) {
|
||||||
cache_addw(0xc483); //add ESP,imm byte
|
cache_addw(0xc483); //add ESP,imm byte
|
||||||
cache_addb(paramcount*4);
|
cache_addb(paramcount*4+(release_flags?4:0));
|
||||||
|
} else if (release_flags) {
|
||||||
|
cache_addw(0xc483); //add ESP,imm byte
|
||||||
|
cache_addb(4);
|
||||||
}
|
}
|
||||||
/* Save the return value in correct register */
|
/* Save the return value in correct register */
|
||||||
if (retparam) {
|
if (retparam) {
|
||||||
DynReg * dynreg=(DynReg *)retparam->value;
|
DynReg * dynreg=(DynReg *)retparam->value;
|
||||||
GenReg * genreg=FindDynReg(dynreg);
|
GenReg * genreg=FindDynReg(dynreg);
|
||||||
|
if (genreg->index) // test for (e)ax/al
|
||||||
switch (*retparam->line) {
|
switch (*retparam->line) {
|
||||||
case 'd':
|
case 'd':
|
||||||
cache_addw(0xc08b+(genreg->index <<(8+3))); //mov reg,eax
|
cache_addw(0xc08b+(genreg->index <<(8+3))); //mov reg,eax
|
||||||
@ -676,10 +712,47 @@ static void gen_call_function(void * func,char * ops,...) {
|
|||||||
x86gen.regs[X86_REG_EAX]->notusable=false;
|
x86gen.regs[X86_REG_EAX]->notusable=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void gen_call_write(DynReg * dr,Bit32u val,Bitu write_size) {
|
||||||
|
/* Clear the EAX Genreg for usage */
|
||||||
|
x86gen.regs[X86_REG_EAX]->Clear();
|
||||||
|
x86gen.regs[X86_REG_EAX]->notusable=true;
|
||||||
|
gen_protectflags();
|
||||||
|
|
||||||
|
cache_addb(0x68); //PUSH val
|
||||||
|
cache_addd(val);
|
||||||
|
GenReg * genreg=FindDynReg(dr);
|
||||||
|
cache_addb(0x50+genreg->index); //PUSH reg
|
||||||
|
|
||||||
|
/* Clear some unprotected registers */
|
||||||
|
x86gen.regs[X86_REG_ECX]->Clear();
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
static Bit8u * gen_create_branch(BranchTypes type) {
|
static Bit8u * gen_create_branch(BranchTypes type) {
|
||||||
/* First free all registers */
|
/* First free all registers */
|
||||||
cache_addb(0x70+type);
|
cache_addw(0x70+type);
|
||||||
cache_addb(0);
|
|
||||||
return (cache.pos-1);
|
return (cache.pos-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -692,6 +765,16 @@ static void gen_fill_branch(Bit8u * data,Bit8u * from=cache.pos) {
|
|||||||
*data=(from-data-1);
|
*data=(from-data-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Bit8u * gen_create_branch_long(BranchTypes type) {
|
||||||
|
cache_addw(0x800f+(type<<8));
|
||||||
|
cache_addd(0);
|
||||||
|
return (cache.pos-4);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void gen_fill_branch_long(Bit8u * data,Bit8u * from=cache.pos) {
|
||||||
|
*(Bit32u*)data=(from-data-4);
|
||||||
|
}
|
||||||
|
|
||||||
static Bit8u * gen_create_jump(Bit8u * to=0) {
|
static Bit8u * gen_create_jump(Bit8u * to=0) {
|
||||||
/* First free all registers */
|
/* First free all registers */
|
||||||
cache_addb(0xe9);
|
cache_addb(0xe9);
|
||||||
@ -720,7 +803,7 @@ static void gen_jmp_ptr(void * ptr,Bits imm=0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gen_save_flags(DynReg * dynreg) {
|
static void gen_save_flags(DynReg * dynreg) {
|
||||||
if (x86gen.flagsactive) IllegalOption();
|
if (GCC_UNLIKELY(x86gen.flagsactive)) IllegalOption("gen_save_flags");
|
||||||
GenReg * genreg=FindDynReg(dynreg);
|
GenReg * genreg=FindDynReg(dynreg);
|
||||||
cache_addb(0x8b); //MOV REG,[esp]
|
cache_addb(0x8b); //MOV REG,[esp]
|
||||||
cache_addw(0x2404+(genreg->index << 3));
|
cache_addw(0x2404+(genreg->index << 3));
|
||||||
@ -728,7 +811,7 @@ static void gen_save_flags(DynReg * dynreg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gen_load_flags(DynReg * dynreg) {
|
static void gen_load_flags(DynReg * dynreg) {
|
||||||
if (x86gen.flagsactive) IllegalOption();
|
if (GCC_UNLIKELY(x86gen.flagsactive)) IllegalOption("gen_load_flags");
|
||||||
cache_addw(0xc483); //ADD ESP,4
|
cache_addw(0xc483); //ADD ESP,4
|
||||||
cache_addb(0x4);
|
cache_addb(0x4);
|
||||||
GenReg * genreg=FindDynReg(dynreg);
|
GenReg * genreg=FindDynReg(dynreg);
|
||||||
@ -748,29 +831,62 @@ static void gen_load_host(void * data,DynReg * dr1,Bitu size) {
|
|||||||
case 2:cache_addw(0xb70f);break; //movzx word
|
case 2:cache_addw(0xb70f);break; //movzx word
|
||||||
case 4:cache_addb(0x8b);break; //mov
|
case 4:cache_addb(0x8b);break; //mov
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("gen_load_host");
|
||||||
}
|
}
|
||||||
cache_addb(0x5+(gr1->index<<3));
|
cache_addb(0x5+(gr1->index<<3));
|
||||||
cache_addd((Bit32u)data);
|
cache_addd((Bit32u)data);
|
||||||
dr1->flags|=DYNFLG_CHANGED;
|
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) {
|
static void gen_return(BlockReturn retcode) {
|
||||||
gen_protectflags();
|
gen_protectflags();
|
||||||
cache_addb(0x59); //POP ECX, the flags
|
cache_addb(0x59); //POP ECX, the flags
|
||||||
|
if (retcode==0) cache_addw(0xc033); //MOV EAX, 0
|
||||||
|
else {
|
||||||
cache_addb(0xb8); //MOV EAX, retcode
|
cache_addb(0xb8); //MOV EAX, retcode
|
||||||
cache_addd(retcode);
|
cache_addd(retcode);
|
||||||
|
}
|
||||||
|
cache_addb(0xc3); //RET
|
||||||
|
}
|
||||||
|
|
||||||
|
static void gen_return_fast(BlockReturn retcode,bool ret_exception=false) {
|
||||||
|
if (GCC_UNLIKELY(x86gen.flagsactive)) IllegalOption("gen_return_fast");
|
||||||
|
cache_addw(0x0d8b); //MOV ECX, the flags
|
||||||
|
cache_addd((Bit32u)&cpu_regs.flags);
|
||||||
|
if (!ret_exception) {
|
||||||
|
cache_addw(0xc483); //ADD ESP,4
|
||||||
|
cache_addb(0x4);
|
||||||
|
if (retcode==0) cache_addw(0xc033); //MOV EAX, 0
|
||||||
|
else {
|
||||||
|
cache_addb(0xb8); //MOV EAX, retcode
|
||||||
|
cache_addd(retcode);
|
||||||
|
}
|
||||||
|
}
|
||||||
cache_addb(0xc3); //RET
|
cache_addb(0xc3); //RET
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_init(void) {
|
static void gen_init(void) {
|
||||||
x86gen.regs[X86_REG_EAX]=new GenReg(0,false);
|
x86gen.regs[X86_REG_EAX]=new GenReg(0);
|
||||||
x86gen.regs[X86_REG_ECX]=new GenReg(1,false);
|
x86gen.regs[X86_REG_ECX]=new GenReg(1);
|
||||||
x86gen.regs[X86_REG_EDX]=new GenReg(2,false);
|
x86gen.regs[X86_REG_EDX]=new GenReg(2);
|
||||||
x86gen.regs[X86_REG_EBX]=new GenReg(3,true);
|
x86gen.regs[X86_REG_EBX]=new GenReg(3);
|
||||||
x86gen.regs[X86_REG_EBP]=new GenReg(5,true);
|
x86gen.regs[X86_REG_EBP]=new GenReg(5);
|
||||||
x86gen.regs[X86_REG_ESI]=new GenReg(6,true);
|
x86gen.regs[X86_REG_ESI]=new GenReg(6);
|
||||||
x86gen.regs[X86_REG_EDI]=new GenReg(7,true);
|
x86gen.regs[X86_REG_EDI]=new GenReg(7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -51,7 +51,7 @@ static void dyn_string(STRING_OP op) {
|
|||||||
case STR_INSB: case STR_INSW: case STR_INSD:
|
case STR_INSB: case STR_INSW: case STR_INSD:
|
||||||
tmp_reg=DREG(TMPB);usesi=false;usedi=true;break;
|
tmp_reg=DREG(TMPB);usesi=false;usedi=true;break;
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("dyn_string op");
|
||||||
}
|
}
|
||||||
gen_load_host(&cpu.direction,DREG(TMPW),4);
|
gen_load_host(&cpu.direction,DREG(TMPW),4);
|
||||||
switch (op & 3) {
|
switch (op & 3) {
|
||||||
@ -59,7 +59,7 @@ static void dyn_string(STRING_OP op) {
|
|||||||
case 1:gen_shift_word_imm(SHIFT_SHL,true,DREG(TMPW),1);break;
|
case 1:gen_shift_word_imm(SHIFT_SHL,true,DREG(TMPW),1);break;
|
||||||
case 2:gen_shift_word_imm(SHIFT_SHL,true,DREG(TMPW),2);break;
|
case 2:gen_shift_word_imm(SHIFT_SHL,true,DREG(TMPW),2);break;
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("dyn_string shift");
|
||||||
|
|
||||||
}
|
}
|
||||||
if (usesi) {
|
if (usesi) {
|
||||||
@ -80,13 +80,10 @@ static void dyn_string(STRING_OP op) {
|
|||||||
dyn_savestate(&rep_state);
|
dyn_savestate(&rep_state);
|
||||||
Bit8u * rep_start=cache.pos;
|
Bit8u * rep_start=cache.pos;
|
||||||
Bit8u * rep_ecx_jmp;
|
Bit8u * rep_ecx_jmp;
|
||||||
/* Check if ECX!=zero and decrease it */
|
/* Check if ECX!=zero */
|
||||||
if (decode.rep) {
|
if (decode.rep) {
|
||||||
gen_dop_word(DOP_OR,decode.big_addr,DREG(ECX),DREG(ECX));
|
gen_dop_word(DOP_OR,decode.big_addr,DREG(ECX),DREG(ECX));
|
||||||
Bit8u * branch_ecx=gen_create_branch(BR_NZ);
|
rep_ecx_jmp=gen_create_branch_long(BR_Z);
|
||||||
rep_ecx_jmp=gen_create_jump();
|
|
||||||
gen_fill_branch(branch_ecx);
|
|
||||||
gen_sop_word(SOP_DEC,decode.big_addr,DREG(ECX));
|
|
||||||
}
|
}
|
||||||
if (usesi) {
|
if (usesi) {
|
||||||
if (!decode.big_addr) {
|
if (!decode.big_addr) {
|
||||||
@ -95,7 +92,6 @@ static void dyn_string(STRING_OP op) {
|
|||||||
} else {
|
} else {
|
||||||
gen_lea(DREG(EA),si_base,DREG(ESI),0,0);
|
gen_lea(DREG(EA),si_base,DREG(ESI),0,0);
|
||||||
}
|
}
|
||||||
gen_dop_word(DOP_ADD,decode.big_addr,DREG(ESI),DREG(TMPW));
|
|
||||||
switch (op&3) {
|
switch (op&3) {
|
||||||
case 0:dyn_read_byte(DREG(EA),tmp_reg,false);break;
|
case 0:dyn_read_byte(DREG(EA),tmp_reg,false);break;
|
||||||
case 1:dyn_read_word(DREG(EA),tmp_reg,false);break;
|
case 1:dyn_read_word(DREG(EA),tmp_reg,false);break;
|
||||||
@ -117,7 +113,6 @@ static void dyn_string(STRING_OP op) {
|
|||||||
} else {
|
} else {
|
||||||
gen_lea(DREG(EA),di_base,DREG(EDI),0,0);
|
gen_lea(DREG(EA),di_base,DREG(EDI),0,0);
|
||||||
}
|
}
|
||||||
gen_dop_word(DOP_ADD,decode.big_addr,DREG(EDI),DREG(TMPW));
|
|
||||||
/* Maybe something special to be done to fill the value */
|
/* Maybe something special to be done to fill the value */
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case STR_INSB:
|
case STR_INSB:
|
||||||
@ -139,25 +134,31 @@ static void dyn_string(STRING_OP op) {
|
|||||||
dyn_write_word(DREG(EA),tmp_reg,true);
|
dyn_write_word(DREG(EA),tmp_reg,true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
IllegalOption();
|
IllegalOption("dyn_string op");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gen_releasereg(DREG(EA));gen_releasereg(DREG(TMPB));
|
gen_releasereg(DREG(EA));gen_releasereg(DREG(TMPB));
|
||||||
|
|
||||||
|
/* update registers */
|
||||||
|
if (usesi) gen_dop_word(DOP_ADD,decode.big_addr,DREG(ESI),DREG(TMPW));
|
||||||
|
if (usedi) gen_dop_word(DOP_ADD,decode.big_addr,DREG(EDI),DREG(TMPW));
|
||||||
|
|
||||||
if (decode.rep) {
|
if (decode.rep) {
|
||||||
DynState cycle_state;
|
gen_sop_word(SOP_DEC,decode.big_addr,DREG(ECX));
|
||||||
gen_sop_word(SOP_DEC,true,DREG(CYCLES));
|
gen_sop_word(SOP_DEC,true,DREG(CYCLES));
|
||||||
gen_releasereg(DREG(CYCLES));
|
gen_releasereg(DREG(CYCLES));
|
||||||
dyn_savestate(&cycle_state);
|
dyn_savestate(&save_info[used_save_info].state);
|
||||||
Bit8u * cycle_branch=gen_create_branch(BR_NLE);
|
save_info[used_save_info].branch_pos=gen_create_branch_long(BR_LE);
|
||||||
gen_dop_word_imm(DOP_ADD,decode.big_op,DREG(EIP),decode.op_start-decode.code_start);
|
save_info[used_save_info].eip_change=decode.op_start-decode.code_start;
|
||||||
dyn_save_critical_regs();
|
save_info[used_save_info].type=normal;
|
||||||
gen_return(BR_Cycles);
|
used_save_info++;
|
||||||
gen_fill_branch(cycle_branch);
|
|
||||||
dyn_loadstate(&cycle_state);
|
|
||||||
dyn_synchstate(&rep_state);
|
|
||||||
/* Jump back to start of ECX check */
|
/* Jump back to start of ECX check */
|
||||||
|
dyn_synchstate(&rep_state);
|
||||||
gen_create_jump(rep_start);
|
gen_create_jump(rep_start);
|
||||||
gen_fill_jump(rep_ecx_jmp);
|
|
||||||
|
dyn_loadstate(&rep_state);
|
||||||
|
gen_fill_branch_long(rep_ecx_jmp);
|
||||||
}
|
}
|
||||||
gen_releasereg(DREG(TMPW));
|
gen_releasereg(DREG(TMPW));
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -86,7 +86,7 @@ nextopcode:;
|
|||||||
SaveIP();
|
SaveIP();
|
||||||
continue;
|
continue;
|
||||||
illegalopcode:
|
illegalopcode:
|
||||||
LOG_MSG("Illegal opcode");
|
LOG(LOG_CPU,LOG_NORMAL)("Illegal opcode");
|
||||||
CPU_Exception(0x6,0);
|
CPU_Exception(0x6,0);
|
||||||
}
|
}
|
||||||
FillFlags();
|
FillFlags();
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -80,6 +80,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -105,10 +107,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
switch (inst.code.load) {
|
switch (inst.code.load) {
|
||||||
/* General loading */
|
/* General loading */
|
||||||
case L_POPwRM:
|
case L_POPwRM:
|
||||||
inst.op1.w = Pop_16();
|
inst_op1_w = Pop_16();
|
||||||
goto case_L_MODRM;
|
goto case_L_MODRM;
|
||||||
case L_POPdRM:
|
case L_POPdRM:
|
||||||
inst.op1.d = Pop_32();
|
inst_op1_d = Pop_32();
|
||||||
goto case_L_MODRM;
|
goto case_L_MODRM;
|
||||||
case_L_MODRM:
|
case_L_MODRM:
|
||||||
case L_MODRM:
|
case L_MODRM:
|
||||||
@ -21,160 +21,160 @@ l_MODRMswitch:
|
|||||||
switch (inst.code.extra) {
|
switch (inst.code.extra) {
|
||||||
/* Byte */
|
/* Byte */
|
||||||
case M_Ib:
|
case M_Ib:
|
||||||
inst.op1.d=Fetchb();
|
inst_op1_d=Fetchb();
|
||||||
break;
|
break;
|
||||||
case M_Ebx:
|
case M_Ebx:
|
||||||
if (inst.rm<0xc0) inst.op1.ds=(Bit8s)LoadMb(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op1_ds=(Bit8s)LoadMb(inst.rm_eaa);
|
||||||
else inst.op1.ds=(Bit8s)reg_8(inst.rm_eai);
|
else inst_op1_ds=(Bit8s)reg_8(inst.rm_eai);
|
||||||
break;
|
break;
|
||||||
case M_EbIb:
|
case M_EbIb:
|
||||||
inst.op2.d=Fetchb();
|
inst_op2_d=Fetchb();
|
||||||
case M_Eb:
|
case M_Eb:
|
||||||
if (inst.rm<0xc0) inst.op1.d=LoadMb(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op1_d=LoadMb(inst.rm_eaa);
|
||||||
else inst.op1.d=reg_8(inst.rm_eai);
|
else inst_op1_d=reg_8(inst.rm_eai);
|
||||||
break;
|
break;
|
||||||
case M_EbGb:
|
case M_EbGb:
|
||||||
if (inst.rm<0xc0) inst.op1.d=LoadMb(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op1_d=LoadMb(inst.rm_eaa);
|
||||||
else inst.op1.d=reg_8(inst.rm_eai);
|
else inst_op1_d=reg_8(inst.rm_eai);
|
||||||
inst.op2.d=reg_8(inst.rm_index);
|
inst_op2_d=reg_8(inst.rm_index);
|
||||||
break;
|
break;
|
||||||
case M_GbEb:
|
case M_GbEb:
|
||||||
if (inst.rm<0xc0) inst.op2.d=LoadMb(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op2_d=LoadMb(inst.rm_eaa);
|
||||||
else inst.op2.d=reg_8(inst.rm_eai);
|
else inst_op2_d=reg_8(inst.rm_eai);
|
||||||
case M_Gb:
|
case M_Gb:
|
||||||
inst.op1.d=reg_8(inst.rm_index);;
|
inst_op1_d=reg_8(inst.rm_index);;
|
||||||
break;
|
break;
|
||||||
/* Word */
|
/* Word */
|
||||||
case M_Iw:
|
case M_Iw:
|
||||||
inst.op1.d=Fetchw();
|
inst_op1_d=Fetchw();
|
||||||
break;
|
break;
|
||||||
case M_EwxGwx:
|
case M_EwxGwx:
|
||||||
inst.op2.ds=(Bit16s)reg_16(inst.rm_index);
|
inst_op2_ds=(Bit16s)reg_16(inst.rm_index);
|
||||||
goto l_M_Ewx;
|
goto l_M_Ewx;
|
||||||
case M_EwxIbx:
|
case M_EwxIbx:
|
||||||
inst.op2.ds=Fetchbs();
|
inst_op2_ds=Fetchbs();
|
||||||
goto l_M_Ewx;
|
goto l_M_Ewx;
|
||||||
case M_EwxIwx:
|
case M_EwxIwx:
|
||||||
inst.op2.ds=Fetchws();
|
inst_op2_ds=Fetchws();
|
||||||
l_M_Ewx:
|
l_M_Ewx:
|
||||||
case M_Ewx:
|
case M_Ewx:
|
||||||
if (inst.rm<0xc0) inst.op1.ds=(Bit16s)LoadMw(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op1_ds=(Bit16s)LoadMw(inst.rm_eaa);
|
||||||
else inst.op1.ds=(Bit16s)reg_16(inst.rm_eai);
|
else inst_op1_ds=(Bit16s)reg_16(inst.rm_eai);
|
||||||
break;
|
break;
|
||||||
case M_EwIb:
|
case M_EwIb:
|
||||||
inst.op2.d=Fetchb();
|
inst_op2_d=Fetchb();
|
||||||
goto l_M_Ew;
|
goto l_M_Ew;
|
||||||
case M_EwIbx:
|
case M_EwIbx:
|
||||||
inst.op2.ds=Fetchbs();
|
inst_op2_ds=Fetchbs();
|
||||||
goto l_M_Ew;
|
goto l_M_Ew;
|
||||||
case M_EwIw:
|
case M_EwIw:
|
||||||
inst.op2.d=Fetchw();
|
inst_op2_d=Fetchw();
|
||||||
goto l_M_Ew;
|
goto l_M_Ew;
|
||||||
case M_EwGwCL:
|
case M_EwGwCL:
|
||||||
inst.imm.d=reg_cl;
|
inst_imm_d=reg_cl;
|
||||||
goto l_M_EwGw;
|
goto l_M_EwGw;
|
||||||
case M_EwGwIb:
|
case M_EwGwIb:
|
||||||
inst.imm.d=Fetchb();
|
inst_imm_d=Fetchb();
|
||||||
goto l_M_EwGw;
|
goto l_M_EwGw;
|
||||||
case M_EwGwt:
|
case M_EwGwt:
|
||||||
inst.op2.d=reg_16(inst.rm_index);
|
inst_op2_d=reg_16(inst.rm_index);
|
||||||
inst.rm_eaa+=((Bit16s)inst.op2.d >> 4) * 2;
|
inst.rm_eaa+=((Bit16s)inst_op2_d >> 4) * 2;
|
||||||
goto l_M_Ew;
|
goto l_M_Ew;
|
||||||
l_M_EwGw:
|
l_M_EwGw:
|
||||||
case M_EwGw:
|
case M_EwGw:
|
||||||
inst.op2.d=reg_16(inst.rm_index);
|
inst_op2_d=reg_16(inst.rm_index);
|
||||||
l_M_Ew:
|
l_M_Ew:
|
||||||
case M_Ew:
|
case M_Ew:
|
||||||
if (inst.rm<0xc0) inst.op1.d=LoadMw(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op1_d=LoadMw(inst.rm_eaa);
|
||||||
else inst.op1.d=reg_16(inst.rm_eai);
|
else inst_op1_d=reg_16(inst.rm_eai);
|
||||||
break;
|
break;
|
||||||
case M_GwEw:
|
case M_GwEw:
|
||||||
if (inst.rm<0xc0) inst.op2.d=LoadMw(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op2_d=LoadMw(inst.rm_eaa);
|
||||||
else inst.op2.d=reg_16(inst.rm_eai);
|
else inst_op2_d=reg_16(inst.rm_eai);
|
||||||
case M_Gw:
|
case M_Gw:
|
||||||
inst.op1.d=reg_16(inst.rm_index);;
|
inst_op1_d=reg_16(inst.rm_index);;
|
||||||
break;
|
break;
|
||||||
/* DWord */
|
/* DWord */
|
||||||
case M_Id:
|
case M_Id:
|
||||||
inst.op1.d=Fetchd();
|
inst_op1_d=Fetchd();
|
||||||
break;
|
break;
|
||||||
case M_EdxGdx:
|
case M_EdxGdx:
|
||||||
inst.op2.ds=(Bit32s)reg_32(inst.rm_index);
|
inst_op2_ds=(Bit32s)reg_32(inst.rm_index);
|
||||||
case M_Edx:
|
case M_Edx:
|
||||||
if (inst.rm<0xc0) inst.op1.d=(Bit32s)LoadMd(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op1_d=(Bit32s)LoadMd(inst.rm_eaa);
|
||||||
else inst.op1.d=(Bit32s)reg_32(inst.rm_eai);
|
else inst_op1_d=(Bit32s)reg_32(inst.rm_eai);
|
||||||
break;
|
break;
|
||||||
case M_EdIb:
|
case M_EdIb:
|
||||||
inst.op2.d=Fetchb();
|
inst_op2_d=Fetchb();
|
||||||
goto l_M_Ed;
|
goto l_M_Ed;
|
||||||
case M_EdIbx:
|
case M_EdIbx:
|
||||||
inst.op2.ds=Fetchbs();
|
inst_op2_ds=Fetchbs();
|
||||||
goto l_M_Ed;
|
goto l_M_Ed;
|
||||||
case M_EdId:
|
case M_EdId:
|
||||||
inst.op2.d=Fetchd();
|
inst_op2_d=Fetchd();
|
||||||
goto l_M_Ed;
|
goto l_M_Ed;
|
||||||
case M_EdGdCL:
|
case M_EdGdCL:
|
||||||
inst.imm.d=reg_cl;
|
inst_imm_d=reg_cl;
|
||||||
goto l_M_EdGd;
|
goto l_M_EdGd;
|
||||||
case M_EdGdt:
|
case M_EdGdt:
|
||||||
inst.op2.d=reg_32(inst.rm_index);
|
inst_op2_d=reg_32(inst.rm_index);
|
||||||
inst.rm_eaa+=((Bit32s)inst.op2.d >> 5) * 4;
|
inst.rm_eaa+=((Bit32s)inst_op2_d >> 5) * 4;
|
||||||
goto l_M_Ed;
|
goto l_M_Ed;
|
||||||
case M_EdGdIb:
|
case M_EdGdIb:
|
||||||
inst.imm.d=Fetchb();
|
inst_imm_d=Fetchb();
|
||||||
goto l_M_EdGd;
|
goto l_M_EdGd;
|
||||||
l_M_EdGd:
|
l_M_EdGd:
|
||||||
case M_EdGd:
|
case M_EdGd:
|
||||||
inst.op2.d=reg_32(inst.rm_index);
|
inst_op2_d=reg_32(inst.rm_index);
|
||||||
l_M_Ed:
|
l_M_Ed:
|
||||||
case M_Ed:
|
case M_Ed:
|
||||||
if (inst.rm<0xc0) inst.op1.d=LoadMd(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op1_d=LoadMd(inst.rm_eaa);
|
||||||
else inst.op1.d=reg_32(inst.rm_eai);
|
else inst_op1_d=reg_32(inst.rm_eai);
|
||||||
break;
|
break;
|
||||||
case M_GdEd:
|
case M_GdEd:
|
||||||
if (inst.rm<0xc0) inst.op2.d=LoadMd(inst.rm_eaa);
|
if (inst.rm<0xc0) inst_op2_d=LoadMd(inst.rm_eaa);
|
||||||
else inst.op2.d=reg_32(inst.rm_eai);
|
else inst_op2_d=reg_32(inst.rm_eai);
|
||||||
case M_Gd:
|
case M_Gd:
|
||||||
inst.op1.d=reg_32(inst.rm_index);
|
inst_op1_d=reg_32(inst.rm_index);
|
||||||
break;
|
break;
|
||||||
/* Others */
|
/* Others */
|
||||||
|
|
||||||
case M_SEG:
|
case M_SEG:
|
||||||
//TODO Check for limit
|
//TODO Check for limit
|
||||||
inst.op1.d=SegValue((SegNames)inst.rm_index);
|
inst_op1_d=SegValue((SegNames)inst.rm_index);
|
||||||
break;
|
break;
|
||||||
case M_Efw:
|
case M_Efw:
|
||||||
if (inst.rm>=0xc0) goto illegalopcode;
|
if (inst.rm>=0xc0) goto illegalopcode;
|
||||||
inst.op1.d=LoadMw(inst.rm_eaa);
|
inst_op1_d=LoadMw(inst.rm_eaa);
|
||||||
inst.op2.d=LoadMw(inst.rm_eaa+2);
|
inst_op2_d=LoadMw(inst.rm_eaa+2);
|
||||||
break;
|
break;
|
||||||
case M_Efd:
|
case M_Efd:
|
||||||
if (inst.rm>=0xc0) goto illegalopcode;
|
if (inst.rm>=0xc0) goto illegalopcode;
|
||||||
inst.op1.d=LoadMd(inst.rm_eaa);
|
inst_op1_d=LoadMd(inst.rm_eaa);
|
||||||
inst.op2.d=LoadMw(inst.rm_eaa+4);
|
inst_op2_d=LoadMw(inst.rm_eaa+4);
|
||||||
break;
|
break;
|
||||||
case M_EA:
|
case M_EA:
|
||||||
inst.op1.d=inst.rm_off;
|
inst_op1_d=inst.rm_off;
|
||||||
break;
|
break;
|
||||||
case M_POPw:
|
case M_POPw:
|
||||||
inst.op1.d = Pop_16();
|
inst_op1_d = Pop_16();
|
||||||
break;
|
break;
|
||||||
case M_POPd:
|
case M_POPd:
|
||||||
inst.op1.d = Pop_32();
|
inst_op1_d = Pop_32();
|
||||||
break;
|
break;
|
||||||
case M_GRP:
|
case M_GRP:
|
||||||
inst.code=Groups[inst.code.op][inst.rm_index];
|
inst.code=Groups[inst.code.op][inst.rm_index];
|
||||||
goto l_MODRMswitch;
|
goto l_MODRMswitch;
|
||||||
case M_GRP_Ib:
|
case M_GRP_Ib:
|
||||||
inst.op2.d=Fetchb();
|
inst_op2_d=Fetchb();
|
||||||
inst.code=Groups[inst.code.op][inst.rm_index];
|
inst.code=Groups[inst.code.op][inst.rm_index];
|
||||||
goto l_MODRMswitch;
|
goto l_MODRMswitch;
|
||||||
case M_GRP_CL:
|
case M_GRP_CL:
|
||||||
inst.op2.d=reg_cl;
|
inst_op2_d=reg_cl;
|
||||||
inst.code=Groups[inst.code.op][inst.rm_index];
|
inst.code=Groups[inst.code.op][inst.rm_index];
|
||||||
goto l_MODRMswitch;
|
goto l_MODRMswitch;
|
||||||
case M_GRP_1:
|
case M_GRP_1:
|
||||||
inst.op2.d=1;
|
inst_op2_d=1;
|
||||||
inst.code=Groups[inst.code.op][inst.rm_index];
|
inst.code=Groups[inst.code.op][inst.rm_index];
|
||||||
goto l_MODRMswitch;
|
goto l_MODRMswitch;
|
||||||
case 0:
|
case 0:
|
||||||
@ -185,61 +185,61 @@ l_M_Ed:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case L_POPw:
|
case L_POPw:
|
||||||
inst.op1.d = Pop_16();
|
inst_op1_d = Pop_16();
|
||||||
break;
|
break;
|
||||||
case L_POPd:
|
case L_POPd:
|
||||||
inst.op1.d = Pop_32();
|
inst_op1_d = Pop_32();
|
||||||
break;
|
break;
|
||||||
case L_POPfw:
|
case L_POPfw:
|
||||||
inst.op1.d = Pop_16();
|
inst_op1_d = Pop_16();
|
||||||
inst.op2.d = Pop_16();
|
inst_op2_d = Pop_16();
|
||||||
break;
|
break;
|
||||||
case L_POPfd:
|
case L_POPfd:
|
||||||
inst.op1.d = Pop_32();
|
inst_op1_d = Pop_32();
|
||||||
inst.op2.d = Pop_16();
|
inst_op2_d = Pop_16();
|
||||||
break;
|
break;
|
||||||
case L_Ib:
|
case L_Ib:
|
||||||
inst.op1.d=Fetchb();
|
inst_op1_d=Fetchb();
|
||||||
break;
|
break;
|
||||||
case L_Ibx:
|
case L_Ibx:
|
||||||
inst.op1.ds=Fetchbs();
|
inst_op1_ds=Fetchbs();
|
||||||
break;
|
break;
|
||||||
case L_Iw:
|
case L_Iw:
|
||||||
inst.op1.d=Fetchw();
|
inst_op1_d=Fetchw();
|
||||||
break;
|
break;
|
||||||
case L_Iwx:
|
case L_Iwx:
|
||||||
inst.op1.ds=Fetchws();
|
inst_op1_ds=Fetchws();
|
||||||
break;
|
break;
|
||||||
case L_Idx:
|
case L_Idx:
|
||||||
case L_Id:
|
case L_Id:
|
||||||
inst.op1.d=Fetchd();
|
inst_op1_d=Fetchd();
|
||||||
break;
|
break;
|
||||||
case L_Ifw:
|
case L_Ifw:
|
||||||
inst.op1.d=Fetchw();
|
inst_op1_d=Fetchw();
|
||||||
inst.op2.d=Fetchw();
|
inst_op2_d=Fetchw();
|
||||||
break;
|
break;
|
||||||
case L_Ifd:
|
case L_Ifd:
|
||||||
inst.op1.d=Fetchd();
|
inst_op1_d=Fetchd();
|
||||||
inst.op2.d=Fetchw();
|
inst_op2_d=Fetchw();
|
||||||
break;
|
break;
|
||||||
/* Direct load of registers */
|
/* Direct load of registers */
|
||||||
case L_REGbIb:
|
case L_REGbIb:
|
||||||
inst.op2.d=Fetchb();
|
inst_op2_d=Fetchb();
|
||||||
case L_REGb:
|
case L_REGb:
|
||||||
inst.op1.d=reg_8(inst.code.extra);
|
inst_op1_d=reg_8(inst.code.extra);
|
||||||
break;
|
break;
|
||||||
case L_REGwIw:
|
case L_REGwIw:
|
||||||
inst.op2.d=Fetchw();
|
inst_op2_d=Fetchw();
|
||||||
case L_REGw:
|
case L_REGw:
|
||||||
inst.op1.d=reg_16(inst.code.extra);
|
inst_op1_d=reg_16(inst.code.extra);
|
||||||
break;
|
break;
|
||||||
case L_REGdId:
|
case L_REGdId:
|
||||||
inst.op2.d=Fetchd();
|
inst_op2_d=Fetchd();
|
||||||
case L_REGd:
|
case L_REGd:
|
||||||
inst.op1.d=reg_32(inst.code.extra);
|
inst_op1_d=reg_32(inst.code.extra);
|
||||||
break;
|
break;
|
||||||
case L_SEG:
|
case L_SEG:
|
||||||
inst.op1.d=SegValue((SegNames)inst.code.extra);
|
inst_op1_d=SegValue((SegNames)inst.code.extra);
|
||||||
break;
|
break;
|
||||||
/* Depending on addressize */
|
/* Depending on addressize */
|
||||||
case L_OP:
|
case L_OP:
|
||||||
@ -277,11 +277,11 @@ l_M_Ed:
|
|||||||
inst.prefix=(inst.prefix & ~1) | (cpu.code.big ^ 1);
|
inst.prefix=(inst.prefix & ~1) | (cpu.code.big ^ 1);
|
||||||
goto restartopcode;
|
goto restartopcode;
|
||||||
case L_VAL:
|
case L_VAL:
|
||||||
inst.op1.d=inst.code.extra;
|
inst_op1_d=inst.code.extra;
|
||||||
break;
|
break;
|
||||||
case L_INTO:
|
case L_INTO:
|
||||||
if (!get_OF()) goto nextopcode;
|
if (!get_OF()) goto nextopcode;
|
||||||
inst.op1.d=4;
|
inst_op1_d=4;
|
||||||
break;
|
break;
|
||||||
case D_IRETw:
|
case D_IRETw:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
@ -428,6 +428,10 @@ l_M_Ed:
|
|||||||
case D_WAIT:
|
case D_WAIT:
|
||||||
case D_NOP:
|
case D_NOP:
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
|
case D_LOCK: /* FIXME: according to intel, LOCK should raise an exception if it's not followed by one of a small set of instructions;
|
||||||
|
probably doesn't matter for our purposes as it is a pentium prefix anyhow */
|
||||||
|
LOG(LOG_CPU,LOG_NORMAL)("CPU:LOCK");
|
||||||
|
goto nextopcode;
|
||||||
case D_ENTERw:
|
case D_ENTERw:
|
||||||
{
|
{
|
||||||
Bitu bytes=Fetchw();
|
Bitu bytes=Fetchw();
|
||||||
@ -468,12 +472,18 @@ l_M_Ed:
|
|||||||
CPU_CPUID();
|
CPU_CPUID();
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case D_HLT:
|
case D_HLT:
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_HLT(GetIP());
|
CPU_HLT(GetIP());
|
||||||
return CBRET_NONE;
|
return CBRET_NONE;
|
||||||
case D_CLTS:
|
case D_CLTS:
|
||||||
//TODO Really clear it sometime
|
if (cpu.pmode && cpu.cpl) goto illegalopcode;
|
||||||
|
cpu.cr0&=(~CR0_TASKSWITCH);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
|
case D_ICEBP:
|
||||||
|
FillFlags();
|
||||||
|
CPU_SW_Interrupt_NoIOPLCheck(1,GetIP());
|
||||||
|
continue;
|
||||||
default:
|
default:
|
||||||
LOG(LOG_CPU,LOG_ERROR)("LOAD:Unhandled code %d opcode %X",inst.code.load,inst.entry);
|
LOG(LOG_CPU,LOG_ERROR)("LOAD:Unhandled code %d opcode %X",inst.code.load,inst.entry);
|
||||||
goto illegalopcode;
|
goto illegalopcode;
|
||||||
|
@ -1,223 +1,223 @@
|
|||||||
/* Do the actual opcode */
|
/* Do the actual opcode */
|
||||||
switch (inst.code.op) {
|
switch (inst.code.op) {
|
||||||
case t_ADDb: case t_ADDw: case t_ADDd:
|
case t_ADDb: case t_ADDw: case t_ADDd:
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
lf_var2d=inst.op2.d;
|
lf_var2d=inst_op2_d;
|
||||||
inst.op1.d=lf_resd=lf_var1d + lf_var2d;
|
inst_op1_d=lf_resd=lf_var1d + lf_var2d;
|
||||||
lflags.type=inst.code.op;
|
lflags.type=inst.code.op;
|
||||||
break;
|
break;
|
||||||
case t_CMPb: case t_CMPw: case t_CMPd:
|
case t_CMPb: case t_CMPw: case t_CMPd:
|
||||||
case t_SUBb: case t_SUBw: case t_SUBd:
|
case t_SUBb: case t_SUBw: case t_SUBd:
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
lf_var2d=inst.op2.d;
|
lf_var2d=inst_op2_d;
|
||||||
inst.op1.d=lf_resd=lf_var1d - lf_var2d;
|
inst_op1_d=lf_resd=lf_var1d - lf_var2d;
|
||||||
lflags.type=inst.code.op;
|
lflags.type=inst.code.op;
|
||||||
break;
|
break;
|
||||||
case t_ORb: case t_ORw: case t_ORd:
|
case t_ORb: case t_ORw: case t_ORd:
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
lf_var2d=inst.op2.d;
|
lf_var2d=inst_op2_d;
|
||||||
inst.op1.d=lf_resd=lf_var1d | lf_var2d;
|
inst_op1_d=lf_resd=lf_var1d | lf_var2d;
|
||||||
lflags.type=inst.code.op;
|
lflags.type=inst.code.op;
|
||||||
break;
|
break;
|
||||||
case t_XORb: case t_XORw: case t_XORd:
|
case t_XORb: case t_XORw: case t_XORd:
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
lf_var2d=inst.op2.d;
|
lf_var2d=inst_op2_d;
|
||||||
inst.op1.d=lf_resd=lf_var1d ^ lf_var2d;
|
inst_op1_d=lf_resd=lf_var1d ^ lf_var2d;
|
||||||
lflags.type=inst.code.op;
|
lflags.type=inst.code.op;
|
||||||
break;
|
break;
|
||||||
case t_TESTb: case t_TESTw: case t_TESTd:
|
case t_TESTb: case t_TESTw: case t_TESTd:
|
||||||
case t_ANDb: case t_ANDw: case t_ANDd:
|
case t_ANDb: case t_ANDw: case t_ANDd:
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
lf_var2d=inst.op2.d;
|
lf_var2d=inst_op2_d;
|
||||||
inst.op1.d=lf_resd=lf_var1d & lf_var2d;
|
inst_op1_d=lf_resd=lf_var1d & lf_var2d;
|
||||||
lflags.type=inst.code.op;
|
lflags.type=inst.code.op;
|
||||||
break;
|
break;
|
||||||
case t_ADCb: case t_ADCw: case t_ADCd:
|
case t_ADCb: case t_ADCw: case t_ADCd:
|
||||||
lflags.oldcf=(get_CF()!=0);
|
lflags.oldcf=(get_CF()!=0);
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
lf_var2d=inst.op2.d;
|
lf_var2d=inst_op2_d;
|
||||||
inst.op1.d=lf_resd=lf_var1d + lf_var2d + lflags.oldcf;
|
inst_op1_d=lf_resd=lf_var1d + lf_var2d + lflags.oldcf;
|
||||||
lflags.type=inst.code.op;
|
lflags.type=inst.code.op;
|
||||||
break;
|
break;
|
||||||
case t_SBBb: case t_SBBw: case t_SBBd:
|
case t_SBBb: case t_SBBw: case t_SBBd:
|
||||||
lflags.oldcf=(get_CF()!=0);
|
lflags.oldcf=(get_CF()!=0);
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
lf_var2d=inst.op2.d;
|
lf_var2d=inst_op2_d;
|
||||||
inst.op1.d=lf_resd=lf_var1d - lf_var2d - lflags.oldcf;
|
inst_op1_d=lf_resd=lf_var1d - lf_var2d - lflags.oldcf;
|
||||||
lflags.type=inst.code.op;
|
lflags.type=inst.code.op;
|
||||||
break;
|
break;
|
||||||
case t_INCb: case t_INCw: case t_INCd:
|
case t_INCb: case t_INCw: case t_INCd:
|
||||||
LoadCF;
|
LoadCF;
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
inst.op1.d=lf_resd=inst.op1.d+1;
|
inst_op1_d=lf_resd=inst_op1_d+1;
|
||||||
lflags.type=inst.code.op;
|
lflags.type=inst.code.op;
|
||||||
break;
|
break;
|
||||||
case t_DECb: case t_DECw: case t_DECd:
|
case t_DECb: case t_DECw: case t_DECd:
|
||||||
LoadCF;
|
LoadCF;
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
inst.op1.d=lf_resd=inst.op1.d-1;
|
inst_op1_d=lf_resd=inst_op1_d-1;
|
||||||
lflags.type=inst.code.op;
|
lflags.type=inst.code.op;
|
||||||
break;
|
break;
|
||||||
/* Using the instructions.h defines */
|
/* Using the instructions.h defines */
|
||||||
case t_ROLb:
|
case t_ROLb:
|
||||||
ROLB(inst.op1.b,inst.op2.b,LoadD,SaveD);
|
ROLB(inst_op1_b,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_ROLw:
|
case t_ROLw:
|
||||||
ROLW(inst.op1.w,inst.op2.b,LoadD,SaveD);
|
ROLW(inst_op1_w,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_ROLd:
|
case t_ROLd:
|
||||||
ROLD(inst.op1.d,inst.op2.b,LoadD,SaveD);
|
ROLD(inst_op1_d,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case t_RORb:
|
case t_RORb:
|
||||||
RORB(inst.op1.b,inst.op2.b,LoadD,SaveD);
|
RORB(inst_op1_b,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_RORw:
|
case t_RORw:
|
||||||
RORW(inst.op1.w,inst.op2.b,LoadD,SaveD);
|
RORW(inst_op1_w,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_RORd:
|
case t_RORd:
|
||||||
RORD(inst.op1.d,inst.op2.b,LoadD,SaveD);
|
RORD(inst_op1_d,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case t_RCLb:
|
case t_RCLb:
|
||||||
RCLB(inst.op1.b,inst.op2.b,LoadD,SaveD);
|
RCLB(inst_op1_b,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_RCLw:
|
case t_RCLw:
|
||||||
RCLW(inst.op1.w,inst.op2.b,LoadD,SaveD);
|
RCLW(inst_op1_w,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_RCLd:
|
case t_RCLd:
|
||||||
RCLD(inst.op1.d,inst.op2.b,LoadD,SaveD);
|
RCLD(inst_op1_d,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case t_RCRb:
|
case t_RCRb:
|
||||||
RCRB(inst.op1.b,inst.op2.b,LoadD,SaveD);
|
RCRB(inst_op1_b,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_RCRw:
|
case t_RCRw:
|
||||||
RCRW(inst.op1.w,inst.op2.b,LoadD,SaveD);
|
RCRW(inst_op1_w,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_RCRd:
|
case t_RCRd:
|
||||||
RCRD(inst.op1.d,inst.op2.b,LoadD,SaveD);
|
RCRD(inst_op1_d,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case t_SHLb:
|
case t_SHLb:
|
||||||
SHLB(inst.op1.b,inst.op2.b,LoadD,SaveD);
|
SHLB(inst_op1_b,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_SHLw:
|
case t_SHLw:
|
||||||
SHLW(inst.op1.w,inst.op2.b,LoadD,SaveD);
|
SHLW(inst_op1_w,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_SHLd:
|
case t_SHLd:
|
||||||
SHLD(inst.op1.d,inst.op2.b,LoadD,SaveD);
|
SHLD(inst_op1_d,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case t_SHRb:
|
case t_SHRb:
|
||||||
SHRB(inst.op1.b,inst.op2.b,LoadD,SaveD);
|
SHRB(inst_op1_b,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_SHRw:
|
case t_SHRw:
|
||||||
SHRW(inst.op1.w,inst.op2.b,LoadD,SaveD);
|
SHRW(inst_op1_w,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_SHRd:
|
case t_SHRd:
|
||||||
SHRD(inst.op1.d,inst.op2.b,LoadD,SaveD);
|
SHRD(inst_op1_d,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case t_SARb:
|
case t_SARb:
|
||||||
SARB(inst.op1.b,inst.op2.b,LoadD,SaveD);
|
SARB(inst_op1_b,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_SARw:
|
case t_SARw:
|
||||||
SARW(inst.op1.w,inst.op2.b,LoadD,SaveD);
|
SARW(inst_op1_w,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case t_SARd:
|
case t_SARd:
|
||||||
SARD(inst.op1.d,inst.op2.b,LoadD,SaveD);
|
SARD(inst_op1_d,inst_op2_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case O_DSHLw:
|
case O_DSHLw:
|
||||||
{
|
{
|
||||||
DSHLW(inst.op1.w,inst.op2.w,inst.imm.b,LoadD,SaveD);
|
DSHLW(inst_op1_w,inst_op2_w,inst_imm_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case O_DSHRw:
|
case O_DSHRw:
|
||||||
{
|
{
|
||||||
DSHRW(inst.op1.w,inst.op2.w,inst.imm.b,LoadD,SaveD);
|
DSHRW(inst_op1_w,inst_op2_w,inst_imm_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case O_DSHLd:
|
case O_DSHLd:
|
||||||
{
|
{
|
||||||
DSHLD(inst.op1.d,inst.op2.d,inst.imm.b,LoadD,SaveD);
|
DSHLD(inst_op1_d,inst_op2_d,inst_imm_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case O_DSHRd:
|
case O_DSHRd:
|
||||||
{
|
{
|
||||||
DSHRD(inst.op1.d,inst.op2.d,inst.imm.b,LoadD,SaveD);
|
DSHRD(inst_op1_d,inst_op2_d,inst_imm_b,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case t_NEGb:
|
case t_NEGb:
|
||||||
lf_var1b=inst.op1.b;
|
lf_var1b=inst_op1_b;
|
||||||
inst.op1.b=lf_resb=0-inst.op1.b;
|
inst_op1_b=lf_resb=0-inst_op1_b;
|
||||||
lflags.type=t_NEGb;
|
lflags.type=t_NEGb;
|
||||||
break;
|
break;
|
||||||
case t_NEGw:
|
case t_NEGw:
|
||||||
lf_var1w=inst.op1.w;
|
lf_var1w=inst_op1_w;
|
||||||
inst.op1.w=lf_resw=0-inst.op1.w;
|
inst_op1_w=lf_resw=0-inst_op1_w;
|
||||||
lflags.type=t_NEGw;
|
lflags.type=t_NEGw;
|
||||||
break;
|
break;
|
||||||
case t_NEGd:
|
case t_NEGd:
|
||||||
lf_var1d=inst.op1.d;
|
lf_var1d=inst_op1_d;
|
||||||
inst.op1.d=lf_resd=0-inst.op1.d;
|
inst_op1_d=lf_resd=0-inst_op1_d;
|
||||||
lflags.type=t_NEGd;
|
lflags.type=t_NEGd;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case O_NOT:
|
case O_NOT:
|
||||||
inst.op1.d=~inst.op1.d;
|
inst_op1_d=~inst_op1_d;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Special instructions */
|
/* Special instructions */
|
||||||
case O_IMULRw:
|
case O_IMULRw:
|
||||||
DIMULW(inst.op1.ws,inst.op1.ws,inst.op2.ws,LoadD,SaveD);
|
DIMULW(inst_op1_ws,inst_op1_ws,inst_op2_ws,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case O_IMULRd:
|
case O_IMULRd:
|
||||||
DIMULD(inst.op1.ds,inst.op1.ds,inst.op2.ds,LoadD,SaveD);
|
DIMULD(inst_op1_ds,inst_op1_ds,inst_op2_ds,LoadD,SaveD);
|
||||||
break;
|
break;
|
||||||
case O_MULb:
|
case O_MULb:
|
||||||
MULB(inst.op1.b,LoadD,0);
|
MULB(inst_op1_b,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_MULw:
|
case O_MULw:
|
||||||
MULW(inst.op1.w,LoadD,0);
|
MULW(inst_op1_w,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_MULd:
|
case O_MULd:
|
||||||
MULD(inst.op1.d,LoadD,0);
|
MULD(inst_op1_d,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_IMULb:
|
case O_IMULb:
|
||||||
IMULB(inst.op1.b,LoadD,0);
|
IMULB(inst_op1_b,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_IMULw:
|
case O_IMULw:
|
||||||
IMULW(inst.op1.w,LoadD,0);
|
IMULW(inst_op1_w,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_IMULd:
|
case O_IMULd:
|
||||||
IMULD(inst.op1.d,LoadD,0);
|
IMULD(inst_op1_d,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_DIVb:
|
case O_DIVb:
|
||||||
DIVB(inst.op1.b,LoadD,0);
|
DIVB(inst_op1_b,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_DIVw:
|
case O_DIVw:
|
||||||
DIVW(inst.op1.w,LoadD,0);
|
DIVW(inst_op1_w,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_DIVd:
|
case O_DIVd:
|
||||||
DIVD(inst.op1.d,LoadD,0);
|
DIVD(inst_op1_d,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_IDIVb:
|
case O_IDIVb:
|
||||||
IDIVB(inst.op1.b,LoadD,0);
|
IDIVB(inst_op1_b,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_IDIVw:
|
case O_IDIVw:
|
||||||
IDIVW(inst.op1.w,LoadD,0);
|
IDIVW(inst_op1_w,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_IDIVd:
|
case O_IDIVd:
|
||||||
IDIVD(inst.op1.d,LoadD,0);
|
IDIVD(inst_op1_d,LoadD,0);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_AAM:
|
case O_AAM:
|
||||||
AAM(inst.op1.b);
|
AAM(inst_op1_b);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_AAD:
|
case O_AAD:
|
||||||
AAD(inst.op1.b);
|
AAD(inst_op1_b);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
|
|
||||||
case O_C_O: inst.cond=TFLG_O; break;
|
case O_C_O: inst.cond=TFLG_O; break;
|
||||||
@ -302,15 +302,15 @@ switch (inst.code.op) {
|
|||||||
case O_XCHG_AX:
|
case O_XCHG_AX:
|
||||||
{
|
{
|
||||||
Bit16u temp=reg_ax;
|
Bit16u temp=reg_ax;
|
||||||
reg_ax=inst.op1.w;
|
reg_ax=inst_op1_w;
|
||||||
inst.op1.w=temp;
|
inst_op1_w=temp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case O_XCHG_EAX:
|
case O_XCHG_EAX:
|
||||||
{
|
{
|
||||||
Bit32u temp=reg_eax;
|
Bit32u temp=reg_eax;
|
||||||
reg_eax=inst.op1.d;
|
reg_eax=inst_op1_d;
|
||||||
inst.op1.d=temp;
|
inst_op1_d=temp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case O_CALLNw:
|
case O_CALLNw:
|
||||||
@ -323,90 +323,94 @@ switch (inst.code.op) {
|
|||||||
break;
|
break;
|
||||||
case O_CALLFw:
|
case O_CALLFw:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_CALL(false,inst.op2.d,inst.op1.d,GetIP());
|
CPU_CALL(false,inst_op2_d,inst_op1_d,GetIP());
|
||||||
continue;
|
continue;
|
||||||
case O_CALLFd:
|
case O_CALLFd:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_CALL(true,inst.op2.d,inst.op1.d,GetIP());
|
CPU_CALL(true,inst_op2_d,inst_op1_d,GetIP());
|
||||||
continue;
|
continue;
|
||||||
case O_JMPFw:
|
case O_JMPFw:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_JMP(false,inst.op2.d,inst.op1.d,GetIP());
|
CPU_JMP(false,inst_op2_d,inst_op1_d,GetIP());
|
||||||
continue;
|
continue;
|
||||||
case O_JMPFd:
|
case O_JMPFd:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_JMP(true,inst.op2.d,inst.op1.d,GetIP());
|
CPU_JMP(true,inst_op2_d,inst_op1_d,GetIP());
|
||||||
continue;
|
continue;
|
||||||
case O_INT:
|
case O_INT:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
#if C_DEBUG
|
#if C_DEBUG
|
||||||
if (((inst.entry & 0xFF)==0xcc) && DEBUG_Breakpoint())
|
if (((inst.entry & 0xFF)==0xcc) && DEBUG_Breakpoint())
|
||||||
return debugCallback;
|
return debugCallback;
|
||||||
else if (DEBUG_IntBreakpoint(inst.op1.b))
|
else if (DEBUG_IntBreakpoint(inst_op1_b))
|
||||||
return debugCallback;
|
return debugCallback;
|
||||||
#endif
|
#endif
|
||||||
CPU_SW_Interrupt(inst.op1.b,GetIP());
|
CPU_SW_Interrupt(inst_op1_b,GetIP());
|
||||||
continue;
|
continue;
|
||||||
case O_INb:
|
case O_INb:
|
||||||
if (CPU_IO_Exception(inst.op1.d,1)) RunException();
|
if (CPU_IO_Exception(inst_op1_d,1)) RunException();
|
||||||
reg_al=IO_ReadB(inst.op1.d);
|
reg_al=IO_ReadB(inst_op1_d);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_INw:
|
case O_INw:
|
||||||
if (CPU_IO_Exception(inst.op1.d,2)) RunException();
|
if (CPU_IO_Exception(inst_op1_d,2)) RunException();
|
||||||
reg_ax=IO_ReadW(inst.op1.d);
|
reg_ax=IO_ReadW(inst_op1_d);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_INd:
|
case O_INd:
|
||||||
if (CPU_IO_Exception(inst.op1.d,4)) RunException();
|
if (CPU_IO_Exception(inst_op1_d,4)) RunException();
|
||||||
reg_eax=IO_ReadD(inst.op1.d);
|
reg_eax=IO_ReadD(inst_op1_d);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_OUTb:
|
case O_OUTb:
|
||||||
if (CPU_IO_Exception(inst.op1.d,1)) RunException();
|
if (CPU_IO_Exception(inst_op1_d,1)) RunException();
|
||||||
IO_WriteB(inst.op1.d,reg_al);
|
IO_WriteB(inst_op1_d,reg_al);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_OUTw:
|
case O_OUTw:
|
||||||
if (CPU_IO_Exception(inst.op1.d,2)) RunException();
|
if (CPU_IO_Exception(inst_op1_d,2)) RunException();
|
||||||
IO_WriteW(inst.op1.d,reg_ax);
|
IO_WriteW(inst_op1_d,reg_ax);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_OUTd:
|
case O_OUTd:
|
||||||
if (CPU_IO_Exception(inst.op1.d,4)) RunException();
|
if (CPU_IO_Exception(inst_op1_d,4)) RunException();
|
||||||
IO_WriteD(inst.op1.d,reg_eax);
|
IO_WriteD(inst_op1_d,reg_eax);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case O_CBACK:
|
case O_CBACK:
|
||||||
FillFlags();SaveIP();
|
FillFlags();SaveIP();
|
||||||
return inst.op1.d;
|
return inst_op1_d;
|
||||||
case O_GRP6w:
|
case O_GRP6w:
|
||||||
case O_GRP6d:
|
case O_GRP6d:
|
||||||
|
if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegalopcode;
|
||||||
switch (inst.rm_index) {
|
switch (inst.rm_index) {
|
||||||
case 0x00: /* SLDT */
|
case 0x00: /* SLDT */
|
||||||
{
|
{
|
||||||
Bitu selector;
|
Bitu selector;
|
||||||
CPU_SLDT(selector);
|
CPU_SLDT(selector);
|
||||||
inst.op1.d=(Bit32u)selector;
|
inst_op1_d=(Bit32u)selector;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x01: /* STR */
|
case 0x01: /* STR */
|
||||||
{
|
{
|
||||||
Bitu selector;
|
Bitu selector;
|
||||||
CPU_STR(selector);
|
CPU_STR(selector);
|
||||||
inst.op1.d=(Bit32u)selector;
|
inst_op1_d=(Bit32u)selector;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x02: /* LLDT */
|
case 0x02: /* LLDT */
|
||||||
CPU_LLDT(inst.op1.d);
|
if (cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
|
if (CPU_LLDT(inst_op1_d)) RunException();
|
||||||
goto nextopcode; /* Else value will saved */
|
goto nextopcode; /* Else value will saved */
|
||||||
case 0x03: /* LTR */
|
case 0x03: /* LTR */
|
||||||
CPU_LTR(inst.op1.d);
|
if (cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
|
if (CPU_LTR(inst_op1_d)) RunException();
|
||||||
goto nextopcode; /* Else value will saved */
|
goto nextopcode; /* Else value will saved */
|
||||||
case 0x04: /* VERR */
|
case 0x04: /* VERR */
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_VERR(inst.op1.d);
|
CPU_VERR(inst_op1_d);
|
||||||
goto nextopcode; /* Else value will saved */
|
goto nextopcode; /* Else value will saved */
|
||||||
case 0x05: /* VERW */
|
case 0x05: /* VERW */
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_VERW(inst.op1.d);
|
CPU_VERW(inst_op1_d);
|
||||||
goto nextopcode; /* Else value will saved */
|
goto nextopcode; /* Else value will saved */
|
||||||
default:
|
default:
|
||||||
LOG(LOG_CPU,LOG_ERROR)("Group 6 Illegal subfunction %X",inst.rm_index);
|
LOG(LOG_CPU,LOG_ERROR)("Group 6 Illegal subfunction %X",inst.rm_index);
|
||||||
|
goto illegalopcode;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_GRP7w:
|
case O_GRP7w:
|
||||||
@ -429,76 +433,80 @@ switch (inst.code.op) {
|
|||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
}
|
}
|
||||||
case 2: /* LGDT */
|
case 2: /* LGDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
CPU_LGDT(LoadMw(inst.rm_eaa),LoadMd(inst.rm_eaa+2)&((inst.code.op == O_GRP7w) ? 0xFFFFFF : 0xFFFFFFFF));
|
CPU_LGDT(LoadMw(inst.rm_eaa),LoadMd(inst.rm_eaa+2)&((inst.code.op == O_GRP7w) ? 0xFFFFFF : 0xFFFFFFFF));
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case 3: /* LIDT */
|
case 3: /* LIDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
CPU_LIDT(LoadMw(inst.rm_eaa),LoadMd(inst.rm_eaa+2)&((inst.code.op == O_GRP7w) ? 0xFFFFFF : 0xFFFFFFFF));
|
CPU_LIDT(LoadMw(inst.rm_eaa),LoadMd(inst.rm_eaa+2)&((inst.code.op == O_GRP7w) ? 0xFFFFFF : 0xFFFFFFFF));
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
case 4: /* SMSW */
|
case 4: /* SMSW */
|
||||||
{
|
{
|
||||||
Bitu word;CPU_SMSW(word);
|
Bitu word;CPU_SMSW(word);
|
||||||
inst.op1.d=word;
|
inst_op1_d=word;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 6: /* LMSW */
|
case 6: /* LMSW */
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_LMSW(inst.op1.w);
|
if (CPU_LMSW(inst_op1_w)) RunException();
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
default:
|
default:
|
||||||
LOG(LOG_CPU,LOG_ERROR)("Group 7 Illegal subfunction %X",inst.rm_index);
|
LOG(LOG_CPU,LOG_ERROR)("Group 7 Illegal subfunction %X",inst.rm_index);
|
||||||
|
goto illegalopcode;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_M_CRx_Rd:
|
case O_M_CRx_Rd:
|
||||||
CPU_SET_CRX(inst.rm_index,inst.op1.d);
|
if (CPU_WRITE_CRX(inst.rm_index,inst_op1_d)) RunException();
|
||||||
break;
|
break;
|
||||||
case O_M_Rd_CRx:
|
case O_M_Rd_CRx:
|
||||||
inst.op1.d=CPU_GET_CRX(inst.rm_index);
|
if (CPU_READ_CRX(inst.rm_index,inst_op1_d)) RunException();
|
||||||
break;
|
break;
|
||||||
case O_M_DRx_Rd:
|
case O_M_DRx_Rd:
|
||||||
// LOG(LOG_CPU,LOG_NORMAL)("MOV DR%d,%X",inst.rm_index,inst.op1.d);
|
if (CPU_WRITE_DRX(inst.rm_index,inst_op1_d)) RunException();
|
||||||
break;
|
break;
|
||||||
case O_M_Rd_DRx:
|
case O_M_Rd_DRx:
|
||||||
inst.op1.d=0;
|
if (CPU_READ_DRX(inst.rm_index,inst_op1_d)) RunException();
|
||||||
// LOG(LOG_CPU,LOG_NORMAL)("MOV %X,DR%d",inst.op1.d,inst.rm_index);
|
|
||||||
break;
|
break;
|
||||||
case O_LAR:
|
case O_LAR:
|
||||||
{
|
{
|
||||||
|
if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegalopcode;
|
||||||
FillFlags();
|
FillFlags();
|
||||||
Bitu ar=inst.op2.d;
|
Bitu ar=inst_op2_d;
|
||||||
CPU_LAR(inst.op1.w,ar);
|
CPU_LAR(inst_op1_w,ar);
|
||||||
inst.op1.d=(Bit32u)ar;
|
inst_op1_d=(Bit32u)ar;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_LSL:
|
case O_LSL:
|
||||||
{
|
{
|
||||||
|
if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegalopcode;
|
||||||
FillFlags();
|
FillFlags();
|
||||||
Bitu limit=inst.op2.d;
|
Bitu limit=inst_op2_d;
|
||||||
CPU_LSL(inst.op1.w,limit);
|
CPU_LSL(inst_op1_w,limit);
|
||||||
inst.op1.d=(Bit32u)limit;
|
inst_op1_d=(Bit32u)limit;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_ARPL:
|
case O_ARPL:
|
||||||
{
|
{
|
||||||
if ((reg_flags & FLAG_VM) || !cpu.pmode) goto illegalopcode;
|
if ((reg_flags & FLAG_VM) || !cpu.pmode) goto illegalopcode;
|
||||||
FillFlags();
|
FillFlags();
|
||||||
Bitu new_sel=inst.op1.d;
|
Bitu new_sel=inst_op1_d;
|
||||||
CPU_ARPL(new_sel,inst.op2.d);
|
CPU_ARPL(new_sel,inst_op2_d);
|
||||||
inst.op1.d=(Bit32u)new_sel;
|
inst_op1_d=(Bit32u)new_sel;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_BSFw:
|
case O_BSFw:
|
||||||
{
|
{
|
||||||
FillFlags();
|
FillFlags();
|
||||||
if (!inst.op1.w) {
|
if (!inst_op1_w) {
|
||||||
SETFLAGBIT(ZF,true);
|
SETFLAGBIT(ZF,true);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
} else {
|
} else {
|
||||||
Bitu count=0;
|
Bitu count=0;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (inst.op1.w & 0x1) break;
|
if (inst_op1_w & 0x1) break;
|
||||||
count++;inst.op1.w>>=1;
|
count++;inst_op1_w>>=1;
|
||||||
}
|
}
|
||||||
inst.op1.d=count;
|
inst_op1_d=count;
|
||||||
SETFLAGBIT(ZF,false);
|
SETFLAGBIT(ZF,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -506,16 +514,16 @@ switch (inst.code.op) {
|
|||||||
case O_BSFd:
|
case O_BSFd:
|
||||||
{
|
{
|
||||||
FillFlags();
|
FillFlags();
|
||||||
if (!inst.op1.d) {
|
if (!inst_op1_d) {
|
||||||
SETFLAGBIT(ZF,true);
|
SETFLAGBIT(ZF,true);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
} else {
|
} else {
|
||||||
Bitu count=0;
|
Bitu count=0;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (inst.op1.d & 0x1) break;
|
if (inst_op1_d & 0x1) break;
|
||||||
count++;inst.op1.d>>=1;
|
count++;inst_op1_d>>=1;
|
||||||
}
|
}
|
||||||
inst.op1.d=count;
|
inst_op1_d=count;
|
||||||
SETFLAGBIT(ZF,false);
|
SETFLAGBIT(ZF,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -523,16 +531,16 @@ switch (inst.code.op) {
|
|||||||
case O_BSRw:
|
case O_BSRw:
|
||||||
{
|
{
|
||||||
FillFlags();
|
FillFlags();
|
||||||
if (!inst.op1.w) {
|
if (!inst_op1_w) {
|
||||||
SETFLAGBIT(ZF,true);
|
SETFLAGBIT(ZF,true);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
} else {
|
} else {
|
||||||
Bitu count=15;
|
Bitu count=15;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (inst.op1.w & 0x8000) break;
|
if (inst_op1_w & 0x8000) break;
|
||||||
count--;inst.op1.w<<=1;
|
count--;inst_op1_w<<=1;
|
||||||
}
|
}
|
||||||
inst.op1.d=count;
|
inst_op1_d=count;
|
||||||
SETFLAGBIT(ZF,false);
|
SETFLAGBIT(ZF,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -540,60 +548,60 @@ switch (inst.code.op) {
|
|||||||
case O_BSRd:
|
case O_BSRd:
|
||||||
{
|
{
|
||||||
FillFlags();
|
FillFlags();
|
||||||
if (!inst.op1.d) {
|
if (!inst_op1_d) {
|
||||||
SETFLAGBIT(ZF,true);
|
SETFLAGBIT(ZF,true);
|
||||||
goto nextopcode;
|
goto nextopcode;
|
||||||
} else {
|
} else {
|
||||||
Bitu count=31;
|
Bitu count=31;
|
||||||
while (1) {
|
while (1) {
|
||||||
if (inst.op1.d & 0x80000000) break;
|
if (inst_op1_d & 0x80000000) break;
|
||||||
count--;inst.op1.d<<=1;
|
count--;inst_op1_d<<=1;
|
||||||
}
|
}
|
||||||
inst.op1.d=count;
|
inst_op1_d=count;
|
||||||
SETFLAGBIT(ZF,false);
|
SETFLAGBIT(ZF,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_BTw:
|
case O_BTw:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
SETFLAGBIT(CF,(inst.op1.d & (1 << (inst.op2.d & 15))));
|
SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 15))));
|
||||||
break;
|
break;
|
||||||
case O_BTSw:
|
case O_BTSw:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
SETFLAGBIT(CF,(inst.op1.d & (1 << (inst.op2.d & 15))));
|
SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 15))));
|
||||||
inst.op1.d|=(1 << (inst.op2.d & 15));
|
inst_op1_d|=(1 << (inst_op2_d & 15));
|
||||||
break;
|
break;
|
||||||
case O_BTCw:
|
case O_BTCw:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
SETFLAGBIT(CF,(inst.op1.d & (1 << (inst.op2.d & 15))));
|
SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 15))));
|
||||||
inst.op1.d^=(1 << (inst.op2.d & 15));
|
inst_op1_d^=(1 << (inst_op2_d & 15));
|
||||||
break;
|
break;
|
||||||
case O_BTRw:
|
case O_BTRw:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
SETFLAGBIT(CF,(inst.op1.d & (1 << (inst.op2.d & 15))));
|
SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 15))));
|
||||||
inst.op1.d&=~(1 << (inst.op2.d & 15));
|
inst_op1_d&=~(1 << (inst_op2_d & 15));
|
||||||
break;
|
break;
|
||||||
case O_BTd:
|
case O_BTd:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
SETFLAGBIT(CF,(inst.op1.d & (1 << (inst.op2.d & 31))));
|
SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 31))));
|
||||||
break;
|
break;
|
||||||
case O_BTSd:
|
case O_BTSd:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
SETFLAGBIT(CF,(inst.op1.d & (1 << (inst.op2.d & 31))));
|
SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 31))));
|
||||||
inst.op1.d|=(1 << (inst.op2.d & 31));
|
inst_op1_d|=(1 << (inst_op2_d & 31));
|
||||||
break;
|
break;
|
||||||
case O_BTCd:
|
case O_BTCd:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
SETFLAGBIT(CF,(inst.op1.d & (1 << (inst.op2.d & 31))));
|
SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 31))));
|
||||||
inst.op1.d^=(1 << (inst.op2.d & 31));
|
inst_op1_d^=(1 << (inst_op2_d & 31));
|
||||||
break;
|
break;
|
||||||
case O_BTRd:
|
case O_BTRd:
|
||||||
FillFlags();
|
FillFlags();
|
||||||
SETFLAGBIT(CF,(inst.op1.d & (1 << (inst.op2.d & 31))));
|
SETFLAGBIT(CF,(inst_op1_d & (1 << (inst_op2_d & 31))));
|
||||||
inst.op1.d&=~(1 << (inst.op2.d & 31));
|
inst_op1_d&=~(1 << (inst_op2_d & 31));
|
||||||
break;
|
break;
|
||||||
case O_BSWAP:
|
case O_BSWAP:
|
||||||
BSWAP(inst.op1.d);
|
BSWAP(inst_op1_d);
|
||||||
break;
|
break;
|
||||||
case O_FPU:
|
case O_FPU:
|
||||||
#if C_FPU
|
#if C_FPU
|
||||||
@ -626,7 +634,7 @@ switch (inst.code.op) {
|
|||||||
Bit16s bound_min, bound_max;
|
Bit16s bound_min, bound_max;
|
||||||
bound_min=LoadMw(inst.rm_eaa);
|
bound_min=LoadMw(inst.rm_eaa);
|
||||||
bound_max=LoadMw(inst.rm_eaa+2);
|
bound_max=LoadMw(inst.rm_eaa+2);
|
||||||
if ( (((Bit16s)inst.op1.w) < bound_min) || (((Bit16s)inst.op1.w) > bound_max) ) {
|
if ( (((Bit16s)inst_op1_w) < bound_min) || (((Bit16s)inst_op1_w) > bound_max) ) {
|
||||||
EXCEPTION(5);
|
EXCEPTION(5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ static OpCode OpCodeTable[1024]={
|
|||||||
{L_REGw ,O_OUTb ,0 ,REGI_DX},{L_REGw ,O_OUTw ,0 ,REGI_DX},
|
{L_REGw ,O_OUTb ,0 ,REGI_DX},{L_REGw ,O_OUTw ,0 ,REGI_DX},
|
||||||
|
|
||||||
/* 0xf0 - 0xf7 */
|
/* 0xf0 - 0xf7 */
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{D_LOCK ,0 ,0 ,0 },{D_ICEBP ,0 ,0 ,0 },
|
||||||
{L_PREREPNE ,0 ,0 ,0 },{L_PREREP ,0 ,0 ,0 },
|
{L_PREREPNE ,0 ,0 ,0 },{L_PREREP ,0 ,0 ,0 },
|
||||||
{D_HLT ,0 ,0 ,0 },{D_CMC ,0 ,0 ,0 },
|
{D_HLT ,0 ,0 ,0 },{D_CMC ,0 ,0 ,0 },
|
||||||
{L_MODRM ,8 ,0 ,M_GRP },{L_MODRM ,9 ,0 ,M_GRP },
|
{L_MODRM ,8 ,0 ,M_GRP },{L_MODRM ,9 ,0 ,M_GRP },
|
||||||
@ -316,7 +316,7 @@ static OpCode OpCodeTable[1024]={
|
|||||||
{L_MODRM ,0 ,S_Gw ,M_Ebx },{L_MODRM ,0 ,S_Gw ,M_Ewx },
|
{L_MODRM ,0 ,S_Gw ,M_Ebx },{L_MODRM ,0 ,S_Gw ,M_Ewx },
|
||||||
|
|
||||||
/* 0x1c0 - 0x1cc */
|
/* 0x1c0 - 0x1cc */
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{L_MODRM ,t_ADDb ,S_EbGb ,M_GbEb },{L_MODRM ,t_ADDw ,S_EwGw ,M_GwEw },
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||||
@ -526,7 +526,7 @@ static OpCode OpCodeTable[1024]={
|
|||||||
{L_REGw ,O_OUTb ,0 ,REGI_DX},{L_REGw ,O_OUTd ,0 ,REGI_DX},
|
{L_REGw ,O_OUTb ,0 ,REGI_DX},{L_REGw ,O_OUTd ,0 ,REGI_DX},
|
||||||
|
|
||||||
/* 0x2f0 - 0x2f7 */
|
/* 0x2f0 - 0x2f7 */
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{D_LOCK ,0 ,0 ,0 },{D_ICEBP ,0 ,0 ,0 },
|
||||||
{L_PREREPNE ,0 ,0 ,0 },{L_PREREP ,0 ,0 ,0 },
|
{L_PREREPNE ,0 ,0 ,0 },{L_PREREP ,0 ,0 ,0 },
|
||||||
{0 ,0 ,0 ,0 },{D_CMC ,0 ,0 ,0 },
|
{0 ,0 ,0 ,0 },{D_CMC ,0 ,0 ,0 },
|
||||||
{L_MODRM ,8 ,0 ,M_GRP },{L_MODRM ,0xa ,0 ,M_GRP },
|
{L_MODRM ,8 ,0 ,M_GRP },{L_MODRM ,0xa ,0 ,M_GRP },
|
||||||
@ -672,7 +672,7 @@ static OpCode OpCodeTable[1024]={
|
|||||||
{L_MODRM ,0 ,S_Gd ,M_Ebx },{L_MODRM ,0 ,S_Gd ,M_Ewx },
|
{L_MODRM ,0 ,S_Gd ,M_Ebx },{L_MODRM ,0 ,S_Gd ,M_Ewx },
|
||||||
|
|
||||||
/* 0x3c0 - 0x3cc */
|
/* 0x3c0 - 0x3cc */
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{L_MODRM ,t_ADDb ,S_EbGb ,M_GbEb },{L_MODRM ,t_ADDd ,S_EdGd ,M_GdEd },
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||||
|
@ -2,95 +2,95 @@
|
|||||||
switch (inst.code.save) {
|
switch (inst.code.save) {
|
||||||
/* Byte */
|
/* Byte */
|
||||||
case S_C_Eb:
|
case S_C_Eb:
|
||||||
inst.op1.b=inst.cond ? 1 : 0;
|
inst_op1_b=inst.cond ? 1 : 0;
|
||||||
case S_Eb:
|
case S_Eb:
|
||||||
if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst.op1.b);
|
if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst_op1_b);
|
||||||
else reg_8(inst.rm_eai)=inst.op1.b;
|
else reg_8(inst.rm_eai)=inst_op1_b;
|
||||||
break;
|
break;
|
||||||
case S_Gb:
|
case S_Gb:
|
||||||
reg_8(inst.rm_index)=inst.op1.b;
|
reg_8(inst.rm_index)=inst_op1_b;
|
||||||
break;
|
break;
|
||||||
case S_EbGb:
|
case S_EbGb:
|
||||||
if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst.op1.b);
|
if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst_op1_b);
|
||||||
else reg_8(inst.rm_eai)=inst.op1.b;
|
else reg_8(inst.rm_eai)=inst_op1_b;
|
||||||
reg_8(inst.rm_index)=inst.op2.b;
|
reg_8(inst.rm_index)=inst_op2_b;
|
||||||
break;
|
break;
|
||||||
/* Word */
|
/* Word */
|
||||||
case S_Ew:
|
case S_Ew:
|
||||||
if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst.op1.w);
|
if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w);
|
||||||
else reg_16(inst.rm_eai)=inst.op1.w;
|
else reg_16(inst.rm_eai)=inst_op1_w;
|
||||||
break;
|
break;
|
||||||
case S_Gw:
|
case S_Gw:
|
||||||
reg_16(inst.rm_index)=inst.op1.w;
|
reg_16(inst.rm_index)=inst_op1_w;
|
||||||
break;
|
break;
|
||||||
case S_EwGw:
|
case S_EwGw:
|
||||||
if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst.op1.w);
|
if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w);
|
||||||
else reg_16(inst.rm_eai)=inst.op1.w;
|
else reg_16(inst.rm_eai)=inst_op1_w;
|
||||||
reg_16(inst.rm_index)=inst.op2.w;
|
reg_16(inst.rm_index)=inst_op2_w;
|
||||||
break;
|
break;
|
||||||
/* Dword */
|
/* Dword */
|
||||||
case S_Ed:
|
case S_Ed:
|
||||||
if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst.op1.d);
|
if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst_op1_d);
|
||||||
else reg_32(inst.rm_eai)=inst.op1.d;
|
else reg_32(inst.rm_eai)=inst_op1_d;
|
||||||
break;
|
break;
|
||||||
case S_EdMw: /* Special one 16 to memory, 32 zero extend to reg */
|
case S_EdMw: /* Special one 16 to memory, 32 zero extend to reg */
|
||||||
if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst.op1.w);
|
if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w);
|
||||||
else reg_32(inst.rm_eai)=inst.op1.d;
|
else reg_32(inst.rm_eai)=inst_op1_d;
|
||||||
break;
|
break;
|
||||||
case S_Gd:
|
case S_Gd:
|
||||||
reg_32(inst.rm_index)=inst.op1.d;
|
reg_32(inst.rm_index)=inst_op1_d;
|
||||||
break;
|
break;
|
||||||
case S_EdGd:
|
case S_EdGd:
|
||||||
if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst.op1.d);
|
if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst_op1_d);
|
||||||
else reg_32(inst.rm_eai)=inst.op1.d;
|
else reg_32(inst.rm_eai)=inst_op1_d;
|
||||||
reg_32(inst.rm_index)=inst.op2.d;
|
reg_32(inst.rm_index)=inst_op2_d;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_REGb:
|
case S_REGb:
|
||||||
reg_8(inst.code.extra)=inst.op1.b;
|
reg_8(inst.code.extra)=inst_op1_b;
|
||||||
break;
|
break;
|
||||||
case S_REGw:
|
case S_REGw:
|
||||||
reg_16(inst.code.extra)=inst.op1.w;
|
reg_16(inst.code.extra)=inst_op1_w;
|
||||||
break;
|
break;
|
||||||
case S_REGd:
|
case S_REGd:
|
||||||
reg_32(inst.code.extra)=inst.op1.d;
|
reg_32(inst.code.extra)=inst_op1_d;
|
||||||
break;
|
break;
|
||||||
case S_SEGm:
|
case S_SEGm:
|
||||||
if (CPU_SetSegGeneral((SegNames)inst.rm_index,inst.op1.w)) RunException();
|
if (CPU_SetSegGeneral((SegNames)inst.rm_index,inst_op1_w)) RunException();
|
||||||
break;
|
break;
|
||||||
case S_SEGGw:
|
case S_SEGGw:
|
||||||
if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst.op2.w)) RunException();
|
if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst_op2_w)) RunException();
|
||||||
reg_16(inst.rm_index)=inst.op1.w;
|
reg_16(inst.rm_index)=inst_op1_w;
|
||||||
break;
|
break;
|
||||||
case S_SEGGd:
|
case S_SEGGd:
|
||||||
if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst.op2.w)) RunException();
|
if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst_op2_w)) RunException();
|
||||||
reg_32(inst.rm_index)=inst.op1.d;
|
reg_32(inst.rm_index)=inst_op1_d;
|
||||||
break;
|
break;
|
||||||
case S_PUSHw:
|
case S_PUSHw:
|
||||||
Push_16(inst.op1.w);
|
Push_16(inst_op1_w);
|
||||||
break;
|
break;
|
||||||
case S_PUSHd:
|
case S_PUSHd:
|
||||||
Push_32(inst.op1.d);
|
Push_32(inst_op1_d);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_C_AIPw:
|
case S_C_AIPw:
|
||||||
if (!inst.cond) goto nextopcode;
|
if (!inst.cond) goto nextopcode;
|
||||||
case S_AIPw:
|
case S_AIPw:
|
||||||
SaveIP();
|
SaveIP();
|
||||||
reg_eip+=inst.op1.d;
|
reg_eip+=inst_op1_d;
|
||||||
reg_eip&=0xffff;
|
reg_eip&=0xffff;
|
||||||
continue;
|
continue;
|
||||||
case S_C_AIPd:
|
case S_C_AIPd:
|
||||||
if (!inst.cond) goto nextopcode;
|
if (!inst.cond) goto nextopcode;
|
||||||
case S_AIPd:
|
case S_AIPd:
|
||||||
SaveIP();
|
SaveIP();
|
||||||
reg_eip+=inst.op1.d;
|
reg_eip+=inst_op1_d;
|
||||||
continue;
|
continue;
|
||||||
case S_IPIw:
|
case S_IPIw:
|
||||||
reg_esp+=Fetchw();
|
reg_esp+=Fetchw();
|
||||||
case S_IP:
|
case S_IP:
|
||||||
SaveIP();
|
SaveIP();
|
||||||
reg_eip=inst.op1.d;
|
reg_eip=inst_op1_d;
|
||||||
continue;
|
continue;
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
@ -45,6 +45,7 @@ enum {
|
|||||||
D_SAHF,D_LAHF,
|
D_SAHF,D_LAHF,
|
||||||
D_CPUID,
|
D_CPUID,
|
||||||
D_HLT,D_CLTS,
|
D_HLT,D_CLTS,
|
||||||
|
D_LOCK,D_ICEBP,
|
||||||
L_ERROR,
|
L_ERROR,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -164,11 +165,22 @@ struct FullData {
|
|||||||
Bitu rm_mod;
|
Bitu rm_mod;
|
||||||
OpCode code;
|
OpCode code;
|
||||||
EAPoint cseip;
|
EAPoint cseip;
|
||||||
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
union {
|
||||||
|
Bit32u dword[1];
|
||||||
|
Bit32s dwords[1];
|
||||||
|
Bit16u word[2];
|
||||||
|
Bit16s words[2];
|
||||||
|
Bit8u byte[4];
|
||||||
|
Bit8s bytes[4];
|
||||||
|
} blah1,blah2,blah_imm;
|
||||||
|
#else
|
||||||
union {
|
union {
|
||||||
Bit8u b;Bit8s bs;
|
Bit8u b;Bit8s bs;
|
||||||
Bit16u w;Bit16s ws;
|
Bit16u w;Bit16s ws;
|
||||||
Bit32u d;Bit32s ds;
|
Bit32u d;Bit32s ds;
|
||||||
} op1,op2,imm;
|
} op1,op2,imm;
|
||||||
|
#endif
|
||||||
Bitu new_flags;
|
Bitu new_flags;
|
||||||
struct {
|
struct {
|
||||||
EAPoint base;
|
EAPoint base;
|
||||||
@ -178,6 +190,55 @@ struct FullData {
|
|||||||
Bitu prefix;
|
Bitu prefix;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Some defines to get the names correct. */
|
||||||
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
|
||||||
|
#define inst_op1_b inst.blah1.byte[3]
|
||||||
|
#define inst_op1_bs inst.blah1.bytes[3]
|
||||||
|
#define inst_op1_w inst.blah1.word[1]
|
||||||
|
#define inst_op1_ws inst.blah1.words[1]
|
||||||
|
#define inst_op1_d inst.blah1.dword[0]
|
||||||
|
#define inst_op1_ds inst.blah1.dwords[0]
|
||||||
|
|
||||||
|
#define inst_op2_b inst.blah2.byte[3]
|
||||||
|
#define inst_op2_bs inst.blah2.bytes[3]
|
||||||
|
#define inst_op2_w inst.blah2.word[1]
|
||||||
|
#define inst_op2_ws inst.blah2.words[1]
|
||||||
|
#define inst_op2_d inst.blah2.dword[0]
|
||||||
|
#define inst_op2_ds inst.blah2.dwords[0]
|
||||||
|
|
||||||
|
#define inst_imm_b inst.blah_imm.byte[3]
|
||||||
|
#define inst_imm_bs inst.blah_imm.bytes[3]
|
||||||
|
#define inst_imm_w inst.blah_imm.word[1]
|
||||||
|
#define inst_imm_ws inst.blah_imm.words[1]
|
||||||
|
#define inst_imm_d inst.blah_imm.dword[0]
|
||||||
|
#define inst_imm_ds inst.blah_imm.dwords[0]
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define inst_op1_b inst.op1.b
|
||||||
|
#define inst_op1_bs inst.op1.bs
|
||||||
|
#define inst_op1_w inst.op1.w
|
||||||
|
#define inst_op1_ws inst.op1.ws
|
||||||
|
#define inst_op1_d inst.op1.d
|
||||||
|
#define inst_op1_ds inst.op1.ds
|
||||||
|
|
||||||
|
#define inst_op2_b inst.op2.b
|
||||||
|
#define inst_op2_bs inst.op2.bs
|
||||||
|
#define inst_op2_w inst.op2.w
|
||||||
|
#define inst_op2_ws inst.op2.ws
|
||||||
|
#define inst_op2_d inst.op2.d
|
||||||
|
#define inst_op2_ds inst.op2.ds
|
||||||
|
|
||||||
|
#define inst_imm_b inst.imm.b
|
||||||
|
#define inst_imm_bs inst.imm.bs
|
||||||
|
#define inst_imm_w inst.imm.w
|
||||||
|
#define inst_imm_ws inst.imm.ws
|
||||||
|
#define inst_imm_d inst.imm.d
|
||||||
|
#define inst_imm_ds inst.imm.ds
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define PREFIX_NONE 0x0
|
#define PREFIX_NONE 0x0
|
||||||
#define PREFIX_ADDR 0x1
|
#define PREFIX_ADDR 0x1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -171,7 +171,7 @@ restart_opcode:
|
|||||||
sprintf(writecode,"%X",mem_readb(core.cseip++));
|
sprintf(writecode,"%X",mem_readb(core.cseip++));
|
||||||
writecode+=2;
|
writecode+=2;
|
||||||
}
|
}
|
||||||
LOG(LOG_CPU,LOG_ERROR)("Illegal/Unhandled opcode %s",tempcode);
|
LOG(LOG_CPU,LOG_NORMAL)("Illegal/Unhandled opcode %s",tempcode);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
CPU_Exception(6,0);
|
CPU_Exception(6,0);
|
||||||
@ -188,13 +188,12 @@ decode_end:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Bits CPU_Core_Normal_Trap_Run(void) {
|
Bits CPU_Core_Normal_Trap_Run(void) {
|
||||||
|
|
||||||
Bits oldCycles = CPU_Cycles;
|
Bits oldCycles = CPU_Cycles;
|
||||||
CPU_Cycles = 1;
|
CPU_Cycles = 1;
|
||||||
core.trap.skip=false;
|
core.trap.skip=false;
|
||||||
|
|
||||||
Bits ret=CPU_Core_Normal_Run();
|
Bits ret=CPU_Core_Normal_Run();
|
||||||
if (!core.trap.skip) CPU_SW_Interrupt(1,reg_eip);
|
if (!core.trap.skip) CPU_HW_Interrupt(1);
|
||||||
CPU_Cycles = oldCycles-1;
|
CPU_Cycles = oldCycles-1;
|
||||||
cpudecoder = &CPU_Core_Normal_Run;
|
cpudecoder = &CPU_Core_Normal_Run;
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -80,6 +80,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -105,10 +107,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
CASE_0F_W(0x00) /* GRP 6 Exxx */
|
CASE_0F_W(0x00) /* GRP 6 Exxx */
|
||||||
{
|
{
|
||||||
|
if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegal_opcode;
|
||||||
GetRM;Bitu which=(rm>>3)&7;
|
GetRM;Bitu which=(rm>>3)&7;
|
||||||
switch (which) {
|
switch (which) {
|
||||||
case 0x00: /* SLDT */
|
case 0x00: /* SLDT */
|
||||||
@ -37,10 +38,20 @@
|
|||||||
if (rm >= 0xc0 ) {GetEArw;loadval=*earw;}
|
if (rm >= 0xc0 ) {GetEArw;loadval=*earw;}
|
||||||
else {GetEAa;loadval=LoadMw(eaa);}
|
else {GetEAa;loadval=LoadMw(eaa);}
|
||||||
switch (which) {
|
switch (which) {
|
||||||
case 0x02:CPU_LLDT(loadval);break;
|
case 0x02:
|
||||||
case 0x03:CPU_LTR(loadval);break;
|
if (cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
case 0x04:CPU_VERR(loadval);break;
|
if (CPU_LLDT(loadval)) RUNEXCEPTION();
|
||||||
case 0x05:CPU_VERW(loadval);break;
|
break;
|
||||||
|
case 0x03:
|
||||||
|
if (cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
|
if (CPU_LTR(loadval)) RUNEXCEPTION();
|
||||||
|
break;
|
||||||
|
case 0x04:
|
||||||
|
CPU_VERR(loadval);
|
||||||
|
break;
|
||||||
|
case 0x05:
|
||||||
|
CPU_VERW(loadval);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -66,9 +77,11 @@
|
|||||||
SaveMd(eaa+2,base);
|
SaveMd(eaa+2,base);
|
||||||
break;
|
break;
|
||||||
case 0x02: /* LGDT */
|
case 0x02: /* LGDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
CPU_LGDT(LoadMw(eaa),LoadMd(eaa+2) & 0xFFFFFF);
|
CPU_LGDT(LoadMw(eaa),LoadMd(eaa+2) & 0xFFFFFF);
|
||||||
break;
|
break;
|
||||||
case 0x03: /* LIDT */
|
case 0x03: /* LIDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
CPU_LIDT(LoadMw(eaa),LoadMd(eaa+2) & 0xFFFFFF);
|
CPU_LIDT(LoadMw(eaa),LoadMd(eaa+2) & 0xFFFFFF);
|
||||||
break;
|
break;
|
||||||
case 0x04: /* SMSW */
|
case 0x04: /* SMSW */
|
||||||
@ -83,6 +96,12 @@
|
|||||||
} else {
|
} else {
|
||||||
GetEArw;Bitu limit;
|
GetEArw;Bitu limit;
|
||||||
switch (which) {
|
switch (which) {
|
||||||
|
case 0x02: /* LGDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
|
goto illegal_opcode;
|
||||||
|
case 0x03: /* LIDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
|
goto illegal_opcode;
|
||||||
case 0x04: /* SMSW */
|
case 0x04: /* SMSW */
|
||||||
CPU_SMSW(limit);
|
CPU_SMSW(limit);
|
||||||
*earw=limit;
|
*earw=limit;
|
||||||
@ -98,6 +117,7 @@
|
|||||||
break;
|
break;
|
||||||
CASE_0F_W(0x02) /* LAR Gw,Ew */
|
CASE_0F_W(0x02) /* LAR Gw,Ew */
|
||||||
{
|
{
|
||||||
|
if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegal_opcode;
|
||||||
FillFlags();
|
FillFlags();
|
||||||
GetRMrw;Bitu ar=*rmrw;
|
GetRMrw;Bitu ar=*rmrw;
|
||||||
if (rm >= 0xc0) {
|
if (rm >= 0xc0) {
|
||||||
@ -110,6 +130,7 @@
|
|||||||
break;
|
break;
|
||||||
CASE_0F_W(0x03) /* LSL Gw,Ew */
|
CASE_0F_W(0x03) /* LSL Gw,Ew */
|
||||||
{
|
{
|
||||||
|
if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegal_opcode;
|
||||||
FillFlags();
|
FillFlags();
|
||||||
GetRMrw;Bitu limit=*rmrw;
|
GetRMrw;Bitu limit=*rmrw;
|
||||||
if (rm >= 0xc0) {
|
if (rm >= 0xc0) {
|
||||||
@ -121,52 +142,59 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
CASE_0F_B(0x06) /* CLTS */
|
CASE_0F_B(0x06) /* CLTS */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
|
cpu.cr0&=(~CR0_TASKSWITCH);
|
||||||
break;
|
break;
|
||||||
CASE_0F_B(0x20) /* MOV Rd.CRx */
|
CASE_0F_B(0x20) /* MOV Rd.CRx */
|
||||||
{
|
{
|
||||||
GetRM;
|
GetRM;
|
||||||
Bitu which=(rm >> 3) & 7;
|
Bitu which=(rm >> 3) & 7;
|
||||||
if (rm >= 0xc0 ) {
|
if (rm < 0xc0 ) {
|
||||||
GetEArd;
|
rm |= 0xc0;
|
||||||
*eard=CPU_GET_CRX(which);
|
|
||||||
} else {
|
|
||||||
GetEAa;
|
|
||||||
LOG(LOG_CPU,LOG_ERROR)("MOV XXX,CR%d with non-register",which);
|
LOG(LOG_CPU,LOG_ERROR)("MOV XXX,CR%d with non-register",which);
|
||||||
}
|
}
|
||||||
|
GetEArd;
|
||||||
|
Bit32u crx_value;
|
||||||
|
if (CPU_READ_CRX(which,crx_value)) RUNEXCEPTION();
|
||||||
|
*eard=crx_value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
CASE_0F_B(0x21) /* MOV Rd,DRx */
|
CASE_0F_B(0x21) /* MOV Rd,DRx */
|
||||||
{
|
{
|
||||||
GetRM;
|
GetRM;
|
||||||
Bitu which=(rm >> 3) & 7;
|
Bitu which=(rm >> 3) & 7;
|
||||||
if (rm >= 0xc0 ) {
|
if (rm < 0xc0 ) {
|
||||||
GetEArd;
|
rm |= 0xc0;
|
||||||
} else {
|
|
||||||
GetEAa;
|
|
||||||
LOG(LOG_CPU,LOG_ERROR)("MOV XXX,DR% with non-register",which);
|
LOG(LOG_CPU,LOG_ERROR)("MOV XXX,DR% with non-register",which);
|
||||||
}
|
}
|
||||||
|
GetEArd;
|
||||||
|
Bit32u drx_value;
|
||||||
|
if (CPU_READ_DRX(which,drx_value)) RUNEXCEPTION();
|
||||||
|
*eard=drx_value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
CASE_0F_B(0x22) /* MOV CRx,Rd */
|
CASE_0F_B(0x22) /* MOV CRx,Rd */
|
||||||
{
|
{
|
||||||
GetRM;
|
GetRM;
|
||||||
Bitu which=(rm >> 3) & 7;
|
Bitu which=(rm >> 3) & 7;
|
||||||
if (rm >= 0xc0 ) {
|
if (rm < 0xc0 ) {
|
||||||
|
rm |= 0xc0;
|
||||||
|
LOG(LOG_CPU,LOG_ERROR)("MOV XXX,CR% with non-register",which);
|
||||||
|
}
|
||||||
GetEArd;
|
GetEArd;
|
||||||
if (CPU_SET_CRX(which,*eard)) RUNEXCEPTION();
|
if (CPU_WRITE_CRX(which,*eard)) RUNEXCEPTION();
|
||||||
} else goto illegal_opcode;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
CASE_0F_B(0x23) /* MOV DRx,Rd */
|
CASE_0F_B(0x23) /* MOV DRx,Rd */
|
||||||
{
|
{
|
||||||
GetRM;
|
GetRM;
|
||||||
Bitu which=(rm >> 3) & 7;
|
Bitu which=(rm >> 3) & 7;
|
||||||
if (rm >= 0xc0 ) {
|
if (rm < 0xc0 ) {
|
||||||
GetEArd;
|
rm |= 0xc0;
|
||||||
} else {
|
|
||||||
GetEAa;
|
|
||||||
LOG(LOG_CPU,LOG_ERROR)("MOV DR%,XXX with non-register",which);
|
LOG(LOG_CPU,LOG_ERROR)("MOV DR%,XXX with non-register",which);
|
||||||
}
|
}
|
||||||
|
GetEArd;
|
||||||
|
if (CPU_WRITE_DRX(which,*eard)) RUNEXCEPTION();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
CASE_0F_W(0x80) /* JO */
|
CASE_0F_W(0x80) /* JO */
|
||||||
@ -444,6 +472,20 @@
|
|||||||
else {GetEAa;*rmrw=LoadMbs(eaa);}
|
else {GetEAa;*rmrw=LoadMbs(eaa);}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
CASE_0F_B(0xc0) /* XADD Gb,Eb */
|
||||||
|
{
|
||||||
|
GetRMrb;Bit8u oldrmrb=*rmrb;
|
||||||
|
if (rm >= 0xc0 ) {GetEArb;*rmrb=*earb;*earb+=oldrmrb;}
|
||||||
|
else {GetEAa;*rmrb=LoadMb(eaa);SaveMb(eaa,LoadMb(eaa)+oldrmrb);}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
CASE_0F_W(0xc1) /* XADD Gw,Ew */
|
||||||
|
{
|
||||||
|
GetRMrw;Bit16u oldrmrw=*rmrw;
|
||||||
|
if (rm >= 0xc0 ) {GetEArw;*rmrw=*earw;*earw+=oldrmrw;}
|
||||||
|
else {GetEAa;*rmrw=LoadMw(eaa);SaveMw(eaa,LoadMw(eaa)+oldrmrw);}
|
||||||
|
break;
|
||||||
|
}
|
||||||
CASE_0F_B(0xc8) /* BSWAP EAX */
|
CASE_0F_B(0xc8) /* BSWAP EAX */
|
||||||
BSWAP(reg_eax);break;
|
BSWAP(reg_eax);break;
|
||||||
CASE_0F_B(0xc9) /* BSWAP ECX */
|
CASE_0F_B(0xc9) /* BSWAP ECX */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -331,8 +331,8 @@
|
|||||||
case 0x05: /* MOV Ew,GS */
|
case 0x05: /* MOV Ew,GS */
|
||||||
val=SegValue(gs);break;
|
val=SegValue(gs);break;
|
||||||
default:
|
default:
|
||||||
val=0;
|
LOG(LOG_CPU,LOG_ERROR)("CPU:8c:Illegal RM Byte");
|
||||||
E_Exit("CPU:8c:Illegal RM Byte");
|
goto illegal_opcode;
|
||||||
}
|
}
|
||||||
if (rm >= 0xc0 ) {GetEArd;*eard=val;}
|
if (rm >= 0xc0 ) {GetEArd;*eard=val;}
|
||||||
else {GetEAa;SaveMw(eaa,val);}
|
else {GetEAa;SaveMw(eaa,val);}
|
||||||
@ -389,6 +389,12 @@
|
|||||||
Bit32u newip=Fetchd();Bit16u newcs=Fetchw();
|
Bit32u newip=Fetchd();Bit16u newcs=Fetchw();
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_CALL(true,newcs,newip,GETIP);
|
CPU_CALL(true,newcs,newip,GETIP);
|
||||||
|
#if CPU_TRAP_CHECK
|
||||||
|
if (GETFLAG(TF)) {
|
||||||
|
cpudecoder=CPU_Core_Normal_Trap_Run;
|
||||||
|
return CBRET_NONE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
CASE_D(0x9c) /* PUSHFD */
|
CASE_D(0x9c) /* PUSHFD */
|
||||||
@ -581,6 +587,12 @@
|
|||||||
Bit16u newcs=Fetchw();
|
Bit16u newcs=Fetchw();
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_JMP(true,newcs,newip,GETIP);
|
CPU_JMP(true,newcs,newip,GETIP);
|
||||||
|
#if CPU_TRAP_CHECK
|
||||||
|
if (GETFLAG(TF)) {
|
||||||
|
cpudecoder=CPU_Core_Normal_Trap_Run;
|
||||||
|
return CBRET_NONE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
CASE_D(0xeb) /* JMP Jb */
|
CASE_D(0xeb) /* JMP Jb */
|
||||||
@ -657,11 +669,18 @@
|
|||||||
continue;
|
continue;
|
||||||
case 0x03: /* CALL FAR Ed */
|
case 0x03: /* CALL FAR Ed */
|
||||||
{
|
{
|
||||||
|
if (rm >= 0xc0) goto illegal_opcode;
|
||||||
GetEAa;
|
GetEAa;
|
||||||
Bit32u newip=LoadMd(eaa);
|
Bit32u newip=LoadMd(eaa);
|
||||||
Bit16u newcs=LoadMw(eaa+4);
|
Bit16u newcs=LoadMw(eaa+4);
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_CALL(true,newcs,newip,GETIP);
|
CPU_CALL(true,newcs,newip,GETIP);
|
||||||
|
#if CPU_TRAP_CHECK
|
||||||
|
if (GETFLAG(TF)) {
|
||||||
|
cpudecoder=CPU_Core_Normal_Trap_Run;
|
||||||
|
return CBRET_NONE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
case 0x04: /* JMP NEAR Ed */
|
case 0x04: /* JMP NEAR Ed */
|
||||||
@ -670,11 +689,18 @@
|
|||||||
continue;
|
continue;
|
||||||
case 0x05: /* JMP FAR Ed */
|
case 0x05: /* JMP FAR Ed */
|
||||||
{
|
{
|
||||||
|
if (rm >= 0xc0) goto illegal_opcode;
|
||||||
GetEAa;
|
GetEAa;
|
||||||
Bit32u newip=LoadMd(eaa);
|
Bit32u newip=LoadMd(eaa);
|
||||||
Bit16u newcs=LoadMw(eaa+4);
|
Bit16u newcs=LoadMw(eaa+4);
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_JMP(true,newcs,newip,GETIP);
|
CPU_JMP(true,newcs,newip,GETIP);
|
||||||
|
#if CPU_TRAP_CHECK
|
||||||
|
if (GETFLAG(TF)) {
|
||||||
|
cpudecoder=CPU_Core_Normal_Trap_Run;
|
||||||
|
return CBRET_NONE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -15,8 +15,10 @@
|
|||||||
* along with this program; if not, write to the Free Software
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CASE_0F_D(0x00) /* GRP 6 Exxx */
|
CASE_0F_D(0x00) /* GRP 6 Exxx */
|
||||||
{
|
{
|
||||||
|
if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegal_opcode;
|
||||||
GetRM;Bitu which=(rm>>3)&7;
|
GetRM;Bitu which=(rm>>3)&7;
|
||||||
switch (which) {
|
switch (which) {
|
||||||
case 0x00: /* SLDT */
|
case 0x00: /* SLDT */
|
||||||
@ -37,15 +39,26 @@
|
|||||||
if (rm >= 0xc0 ) {GetEArw;loadval=*earw;}
|
if (rm >= 0xc0 ) {GetEArw;loadval=*earw;}
|
||||||
else {GetEAa;loadval=LoadMw(eaa);}
|
else {GetEAa;loadval=LoadMw(eaa);}
|
||||||
switch (which) {
|
switch (which) {
|
||||||
case 0x02:CPU_LLDT(loadval);break;
|
case 0x02:
|
||||||
case 0x03:CPU_LTR(loadval);break;
|
if (cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
case 0x04:CPU_VERR(loadval);break;
|
if (CPU_LLDT(loadval)) RUNEXCEPTION();
|
||||||
case 0x05:CPU_VERW(loadval);break;
|
break;
|
||||||
|
case 0x03:
|
||||||
|
if (cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
|
if (CPU_LTR(loadval)) RUNEXCEPTION();
|
||||||
|
break;
|
||||||
|
case 0x04:
|
||||||
|
CPU_VERR(loadval);
|
||||||
|
break;
|
||||||
|
case 0x05:
|
||||||
|
CPU_VERW(loadval);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(LOG_CPU,LOG_ERROR)("GRP6:Illegal call %2X",which);
|
LOG(LOG_CPU,LOG_ERROR)("GRP6:Illegal call %2X",which);
|
||||||
|
goto illegal_opcode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -66,9 +79,11 @@
|
|||||||
SaveMd(eaa+2,(Bit32u)base);
|
SaveMd(eaa+2,(Bit32u)base);
|
||||||
break;
|
break;
|
||||||
case 0x02: /* LGDT */
|
case 0x02: /* LGDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
CPU_LGDT(LoadMw(eaa),LoadMd(eaa+2));
|
CPU_LGDT(LoadMw(eaa),LoadMd(eaa+2));
|
||||||
break;
|
break;
|
||||||
case 0x03: /* LIDT */
|
case 0x03: /* LIDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
CPU_LIDT(LoadMw(eaa),LoadMd(eaa+2));
|
CPU_LIDT(LoadMw(eaa),LoadMd(eaa+2));
|
||||||
break;
|
break;
|
||||||
case 0x04: /* SMSW */
|
case 0x04: /* SMSW */
|
||||||
@ -77,21 +92,28 @@
|
|||||||
break;
|
break;
|
||||||
case 0x06: /* LMSW */
|
case 0x06: /* LMSW */
|
||||||
limit=LoadMw(eaa);
|
limit=LoadMw(eaa);
|
||||||
if (!CPU_LMSW((Bit16u)limit)) goto decode_end;
|
if (CPU_LMSW((Bit16u)limit)) RUNEXCEPTION();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GetEArd;Bitu limit;
|
GetEArd;Bitu limit;
|
||||||
switch (which) {
|
switch (which) {
|
||||||
|
case 0x02: /* LGDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
|
goto illegal_opcode;
|
||||||
|
case 0x03: /* LIDT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
|
goto illegal_opcode;
|
||||||
case 0x04: /* SMSW */
|
case 0x04: /* SMSW */
|
||||||
CPU_SMSW(limit);
|
CPU_SMSW(limit);
|
||||||
*eard=(Bit32u)limit;
|
*eard=(Bit32u)limit;
|
||||||
break;
|
break;
|
||||||
case 0x06: /* LMSW */
|
case 0x06: /* LMSW */
|
||||||
if (!CPU_LMSW(*eard)) goto decode_end;
|
if (CPU_LMSW(*eard)) RUNEXCEPTION();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(LOG_CPU,LOG_ERROR)("Illegal group 7 RM subfunction %d",which);
|
LOG(LOG_CPU,LOG_ERROR)("Illegal group 7 RM subfunction %d",which);
|
||||||
|
goto illegal_opcode;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +122,7 @@
|
|||||||
break;
|
break;
|
||||||
CASE_0F_D(0x02) /* LAR Gd,Ed */
|
CASE_0F_D(0x02) /* LAR Gd,Ed */
|
||||||
{
|
{
|
||||||
|
if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegal_opcode;
|
||||||
FillFlags();
|
FillFlags();
|
||||||
GetRMrd;Bitu ar=*rmrd;
|
GetRMrd;Bitu ar=*rmrd;
|
||||||
if (rm >= 0xc0) {
|
if (rm >= 0xc0) {
|
||||||
@ -112,6 +135,7 @@
|
|||||||
break;
|
break;
|
||||||
CASE_0F_D(0x03) /* LSL Gd,Ew */
|
CASE_0F_D(0x03) /* LSL Gd,Ew */
|
||||||
{
|
{
|
||||||
|
if ((reg_flags & FLAG_VM) || (!cpu.pmode)) goto illegal_opcode;
|
||||||
FillFlags();
|
FillFlags();
|
||||||
GetRMrd;Bitu limit=*rmrd;
|
GetRMrd;Bitu limit=*rmrd;
|
||||||
/* Just load 16-bit values for selectors */
|
/* Just load 16-bit values for selectors */
|
||||||
@ -376,3 +400,10 @@
|
|||||||
else {GetEAa;*rmrd=LoadMws(eaa);}
|
else {GetEAa;*rmrd=LoadMws(eaa);}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
CASE_0F_D(0xc1) /* XADD Gd,Ed */
|
||||||
|
{
|
||||||
|
GetRMrd;Bit32u oldrmrd=*rmrd;
|
||||||
|
if (rm >= 0xc0 ) {GetEArd;*rmrd=*eard;*eard+=oldrmrd;}
|
||||||
|
else {GetEAa;*rmrd=LoadMd(eaa);SaveMd(eaa,LoadMd(eaa)+oldrmrd);}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -472,8 +472,8 @@
|
|||||||
case 0x05: /* MOV Ew,GS */
|
case 0x05: /* MOV Ew,GS */
|
||||||
val=SegValue(gs);break;
|
val=SegValue(gs);break;
|
||||||
default:
|
default:
|
||||||
val=0;
|
LOG(LOG_CPU,LOG_ERROR)("CPU:8c:Illegal RM Byte");
|
||||||
E_Exit("CPU:8c:Illegal RM Byte");
|
goto illegal_opcode;
|
||||||
}
|
}
|
||||||
if (rm >= 0xc0 ) {GetEArw;*earw=val;}
|
if (rm >= 0xc0 ) {GetEArw;*earw=val;}
|
||||||
else {GetEAa;SaveMw(eaa,val);}
|
else {GetEAa;SaveMw(eaa,val);}
|
||||||
@ -551,6 +551,12 @@
|
|||||||
FillFlags();
|
FillFlags();
|
||||||
Bit16u newip=Fetchw();Bit16u newcs=Fetchw();
|
Bit16u newip=Fetchw();Bit16u newcs=Fetchw();
|
||||||
CPU_CALL(false,newcs,newip,GETIP);
|
CPU_CALL(false,newcs,newip,GETIP);
|
||||||
|
#if CPU_TRAP_CHECK
|
||||||
|
if (GETFLAG(TF)) {
|
||||||
|
cpudecoder=CPU_Core_Normal_Trap_Run;
|
||||||
|
return CBRET_NONE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
CASE_B(0x9b) /* WAIT */
|
CASE_B(0x9b) /* WAIT */
|
||||||
@ -727,7 +733,7 @@
|
|||||||
if (DEBUG_Breakpoint())
|
if (DEBUG_Breakpoint())
|
||||||
return debugCallback;
|
return debugCallback;
|
||||||
#endif
|
#endif
|
||||||
CPU_SW_Interrupt(3,GETIP);
|
CPU_SW_Interrupt_NoIOPLCheck(3,GETIP);
|
||||||
#if CPU_TRAP_CHECK
|
#if CPU_TRAP_CHECK
|
||||||
core.trap.skip=true;
|
core.trap.skip=true;
|
||||||
#endif
|
#endif
|
||||||
@ -761,14 +767,14 @@
|
|||||||
{
|
{
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_IRET(false,GETIP);
|
CPU_IRET(false,GETIP);
|
||||||
#if CPU_PIC_CHECK
|
|
||||||
if (GETFLAG(IF) && PIC_IRQCheck) return CBRET_NONE;
|
|
||||||
#endif
|
|
||||||
#if CPU_TRAP_CHECK
|
#if CPU_TRAP_CHECK
|
||||||
if (GETFLAG(TF)) {
|
if (GETFLAG(TF)) {
|
||||||
cpudecoder=CPU_Core_Normal_Trap_Run;
|
cpudecoder=CPU_Core_Normal_Trap_Run;
|
||||||
return CBRET_NONE;
|
return CBRET_NONE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if CPU_PIC_CHECK
|
||||||
|
if (GETFLAG(IF) && PIC_IRQCheck) return CBRET_NONE;
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -900,6 +906,12 @@
|
|||||||
Bit16u newcs=Fetchw();
|
Bit16u newcs=Fetchw();
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_JMP(false,newcs,newip,GETIP);
|
CPU_JMP(false,newcs,newip,GETIP);
|
||||||
|
#if CPU_TRAP_CHECK
|
||||||
|
if (GETFLAG(TF)) {
|
||||||
|
cpudecoder=CPU_Core_Normal_Trap_Run;
|
||||||
|
return CBRET_NONE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
CASE_W(0xeb) /* JMP Jb */
|
CASE_W(0xeb) /* JMP Jb */
|
||||||
@ -926,8 +938,15 @@
|
|||||||
IO_WriteW(reg_dx,reg_ax);
|
IO_WriteW(reg_dx,reg_ax);
|
||||||
break;
|
break;
|
||||||
CASE_B(0xf0) /* LOCK */
|
CASE_B(0xf0) /* LOCK */
|
||||||
LOG(LOG_CPU,LOG_NORMAL)("CPU:LOCK");
|
LOG(LOG_CPU,LOG_NORMAL)("CPU:LOCK"); /* FIXME: see case D_LOCK in core_full/load.h */
|
||||||
break;
|
break;
|
||||||
|
CASE_B(0xf1) /* ICEBP */
|
||||||
|
FillFlags();
|
||||||
|
CPU_SW_Interrupt_NoIOPLCheck(1,GETIP);
|
||||||
|
#if CPU_TRAP_CHECK
|
||||||
|
core.trap.skip=true;
|
||||||
|
#endif
|
||||||
|
continue;
|
||||||
CASE_B(0xf2) /* REPNZ */
|
CASE_B(0xf2) /* REPNZ */
|
||||||
DO_PREFIX_REP(false);
|
DO_PREFIX_REP(false);
|
||||||
break;
|
break;
|
||||||
@ -935,6 +954,7 @@
|
|||||||
DO_PREFIX_REP(true);
|
DO_PREFIX_REP(true);
|
||||||
break;
|
break;
|
||||||
CASE_B(0xf4) /* HLT */
|
CASE_B(0xf4) /* HLT */
|
||||||
|
if (cpu.pmode && cpu.cpl) EXCEPTION(EXCEPTION_GP);
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_HLT(GETIP);
|
CPU_HLT(GETIP);
|
||||||
return CBRET_NONE; //Needs to return for hlt cpu core
|
return CBRET_NONE; //Needs to return for hlt cpu core
|
||||||
@ -1094,11 +1114,18 @@
|
|||||||
continue;
|
continue;
|
||||||
case 0x03: /* CALL Ep */
|
case 0x03: /* CALL Ep */
|
||||||
{
|
{
|
||||||
|
if (rm >= 0xc0) goto illegal_opcode;
|
||||||
GetEAa;
|
GetEAa;
|
||||||
Bit16u newip=LoadMw(eaa);
|
Bit16u newip=LoadMw(eaa);
|
||||||
Bit16u newcs=LoadMw(eaa+2);
|
Bit16u newcs=LoadMw(eaa+2);
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_CALL(false,newcs,newip,GETIP);
|
CPU_CALL(false,newcs,newip,GETIP);
|
||||||
|
#if CPU_TRAP_CHECK
|
||||||
|
if (GETFLAG(TF)) {
|
||||||
|
cpudecoder=CPU_Core_Normal_Trap_Run;
|
||||||
|
return CBRET_NONE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1108,11 +1135,18 @@
|
|||||||
continue;
|
continue;
|
||||||
case 0x05: /* JMP Ep */
|
case 0x05: /* JMP Ep */
|
||||||
{
|
{
|
||||||
|
if (rm >= 0xc0) goto illegal_opcode;
|
||||||
GetEAa;
|
GetEAa;
|
||||||
Bit16u newip=LoadMw(eaa);
|
Bit16u newip=LoadMw(eaa);
|
||||||
Bit16u newcs=LoadMw(eaa+2);
|
Bit16u newcs=LoadMw(eaa+2);
|
||||||
FillFlags();
|
FillFlags();
|
||||||
CPU_JMP(false,newcs,newip,GETIP);
|
CPU_JMP(false,newcs,newip,GETIP);
|
||||||
|
#if CPU_TRAP_CHECK
|
||||||
|
if (GETFLAG(TF)) {
|
||||||
|
cpudecoder=CPU_Core_Normal_Trap_Run;
|
||||||
|
return CBRET_NONE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -34,6 +34,7 @@ static void DoString(STRING_OP type) {
|
|||||||
CPU_Cycles=0;
|
CPU_Cycles=0;
|
||||||
LOADIP; //RESET IP to the start
|
LOADIP; //RESET IP to the start
|
||||||
} else {
|
} else {
|
||||||
|
if ((count<=1) && (CPU_Cycles<=1)) CPU_Cycles--;
|
||||||
/* Won't interrupt scas and cmps instruction since they can interrupt themselves */
|
/* Won't interrupt scas and cmps instruction since they can interrupt themselves */
|
||||||
count_left=0;
|
count_left=0;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -165,7 +165,7 @@ restart_opcode:
|
|||||||
// sprintf(writecode,"%X",mem_readb(core.cseip++));
|
// sprintf(writecode,"%X",mem_readb(core.cseip++));
|
||||||
writecode+=2;
|
writecode+=2;
|
||||||
}
|
}
|
||||||
LOG(LOG_CPU,LOG_ERROR)("Illegal/Unhandled opcode %s",tempcode);
|
LOG(LOG_CPU,LOG_NORMAL)("Illegal/Unhandled opcode %s",tempcode);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
CPU_Exception(6,0);
|
CPU_Exception(6,0);
|
||||||
@ -200,4 +200,3 @@ Bits CPU_Core_Simple_Trap_Run(void) {
|
|||||||
void CPU_Core_Simple_Init(void) {
|
void CPU_Core_Simple_Init(void) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1105
src/cpu/cpu.cpp
1105
src/cpu/cpu.cpp
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -599,9 +599,11 @@
|
|||||||
Bitu val=load(op1); \
|
Bitu val=load(op1); \
|
||||||
if (val==0) EXCEPTION(0); \
|
if (val==0) EXCEPTION(0); \
|
||||||
Bitu quo=reg_ax / val; \
|
Bitu quo=reg_ax / val; \
|
||||||
reg_ah=(Bit8u)(reg_ax % val); \
|
Bit8u rem=(Bit8u)(reg_ax % val); \
|
||||||
reg_al=(Bit8u)quo; \
|
Bit8u quo8=(Bit8u)(quo&0xff); \
|
||||||
if (quo>0xff) EXCEPTION(0); \
|
if (quo>0xff) EXCEPTION(0); \
|
||||||
|
reg_ah=rem; \
|
||||||
|
reg_al=quo8; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -611,9 +613,11 @@
|
|||||||
if (val==0) EXCEPTION(0); \
|
if (val==0) EXCEPTION(0); \
|
||||||
Bitu num=(reg_dx<<16)|reg_ax; \
|
Bitu num=(reg_dx<<16)|reg_ax; \
|
||||||
Bitu quo=num/val; \
|
Bitu quo=num/val; \
|
||||||
reg_dx=(Bit16u)(num % val); \
|
Bit16u rem=(Bit16u)(num % val); \
|
||||||
reg_ax=(Bit16u)quo; \
|
Bit16u quo16=(Bit16u)(quo&0xffff); \
|
||||||
if (quo>0xffff) EXCEPTION(0); \
|
if (quo!=(Bit32u)quo16) EXCEPTION(0); \
|
||||||
|
reg_dx=rem; \
|
||||||
|
reg_ax=quo16; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DIVD(op1,load,save) \
|
#define DIVD(op1,load,save) \
|
||||||
@ -622,9 +626,11 @@
|
|||||||
if (!val) EXCEPTION(0); \
|
if (!val) EXCEPTION(0); \
|
||||||
Bit64u num=(((Bit64u)reg_edx)<<32)|reg_eax; \
|
Bit64u num=(((Bit64u)reg_edx)<<32)|reg_eax; \
|
||||||
Bit64u quo=num/val; \
|
Bit64u quo=num/val; \
|
||||||
reg_edx=(Bit32u)(num % val); \
|
Bit32u rem=(Bit32u)(num % val); \
|
||||||
reg_eax=(Bit32u)quo; \
|
Bit32u quo32=(Bit32u)(quo&0xffffffff); \
|
||||||
if (quo!=(Bit64u)reg_eax) EXCEPTION(0); \
|
if (quo!=(Bit64u)quo32) EXCEPTION(0); \
|
||||||
|
reg_edx=rem; \
|
||||||
|
reg_eax=quo32; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -633,9 +639,11 @@
|
|||||||
Bits val=(Bit8s)(load(op1)); \
|
Bits val=(Bit8s)(load(op1)); \
|
||||||
if (val==0) EXCEPTION(0); \
|
if (val==0) EXCEPTION(0); \
|
||||||
Bits quo=((Bit16s)reg_ax) / val; \
|
Bits quo=((Bit16s)reg_ax) / val; \
|
||||||
reg_ah=(Bit8s)(((Bit16s)reg_ax) % val); \
|
Bit8s rem=(Bit8s)((Bit16s)reg_ax % val); \
|
||||||
reg_al=(Bit8s)quo; \
|
Bit8s quo8s=(Bit8s)(quo&0xff); \
|
||||||
if (quo!=(Bit8s)reg_al) EXCEPTION(0); \
|
if (quo!=(Bit16s)quo8s) EXCEPTION(0); \
|
||||||
|
reg_ah=rem; \
|
||||||
|
reg_al=quo8s; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -645,9 +653,11 @@
|
|||||||
if (!val) EXCEPTION(0); \
|
if (!val) EXCEPTION(0); \
|
||||||
Bits num=(Bit32s)((reg_dx<<16)|reg_ax); \
|
Bits num=(Bit32s)((reg_dx<<16)|reg_ax); \
|
||||||
Bits quo=num/val; \
|
Bits quo=num/val; \
|
||||||
reg_dx=(Bit16u)(num % val); \
|
Bit16s rem=(Bit16s)(num % val); \
|
||||||
reg_ax=(Bit16s)quo; \
|
Bit16s quo16s=(Bit16s)quo; \
|
||||||
if (quo!=(Bit16s)reg_ax) EXCEPTION(0); \
|
if (quo!=(Bit32s)quo16s) EXCEPTION(0); \
|
||||||
|
reg_dx=rem; \
|
||||||
|
reg_ax=quo16s; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IDIVD(op1,load,save) \
|
#define IDIVD(op1,load,save) \
|
||||||
@ -656,9 +666,11 @@
|
|||||||
if (!val) EXCEPTION(0); \
|
if (!val) EXCEPTION(0); \
|
||||||
Bit64s num=(((Bit64u)reg_edx)<<32)|reg_eax; \
|
Bit64s num=(((Bit64u)reg_edx)<<32)|reg_eax; \
|
||||||
Bit64s quo=num/val; \
|
Bit64s quo=num/val; \
|
||||||
reg_edx=(Bit32s)(num % val); \
|
Bit32s rem=(Bit32s)(num % val); \
|
||||||
reg_eax=(Bit32s)(quo); \
|
Bit32s quo32s=(Bit32s)(quo&0xffffffff); \
|
||||||
if (quo!=(Bit64s)((Bit32s)reg_eax)) EXCEPTION(0); \
|
if (quo!=(Bit64s)quo32s) EXCEPTION(0); \
|
||||||
|
reg_edx=rem; \
|
||||||
|
reg_eax=quo32s; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define IMULB(op1,load,save) \
|
#define IMULB(op1,load,save) \
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -27,11 +27,13 @@
|
|||||||
#include "lazyflags.h"
|
#include "lazyflags.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "setup.h"
|
||||||
|
|
||||||
#define LINK_TOTAL (64*1024)
|
#define LINK_TOTAL (64*1024)
|
||||||
|
|
||||||
PagingBlock paging;
|
PagingBlock paging;
|
||||||
static Bit32u mapfirstmb[LINK_START];
|
|
||||||
|
|
||||||
|
|
||||||
Bitu PageHandler::readb(PhysPt addr) {
|
Bitu PageHandler::readb(PhysPt addr) {
|
||||||
E_Exit("No byte handler for read from %d",addr);
|
E_Exit("No byte handler for read from %d",addr);
|
||||||
@ -65,10 +67,34 @@ void PageHandler::writed(PhysPt addr,Bitu val) {
|
|||||||
writeb(addr+3,(Bit8u) (val >> 24));
|
writeb(addr+3,(Bit8u) (val >> 24));
|
||||||
};
|
};
|
||||||
|
|
||||||
HostPt PageHandler::GetHostPt(Bitu phys_page) {
|
HostPt PageHandler::GetHostReadPt(Bitu phys_page) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HostPt PageHandler::GetHostWritePt(Bitu phys_page) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PageHandler::readb_checked(PhysPt addr, Bitu * val) {
|
||||||
|
*val=readb(addr); return false;
|
||||||
|
}
|
||||||
|
bool PageHandler::readw_checked(PhysPt addr, Bitu * val) {
|
||||||
|
*val=readw(addr); return false;
|
||||||
|
}
|
||||||
|
bool PageHandler::readd_checked(PhysPt addr, Bitu * val) {
|
||||||
|
*val=readd(addr); return false;
|
||||||
|
}
|
||||||
|
bool PageHandler::writeb_checked(PhysPt addr,Bitu val) {
|
||||||
|
writeb(addr,val); return false;
|
||||||
|
}
|
||||||
|
bool PageHandler::writew_checked(PhysPt addr,Bitu val) {
|
||||||
|
writew(addr,val); return false;
|
||||||
|
}
|
||||||
|
bool PageHandler::writed_checked(PhysPt addr,Bitu val) {
|
||||||
|
writed(addr,val); return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct PF_Entry {
|
struct PF_Entry {
|
||||||
Bitu cs;
|
Bitu cs;
|
||||||
@ -77,7 +103,7 @@ struct PF_Entry {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define PF_QUEUESIZE 16
|
#define PF_QUEUESIZE 16
|
||||||
struct {
|
static struct {
|
||||||
Bitu used;
|
Bitu used;
|
||||||
PF_Entry entries[PF_QUEUESIZE];
|
PF_Entry entries[PF_QUEUESIZE];
|
||||||
} pf_queue;
|
} pf_queue;
|
||||||
@ -104,7 +130,7 @@ Bitu DEBUG_EnableDebugger(void);
|
|||||||
|
|
||||||
bool first=false;
|
bool first=false;
|
||||||
|
|
||||||
void PAGING_PageFault(PhysPt lin_addr,Bitu page_addr,Bitu type) {
|
void PAGING_PageFault(PhysPt lin_addr,Bitu page_addr,bool writefault,Bitu faultcode) {
|
||||||
/* Save the state of the cpu cores */
|
/* Save the state of the cpu cores */
|
||||||
LazyFlags old_lflags;
|
LazyFlags old_lflags;
|
||||||
memcpy(&old_lflags,&lflags,sizeof(LazyFlags));
|
memcpy(&old_lflags,&lflags,sizeof(LazyFlags));
|
||||||
@ -113,14 +139,14 @@ void PAGING_PageFault(PhysPt lin_addr,Bitu page_addr,Bitu type) {
|
|||||||
cpudecoder=&PageFaultCore;
|
cpudecoder=&PageFaultCore;
|
||||||
paging.cr2=lin_addr;
|
paging.cr2=lin_addr;
|
||||||
PF_Entry * entry=&pf_queue.entries[pf_queue.used++];
|
PF_Entry * entry=&pf_queue.entries[pf_queue.used++];
|
||||||
LOG(LOG_PAGING,LOG_NORMAL)("PageFault at %X type %d queue %d",lin_addr,type,pf_queue.used);
|
LOG(LOG_PAGING,LOG_NORMAL)("PageFault at %X type [%x:%x] queue %d",lin_addr,writefault,faultcode,pf_queue.used);
|
||||||
// LOG_MSG("EAX:%04X ECX:%04X EDX:%04X EBX:%04X",reg_eax,reg_ecx,reg_edx,reg_ebx);
|
// LOG_MSG("EAX:%04X ECX:%04X EDX:%04X EBX:%04X",reg_eax,reg_ecx,reg_edx,reg_ebx);
|
||||||
// LOG_MSG("CS:%04X EIP:%08X SS:%04x SP:%08X",SegValue(cs),reg_eip,SegValue(ss),reg_esp);
|
// LOG_MSG("CS:%04X EIP:%08X SS:%04x SP:%08X",SegValue(cs),reg_eip,SegValue(ss),reg_esp);
|
||||||
entry->cs=SegValue(cs);
|
entry->cs=SegValue(cs);
|
||||||
entry->eip=reg_eip;
|
entry->eip=reg_eip;
|
||||||
entry->page_addr=page_addr;
|
entry->page_addr=page_addr;
|
||||||
//Caused by a write by default?
|
//Caused by a write by default?
|
||||||
CPU_Exception(14,0x2 );
|
CPU_Exception(14,(writefault?0x02:0x00) | faultcode);
|
||||||
#if C_DEBUG
|
#if C_DEBUG
|
||||||
// DEBUG_EnableDebugger();
|
// DEBUG_EnableDebugger();
|
||||||
#endif
|
#endif
|
||||||
@ -136,30 +162,66 @@ class InitPageHandler : public PageHandler {
|
|||||||
public:
|
public:
|
||||||
InitPageHandler() {flags=PFLAG_INIT|PFLAG_NOCODE;}
|
InitPageHandler() {flags=PFLAG_INIT|PFLAG_NOCODE;}
|
||||||
Bitu readb(PhysPt addr) {
|
Bitu readb(PhysPt addr) {
|
||||||
InitPage(addr);
|
InitPage(addr,false);
|
||||||
return mem_readb(addr);
|
return mem_readb(addr);
|
||||||
}
|
}
|
||||||
Bitu readw(PhysPt addr) {
|
Bitu readw(PhysPt addr) {
|
||||||
InitPage(addr);
|
InitPage(addr,false);
|
||||||
return mem_readw(addr);
|
return mem_readw(addr);
|
||||||
}
|
}
|
||||||
Bitu readd(PhysPt addr) {
|
Bitu readd(PhysPt addr) {
|
||||||
InitPage(addr);
|
InitPage(addr,false);
|
||||||
return mem_readd(addr);
|
return mem_readd(addr);
|
||||||
}
|
}
|
||||||
void writeb(PhysPt addr,Bitu val) {
|
void writeb(PhysPt addr,Bitu val) {
|
||||||
InitPage(addr);
|
InitPage(addr,true);
|
||||||
mem_writeb(addr,val);
|
mem_writeb(addr,val);
|
||||||
}
|
}
|
||||||
void writew(PhysPt addr,Bitu val) {
|
void writew(PhysPt addr,Bitu val) {
|
||||||
InitPage(addr);
|
InitPage(addr,true);
|
||||||
mem_writew(addr,val);
|
mem_writew(addr,val);
|
||||||
}
|
}
|
||||||
void writed(PhysPt addr,Bitu val) {
|
void writed(PhysPt addr,Bitu val) {
|
||||||
InitPage(addr);
|
InitPage(addr,true);
|
||||||
mem_writed(addr,val);
|
mem_writed(addr,val);
|
||||||
}
|
}
|
||||||
void InitPage(Bitu lin_addr) {
|
bool readb_checked(PhysPt addr, Bitu * val) {
|
||||||
|
if (InitPage(addr,false,true)) {
|
||||||
|
*val=mem_readb(addr);
|
||||||
|
return false;
|
||||||
|
} else return true;
|
||||||
|
}
|
||||||
|
bool readw_checked(PhysPt addr, Bitu * val) {
|
||||||
|
if (InitPage(addr,false,true)){
|
||||||
|
*val=mem_readw(addr);
|
||||||
|
return false;
|
||||||
|
} else return true;
|
||||||
|
}
|
||||||
|
bool readd_checked(PhysPt addr, Bitu * val) {
|
||||||
|
if (InitPage(addr,false,true)) {
|
||||||
|
*val=mem_readd(addr);
|
||||||
|
return false;
|
||||||
|
} else return true;
|
||||||
|
}
|
||||||
|
bool writeb_checked(PhysPt addr,Bitu val) {
|
||||||
|
if (InitPage(addr,true,true)) {
|
||||||
|
mem_writeb(addr,val);
|
||||||
|
return false;
|
||||||
|
} else return true;
|
||||||
|
}
|
||||||
|
bool writew_checked(PhysPt addr,Bitu val) {
|
||||||
|
if (InitPage(addr,true,true)) {
|
||||||
|
mem_writew(addr,val);
|
||||||
|
return false;
|
||||||
|
} else return true;
|
||||||
|
}
|
||||||
|
bool writed_checked(PhysPt addr,Bitu val) {
|
||||||
|
if (InitPage(addr,true,true)) {
|
||||||
|
mem_writed(addr,val);
|
||||||
|
return false;
|
||||||
|
} else return true;
|
||||||
|
}
|
||||||
|
bool InitPage(Bitu lin_addr,bool writing,bool check_only=false) {
|
||||||
Bitu lin_page=lin_addr >> 12;
|
Bitu lin_page=lin_addr >> 12;
|
||||||
Bitu phys_page;
|
Bitu phys_page;
|
||||||
if (paging.enabled) {
|
if (paging.enabled) {
|
||||||
@ -169,32 +231,63 @@ public:
|
|||||||
X86PageEntry table;
|
X86PageEntry table;
|
||||||
table.load=phys_readd(table_addr);
|
table.load=phys_readd(table_addr);
|
||||||
if (!table.block.p) {
|
if (!table.block.p) {
|
||||||
LOG(LOG_PAGING,LOG_ERROR)("NP Table");
|
if (check_only) {
|
||||||
PAGING_PageFault(lin_addr,table_addr,0);
|
paging.cr2=lin_addr;
|
||||||
|
cpu.exception.which=14;
|
||||||
|
cpu.exception.error=writing?0x02:0x00;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
LOG(LOG_PAGING,LOG_NORMAL)("NP Table");
|
||||||
|
PAGING_PageFault(lin_addr,table_addr,false,writing?0x02:0x00);
|
||||||
table.load=phys_readd(table_addr);
|
table.load=phys_readd(table_addr);
|
||||||
if (!table.block.p)
|
if (!table.block.p)
|
||||||
E_Exit("Pagefault didn't correct table");
|
E_Exit("Pagefault didn't correct table");
|
||||||
}
|
}
|
||||||
table.block.a=table.block.d=1; //Set access/Dirty
|
if (!table.block.a) {
|
||||||
|
table.block.a=1; //Set access
|
||||||
phys_writed(table_addr,table.load);
|
phys_writed(table_addr,table.load);
|
||||||
|
}
|
||||||
X86PageEntry entry;
|
X86PageEntry entry;
|
||||||
Bitu entry_addr=(table.block.base<<12)+t_index*4;
|
Bitu entry_addr=(table.block.base<<12)+t_index*4;
|
||||||
entry.load=phys_readd(entry_addr);
|
entry.load=phys_readd(entry_addr);
|
||||||
if (!entry.block.p) {
|
if (!entry.block.p) {
|
||||||
LOG(LOG_PAGING,LOG_ERROR)("NP Page");
|
if (check_only) {
|
||||||
PAGING_PageFault(lin_addr,entry_addr,0);
|
paging.cr2=lin_addr;
|
||||||
|
cpu.exception.which=14;
|
||||||
|
cpu.exception.error=writing?0x02:0x00;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// LOG(LOG_PAGING,LOG_NORMAL)("NP Page");
|
||||||
|
PAGING_PageFault(lin_addr,entry_addr,false,writing?0x02:0x00);
|
||||||
entry.load=phys_readd(entry_addr);
|
entry.load=phys_readd(entry_addr);
|
||||||
if (!entry.block.p)
|
if (!entry.block.p)
|
||||||
E_Exit("Pagefault didn't correct page");
|
E_Exit("Pagefault didn't correct page");
|
||||||
}
|
}
|
||||||
entry.block.a=entry.block.d=1; //Set access/Dirty
|
if (cpu.cpl==3) {
|
||||||
|
if ((entry.block.us==0) || (table.block.us==0) && (((entry.block.wr==0) || (table.block.wr==0)) && writing)) {
|
||||||
|
LOG(LOG_PAGING,LOG_NORMAL)("Page access denied: cpl=%i, %x:%x:%x:%x",cpu.cpl,entry.block.us,table.block.us,entry.block.wr,table.block.wr);
|
||||||
|
if (check_only) {
|
||||||
|
paging.cr2=lin_addr;
|
||||||
|
cpu.exception.which=14;
|
||||||
|
cpu.exception.error=0x05 | (writing?0x02:0x00);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
PAGING_PageFault(lin_addr,entry_addr,writing,0x05 | (writing?0x02:0x00));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (check_only) return true;
|
||||||
|
if ((!entry.block.a) || (!entry.block.d)) {
|
||||||
|
entry.block.a=1; //Set access
|
||||||
|
entry.block.d=1; //Set dirty
|
||||||
phys_writed(entry_addr,entry.load);
|
phys_writed(entry_addr,entry.load);
|
||||||
|
}
|
||||||
phys_page=entry.block.base;
|
phys_page=entry.block.base;
|
||||||
} else {
|
} else {
|
||||||
if (lin_page<LINK_START) phys_page=mapfirstmb[lin_page];
|
if (lin_page<LINK_START) phys_page=paging.firstmb[lin_page];
|
||||||
else phys_page=lin_page;
|
else phys_page=lin_page;
|
||||||
}
|
}
|
||||||
PAGING_LinkPage(lin_page,phys_page);
|
PAGING_LinkPage(lin_page,phys_page);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -210,7 +303,7 @@ bool PAGING_MakePhysPage(Bitu & page) {
|
|||||||
if (!entry.block.p) return false;
|
if (!entry.block.p) return false;
|
||||||
page=entry.block.base;
|
page=entry.block.base;
|
||||||
} else {
|
} else {
|
||||||
if (page<LINK_START) page=mapfirstmb[page];
|
if (page<LINK_START) page=paging.firstmb[page];
|
||||||
//Else keep it the same
|
//Else keep it the same
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -262,11 +355,10 @@ void PAGING_LinkPage(Bitu lin_page,Bitu phys_page) {
|
|||||||
PAGING_ClearTLB();
|
PAGING_ClearTLB();
|
||||||
}
|
}
|
||||||
|
|
||||||
HostPt host_mem=handler->GetHostPt(phys_page);
|
|
||||||
paging.tlb.phys_page[lin_page]=phys_page;
|
paging.tlb.phys_page[lin_page]=phys_page;
|
||||||
if (handler->flags & PFLAG_READABLE) paging.tlb.read[lin_page]=host_mem-lin_base;
|
if (handler->flags & PFLAG_READABLE) paging.tlb.read[lin_page]=handler->GetHostReadPt(phys_page)-lin_base;
|
||||||
else paging.tlb.read[lin_page]=0;
|
else paging.tlb.read[lin_page]=0;
|
||||||
if (handler->flags & PFLAG_WRITEABLE) paging.tlb.write[lin_page]=host_mem-lin_base;
|
if (handler->flags & PFLAG_WRITEABLE) paging.tlb.write[lin_page]=handler->GetHostWritePt(phys_page)-lin_base;
|
||||||
else paging.tlb.write[lin_page]=0;
|
else paging.tlb.write[lin_page]=0;
|
||||||
|
|
||||||
paging.links.entries[paging.links.used++]=lin_page;
|
paging.links.entries[paging.links.used++]=lin_page;
|
||||||
@ -275,7 +367,7 @@ void PAGING_LinkPage(Bitu lin_page,Bitu phys_page) {
|
|||||||
|
|
||||||
void PAGING_MapPage(Bitu lin_page,Bitu phys_page) {
|
void PAGING_MapPage(Bitu lin_page,Bitu phys_page) {
|
||||||
if (lin_page<LINK_START) {
|
if (lin_page<LINK_START) {
|
||||||
mapfirstmb[lin_page]=phys_page;
|
paging.firstmb[lin_page]=phys_page;
|
||||||
paging.tlb.read[lin_page]=0;
|
paging.tlb.read[lin_page]=0;
|
||||||
paging.tlb.write[lin_page]=0;
|
paging.tlb.write[lin_page]=0;
|
||||||
paging.tlb.handler[lin_page]=&init_page_handler;
|
paging.tlb.handler[lin_page]=&init_page_handler;
|
||||||
@ -318,14 +410,22 @@ bool PAGING_Enabled(void) {
|
|||||||
return paging.enabled;
|
return paging.enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PAGING_Init(Section * sec) {
|
class PAGING:public Module_base{
|
||||||
|
public:
|
||||||
|
PAGING(Section* configuration):Module_base(configuration){
|
||||||
/* Setup default Page Directory, force it to update */
|
/* Setup default Page Directory, force it to update */
|
||||||
paging.enabled=false;
|
paging.enabled=false;
|
||||||
PAGING_InitTLB();
|
PAGING_InitTLB();
|
||||||
Bitu i;
|
Bitu i;
|
||||||
for (i=0;i<LINK_START;i++) {
|
for (i=0;i<LINK_START;i++) {
|
||||||
mapfirstmb[i]=i;
|
paging.firstmb[i]=i;
|
||||||
}
|
}
|
||||||
pf_queue.used=0;
|
pf_queue.used=0;
|
||||||
}
|
}
|
||||||
|
~PAGING(){}
|
||||||
|
};
|
||||||
|
|
||||||
|
static PAGING* test;
|
||||||
|
void PAGING_Init(Section * sec) {
|
||||||
|
test = new PAGING(sec);
|
||||||
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -100,6 +100,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -125,10 +127,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,10 +16,11 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: debug.cpp,v 1.60 2004/10/23 15:15:06 qbix79 Exp $ */
|
/* $Id: debug.cpp,v 1.76 2006/03/26 11:11:56 qbix79 Exp $ */
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
#if C_DEBUG
|
#if C_DEBUG
|
||||||
@ -39,6 +40,8 @@
|
|||||||
#include "shell.h"
|
#include "shell.h"
|
||||||
#include "programs.h"
|
#include "programs.h"
|
||||||
#include "debug_inc.h"
|
#include "debug_inc.h"
|
||||||
|
#include "../cpu/lazyflags.h"
|
||||||
|
#include "keyboard.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
void WIN32_Console();
|
void WIN32_Console();
|
||||||
@ -53,16 +56,37 @@ int old_cursor_state;
|
|||||||
static void DrawCode(void);
|
static void DrawCode(void);
|
||||||
static bool DEBUG_Log_Loop(int count);
|
static bool DEBUG_Log_Loop(int count);
|
||||||
static void DEBUG_RaiseTimerIrq(void);
|
static void DEBUG_RaiseTimerIrq(void);
|
||||||
static void SaveMemory(Bitu seg, Bitu ofs1, Bit32s num);
|
static void SaveMemory(Bitu seg, Bitu ofs1, Bit32u num);
|
||||||
|
static void SaveMemoryBin(Bitu seg, Bitu ofs1, Bit32u num);
|
||||||
static void LogGDT(void);
|
static void LogGDT(void);
|
||||||
static void LogLDT(void);
|
static void LogLDT(void);
|
||||||
static void LogIDT(void);
|
static void LogIDT(void);
|
||||||
|
static void LogPages(char* selname);
|
||||||
|
static void LogCPUInfo(void);
|
||||||
static void OutputVecTable(char* filename);
|
static void OutputVecTable(char* filename);
|
||||||
static void DrawVariables(void);
|
static void DrawVariables(void);
|
||||||
|
|
||||||
char* AnalyzeInstruction(char* inst, bool saveSelector);
|
char* AnalyzeInstruction(char* inst, bool saveSelector);
|
||||||
Bit32u GetHexValue(char* str, char*& hex);
|
Bit32u GetHexValue(char* str, char*& hex);
|
||||||
|
|
||||||
|
class DebugPageHandler : public PageHandler {
|
||||||
|
public:
|
||||||
|
Bitu readb(PhysPt addr) {
|
||||||
|
}
|
||||||
|
Bitu readw(PhysPt addr) {
|
||||||
|
}
|
||||||
|
Bitu readd(PhysPt addr) {
|
||||||
|
}
|
||||||
|
void writeb(PhysPt addr,Bitu val) {
|
||||||
|
}
|
||||||
|
void writew(PhysPt addr,Bitu val) {
|
||||||
|
}
|
||||||
|
void writed(PhysPt addr,Bitu val) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class DEBUG;
|
class DEBUG;
|
||||||
@ -77,6 +101,7 @@ bool logHeavy = false;
|
|||||||
static FILE* cpuLogFile = 0;
|
static FILE* cpuLogFile = 0;
|
||||||
static bool cpuLog = false;
|
static bool cpuLog = false;
|
||||||
static int cpuLogCounter = 0;
|
static int cpuLogCounter = 0;
|
||||||
|
static int cpuLogType = 1; // log detail
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -88,7 +113,7 @@ static struct {
|
|||||||
static char curSelectorName[3] = { 0,0,0 };
|
static char curSelectorName[3] = { 0,0,0 };
|
||||||
|
|
||||||
static Segment oldsegs[6];
|
static Segment oldsegs[6];
|
||||||
static Bitu oldflags;
|
static Bitu oldflags,oldcpucpl;
|
||||||
DBGBlock dbg;
|
DBGBlock dbg;
|
||||||
static Bitu input_count;
|
static Bitu input_count;
|
||||||
Bitu cycle_count;
|
Bitu cycle_count;
|
||||||
@ -134,7 +159,7 @@ Bit32u PhysMakeProt(Bit16u selector, Bit32u offset)
|
|||||||
Bit32u GetAddress(Bit16u seg, Bit32u offset)
|
Bit32u GetAddress(Bit16u seg, Bit32u offset)
|
||||||
{
|
{
|
||||||
if (seg==SegValue(cs)) return SegPhys(cs)+offset;
|
if (seg==SegValue(cs)) return SegPhys(cs)+offset;
|
||||||
if (cpu.pmode) {
|
if (cpu.pmode && !(reg_flags & FLAG_VM)) {
|
||||||
Descriptor desc;
|
Descriptor desc;
|
||||||
if (cpu.gdt.GetDescriptor(seg,desc)) return PhysMakeProt(seg,offset);
|
if (cpu.gdt.GetDescriptor(seg,desc)) return PhysMakeProt(seg,offset);
|
||||||
}
|
}
|
||||||
@ -147,15 +172,43 @@ bool GetDescriptorInfo(char* selname, char* out1, char* out2)
|
|||||||
Bitu sel;
|
Bitu sel;
|
||||||
Descriptor desc;
|
Descriptor desc;
|
||||||
|
|
||||||
if (strstr(selname,"cs") || strstr(selname,"CS")) sel = SegValue(cs); else
|
if (strstr(selname,"cs") || strstr(selname,"CS")) sel = SegValue(cs);
|
||||||
if (strstr(selname,"ds") || strstr(selname,"DS")) sel = SegValue(ds); else
|
else if (strstr(selname,"ds") || strstr(selname,"DS")) sel = SegValue(ds);
|
||||||
if (strstr(selname,"es") || strstr(selname,"ES")) sel = SegValue(es); else
|
else if (strstr(selname,"es") || strstr(selname,"ES")) sel = SegValue(es);
|
||||||
if (strstr(selname,"fs") || strstr(selname,"FS")) sel = SegValue(fs); else
|
else if (strstr(selname,"fs") || strstr(selname,"FS")) sel = SegValue(fs);
|
||||||
if (strstr(selname,"gs") || strstr(selname,"GS")) sel = SegValue(gs); else
|
else if (strstr(selname,"gs") || strstr(selname,"GS")) sel = SegValue(gs);
|
||||||
if (strstr(selname,"ss") || strstr(selname,"SS")) sel = SegValue(ss); else
|
else if (strstr(selname,"ss") || strstr(selname,"SS")) sel = SegValue(ss);
|
||||||
|
else {
|
||||||
sel = GetHexValue(selname,selname);
|
sel = GetHexValue(selname,selname);
|
||||||
// FIXME: Call Gate Descriptors
|
if (*selname==0) selname=" ";
|
||||||
|
}
|
||||||
if (cpu.gdt.GetDescriptor(sel,desc)) {
|
if (cpu.gdt.GetDescriptor(sel,desc)) {
|
||||||
|
switch (desc.Type()) {
|
||||||
|
case DESC_TASK_GATE:
|
||||||
|
sprintf(out1,"%s: s:%08X type:%02X p",selname,desc.GetSelector(),desc.saved.gate.type);
|
||||||
|
sprintf(out2," TaskGate dpl : %01X %1X",desc.saved.gate.dpl,desc.saved.gate.p);
|
||||||
|
return true;
|
||||||
|
case DESC_LDT:
|
||||||
|
case DESC_286_TSS_A:
|
||||||
|
case DESC_286_TSS_B:
|
||||||
|
case DESC_386_TSS_A:
|
||||||
|
case DESC_386_TSS_B:
|
||||||
|
sprintf(out1,"%s: b:%08X type:%02X pag",selname,desc.GetBase(),desc.saved.seg.type);
|
||||||
|
sprintf(out2," l:%08X dpl : %01X %1X%1X%1X",desc.GetLimit(),desc.saved.seg.dpl,desc.saved.seg.p,desc.saved.seg.avl,desc.saved.seg.g);
|
||||||
|
return true;
|
||||||
|
case DESC_286_CALL_GATE:
|
||||||
|
case DESC_386_CALL_GATE:
|
||||||
|
sprintf(out1,"%s: s:%08X type:%02X p params: %02X",selname,desc.GetSelector(),desc.saved.gate.type,desc.saved.gate.paramcount);
|
||||||
|
sprintf(out2," o:%08X dpl : %01X %1X",desc.GetOffset(),desc.saved.gate.dpl,desc.saved.gate.p);
|
||||||
|
return true;
|
||||||
|
case DESC_286_INT_GATE:
|
||||||
|
case DESC_286_TRAP_GATE:
|
||||||
|
case DESC_386_INT_GATE:
|
||||||
|
case DESC_386_TRAP_GATE:
|
||||||
|
sprintf(out1,"%s: s:%08X type:%02X p",selname,desc.GetSelector(),desc.saved.gate.type);
|
||||||
|
sprintf(out2," o:%08X dpl : %01X %1X",desc.GetOffset(),desc.saved.gate.dpl,desc.saved.gate.p);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
sprintf(out1,"%s: b:%08X type:%02X parbg",selname,desc.GetBase(),desc.saved.seg.type);
|
sprintf(out1,"%s: b:%08X type:%02X parbg",selname,desc.GetBase(),desc.saved.seg.type);
|
||||||
sprintf(out2," l:%08X dpl : %01X %1X%1X%1X%1X%1X",desc.GetLimit(),desc.saved.seg.dpl,desc.saved.seg.p,desc.saved.seg.avl,desc.saved.seg.r,desc.saved.seg.big,desc.saved.seg.g);
|
sprintf(out2," l:%08X dpl : %01X %1X%1X%1X%1X%1X",desc.GetLimit(),desc.saved.seg.dpl,desc.saved.seg.p,desc.saved.seg.avl,desc.saved.seg.r,desc.saved.seg.big,desc.saved.seg.g);
|
||||||
return true;
|
return true;
|
||||||
@ -163,7 +216,6 @@ bool GetDescriptorInfo(char* selname, char* out1, char* out2)
|
|||||||
strcpy(out1," ");
|
strcpy(out1," ");
|
||||||
strcpy(out2," ");
|
strcpy(out2," ");
|
||||||
}
|
}
|
||||||
//out1[0] = out2[0] = 0;
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -174,7 +226,7 @@ bool GetDescriptorInfo(char* selname, char* out1, char* out2)
|
|||||||
class CDebugVar
|
class CDebugVar
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CDebugVar(char* _name, PhysPt _adr) { adr=_adr; (strlen(name)<15)?strcpy(name,_name):strncpy(name,_name,15); name[15]=0; };
|
CDebugVar(char* _name, PhysPt _adr) { adr=_adr; safe_strncpy(name,_name,16); };
|
||||||
|
|
||||||
char* GetName(void) { return name; };
|
char* GetName(void) { return name; };
|
||||||
PhysPt GetAdr (void) { return adr; };
|
PhysPt GetAdr (void) { return adr; };
|
||||||
@ -536,6 +588,9 @@ void CBreakpoint::ShowList(void)
|
|||||||
} else if (bp->GetType()==BKPNT_MEMORY) {
|
} else if (bp->GetType()==BKPNT_MEMORY) {
|
||||||
DEBUG_ShowMsg("%02X. BPMEM %04X:%04X (%02X)\n",nr,bp->GetSegment(),bp->GetOffset(),bp->GetValue());
|
DEBUG_ShowMsg("%02X. BPMEM %04X:%04X (%02X)\n",nr,bp->GetSegment(),bp->GetOffset(),bp->GetValue());
|
||||||
nr++;
|
nr++;
|
||||||
|
} else if (bp->GetType()==BKPNT_MEMORY_PROT) {
|
||||||
|
DEBUG_ShowMsg("%02X. BPPM %04X:%08X (%02X)\n",nr,bp->GetSegment(),bp->GetOffset(),bp->GetValue());
|
||||||
|
nr++;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -603,15 +658,16 @@ static void DrawData(void) {
|
|||||||
/* Data win */
|
/* Data win */
|
||||||
for (int y=0; y<8; y++) {
|
for (int y=0; y<8; y++) {
|
||||||
// Adress
|
// Adress
|
||||||
mvwprintw (dbg.win_data,1+y,0,"%04X:%04X ",dataSeg,add);
|
if (add<0x10000) mvwprintw (dbg.win_data,1+y,0,"%04X:%04X ",dataSeg,add);
|
||||||
|
else mvwprintw (dbg.win_data,1+y,0,"%04X:%08X ",dataSeg,add);
|
||||||
for (int x=0; x<16; x++) {
|
for (int x=0; x<16; x++) {
|
||||||
address = GetAddress(dataSeg,add);
|
address = GetAddress(dataSeg,add);
|
||||||
if (!(paging.tlb.handler[address >> 12]->flags & PFLAG_INIT)) {
|
if (!(paging.tlb.handler[address >> 12]->flags & PFLAG_INIT)) {
|
||||||
ch = mem_readb(address);
|
ch = mem_readb(address);
|
||||||
} else ch = 0;
|
} else ch = 0;
|
||||||
mvwprintw (dbg.win_data,1+y,11+3*x,"%02X",ch);
|
mvwprintw (dbg.win_data,1+y,14+3*x,"%02X",ch);
|
||||||
if (ch<32) ch='.';
|
if (ch<32 || !isprint(*reinterpret_cast<unsigned char*>(&ch))) ch='.';
|
||||||
mvwprintw (dbg.win_data,1+y,60+x,"%c",ch);
|
mvwprintw (dbg.win_data,1+y,63+x,"%c",ch);
|
||||||
add++;
|
add++;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -661,8 +717,14 @@ static void DrawRegisters(void) {
|
|||||||
SetColor((reg_flags ^ oldflags)&FLAG_TF);
|
SetColor((reg_flags ^ oldflags)&FLAG_TF);
|
||||||
mvwprintw (dbg.win_reg,1,77,"%01X",GETFLAG(TF) ? 1:0);
|
mvwprintw (dbg.win_reg,1,77,"%01X",GETFLAG(TF) ? 1:0);
|
||||||
|
|
||||||
|
SetColor((reg_flags ^ oldflags)&FLAG_IOPL);
|
||||||
|
mvwprintw (dbg.win_reg,2,72,"%01X",GETFLAG(IOPL)>>12);
|
||||||
oldflags=reg_flags;
|
oldflags=reg_flags;
|
||||||
|
|
||||||
|
SetColor(cpu.cpl ^ oldcpucpl);
|
||||||
|
mvwprintw (dbg.win_reg,2,78,"%01X",cpu.cpl);
|
||||||
|
oldcpucpl=cpu.cpl;
|
||||||
|
|
||||||
if (cpu.pmode) {
|
if (cpu.pmode) {
|
||||||
if (reg_flags & FLAG_VM) mvwprintw(dbg.win_reg,0,76,"VM86");
|
if (reg_flags & FLAG_VM) mvwprintw(dbg.win_reg,0,76,"VM86");
|
||||||
else if (cpu.code.big) mvwprintw(dbg.win_reg,0,76,"Pr32");
|
else if (cpu.code.big) mvwprintw(dbg.win_reg,0,76,"Pr32");
|
||||||
@ -843,11 +905,12 @@ bool ChangeRegister(char* str)
|
|||||||
if (strstr(hex,"SS")==hex) { hex+=2; SegSet16(ss,(Bit16u)GetHexValue(hex,hex)); } else
|
if (strstr(hex,"SS")==hex) { hex+=2; SegSet16(ss,(Bit16u)GetHexValue(hex,hex)); } else
|
||||||
if (strstr(hex,"AF")==hex) { hex+=2; SETFLAGBIT(AF,GetHexValue(hex,hex)); } else
|
if (strstr(hex,"AF")==hex) { hex+=2; SETFLAGBIT(AF,GetHexValue(hex,hex)); } else
|
||||||
if (strstr(hex,"CF")==hex) { hex+=2; SETFLAGBIT(CF,GetHexValue(hex,hex)); } else
|
if (strstr(hex,"CF")==hex) { hex+=2; SETFLAGBIT(CF,GetHexValue(hex,hex)); } else
|
||||||
if (strstr(hex,"DF")==hex) { hex+=2; SETFLAGBIT(PF,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,"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,"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,"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,"PF")==hex) { hex+=3; SETFLAGBIT(PF,GetHexValue(hex,hex)); } else
|
||||||
|
if (strstr(hex,"SF")==hex) { hex+=3; SETFLAGBIT(SF,GetHexValue(hex,hex)); } else
|
||||||
{ return false; };
|
{ return false; };
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
@ -869,6 +932,15 @@ bool ParseCommand(char* str)
|
|||||||
SaveMemory(seg,ofs,num);
|
SaveMemory(seg,ofs,num);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
found = strstr(str,"MEMDUMPBIN ");
|
||||||
|
if (found) { // Insert variable
|
||||||
|
found+=11;
|
||||||
|
Bit16u seg = (Bit16u)GetHexValue(found,found); found++;
|
||||||
|
Bit32u ofs = GetHexValue(found,found); found++;
|
||||||
|
Bit32u num = GetHexValue(found,found); found++;
|
||||||
|
SaveMemoryBin(seg,ofs,num);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
found = strstr(str,"IV ");
|
found = strstr(str,"IV ");
|
||||||
if (found) { // Insert variable
|
if (found) { // Insert variable
|
||||||
@ -964,8 +1036,11 @@ bool ParseCommand(char* str)
|
|||||||
Bit16u seg = (Bit16u)GetHexValue(found,found);found++; // skip ":"
|
Bit16u seg = (Bit16u)GetHexValue(found,found);found++; // skip ":"
|
||||||
Bit32u ofs = GetHexValue(found,found);
|
Bit32u ofs = GetHexValue(found,found);
|
||||||
CBreakpoint* bp = CBreakpoint::AddMemBreakpoint(seg,ofs);
|
CBreakpoint* bp = CBreakpoint::AddMemBreakpoint(seg,ofs);
|
||||||
if (bp) bp->SetType(BKPNT_MEMORY_PROT);
|
if (bp)
|
||||||
|
{
|
||||||
|
bp->SetType(BKPNT_MEMORY_PROT);
|
||||||
DEBUG_ShowMsg("DEBUG: Set prot-mode memory breakpoint at %04X:%08X\n",seg,ofs);
|
DEBUG_ShowMsg("DEBUG: Set prot-mode memory breakpoint at %04X:%08X\n",seg,ofs);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
found = strstr(str,"BPLM ");
|
found = strstr(str,"BPLM ");
|
||||||
@ -1039,10 +1114,51 @@ bool ParseCommand(char* str)
|
|||||||
// DEBUG_Log_Loop(GetHexValue(found,found));
|
// DEBUG_Log_Loop(GetHexValue(found,found));
|
||||||
cpuLogFile = fopen("LOGCPU.TXT","wt");
|
cpuLogFile = fopen("LOGCPU.TXT","wt");
|
||||||
if (!cpuLogFile) {
|
if (!cpuLogFile) {
|
||||||
DEBUG_ShowMsg("DEBUG: Logfile couldnt be created.\n");
|
DEBUG_ShowMsg("DEBUG: Logfile couldn't be created.\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
cpuLog = true;
|
cpuLog = true;
|
||||||
|
cpuLogType = 1;
|
||||||
|
cpuLogCounter = GetHexValue(found,found);
|
||||||
|
|
||||||
|
debugging=false;
|
||||||
|
CBreakpoint::ActivateBreakpoints(SegPhys(cs)+reg_eip,true);
|
||||||
|
ignoreAddressOnce = SegPhys(cs)+reg_eip;
|
||||||
|
DOSBOX_SetNormalLoop();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
cpuLogType = 0;
|
||||||
|
cpuLogCounter = GetHexValue(found,found);
|
||||||
|
|
||||||
|
debugging=false;
|
||||||
|
CBreakpoint::ActivateBreakpoints(SegPhys(cs)+reg_eip,true);
|
||||||
|
ignoreAddressOnce = SegPhys(cs)+reg_eip;
|
||||||
|
DOSBOX_SetNormalLoop();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
found = strstr(str,"LOGL ");
|
||||||
|
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;
|
||||||
|
cpuLogType = 2;
|
||||||
cpuLogCounter = GetHexValue(found,found);
|
cpuLogCounter = GetHexValue(found,found);
|
||||||
|
|
||||||
debugging=false;
|
debugging=false;
|
||||||
@ -1100,6 +1216,18 @@ bool ParseCommand(char* str)
|
|||||||
LogIDT();
|
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 ");
|
found = strstr(str,"INTVEC ");
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
@ -1124,15 +1252,6 @@ bool ParseCommand(char* str)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* found = strstr(str,"EXCEPTION ");
|
|
||||||
if (found) {
|
|
||||||
found += 9;
|
|
||||||
Bit8u num = GetHexValue(found,found);
|
|
||||||
DPMI_CreateException(num,0xDD);
|
|
||||||
DEBUG_ShowMsg("Exception %04X\n",num);
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if C_HEAVY_DEBUG
|
#if C_HEAVY_DEBUG
|
||||||
found = strstr(str,"HEAVYLOG");
|
found = strstr(str,"HEAVYLOG");
|
||||||
if (found) { // Create Cpu log file
|
if (found) { // Create Cpu log file
|
||||||
@ -1169,6 +1288,7 @@ bool ParseCommand(char* str)
|
|||||||
DEBUG_ShowMsg("INT [nr] / INTT [nr] - Execute / Trace into interrupt.\n");
|
DEBUG_ShowMsg("INT [nr] / INTT [nr] - Execute / Trace into interrupt.\n");
|
||||||
#if C_HEAVY_DEBUG
|
#if C_HEAVY_DEBUG
|
||||||
DEBUG_ShowMsg("LOG [num] - Write cpu log file.\n");
|
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("HEAVYLOG - Enable/Disable automatic cpu when dosbox exits.\n");
|
||||||
#endif
|
#endif
|
||||||
DEBUG_ShowMsg("SR [reg] [value] - Set register value.\n");
|
DEBUG_ShowMsg("SR [reg] [value] - Set register value.\n");
|
||||||
@ -1176,14 +1296,21 @@ bool ParseCommand(char* str)
|
|||||||
|
|
||||||
DEBUG_ShowMsg("IV [seg]:[off] [name] - Create var name for memory address.\n");
|
DEBUG_ShowMsg("IV [seg]:[off] [name] - Create var name for memory address.\n");
|
||||||
DEBUG_ShowMsg("SV [filename] - Save var list in file.\n");
|
DEBUG_ShowMsg("SV [filename] - Save var list in file.\n");
|
||||||
DEBUG_ShowMsg("LV [seg]:[off] [name] - Load var list from file.\n");
|
DEBUG_ShowMsg("LV [filename] - Load var list from file.\n");
|
||||||
|
|
||||||
DEBUG_ShowMsg("MEMDUMP [seg]:[off] [len] - Write memory to file memdump.txt.\n");
|
DEBUG_ShowMsg("MEMDUMP [seg]:[off] [len] - Write memory to file memdump.txt.\n");
|
||||||
|
DEBUG_ShowMsg("MEMDUMPBIN [s]:[o] [len] - Write memory to file memdump.bin.\n");
|
||||||
DEBUG_ShowMsg("SELINFO [segName] - Show selector info.\n");
|
DEBUG_ShowMsg("SELINFO [segName] - Show selector info.\n");
|
||||||
|
|
||||||
DEBUG_ShowMsg("INTVEC [filename] - Writes interrupt vector table to file.\n");
|
DEBUG_ShowMsg("INTVEC [filename] - Writes interrupt vector table to file.\n");
|
||||||
DEBUG_ShowMsg("INTHAND [intNum] - Set code view to interrupt handler.\n");
|
DEBUG_ShowMsg("INTHAND [intNum] - Set code view to interrupt handler.\n");
|
||||||
|
|
||||||
|
DEBUG_ShowMsg("CPU - Display CPU status information.\n");
|
||||||
|
DEBUG_ShowMsg("GDT - Lists descriptors of the GDT.\n");
|
||||||
|
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("H - Help\n");
|
DEBUG_ShowMsg("H - Help\n");
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1288,65 +1415,65 @@ char* AnalyzeInstruction(char* inst, bool saveSelector)
|
|||||||
// Must be a jump
|
// Must be a jump
|
||||||
if (instu[0] == 'J')
|
if (instu[0] == 'J')
|
||||||
{
|
{
|
||||||
bool jmp = 0;
|
bool jmp = false;
|
||||||
switch (instu[1]) {
|
switch (instu[1]) {
|
||||||
case 'A' : { jmp = !GETFLAGBOOL(CF) && !GETFLAGBOOL(ZF); // JA
|
case 'A' : { jmp = (get_CF()?false:true) && (get_ZF()?false:true); // JA
|
||||||
} break;
|
} break;
|
||||||
case 'B' : { if (instu[2] == 'E') {
|
case 'B' : { if (instu[2] == 'E') {
|
||||||
jmp = GETFLAGBOOL(CF) && GETFLAGBOOL(ZF); // JBE
|
jmp = (get_CF()?true:false) && (get_ZF()?true:false); // JBE
|
||||||
} else {
|
} else {
|
||||||
jmp = GETFLAGBOOL(CF); // JB
|
jmp = get_CF()?true:false; // JB
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 'C' : { if (instu[2] == 'X') {
|
case 'C' : { if (instu[2] == 'X') {
|
||||||
jmp = reg_cx == 0; // JCXZ
|
jmp = reg_cx == 0; // JCXZ
|
||||||
} else {
|
} else {
|
||||||
jmp = GETFLAGBOOL(CF); // JC
|
jmp = get_CF()?true:false; // JC
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 'E' : { jmp = GETFLAGBOOL(ZF); // JE
|
case 'E' : { jmp = get_ZF()?true:false; // JE
|
||||||
} break;
|
} break;
|
||||||
case 'G' : { if (instu[2] == 'E') {
|
case 'G' : { if (instu[2] == 'E') {
|
||||||
jmp = !GETFLAGBOOL(SF); // JGE
|
jmp = get_SF()?false:true; // JGE
|
||||||
} else {
|
} else {
|
||||||
jmp = !GETFLAGBOOL(SF) && !GETFLAGBOOL(ZF); // JG
|
jmp = (get_SF()?false:true) && (get_ZF()?false:true); // JG
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 'L' : { if (instu[2] == 'E') {
|
case 'L' : { if (instu[2] == 'E') {
|
||||||
jmp = GETFLAGBOOL(SF) || GETFLAGBOOL(ZF); // JLE
|
jmp = (get_SF()?true:false) || (get_ZF()?true:false) ; // JLE
|
||||||
} else {
|
} else {
|
||||||
jmp = GETFLAGBOOL(SF); // JL
|
jmp = get_SF()?true:false; // JL
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 'M' : { jmp = true; // JMP
|
case 'M' : { jmp = true; // JMP
|
||||||
} break;
|
} break;
|
||||||
case 'N' : { switch (instu[2]) {
|
case 'N' : { switch (instu[2]) {
|
||||||
case 'B' :
|
case 'B' :
|
||||||
case 'C' : { jmp = !GETFLAGBOOL(CF); // JNB / JNC
|
case 'C' : { jmp = get_CF()?false:true; // JNB / JNC
|
||||||
} break;
|
} break;
|
||||||
case 'E' : { jmp = !GETFLAGBOOL(ZF); // JNE
|
case 'E' : { jmp = get_ZF()?false:true; // JNE
|
||||||
} break;
|
} break;
|
||||||
case 'O' : { jmp = !GETFLAGBOOL(OF); // JNO
|
case 'O' : { jmp = get_OF()?false:true; // JNO
|
||||||
} break;
|
} break;
|
||||||
case 'P' : { jmp = !GETFLAGBOOL(PF); // JNP
|
case 'P' : { jmp = get_PF()?false:true; // JNP
|
||||||
} break;
|
} break;
|
||||||
case 'S' : { jmp = !GETFLAGBOOL(SF); // JNS
|
case 'S' : { jmp = get_SF()?false:true; // JNS
|
||||||
} break;
|
} break;
|
||||||
case 'Z' : { jmp = !GETFLAGBOOL(ZF); // JNZ
|
case 'Z' : { jmp = get_ZF()?false:true; // JNZ
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 'O' : { jmp = GETFLAGBOOL(OF); // JMP
|
case 'O' : { jmp = get_OF()?true:false; // JMP
|
||||||
} break;
|
} break;
|
||||||
case 'P' : { if (instu[2] == 'O') {
|
case 'P' : { if (instu[2] == 'O') {
|
||||||
jmp = !GETFLAGBOOL(PF); // JPO
|
jmp = get_PF()?false:true; // JPO
|
||||||
} else {
|
} else {
|
||||||
jmp = GETFLAGBOOL(SF); // JP / JPE
|
jmp = get_SF()?true:false; // JP / JPE
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case 'S' : { jmp = GETFLAGBOOL(SF); // JS
|
case 'S' : { jmp = get_SF()?true:false; // JS
|
||||||
} break;
|
} break;
|
||||||
case 'Z' : { jmp = GETFLAGBOOL(ZF); // JZ
|
case 'Z' : { jmp = get_ZF()?true:false; // JZ
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
if (jmp) {
|
if (jmp) {
|
||||||
@ -1374,6 +1501,7 @@ Bit32u DEBUG_CheckKeys(void) {
|
|||||||
ParseCommand(codeViewData.inputStr);
|
ParseCommand(codeViewData.inputStr);
|
||||||
break;
|
break;
|
||||||
case 0x107: //backspace (linux)
|
case 0x107: //backspace (linux)
|
||||||
|
case 0x7f: //backspace in some terminal emulators (linux)
|
||||||
case 0x08: // delete
|
case 0x08: // delete
|
||||||
if (strlen(codeViewData.inputStr)>0) codeViewData.inputStr[strlen(codeViewData.inputStr)-1] = 0;
|
if (strlen(codeViewData.inputStr)>0) codeViewData.inputStr[strlen(codeViewData.inputStr)-1] = 0;
|
||||||
break;
|
break;
|
||||||
@ -1418,19 +1546,24 @@ Bit32u DEBUG_CheckKeys(void) {
|
|||||||
ret=(*cpudecoder)();
|
ret=(*cpudecoder)();
|
||||||
break;
|
break;
|
||||||
case 'D': dataSeg = SegValue(ds);
|
case 'D': dataSeg = SegValue(ds);
|
||||||
dataOfs = reg_si;
|
if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_esi;
|
||||||
|
else dataOfs = reg_si;
|
||||||
break;
|
break;
|
||||||
case 'E': dataSeg = SegValue(es);
|
case 'E': dataSeg = SegValue(es);
|
||||||
dataOfs = reg_di;
|
if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_edi;
|
||||||
|
else dataOfs = reg_di;
|
||||||
break;
|
break;
|
||||||
case 'X': dataSeg = SegValue(ds);
|
case 'X': dataSeg = SegValue(ds);
|
||||||
dataOfs = reg_dx;
|
if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_edx;
|
||||||
|
else dataOfs = reg_dx;
|
||||||
break;
|
break;
|
||||||
case 'B': dataSeg = SegValue(es);
|
case 'B': dataSeg = SegValue(es);
|
||||||
dataOfs = reg_bx;
|
if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_ebx;
|
||||||
|
else dataOfs = reg_bx;
|
||||||
break;
|
break;
|
||||||
case 'S': dataSeg = SegValue(ss);
|
case 'S': dataSeg = SegValue(ss);
|
||||||
dataOfs = reg_sp;
|
if (cpu.pmode && !(reg_flags & FLAG_VM)) dataOfs = reg_esp;
|
||||||
|
else dataOfs = reg_sp;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'R' : dataOfs -= 16; break;
|
case 'R' : dataOfs -= 16; break;
|
||||||
@ -1527,7 +1660,9 @@ Bitu DEBUG_Loop(void) {
|
|||||||
return DEBUG_CheckKeys();
|
return DEBUG_CheckKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DEBUG_Enable(void) {
|
void DEBUG_Enable(bool pressed) {
|
||||||
|
if (!pressed)
|
||||||
|
return;
|
||||||
static bool showhelp=false;
|
static bool showhelp=false;
|
||||||
debugging=true;
|
debugging=true;
|
||||||
SetCodeWinStart();
|
SetCodeWinStart();
|
||||||
@ -1537,6 +1672,7 @@ void DEBUG_Enable(void) {
|
|||||||
showhelp=true;
|
showhelp=true;
|
||||||
DEBUG_ShowMsg("***| PRESS \"H\" TO SHOW ALL COMMANDS. PRESS \"RETURN\" TO ENTER COMMANDMODE. |***\n");
|
DEBUG_ShowMsg("***| PRESS \"H\" TO SHOW ALL COMMANDS. PRESS \"RETURN\" TO ENTER COMMANDMODE. |***\n");
|
||||||
}
|
}
|
||||||
|
KEYBOARD_ClrBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DEBUG_DrawScreen(void) {
|
void DEBUG_DrawScreen(void) {
|
||||||
@ -1603,6 +1739,68 @@ static void LogIDT(void)
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void LogPages(char* selname)
|
||||||
|
{
|
||||||
|
char out1[512];
|
||||||
|
if (paging.enabled) {
|
||||||
|
Bitu sel = GetHexValue(selname,selname);
|
||||||
|
if ((sel==0x00) && ((*selname==0) || (*selname=='*'))) {
|
||||||
|
for (int i=0; i<0xfffff; i++) {
|
||||||
|
Bitu table_addr=(paging.base.page<<12)+(i >> 10)*4;
|
||||||
|
X86PageEntry table;
|
||||||
|
table.load=phys_readd(table_addr);
|
||||||
|
if (table.block.p) {
|
||||||
|
X86PageEntry entry;
|
||||||
|
Bitu entry_addr=(table.block.base<<12)+(i & 0x3ff)*4;
|
||||||
|
entry.load=phys_readd(entry_addr);
|
||||||
|
if (entry.block.p) {
|
||||||
|
sprintf(out1,"page %05Xxxx -> %04Xxxx flags [uw] %x:%x::%x:%x",i,entry.block.base,entry.block.us,table.block.us,entry.block.wr,table.block.wr);
|
||||||
|
LOG(LOG_MISC,LOG_ERROR)(out1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Bitu table_addr=(paging.base.page<<12)+(sel >> 10)*4;
|
||||||
|
X86PageEntry table;
|
||||||
|
table.load=phys_readd(table_addr);
|
||||||
|
if (table.block.p) {
|
||||||
|
X86PageEntry entry;
|
||||||
|
Bitu entry_addr=(table.block.base<<12)+(sel & 0x3ff)*4;
|
||||||
|
entry.load=phys_readd(entry_addr);
|
||||||
|
sprintf(out1,"page %05Xxxx -> %04Xxxx flags [puw] %x:%x::%x:%x::%x:%x",sel,entry.block.base,entry.block.p,table.block.p,entry.block.us,table.block.us,entry.block.wr,table.block.wr);
|
||||||
|
LOG(LOG_MISC,LOG_ERROR)(out1);
|
||||||
|
} else {
|
||||||
|
sprintf(out1,"pagetable %03X not present, flags [puw] %x::%x::%x",(sel >> 10),table.block.p,table.block.us,table.block.wr);
|
||||||
|
LOG(LOG_MISC,LOG_ERROR)(out1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static void LogCPUInfo(void)
|
||||||
|
{
|
||||||
|
char out1[512];
|
||||||
|
sprintf(out1,"cr0:%08X cr2:%08X cr3:%08X cpl=%x",cpu.cr0,paging.cr2,paging.cr3,cpu.cpl);
|
||||||
|
LOG(LOG_MISC,LOG_ERROR)(out1);
|
||||||
|
sprintf(out1,"eflags:%08X [vm=%x iopl=%x nt=%x]",reg_flags,GETFLAG(VM)>>17,GETFLAG(IOPL)>>12,GETFLAG(NT)>>14);
|
||||||
|
LOG(LOG_MISC,LOG_ERROR)(out1);
|
||||||
|
sprintf(out1,"GDT base=%08X limit=%08X",cpu.gdt.GetBase(),cpu.gdt.GetLimit());
|
||||||
|
LOG(LOG_MISC,LOG_ERROR)(out1);
|
||||||
|
sprintf(out1,"IDT base=%08X limit=%08X",cpu.idt.GetBase(),cpu.idt.GetLimit());
|
||||||
|
LOG(LOG_MISC,LOG_ERROR)(out1);
|
||||||
|
|
||||||
|
Bitu sel;
|
||||||
|
Descriptor desc;
|
||||||
|
CPU_STR(sel);
|
||||||
|
cpu.gdt.GetDescriptor(sel,desc);
|
||||||
|
sprintf(out1,"TR selector=%04X, base=%08X limit=%08X*%X",sel,desc.GetBase(),desc.GetLimit(),desc.saved.seg.g?0x4000:1);
|
||||||
|
LOG(LOG_MISC,LOG_ERROR)(out1);
|
||||||
|
sel=cpu.gdt.SLDT();
|
||||||
|
cpu.gdt.GetDescriptor(sel,desc);
|
||||||
|
sprintf(out1,"LDT selector=%04X, base=%08X limit=%08X*%X",sel,desc.GetBase(),desc.GetLimit(),desc.saved.seg.g?0x4000:1);
|
||||||
|
LOG(LOG_MISC,LOG_ERROR)(out1);
|
||||||
|
};
|
||||||
|
|
||||||
static void LogInstruction(Bit16u segValue, Bit32u eipValue, char* buffer)
|
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 };
|
static char empty[15] = { 32,32,32,32,32,32,32,32,32,32,32,32,32,32,0 };
|
||||||
@ -1614,13 +1812,41 @@ static void LogInstruction(Bit16u segValue, Bit32u eipValue, char* buffer)
|
|||||||
char* res = empty;
|
char* res = empty;
|
||||||
if (showExtend) {
|
if (showExtend) {
|
||||||
res = AnalyzeInstruction(dline,false);
|
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 || (strlen(res)==0)) res = empty;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (len<30) for (Bitu i=0; i<30-len; i++) strcat(dline," ");
|
|
||||||
// Get register values
|
// 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),
|
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),
|
||||||
GETFLAGBOOL(CF),GETFLAGBOOL(ZF),GETFLAGBOOL(SF),GETFLAGBOOL(OF),GETFLAGBOOL(AF),GETFLAGBOOL(PF),GETFLAGBOOL(IF));
|
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," ");
|
||||||
|
char ibytes[200]=""; char tmpc[200];
|
||||||
|
for (Bitu i=0; i<size; i++) {
|
||||||
|
sprintf(tmpc,"%02X ",mem_readb(start+i));
|
||||||
|
strcat(ibytes,tmpc);
|
||||||
|
}
|
||||||
|
len=strlen(ibytes);
|
||||||
|
if (len<21) for (Bitu i=0; i<21-len; i++) strcat(ibytes," ");
|
||||||
|
sprintf(buffer,"%04X:%08X %s %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 TF:%01X VM:%01X FLG:%08X CR0:%08X\n",segValue,eipValue,ibytes,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),GETFLAGBOOL(TF),GETFLAGBOOL(VM),reg_flags,cpu.cr0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool DEBUG_Log_Loop(int count) {
|
static bool DEBUG_Log_Loop(int count) {
|
||||||
@ -1671,7 +1897,7 @@ public:
|
|||||||
char filename[128];
|
char filename[128];
|
||||||
char args[256];
|
char args[256];
|
||||||
cmd->FindCommand(1,temp_line);
|
cmd->FindCommand(1,temp_line);
|
||||||
strncpy(filename,temp_line.c_str(),128);
|
safe_strncpy(filename,temp_line.c_str(),128);
|
||||||
// Read commandline
|
// Read commandline
|
||||||
Bit16u i =2;
|
Bit16u i =2;
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
@ -1723,7 +1949,7 @@ void DEBUG_CheckExecuteBreakpoint(Bit16u seg, Bit32u off)
|
|||||||
Bitu DEBUG_EnableDebugger(void)
|
Bitu DEBUG_EnableDebugger(void)
|
||||||
{
|
{
|
||||||
exitLoop = true;
|
exitLoop = true;
|
||||||
DEBUG_Enable();
|
DEBUG_Enable(true);
|
||||||
CPU_Cycles=CPU_CycleLeft=0;
|
CPU_Cycles=CPU_CycleLeft=0;
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
@ -1758,7 +1984,8 @@ static void DEBUG_ShutDown(Section * sec)
|
|||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
curs_set(old_cursor_state);
|
curs_set(old_cursor_state);
|
||||||
tcsetattr(0, TCSANOW,&consolesettings);
|
tcsetattr(0, TCSANOW,&consolesettings);
|
||||||
printf("\e[0m\e[2J");
|
// printf("\e[0m\e[2J"); //Seems to destroy scrolling
|
||||||
|
printf("\ec");
|
||||||
fflush(NULL);
|
fflush(NULL);
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
@ -1770,7 +1997,7 @@ void DEBUG_Init(Section* sec) {
|
|||||||
MSG_Add("DEBUG_CONFIGFILE_HELP","Debugger related options.\n");
|
MSG_Add("DEBUG_CONFIGFILE_HELP","Debugger related options.\n");
|
||||||
DEBUG_DrawScreen();
|
DEBUG_DrawScreen();
|
||||||
/* Add some keyhandlers */
|
/* Add some keyhandlers */
|
||||||
MAPPER_AddHandler(DEBUG_Enable,MK_pause,0,"debugger","Debugger");
|
MAPPER_AddHandler(DEBUG_Enable,MK_pause,MMOD2,"debugger","Debugger");
|
||||||
/* Clear the TBreakpoint list */
|
/* Clear the TBreakpoint list */
|
||||||
memset((void*)&codeViewData,0,sizeof(codeViewData));
|
memset((void*)&codeViewData,0,sizeof(codeViewData));
|
||||||
/* setup debug.com */
|
/* setup debug.com */
|
||||||
@ -1857,7 +2084,7 @@ bool CDebugVar::LoadVars(char* name)
|
|||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void SaveMemory(Bitu seg, Bitu ofs1, Bit32s num)
|
static void SaveMemory(Bitu seg, Bitu ofs1, Bit32u num)
|
||||||
{
|
{
|
||||||
FILE* f = fopen("MEMDUMP.TXT","wt");
|
FILE* f = fopen("MEMDUMP.TXT","wt");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
@ -1884,6 +2111,22 @@ static void SaveMemory(Bitu seg, Bitu ofs1, Bit32s num)
|
|||||||
DEBUG_ShowMsg("DEBUG: Memory dump success.\n");
|
DEBUG_ShowMsg("DEBUG: Memory dump success.\n");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void SaveMemoryBin(Bitu seg, Bitu ofs1, Bit32u num) {
|
||||||
|
FILE* f = fopen("MEMDUMP.BIN","wb");
|
||||||
|
if (!f) {
|
||||||
|
DEBUG_ShowMsg("DEBUG: Memory binary dump failed.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(Bitu x = 0; x < num;x++) {
|
||||||
|
Bit8u val = mem_readb(GetAddress(seg,ofs1+x));
|
||||||
|
fwrite(&val,1,1,f);
|
||||||
|
};
|
||||||
|
|
||||||
|
fclose(f);
|
||||||
|
DEBUG_ShowMsg("DEBUG: Memory dump binary success.\n");
|
||||||
|
};
|
||||||
|
|
||||||
static void OutputVecTable(char* filename)
|
static void OutputVecTable(char* filename)
|
||||||
{
|
{
|
||||||
FILE* f = fopen(filename, "wt");
|
FILE* f = fopen(filename, "wt");
|
||||||
|
@ -260,7 +260,7 @@ static char *op386map1[256] = {
|
|||||||
"call %Jv", "jmp %Jv", "jmp %Ap", "jmp %Ks%Jb",
|
"call %Jv", "jmp %Jv", "jmp %Ap", "jmp %Ks%Jb",
|
||||||
"in al,dx", "in %eax,dx", "out dx,al", "out dx,%eax",
|
"in al,dx", "in %eax,dx", "out dx,al", "out dx,%eax",
|
||||||
/* f */
|
/* f */
|
||||||
"lock %p ", 0, "repne %p ", "repe %p ",
|
"lock %p ", "icebp", "repne %p ", "repe %p ",
|
||||||
"hlt", "cmc", "%g2", "%g2",
|
"hlt", "cmc", "%g2", "%g2",
|
||||||
"clc", "stc", "cli", "sti",
|
"clc", "stc", "cli", "sti",
|
||||||
"cld", "std", "%g3", "%g4"
|
"cld", "std", "%g3", "%g4"
|
||||||
@ -269,8 +269,8 @@ static char *op386map1[256] = {
|
|||||||
static char *second[] = {
|
static char *second[] = {
|
||||||
/* 0 */
|
/* 0 */
|
||||||
"%g5", "%g6", "lar %Gv,%Ew", "lsl %Gv,%Ew",
|
"%g5", "%g6", "lar %Gv,%Ew", "lsl %Gv,%Ew",
|
||||||
0, "loadall", "clts", "loadall",
|
0, "[loadall]", "clts", "[loadall]",
|
||||||
"invd", "wbinvd", 0, 0,
|
"invd", "wbinvd", 0, "UD2",
|
||||||
0, 0, 0, 0,
|
0, 0, 0, 0,
|
||||||
/* 1 */
|
/* 1 */
|
||||||
"mov %Eb,%Gb", "mov %Ev,%Gv", "mov %Gb,%Eb", "mov %Gv,%Ev",
|
"mov %Eb,%Gb", "mov %Ev,%Gv", "mov %Gb,%Eb", "mov %Gv,%Ev",
|
||||||
@ -308,7 +308,7 @@ static char *second[] = {
|
|||||||
"sets %Eb", "setns %Eb", "setp %Eb", "setnp %Eb",
|
"sets %Eb", "setns %Eb", "setp %Eb", "setnp %Eb",
|
||||||
"setl %Eb", "setge %Eb", "setle %Eb", "setg %Eb",
|
"setl %Eb", "setge %Eb", "setle %Eb", "setg %Eb",
|
||||||
/* a */
|
/* a */
|
||||||
"push fs", "pop fs", 0, "bt %Ev,%Gv",
|
"push fs", "pop fs", "cpuid", "bt %Ev,%Gv",
|
||||||
"shld %Ev,%Gv,%Ib", "shld %Ev,%Gv,cl", 0, 0,
|
"shld %Ev,%Gv,%Ib", "shld %Ev,%Gv,cl", 0, 0,
|
||||||
"push gs", "pop gs", 0, "bts %Ev,%Gv",
|
"push gs", "pop gs", 0, "bts %Ev,%Gv",
|
||||||
"shrd %Ev,%Gv,%Ib", "shrd %Ev,%Gv,cl", 0, "imul %Gv,%Ev",
|
"shrd %Ev,%Gv,%Ib", "shrd %Ev,%Gv,cl", 0, "imul %Gv,%Ev",
|
||||||
@ -354,7 +354,7 @@ static char *groups[][8] = { /* group 0 is group 3 for %Ev set */
|
|||||||
"verr %Ew", "verw %Ew", 0, 0 },
|
"verr %Ew", "verw %Ew", 0, 0 },
|
||||||
/* 6 */
|
/* 6 */
|
||||||
{ "sgdt %Ms", "sidt %Ms", "lgdt %Ms", "lidt %Ms",
|
{ "sgdt %Ms", "sidt %Ms", "lgdt %Ms", "lidt %Ms",
|
||||||
"smsw %Ew", 0, "lmsw %Ew", 0 },
|
"smsw %Ew", 0, "lmsw %Ew", "invlpg" },
|
||||||
/* 7 */
|
/* 7 */
|
||||||
{ 0, 0, 0, 0,
|
{ 0, 0, 0, 0,
|
||||||
"bt", "bts", "btr", "btc" }
|
"bt", "bts", "btr", "btc" }
|
||||||
@ -363,8 +363,10 @@ static char *groups[][8] = { /* group 0 is group 3 for %Ev set */
|
|||||||
/* zero here means invalid. If first entry starts with '*', use st(i) */
|
/* zero here means invalid. If first entry starts with '*', use st(i) */
|
||||||
/* no assumed %EFs here. Indexed by RM(modrm()) */
|
/* no assumed %EFs here. Indexed by RM(modrm()) */
|
||||||
static char *f0[] = { 0, 0, 0, 0, 0, 0, 0, 0};
|
static char *f0[] = { 0, 0, 0, 0, 0, 0, 0, 0};
|
||||||
|
static char *fop_8[] = { "*fld st,%GF" };
|
||||||
static char *fop_9[] = { "*fxch st,%GF" };
|
static char *fop_9[] = { "*fxch st,%GF" };
|
||||||
static char *fop_10[] = { "fnop", 0, 0, 0, 0, 0, 0, 0 };
|
static char *fop_10[] = { "fnop", 0, 0, 0, 0, 0, 0, 0 };
|
||||||
|
static char *fop_11[] = { "*fst st,%GF" };
|
||||||
static char *fop_12[] = { "fchs", "fabs", 0, 0, "ftst", "fxam", 0, 0 };
|
static char *fop_12[] = { "fchs", "fabs", 0, 0, "ftst", "fxam", 0, 0 };
|
||||||
static char *fop_13[] = { "fld1", "fldl2t", "fldl2e", "fldpi",
|
static char *fop_13[] = { "fld1", "fldl2t", "fldl2e", "fldpi",
|
||||||
"fldlg2", "fldln2", "fldz", 0 };
|
"fldlg2", "fldln2", "fldz", 0 };
|
||||||
@ -373,20 +375,24 @@ static char *fop_14[] = { "f2xm1", "fyl2x", "fptan", "fpatan",
|
|||||||
static char *fop_15[] = { "fprem", "fyl2xp1", "fsqrt", "fsincos",
|
static char *fop_15[] = { "fprem", "fyl2xp1", "fsqrt", "fsincos",
|
||||||
"frndint", "fscale", "fsin", "fcos" };
|
"frndint", "fscale", "fsin", "fcos" };
|
||||||
static char *fop_21[] = { 0, "fucompp", 0, 0, 0, 0, 0, 0 };
|
static char *fop_21[] = { 0, "fucompp", 0, 0, 0, 0, 0, 0 };
|
||||||
static char *fop_28[] = { 0, 0, "fclex", "finit", 0, 0, 0, 0 };
|
static char *fop_28[] = { "[fneni]", "[fndis]", "fclex", "finit", "[fnsetpm]", "[frstpm]", 0, 0 };
|
||||||
static char *fop_32[] = { "*fadd %GF,st" };
|
static char *fop_32[] = { "*fadd %GF,st" };
|
||||||
static char *fop_33[] = { "*fmul %GF,st" };
|
static char *fop_33[] = { "*fmul %GF,st" };
|
||||||
|
static char *fop_34[] = { "*fcom %GF,st" };
|
||||||
|
static char *fop_35[] = { "*fcomp %GF,st" };
|
||||||
static char *fop_36[] = { "*fsubr %GF,st" };
|
static char *fop_36[] = { "*fsubr %GF,st" };
|
||||||
static char *fop_37[] = { "*fsub %GF,st" };
|
static char *fop_37[] = { "*fsub %GF,st" };
|
||||||
static char *fop_38[] = { "*fdivr %GF,st" };
|
static char *fop_38[] = { "*fdivr %GF,st" };
|
||||||
static char *fop_39[] = { "*fdiv %GF,st" };
|
static char *fop_39[] = { "*fdiv %GF,st" };
|
||||||
static char *fop_40[] = { "*ffree %GF" };
|
static char *fop_40[] = { "*ffree %GF" };
|
||||||
|
static char *fop_41[] = { "*fxch %GF" };
|
||||||
static char *fop_42[] = { "*fst %GF" };
|
static char *fop_42[] = { "*fst %GF" };
|
||||||
static char *fop_43[] = { "*fstp %GF" };
|
static char *fop_43[] = { "*fstp %GF" };
|
||||||
static char *fop_44[] = { "*fucom %GF" };
|
static char *fop_44[] = { "*fucom %GF" };
|
||||||
static char *fop_45[] = { "*fucomp %GF" };
|
static char *fop_45[] = { "*fucomp %GF" };
|
||||||
static char *fop_48[] = { "*faddp %GF,st" };
|
static char *fop_48[] = { "*faddp %GF,st" };
|
||||||
static char *fop_49[] = { "*fmulp %GF,st" };
|
static char *fop_49[] = { "*fmulp %GF,st" };
|
||||||
|
static char *fop_50[] = { "*fcomp %GF,st" };
|
||||||
static char *fop_51[] = { 0, "fcompp", 0, 0, 0, 0, 0, 0 };
|
static char *fop_51[] = { 0, "fcompp", 0, 0, 0, 0, 0, 0 };
|
||||||
static char *fop_52[] = { "*fsubrp %GF,st" };
|
static char *fop_52[] = { "*fsubrp %GF,st" };
|
||||||
static char *fop_53[] = { "*fsubp %GF,st" };
|
static char *fop_53[] = { "*fsubp %GF,st" };
|
||||||
@ -396,12 +402,12 @@ static char *fop_60[] = { "fstsw ax", 0, 0, 0, 0, 0, 0, 0 };
|
|||||||
|
|
||||||
static char **fspecial[] = { /* 0=use st(i), 1=undefined 0 in fop_* means undefined */
|
static char **fspecial[] = { /* 0=use st(i), 1=undefined 0 in fop_* means undefined */
|
||||||
0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, fop_9, fop_10, 0, fop_12, fop_13, fop_14, fop_15,
|
fop_8, fop_9, fop_10, fop_11, fop_12, fop_13, fop_14, fop_15,
|
||||||
f0, f0, f0, f0, f0, fop_21, f0, f0,
|
f0, f0, f0, f0, f0, fop_21, f0, f0,
|
||||||
f0, f0, f0, f0, fop_28, f0, f0, f0,
|
f0, f0, f0, f0, fop_28, f0, f0, f0,
|
||||||
fop_32, fop_33, f0, f0, fop_36, fop_37, fop_38, fop_39,
|
fop_32, fop_33, fop_34, fop_35, fop_36, fop_37, fop_38, fop_39,
|
||||||
fop_40, f0, fop_42, fop_43, fop_44, fop_45, f0, f0,
|
fop_40, fop_41, fop_42, fop_43, fop_44, fop_45, f0, f0,
|
||||||
fop_48, fop_49, f0, fop_51, fop_52, fop_53, fop_54, fop_55,
|
fop_48, fop_49, fop_50, fop_51, fop_52, fop_53, fop_54, fop_55,
|
||||||
f0, f0, f0, f0, fop_60, f0, f0, f0,
|
f0, f0, f0, f0, fop_60, f0, f0, f0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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.
|
* 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 $ */
|
||||||
|
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
|
|
||||||
#if C_DEBUG
|
#if C_DEBUG
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -36,11 +37,16 @@ struct _LogGroup {
|
|||||||
char * front;
|
char * front;
|
||||||
bool enabled;
|
bool enabled;
|
||||||
};
|
};
|
||||||
|
#include <list>
|
||||||
|
#include <string>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
#define MAX_LOG_BUFFER 500
|
||||||
|
static list<string> logBuff;
|
||||||
|
static list<string>::iterator logBuffPos = logBuff.end();
|
||||||
|
|
||||||
static _LogGroup loggrp[LOG_MAX]={{"",true},{0,false}};
|
static _LogGroup loggrp[LOG_MAX]={{"",true},{0,false}};
|
||||||
static FILE* debuglog;
|
static FILE* debuglog;
|
||||||
static std::list<char*> logBuff;
|
|
||||||
static std::list<char*>::iterator logBuffPos = logBuff.end();
|
|
||||||
|
|
||||||
extern int old_cursor_state;
|
extern int old_cursor_state;
|
||||||
|
|
||||||
@ -60,19 +66,15 @@ void DEBUG_ShowMsg(char * format,...) {
|
|||||||
|
|
||||||
if(debuglog) fprintf(debuglog,"%s",buf);
|
if(debuglog) fprintf(debuglog,"%s",buf);
|
||||||
|
|
||||||
char* newLine = new char[strlen(buf) + 1];
|
|
||||||
strcpy(newLine, buf);
|
|
||||||
if (logBuffPos!=logBuff.end()) {
|
if (logBuffPos!=logBuff.end()) {
|
||||||
logBuffPos=logBuff.end();
|
logBuffPos=logBuff.end();
|
||||||
DEBUG_RefreshPage(0);
|
DEBUG_RefreshPage(0);
|
||||||
mvwprintw(dbg.win_out,dbg.win_out->_maxy-1, 0, "");
|
mvwprintw(dbg.win_out,dbg.win_out->_maxy-1, 0, "");
|
||||||
}
|
}
|
||||||
logBuff.push_back(newLine);
|
logBuff.push_back(buf);
|
||||||
if (logBuff.size()>500) {
|
if (logBuff.size() > MAX_LOG_BUFFER)
|
||||||
char * firstline = logBuff.front();
|
|
||||||
delete firstline;
|
|
||||||
logBuff.pop_front();
|
logBuff.pop_front();
|
||||||
}
|
|
||||||
logBuffPos = logBuff.end();
|
logBuffPos = logBuff.end();
|
||||||
wprintw(dbg.win_out,"%s",buf);
|
wprintw(dbg.win_out,"%s",buf);
|
||||||
wrefresh(dbg.win_out);
|
wrefresh(dbg.win_out);
|
||||||
@ -82,14 +84,15 @@ void DEBUG_RefreshPage(char scroll) {
|
|||||||
if (scroll==-1 && logBuffPos!=logBuff.begin()) logBuffPos--;
|
if (scroll==-1 && logBuffPos!=logBuff.begin()) logBuffPos--;
|
||||||
else if (scroll==1 && logBuffPos!=logBuff.end()) logBuffPos++;
|
else if (scroll==1 && logBuffPos!=logBuff.end()) logBuffPos++;
|
||||||
|
|
||||||
std::list<char*>::iterator i = logBuffPos;
|
list<string>::iterator i = logBuffPos;
|
||||||
int rem_lines = dbg.win_out->_maxy;
|
int rem_lines = dbg.win_out->_maxy;
|
||||||
|
|
||||||
wclear(dbg.win_out);
|
wclear(dbg.win_out);
|
||||||
|
|
||||||
while (rem_lines > 0 && i!=logBuff.begin()) {
|
while (rem_lines > 0 && i!=logBuff.begin()) {
|
||||||
rem_lines -= (int) (strlen(*--i) / dbg.win_out->_maxx) + 1;
|
rem_lines -= (int) ((*--i).size() / dbg.win_out->_maxx) + 1;
|
||||||
mvwprintw(dbg.win_out,rem_lines-1, 0, *i);
|
/* Const cast is needed for pdcurses which has no const char in mvwprintw (bug maybe) */
|
||||||
|
mvwprintw(dbg.win_out,rem_lines-1, 0, const_cast<char*>((*i).c_str()));
|
||||||
}
|
}
|
||||||
wrefresh(dbg.win_out);
|
wrefresh(dbg.win_out);
|
||||||
}
|
}
|
||||||
@ -127,6 +130,8 @@ static void Draw_RegisterLayout(void) {
|
|||||||
mvwaddstr(dbg.win_reg,1,28,"CS=");
|
mvwaddstr(dbg.win_reg,1,28,"CS=");
|
||||||
mvwaddstr(dbg.win_reg,1,38,"EIP=");
|
mvwaddstr(dbg.win_reg,1,38,"EIP=");
|
||||||
|
|
||||||
|
mvwaddstr(dbg.win_reg,2,75,"CPL");
|
||||||
|
mvwaddstr(dbg.win_reg,2,68,"IOPL");
|
||||||
|
|
||||||
mvwaddstr(dbg.win_reg,1,52,"C Z S O A P D I T ");
|
mvwaddstr(dbg.win_reg,1,52,"C Z S O A P D I T ");
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
/* Local Debug Function */
|
/* Local Debug Function */
|
||||||
|
|
||||||
/* $Id: debug_inc.h,v 1.8 2004/08/28 12:51:35 qbix79 Exp $ */
|
/* $Id: debug_inc.h,v 1.10 2006/02/09 11:47:48 qbix79 Exp $ */
|
||||||
|
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -69,6 +69,7 @@ static void ResizeConsole( HANDLE hConsole, SHORT xSize, SHORT ySize ) {
|
|||||||
|
|
||||||
void WIN32_Console() {
|
void WIN32_Console() {
|
||||||
AllocConsole();
|
AllocConsole();
|
||||||
|
SetConsoleTitle("DOSBox Debugger");
|
||||||
ResizeConsole(GetStdHandle(STD_OUTPUT_HANDLE),80,50);
|
ResizeConsole(GetStdHandle(STD_OUTPUT_HANDLE),80,50);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -6,4 +6,5 @@ libdos_a_SOURCES = dos.cpp dos_devices.cpp dos_execute.cpp dos_files.cpp dos_ioc
|
|||||||
dos_misc.cpp dos_classes.cpp dos_programs.cpp dos_tables.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 \
|
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 \
|
||||||
cdrom.h cdrom.cpp cdrom_ioctl_win32.cpp cdrom_aspi_win32.cpp cdrom_ioctl_linux.cpp cdrom_image.cpp
|
cdrom.h cdrom.cpp cdrom_ioctl_win32.cpp cdrom_aspi_win32.cpp cdrom_ioctl_linux.cpp cdrom_image.cpp \
|
||||||
|
cdrom_ioctl_os2.cpp
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# Makefile.in generated by automake 1.9.3 from Makefile.am.
|
# Makefile.in generated by automake 1.9.5 from Makefile.am.
|
||||||
# @configure_input@
|
# @configure_input@
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
# This Makefile.in is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
# with or without modifications, as long as this notice is preserved.
|
# with or without modifications, as long as this notice is preserved.
|
||||||
@ -62,7 +62,8 @@ am_libdos_a_OBJECTS = dos.$(OBJEXT) dos_devices.$(OBJEXT) \
|
|||||||
drive_cache.$(OBJEXT) drive_fat.$(OBJEXT) drive_iso.$(OBJEXT) \
|
drive_cache.$(OBJEXT) drive_fat.$(OBJEXT) drive_iso.$(OBJEXT) \
|
||||||
dos_mscdex.$(OBJEXT) cdrom.$(OBJEXT) \
|
dos_mscdex.$(OBJEXT) cdrom.$(OBJEXT) \
|
||||||
cdrom_ioctl_win32.$(OBJEXT) cdrom_aspi_win32.$(OBJEXT) \
|
cdrom_ioctl_win32.$(OBJEXT) cdrom_aspi_win32.$(OBJEXT) \
|
||||||
cdrom_ioctl_linux.$(OBJEXT) cdrom_image.$(OBJEXT)
|
cdrom_ioctl_linux.$(OBJEXT) cdrom_image.$(OBJEXT) \
|
||||||
|
cdrom_ioctl_os2.$(OBJEXT)
|
||||||
libdos_a_OBJECTS = $(am_libdos_a_OBJECTS)
|
libdos_a_OBJECTS = $(am_libdos_a_OBJECTS)
|
||||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||||
@ -107,6 +108,8 @@ ECHO_N = @ECHO_N@
|
|||||||
ECHO_T = @ECHO_T@
|
ECHO_T = @ECHO_T@
|
||||||
EGREP = @EGREP@
|
EGREP = @EGREP@
|
||||||
EXEEXT = @EXEEXT@
|
EXEEXT = @EXEEXT@
|
||||||
|
HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@
|
||||||
|
HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
@ -132,10 +135,12 @@ SET_MAKE = @SET_MAKE@
|
|||||||
SHELL = @SHELL@
|
SHELL = @SHELL@
|
||||||
STRIP = @STRIP@
|
STRIP = @STRIP@
|
||||||
VERSION = @VERSION@
|
VERSION = @VERSION@
|
||||||
|
WINDRES = @WINDRES@
|
||||||
ac_ct_CC = @ac_ct_CC@
|
ac_ct_CC = @ac_ct_CC@
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
ac_ct_CXX = @ac_ct_CXX@
|
||||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||||
ac_ct_STRIP = @ac_ct_STRIP@
|
ac_ct_STRIP = @ac_ct_STRIP@
|
||||||
|
ac_ct_WINDRES = @ac_ct_WINDRES@
|
||||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||||
@ -184,7 +189,8 @@ libdos_a_SOURCES = dos.cpp dos_devices.cpp dos_execute.cpp dos_files.cpp dos_ioc
|
|||||||
dos_misc.cpp dos_classes.cpp dos_programs.cpp dos_tables.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 \
|
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 \
|
||||||
cdrom.h cdrom.cpp cdrom_ioctl_win32.cpp cdrom_aspi_win32.cpp cdrom_ioctl_linux.cpp cdrom_image.cpp
|
cdrom.h cdrom.cpp cdrom_ioctl_win32.cpp cdrom_aspi_win32.cpp cdrom_ioctl_linux.cpp cdrom_image.cpp \
|
||||||
|
cdrom_ioctl_os2.cpp
|
||||||
|
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
@ -237,6 +243,7 @@ distclean-compile:
|
|||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom_aspi_win32.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom_aspi_win32.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom_image.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom_image.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom_ioctl_linux.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom_ioctl_linux.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom_ioctl_os2.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom_ioctl_win32.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdrom_ioctl_win32.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_classes.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_classes.Po@am__quote@
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -53,6 +53,8 @@ bool CDROM_Interface_SDL::SetDevice (char* path, int forceCD)
|
|||||||
int num = SDL_CDNumDrives();
|
int num = SDL_CDNumDrives();
|
||||||
if ((forceCD>=0) && (forceCD<num)) {
|
if ((forceCD>=0) && (forceCD<num)) {
|
||||||
driveID = forceCD;
|
driveID = forceCD;
|
||||||
|
cd = SDL_CDOpen(driveID);
|
||||||
|
SDL_CDStatus(cd);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -164,7 +166,7 @@ int CDROM_GetMountType(char* path, int forceCD)
|
|||||||
const char* cdName;
|
const char* cdName;
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
strcpy(buffer,path);
|
strcpy(buffer,path);
|
||||||
#if defined (WIN32)
|
#if defined (WIN32) || defined(OS2)
|
||||||
upcase(buffer);
|
upcase(buffer);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -183,9 +185,7 @@ int CDROM_GetMountType(char* path, int forceCD)
|
|||||||
|
|
||||||
// Detect ISO
|
// Detect ISO
|
||||||
struct stat file_stat;
|
struct stat file_stat;
|
||||||
stat(path, &file_stat);
|
if ((stat(path, &file_stat) == 0) && S_ISREG(file_stat.st_mode)) return 1;
|
||||||
if (S_ISREG(file_stat.st_mode)) return 1;
|
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -296,7 +296,7 @@ private:
|
|||||||
|
|
||||||
#endif /* WIN 32 */
|
#endif /* WIN 32 */
|
||||||
|
|
||||||
#if defined (LINUX)
|
#if defined (LINUX) || defined(OS2)
|
||||||
|
|
||||||
class CDROM_Interface_Ioctl : public CDROM_Interface_SDL
|
class CDROM_Interface_Ioctl : public CDROM_Interface_SDL
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: cdrom_aspi_win32.cpp,v 1.12 2004/08/04 09:12:53 qbix79 Exp $ */
|
/* $Id: cdrom_aspi_win32.cpp,v 1.16 2006/02/09 11:47:48 qbix79 Exp $ */
|
||||||
|
|
||||||
#if defined (WIN32)
|
#if defined (WIN32)
|
||||||
|
|
||||||
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "dosbox.h"
|
#include "dosbox.h"
|
||||||
#include "cdrom.h"
|
#include "cdrom.h"
|
||||||
|
#include "support.h"
|
||||||
|
|
||||||
//Are actually system includes but leave for now
|
//Are actually system includes but leave for now
|
||||||
#include "wnaspi32.h"
|
#include "wnaspi32.h"
|
||||||
@ -219,8 +220,7 @@ bool CDROM_Interface_Aspi::GetVendor(BYTE HA_num, BYTE SCSI_Id, BYTE SCSI_Lun, c
|
|||||||
strcpy (szBuffer, "error" );
|
strcpy (szBuffer, "error" );
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
strncpy(szBuffer,szBuffer+8,25);
|
safe_strncpy(szBuffer,szBuffer+8,26);
|
||||||
szBuffer[25] = 0;
|
|
||||||
int len = strlen(szBuffer);
|
int len = strlen(szBuffer);
|
||||||
for (int i=0; i<len; i++) if (szBuffer[i]<=32) szBuffer[i]='_';
|
for (int i=0; i<len; i++) if (szBuffer[i]<=32) szBuffer[i]='_';
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: cdrom_image.cpp,v 1.4 2004/10/05 19:55:03 qbix79 Exp $ */
|
/* $Id: cdrom_image.cpp,v 1.11 2006/02/09 11:47:48 qbix79 Exp $ */
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
@ -29,9 +29,12 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "cdrom.h"
|
#include "cdrom.h"
|
||||||
#include "drives.h"
|
#include "drives.h"
|
||||||
|
#include "support.h"
|
||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
|
#else
|
||||||
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@ -256,7 +259,7 @@ bool CDROM_Interface_Image::ReadSectors(PhysPt buffer, bool raw, unsigned long s
|
|||||||
Bitu buflen = num * sectorSize;
|
Bitu buflen = num * sectorSize;
|
||||||
Bit8u* buf = new Bit8u[buflen];
|
Bit8u* buf = new Bit8u[buflen];
|
||||||
|
|
||||||
bool success;
|
bool success = true; //Gobliiins reads 0 sectors
|
||||||
for(int i = 0; i < num; i++) {
|
for(int i = 0; i < num; i++) {
|
||||||
success = ReadSector(&buf[i * sectorSize], raw, sector);
|
success = ReadSector(&buf[i * sectorSize], raw, sector);
|
||||||
if (!success) break;
|
if (!success) break;
|
||||||
@ -387,6 +390,22 @@ bool CDROM_Interface_Image::CanReadPVD(TrackFile *file, int sectorSize, bool mod
|
|||||||
return (pvd[0] == 1 && !strncmp((char*)(&pvd[1]), "CD001", 5) && pvd[6] == 1);
|
return (pvd[0] == 1 && !strncmp((char*)(&pvd[1]), "CD001", 5) && pvd[6] == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(WIN32)
|
||||||
|
static string dirname(char * file) {
|
||||||
|
char * sep = strrchr(file, '\\');
|
||||||
|
if (sep == NULL)
|
||||||
|
sep = strrchr(file, '/');
|
||||||
|
if (sep == NULL)
|
||||||
|
return "";
|
||||||
|
else {
|
||||||
|
int len = (int)(sep - file);
|
||||||
|
char tmp[MAX_FILENAME_LENGTH];
|
||||||
|
safe_strncpy(tmp, file, len+1);
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
bool CDROM_Interface_Image::LoadCueSheet(char *cuefile)
|
bool CDROM_Interface_Image::LoadCueSheet(char *cuefile)
|
||||||
{
|
{
|
||||||
Track track = {0, 0, 0, 0, 0, 0, false, NULL};
|
Track track = {0, 0, 0, 0, 0, 0, false, NULL};
|
||||||
@ -398,12 +417,8 @@ bool CDROM_Interface_Image::LoadCueSheet(char *cuefile)
|
|||||||
bool success;
|
bool success;
|
||||||
bool canAddTrack = false;
|
bool canAddTrack = false;
|
||||||
char tmp[MAX_FILENAME_LENGTH]; // dirname can change its argument
|
char tmp[MAX_FILENAME_LENGTH]; // dirname can change its argument
|
||||||
strncpy(tmp, cuefile, MAX_FILENAME_LENGTH);
|
safe_strncpy(tmp, cuefile, MAX_FILENAME_LENGTH);
|
||||||
#if defined(WIN32)
|
|
||||||
string pathname("");
|
|
||||||
#else
|
|
||||||
string pathname(dirname(tmp));
|
string pathname(dirname(tmp));
|
||||||
#endif
|
|
||||||
ifstream in;
|
ifstream in;
|
||||||
in.open(cuefile, ios::in);
|
in.open(cuefile, ios::in);
|
||||||
if (in.fail()) return false;
|
if (in.fail()) return false;
|
||||||
@ -572,17 +587,15 @@ bool CDROM_Interface_Image::GetRealFileName(string &filename, string &pathname)
|
|||||||
if (stat(filename.c_str(), &test) == 0) return true;
|
if (stat(filename.c_str(), &test) == 0) return true;
|
||||||
|
|
||||||
// check if file with path relative to cue file exists
|
// check if file with path relative to cue file exists
|
||||||
#ifndef WIN32
|
|
||||||
string tmpstr(pathname + "/" + filename);
|
string tmpstr(pathname + "/" + filename);
|
||||||
if (stat(tmpstr.c_str(), &test) == 0) {
|
if (stat(tmpstr.c_str(), &test) == 0) {
|
||||||
filename = tmpstr;
|
filename = tmpstr;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
// finally check if file is in a dosbox local drive
|
// finally check if file is in a dosbox local drive
|
||||||
char fullname[CROSS_LEN];
|
char fullname[CROSS_LEN];
|
||||||
char tmp[CROSS_LEN];
|
char tmp[CROSS_LEN];
|
||||||
strncpy(tmp, filename.c_str(), CROSS_LEN);
|
safe_strncpy(tmp, filename.c_str(), CROSS_LEN);
|
||||||
Bit8u drive;
|
Bit8u drive;
|
||||||
if (!DOS_MakeName(tmp, fullname, &drive)) return false;
|
if (!DOS_MakeName(tmp, fullname, &drive)) return false;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2002-2004 The DOSBox Team
|
* Copyright (C) 2002-2006 The DOSBox Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "cdrom.h"
|
#include "cdrom.h"
|
||||||
|
#include "support.h"
|
||||||
|
|
||||||
#if defined (LINUX)
|
#if defined (LINUX)
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
@ -45,7 +46,7 @@ bool CDROM_Interface_Ioctl::GetUPC(unsigned char& attr, char* upc)
|
|||||||
|
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
attr = 0;
|
attr = 0;
|
||||||
strncpy(upc, (char*)cdrom_mcn.medium_catalog_number, 14);
|
safe_strncpy(upc, (char*)cdrom_mcn.medium_catalog_number, 14);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ret > 0);
|
return (ret > 0);
|
||||||
@ -86,7 +87,7 @@ bool CDROM_Interface_Ioctl::SetDevice(char* path, int forceCD)
|
|||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
const char* tmp = SDL_CDName(forceCD);
|
const char* tmp = SDL_CDName(forceCD);
|
||||||
if (tmp) strncpy(device_name, tmp, 512);
|
if (tmp) safe_strncpy(device_name, tmp, 512);
|
||||||
else success = false;
|
else success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user