first commit
commit
e996990ec4
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="lib" path="libs/admob-sdk-android.jar"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>ZXdroid</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.drodin.zxdroid" android:versionCode="3"
|
||||
android:versionName="0.4.2">
|
||||
|
||||
<supports-screens android:smallScreens="true"
|
||||
android:normalScreens="true" android:largeScreens="true"
|
||||
android:anyDensity="true" />
|
||||
|
||||
<application android:icon="@drawable/icon" android:label="@string/app_name"
|
||||
android:debuggable="true" android:theme="@style/Theme">
|
||||
|
||||
<activity android:name=".MainActivity" android:label="@string/app_name"
|
||||
android:launchMode="singleTask" android:configChanges="keyboardHidden|orientation"
|
||||
android:windowSoftInputMode="stateAlwaysHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity android:name=".menu.MenuTop" android:theme="@style/Theme.Translucent" />
|
||||
<activity android:name=".menu.FileOpen" />
|
||||
<activity android:name=".menu.FileSave" />
|
||||
<activity android:name=".menu.DefineKeys" />
|
||||
<activity android:name=".menu.KeySelect" android:theme="@android:style/Theme.Dialog" />
|
||||
|
||||
<meta-data android:value="a14bbf53ddb4d16" android:name="ADMOB_PUBLISHER_ID" />
|
||||
|
||||
</application>
|
||||
|
||||
<uses-sdk android:minSdkVersion="3" />
|
||||
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
</manifest>
|
|
@ -0,0 +1,3 @@
|
|||
APP_PROJECT_PATH := $(call my-dir)
|
||||
APP_MODULES := fuse spectrum
|
||||
APP_PLATFORM := android-4
|
Binary file not shown.
|
@ -0,0 +1,13 @@
|
|||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system use,
|
||||
# "build.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
|
||||
# Indicates whether an apk should be generated for each density.
|
||||
split.density=false
|
||||
# Project target.
|
||||
target=android-4
|
|
@ -0,0 +1,168 @@
|
|||
########## PATHS ##########
|
||||
|
||||
ROOT_PATH := $(call my-dir)
|
||||
FUSE_PATH := $(ROOT_PATH)/fuse-0.10.0.2
|
||||
LIBSPECTRUM_PATH := $(ROOT_PATH)/libspectrum-0.5.0.1
|
||||
|
||||
FUSEDATADIR := /data/data/com.drodin.zxdroid/files
|
||||
CURRENT_SNAPSHOT := current.sna
|
||||
|
||||
PACKAGE_PATH := com/drodin/zxdroid
|
||||
LIB_CLASS := NativeLib
|
||||
AUDIO_CLASS := MainAudio
|
||||
|
||||
|
||||
|
||||
|
||||
########## FUSE ##########
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := fuse
|
||||
|
||||
LOCAL_PATH := $(FUSE_PATH)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DHAVE_CONFIG_H \
|
||||
-DFUSEDATADIR=\"$(FUSEDATADIR)\" \
|
||||
-DCURRENT_SNAPSHOT=\"$(FUSEDATADIR)/$(CURRENT_SNAPSHOT)\" \
|
||||
-DLIB_CLASS=\"$(PACKAGE_PATH)/$(LIB_CLASS)\" \
|
||||
-DAUDIO_CLASS=\"$(PACKAGE_PATH)/$(AUDIO_CLASS)\" \
|
||||
-I$(FUSE_PATH)/ui/android \
|
||||
-I$(LIBSPECTRUM_PATH) \
|
||||
--include $(FUSE_PATH)/memory.h
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
ay.c \
|
||||
dck.c \
|
||||
display.c \
|
||||
divide.c \
|
||||
event.c \
|
||||
fuse.c \
|
||||
ide.c \
|
||||
if1.c \
|
||||
if2.c \
|
||||
input.c \
|
||||
joystick.c \
|
||||
kempmouse.c \
|
||||
keyboard.c \
|
||||
loader.c \
|
||||
machine.c \
|
||||
memory.c \
|
||||
mempool.c \
|
||||
menu.c \
|
||||
module.c \
|
||||
periph.c \
|
||||
printer.c \
|
||||
profile.c \
|
||||
psg.c \
|
||||
rzx.c \
|
||||
scld.c \
|
||||
screenshot.c \
|
||||
settings.c \
|
||||
simpleide.c \
|
||||
slt.c \
|
||||
snapshot.c \
|
||||
sound.c \
|
||||
spectrum.c \
|
||||
tape.c \
|
||||
ui.c \
|
||||
uidisplay.c \
|
||||
ula.c \
|
||||
utils.c \
|
||||
windres.rc \
|
||||
zxatasp.c \
|
||||
zxcf.c \
|
||||
compat/unix/file.c \
|
||||
compat/unix/osname.c \
|
||||
compat/unix/paths.c \
|
||||
disk/beta.c \
|
||||
disk/crc.c \
|
||||
disk/disk.c \
|
||||
disk/fdd.c \
|
||||
disk/plusd.c \
|
||||
disk/upd_fdc.c \
|
||||
disk/wd_fdc.c \
|
||||
machines/pentagon.c \
|
||||
machines/pentagon512.c \
|
||||
machines/pentagon1024.c \
|
||||
machines/scorpion.c \
|
||||
machines/spec128.c \
|
||||
machines/spec16.c \
|
||||
machines/spec48.c \
|
||||
machines/specplus2.c \
|
||||
machines/spec_se.c \
|
||||
machines/specplus2a.c \
|
||||
machines/specplus3.c \
|
||||
machines/specplus3e.c \
|
||||
machines/tc2048.c \
|
||||
machines/tc2068.c \
|
||||
machines/ts2068.c \
|
||||
timer/timer.c \
|
||||
ui/android/android.c \
|
||||
ui/android/androiddisplay.c \
|
||||
ui/android/androidsound.c \
|
||||
ui/android/androidjoystick.c \
|
||||
ui/android/androidkeyboard.c \
|
||||
ui/android/androidtimer.c \
|
||||
ui/android/androidui.c \
|
||||
ui/android/keysyms.c \
|
||||
z80/z80.c \
|
||||
z80/z80_ops.c
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := spectrum
|
||||
|
||||
LOCAL_LDLIBS := -llog -lz -lGLESv1_CM
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
||||
|
||||
|
||||
########## LIBSPECTRUM ##########
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := spectrum
|
||||
|
||||
LOCAL_PATH := $(LIBSPECTRUM_PATH)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
bzip2.c \
|
||||
creator.c \
|
||||
crypto.c \
|
||||
csw.c \
|
||||
dck.c \
|
||||
ide.c \
|
||||
libspectrum.c \
|
||||
memory.c \
|
||||
microdrive.c \
|
||||
plusd.c \
|
||||
rzx.c \
|
||||
sna.c \
|
||||
snp.c \
|
||||
snapshot.c \
|
||||
snap_accessors.c \
|
||||
sp.c \
|
||||
symbol_table.c \
|
||||
szx.c \
|
||||
tap.c \
|
||||
tape.c \
|
||||
tape_accessors.c \
|
||||
tape_block.c \
|
||||
tape_set.c \
|
||||
timings.c \
|
||||
tzx_read.c \
|
||||
tzx_write.c \
|
||||
warajevo_read.c \
|
||||
wav.c \
|
||||
z80.c \
|
||||
z80em.c \
|
||||
zlib.c \
|
||||
zxs.c \
|
||||
myglib/garray.c \
|
||||
myglib/ghash.c \
|
||||
myglib/gslist.c
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
cd libspectrum-0.5.0.1/
|
||||
|
||||
export ANDROID_ROOT=/opt/android-ndk
|
||||
export PATH=$PATH:$ANDROID_ROOT/build/prebuilt/linux-x86/arm-eabi-4.2.1/bin/
|
||||
|
||||
./configure --host=arm-eabi \
|
||||
CC=arm-eabi-gcc \
|
||||
CPPFLAGS="-I$ANDROID_ROOT/build/platforms/android-4/arch-arm/usr/include/" \
|
||||
CFLAGS="-nostdlib" \
|
||||
LDFLAGS="-Wl,-rpath-link=$ANDROID_ROOT/build/platforms/android-4/arch-arm/usr/lib/ -L$ANDROID_ROOT/build/platforms/android-4/arch-arm/usr/lib/" \
|
||||
LIBS="-lc "
|
||||
|
||||
make libspectrum.h
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
Fuse has been brought to you by:
|
||||
|
||||
* Matan Ziv-Av: SVGAlib and framebuffer user interfaces, the glib
|
||||
replacement code, some work on the sound code and the original
|
||||
`widget' code.
|
||||
|
||||
* Russell Marks: the generic and OSS-specific sound code, the man page,
|
||||
the Kempston joystick emulation and lots of bug reports and fixes.
|
||||
|
||||
* Ian Collier: the original ZX Printer emulation (for xz80).
|
||||
|
||||
* John Elliott: for lib765, which provides Fuse's emulation of the +3's
|
||||
FDC, and libdsk which provides support for more disk image formats:
|
||||
see http://www.seasip.demon.co.uk/Unix/LibDsk/
|
||||
|
||||
* Darren Salt: the original versions of the code for +3 emulation,
|
||||
SLT support, MITSHM support (for the Xlib UI), TZX raw data blocks,
|
||||
and RZX embedded snapshots and compression.
|
||||
|
||||
* Alexander Yurchenko: the OpenBSD/Solaris-specific sound code.
|
||||
|
||||
* Fredrick Meunier: for TC2048 support, the SDL user interface, the
|
||||
graphics filters, Pentagon support, Spectrum SE support, Interface
|
||||
II support and more.
|
||||
|
||||
* Ludvig Strigeus and The ScummVM project: the original graphics filter code.
|
||||
|
||||
* Dmitry Sanarin: the original TR-DOS emulation (for Glukalka).
|
||||
|
||||
* Witold Filipczyk: TC2068 support and more.
|
||||
|
||||
* Matthew Wescott: the AY logging code.
|
||||
|
||||
* Marek Januszewski: Some patches making Fuse much closer to compiling under
|
||||
Win32, and fixing up the GTK+ 2.0 interface.
|
||||
|
||||
* Stuart Brady: for the Scorpion emulation and HP-UX sound support.
|
||||
|
||||
* Garry Lancaster: the simple 8-bit IDE, ZXATASP and ZXCF support.
|
||||
|
||||
* Gergely Szasz: Interface I/microdrive emulation, the 'movie' code and the
|
||||
ao sound driver.
|
||||
|
||||
* Philip Kendall: everything else.
|
||||
|
||||
$Id: AUTHORS 2433 2004-11-28 21:58:44Z pak21 $
|
|
@ -0,0 +1,339 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
|
@ -0,0 +1,964 @@
|
|||
2009-01-14 Philip Kendall <philip-fuse@shadowmagic.org.uk>
|
||||
|
||||
* Fuse 0.10.0.2 released
|
||||
|
||||
* Make loader acceleration work on all compilers (Philip Kendall;
|
||||
thanks, Carlos Almeida, Alberto Garcia and Alexander Yurchenko).
|
||||
|
||||
* Make the "Don't Save" option in the widget UI do the right thing
|
||||
(Frederick Meunier).
|
||||
|
||||
* Allow both +3 disk drives to be used at once (Gergely Szasz).
|
||||
|
||||
* Allow both +D disk drives to be used at once (Gergely Szasz).
|
||||
|
||||
* Make .dsk code handle missing newline on "Track-Info" header
|
||||
(Gergely Szasz; thanks, Simon Owen).
|
||||
|
||||
* Remove unnecessary 'use' directive when building widget options
|
||||
header file; fixes some build issues (Frederick Meunier)
|
||||
|
||||
2008-12-10 Philip Kendall <philip-fuse@shadowmagic.org.uk>
|
||||
|
||||
* Fuse 0.10.0.1 released
|
||||
|
||||
* Writing files would not truncate the file at the correct point,
|
||||
leading to corrupt files when overwriting an existing file
|
||||
(Philip Kendall; thanks, Matthew Westcott).
|
||||
|
||||
* Distribute ui/fb/fbmouse.h (Fredrick Meunier; thanks, rkd77).
|
||||
|
||||
2008-12-03 Philip Kendall <philip-fuse@shadowmagic.org.uk>
|
||||
|
||||
* Fuse 0.10.0 released
|
||||
|
||||
* New upd765 FDC emulation; all known +3 DSK images now work (Gergely
|
||||
Szasz; thanks to Simon Owen for expert technical advice).
|
||||
* Loading acceleration (Philip Kendall).
|
||||
* Automatic saves while using RZX recording (Philip Kendall).
|
||||
* Many improvements to Win32 UI (mostly Marek Januszewski).
|
||||
* Improved widget UI, with look and feel borrowed from that in FuseX
|
||||
(Fredrick Meunier; thanks, crabfists).
|
||||
|
||||
* Emulation core improvements:
|
||||
* New --late-timings option to emulate machines with 1 tstate
|
||||
later timings (Philip Kendall)
|
||||
* Reading from the 128K's memory control port causes that byte to
|
||||
be written back to the port (Philip Kendall; thanks, Marat
|
||||
Fayzullin).
|
||||
* Reading the AY data port on the +2A/+3 is the same as reading
|
||||
the register port (Philip Kendall; thanks, Mark Woodmass).
|
||||
* NMI causes Z80 to unHALT (Philip Kendall; thanks, Simon Owen).
|
||||
* Emulate C, H and P/V flags on repeated IO instructions (Philip
|
||||
Kendall).
|
||||
* Fix crash when using Interface 1 on unoptimised Fuse builds
|
||||
(Philip Kendall).
|
||||
|
||||
* Debugger improvements:
|
||||
* Debugger events to allow the debugger to stop when various
|
||||
Spectrum-level events happen (Philip Kendall).
|
||||
* Allow debugger commands to be run when a breakpoint is hit.
|
||||
No UI for this at present, but can be set from the command line.
|
||||
(Philip Kendall).
|
||||
* Command to exit emulator (Philip Kendall).
|
||||
* Make time breakpoints work properly when more than one is present
|
||||
(Philip Kendall).
|
||||
|
||||
* Miscellaneous improvements:
|
||||
* Loader detection now works with the Digital Integration loader
|
||||
(Philip Kendall).
|
||||
* New HQ2X and HQ3x scalers (Gergely Szasz).
|
||||
* Revert Pentagon 128 to being the "base" machine without extra
|
||||
ROMs (Fredrick Meunier).
|
||||
* Updated +3e ROMs (Fredrick Meunier; thanks, Garry Lancaster).
|
||||
* Allow DivIDE, custom ROMs, Kempston mouse status and Simple 8-bit
|
||||
IDE interface to be saved in snapshots (Fredrick Meunier).
|
||||
* Better (but probably not perfect) TS2068 contention (Philip
|
||||
Kendall).
|
||||
* OpenSolaris compilation fixes (Fredrick Meunier; thanks, Andrew
|
||||
Owen).
|
||||
* C89 compatibility fixes (Fredrick Meunier; thanks, sweetlilmr).
|
||||
* Remove GTK+'s build explicit dependency on Xlib (Philip Kendall).
|
||||
* Minor AmigaOS improvements (Chris Young).
|
||||
|
||||
2008-01-05 Philip Kendall <philip-fuse@shadowmagic.org.uk>
|
||||
|
||||
* Fuse 0.9.0 released
|
||||
|
||||
* New features:
|
||||
* Add +D disk interface support (Stuart Brady).
|
||||
* New floppy disk controller emulation for +D and Beta disk
|
||||
interface emulation (Gergely Szasz and Stuart Brady).
|
||||
* Add Pentagon 512 and Pentagon 1024 emulation (Q-Master).
|
||||
* Add Hi-Fi beeper for improved reproduction of multi-channel beeper
|
||||
tunes (e.g. Fairlight 2, Wham - the Music Box) (Fredrick Meunier).
|
||||
* Add support for saving tape images without using tape traps
|
||||
(Fredrick Meunier).
|
||||
* Add support for loading from WAV tape images (Fredrick Meunier).
|
||||
* Add support for saving CSW tape images and TZX direct recording
|
||||
blocks (Fredrick Meunier).
|
||||
* Allow distinction between "soft" resets (activating the reset line
|
||||
on the Z80) and "hard" resets (pulling the power) (Philip Kendall).
|
||||
* New ALSA sound driver (Gergely Szasz).
|
||||
* AmigaOS support (Chris Young).
|
||||
* MorphOS support (Q-Master).
|
||||
|
||||
* Emulation core improvements:
|
||||
* Fix contention for LD?R, CP?R and IN?R (Philip Kendall; thanks,
|
||||
Mark Woodmass).
|
||||
* Fix undocumented flags after BIT n,(IX+d) instructions (Philip
|
||||
Kendall).
|
||||
* Fix undocumented behaviour of DAA (Stuart Brady).
|
||||
* High ports (0xc000 to 0xffff) are contended on the 128K when a
|
||||
contended RAM page is paged in (Philip Kendall; thanks, Patrik
|
||||
Rak).
|
||||
* Correct contention for the +2A/+3 ULA (Philip Kendall).
|
||||
|
||||
* Machine specific improvements:
|
||||
* Fix joystick port mask on TC2048 (Fredrick Meunier)
|
||||
* Improved keyboard handling for 128K / +3 machines (Philip Kendall).
|
||||
* Improved contention for TC2048 and TC2068 machines (Fredrick
|
||||
Meunier; thanks, Mark Woodmass).
|
||||
|
||||
* Miscellaneous:
|
||||
* Emulation speed no longer artificially limited to 999% (Stuart
|
||||
Brady).
|
||||
* Much improved debugger for the widget UIs (Darren Salt).
|
||||
* Timed breakpoints now work in the debugger (Philip Kendall).
|
||||
* Keys now repeat in the widget fileselector (Fredrick Meunier;
|
||||
thanks, Cygnus).
|
||||
* Removed the GTK+ 1.x UI (please note that GTK+ 2.x will remain
|
||||
supported for the foreseeable future) (Philip Kendall).
|
||||
* GTK+ UI now uses the GTK+ 2.x style file selectors (Philip
|
||||
Kendall).
|
||||
* More informative error messages when ejecting disks (Stuart
|
||||
Brady).
|
||||
* Ejecting Microdrive cartridges now checks for changes and doesn't
|
||||
automatically overwrite the original file (Stuart Brady).
|
||||
* Snapshots can no longer cause the profiler to assert (Philip
|
||||
Kendall; thanks, Stuart Brady).
|
||||
* DivIDE could page itself in incorrectly after a reset (Stuart
|
||||
Brady).
|
||||
* Stop invalid input causing segfault in GTK+ 'Load Binary Chunk'
|
||||
dialog, and allow a length of 65536 to be used (Stuart Brady).
|
||||
* Enable Fuse to build in directories other than the source
|
||||
directory itself (Philip Kendall).
|
||||
* 'make clean' now cleans generated files (Philip Kendall).
|
||||
* Update +3e ROMs to v1.31 (Fredrick Meunier; thanks, Garry
|
||||
Lancaster).
|
||||
* Updated X11 UI (Gergely Szasz).
|
||||
* Updated Win32 UI (Stuart Brady).
|
||||
* Man page fixes (Stuart Brady).
|
||||
|
||||
* Various other minor bugfixes.
|
||||
|
||||
2007-05-11 Philip Kendall <philip-fuse@shadowmagic.org.uk>
|
||||
|
||||
* Fuse 0.8.0.1 released (bug fix release)
|
||||
|
||||
* Fix IN timings and floating bus behaviour: fixes Sidewize (thanks,
|
||||
Pegaz and Mark Woodmass) (Philip Kendall).
|
||||
* Fix widget UI pokefinder and keyboard help picture
|
||||
(thanks, Alberto Garcia) (Philip Kendall and Fredrick Meunier).
|
||||
* Fix crash if fullscreen mode attempted a resolution higher than
|
||||
the native graphics mode could handle (thanks, Alberto Garcia)
|
||||
(Fredrick Meunier).
|
||||
* Ensure ABS, MIN and PATH_MAX are available where needed (Fredrick
|
||||
Meunier).
|
||||
* Distribute autoload snapshots (thanks, Stuart Brady and Arda
|
||||
Erdikmen) (Fredrick Meunier).
|
||||
* Remove flicker when playing back RZX files with embedded
|
||||
snapshots (thanks, Julian Wiseman) (Fredrick Meunier).
|
||||
* Remove warnings when building from CVS (Stuart Brady).
|
||||
|
||||
2007-04-11 Philip Kendall <philip-fuse@shadowmagic.org.uk>
|
||||
|
||||
* Fuse 0.8.0 released
|
||||
|
||||
* New features:
|
||||
* Loader improvements: automatically run at full speed while
|
||||
a loader is in progress and automatically start/stop the tape
|
||||
when the start/end of a loader is detected (Philip Kendall).
|
||||
* RZX 'rollback' support (Philip Kendall).
|
||||
* DivIDE support (Matthew Westcott)
|
||||
* Interface I and Microdrive emulation (Gergely Szasz).
|
||||
* TS2068 support (Fredrick Meunier).
|
||||
* Kempston mouse emulation (Darren Salt).
|
||||
* TZX generalized data block (0x19) support (Philip Kendall).
|
||||
* Much improved widget UI, including allowing selection of
|
||||
filenames (Darren Salt, Gergely Szasz).
|
||||
* Allow SDL full screen mode to be used (Darren Salt).
|
||||
* Add the ability to save 'movies' as collections of screenshots
|
||||
(Gergely Szasz).
|
||||
* Widget pokefinder (Darren Salt).
|
||||
* Add a simple code profiler (Philip Kendall).
|
||||
* New libao sound driver (Gergely Szasz).
|
||||
* New CoreAudio sound driver (Fredrick Meunier).
|
||||
* New PALTV 1-3x and TV3x graphics scalers (Gergely Szasz).
|
||||
|
||||
* Emulation core improvements:
|
||||
* Improved screen rendering code (now character accurate rather
|
||||
than line accurate) (Philip Kendall, Fredrick Meunier).
|
||||
* Corrections to write ordering and contention for EX (SP),HL,
|
||||
EX (SP),IX and EX (SP),IY (Philip Kendall; thanks, Mark
|
||||
Woodmass).
|
||||
* Corrections to contention for OTIR and OTDR (Philip Kendall;
|
||||
thanks, Mark Woodmass).
|
||||
* IR contention (Philip Kendall; thanks, Mark Woodmass).
|
||||
* Flag bits 3 and 5 are copied on all BIT instructions (Philip
|
||||
Kendall; thanks, Mark Woodmass).
|
||||
* Improved ULA emulation with respect to interrupt length
|
||||
(thanks, Jon Needle, Ramsoft and Mark Woodmass) (Philip
|
||||
Kendall).
|
||||
* Fix timings of shifted no operation opcodes (Philip Kendall).
|
||||
* An interrupt in IM 0 takes 13 tstates to acknowledge, not 12
|
||||
(Philip Kendall).
|
||||
* Improved speed control code (Fredrick Meunier).
|
||||
|
||||
* Miscellaneous:
|
||||
* Add a 'save, don't save, cancel' confirmation dialog before any
|
||||
changes to media are lost under the GTK+ UIs (Philip Kendall).
|
||||
* On the Pentagon, page in the TR-DOS ROM on NMI, allowing the
|
||||
snapshot function to work (Philip Kendall). On the Scorpion,
|
||||
page in ROM 2, allowing the monitor to work (thanks, Erik
|
||||
Kunze).
|
||||
* Default snapshot format is now .szx rather than .z80 (Fredrick
|
||||
Meunier)
|
||||
* Store current joystick information in snapshots (Fredrick
|
||||
Meunier).
|
||||
* Optional use of doublescan modes in the framebuffer and
|
||||
SVGAlib UIs (Darren Salt).
|
||||
* Black and white TV support for the framebuffer, SVGAlib and
|
||||
Xlib UIs (Darren Salt).
|
||||
* Catch 'window close' events in the Xlib UI (Darren Salt).
|
||||
* Use stock button icons in the GTK+ 2.x UI (Darren Salt).
|
||||
* Save/restore the 'issue 2 keyboard' flag from snapshots
|
||||
(Philip Kendall).
|
||||
* Correctly quote '-' characters in the man page (needed for
|
||||
UTF-8 environments) (Darren Salt, Stuart Brady).
|
||||
* Use separate menus for controlling +3 and TR-DOS disks (Philip
|
||||
Kendall).
|
||||
* Fix behaviour of ZXATASP and ZXCF on reset (Garry Lancaster).
|
||||
* Improved window scaling behaviour (Darren Salt).
|
||||
* Allow use of the mouse scroll wheel in the GTK+ debugger
|
||||
(Darren Salt).
|
||||
* Improved interaction between Media/Tape/Play and tape traps
|
||||
(Darren Salt).
|
||||
* Various minor improvements to the framebuffer UI (Darren
|
||||
Salt).
|
||||
* Various fixes to allow compilation with gcc 4.x (Philip
|
||||
Kendall).
|
||||
|
||||
* Various other minor bugfixes (Philip Kendall, Fredrick Meunier,
|
||||
Jon Needle, Markus Oberhumer, Mark Round, Darren Salt, Gergely
|
||||
Szasz, Paul van der Laan and other people to whom I apologise
|
||||
for forgetting).
|
||||
|
||||
* On a personal note, I (Philip) would like to dedicate the 0.8
|
||||
release of Fuse to the memory of Chris "Oggie" Lightfoot. I
|
||||
don't know whether he would have loved or hated some of the code
|
||||
in Fuse, but I'm sure he would have expressed his opinion.
|
||||
|
||||
2004-07-16 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Fuse 0.7.0 released.
|
||||
|
||||
* New features:
|
||||
+ Scorpion ZS 256 support (Stuart Brady).
|
||||
+ Spectrum SE support (Fredrick Meunier, Darren Salt).
|
||||
+ Support for the simple 8-bit IDE interface (as used by the
|
||||
+3e) and the ZXATASP and ZXCF interfaces (Garry Lancaster).
|
||||
+ Spectrum +3e support: just a +3 with different ROMs (Philip
|
||||
Kendall).
|
||||
+ Interface II support (Fredrick Meunier).
|
||||
+ Emulation of joysticks other than the Kempston (Philip
|
||||
Kendall).
|
||||
|
||||
* Z80 core improvements:
|
||||
+ Get undocumented flags right after SCF and BIT (thanks, Erik
|
||||
Kunze and Thomas Harte).
|
||||
+ Improved contended memory timings for RLD, RRD and
|
||||
instructions involving (HL), (SP), (IX+dd), (IY+dd) (thanks,
|
||||
Mark Woodmass and Jonathan Needle).
|
||||
(Philip Kendall)
|
||||
|
||||
* Debugger improvements:
|
||||
+ Memory map pane showing what is present in each 8K chunk.
|
||||
+ Allow port values to be masked before checking for port
|
||||
read/write breakpoints.
|
||||
+ Ability to set breakpoints in non-RAM pages.
|
||||
(Philip Kendall)
|
||||
|
||||
* Miscellaneous improvements:
|
||||
+ Improved display timings (thanks, Mark Woodmass and Jonathan
|
||||
Needle) (Philip Kendall).
|
||||
+ Improved floating bus timings; Arkanoid and Sidewize now work
|
||||
(Philip Kendall).
|
||||
+ Save/restore the high bit of the R register; Bruce Lee now
|
||||
works (thanks, Jan Samohýl) (Philip Kendall).
|
||||
+ Fuse can now save snapshot formats other than .z80 and tape
|
||||
formats other than .tap; the appropriate format will be
|
||||
selected according to the extension given (Philip Kendall).
|
||||
+ Improved sound emulation, now using 16 bit samples (Russell
|
||||
Marks, Stuart Brady).
|
||||
+ Allow real joystick buttons to be equivalent to either
|
||||
'emulated joystick fire' or 'press a key' (Philip Kendall).
|
||||
+ The pokefinder can now search for bytes which have increased
|
||||
or decreased since the last search (Philip Kendall).
|
||||
+ HP-UX sound support (Stuart Brady).
|
||||
+ After 'flashloading' a tape block, set the registers to the
|
||||
values they would have if the block had been loaded normally;
|
||||
'The Rats' now loads successfully (thanks, Simon Stuart)
|
||||
(Darren Salt).
|
||||
+ GTK+ 2.x user interface preferred to GTK+ 1.2 by default if
|
||||
available (Philip Kendall).
|
||||
+ Don't display an error message if the same message was
|
||||
displayed within the last second (Philip Kendall).
|
||||
+ Writing to the Betadisk ports is a no-op if TR-DOS isn't
|
||||
active (Stuart Brady).
|
||||
+ Keep Timex Dock cartridge inserted after reset if it had been
|
||||
inserted via File/Open or from the command line (Philip
|
||||
Kendall).
|
||||
+ Split the 'ROM selection' dialog into one dialog for each
|
||||
machine (Philip Kendall).
|
||||
+ Unused bits of AY registers are zeroed (Stuart Brady).
|
||||
+ Remove segfault if one ROM of a multi-ROM machine didn't load
|
||||
(Philip Kendall).
|
||||
+ Don't segfault if Space rather than a mouse double click is
|
||||
used to select things in the GTK+ tape browser, debugger or
|
||||
pokefinder (Darren Salt).
|
||||
+ Stop output to the serial printer when printer emulation is
|
||||
disabled; prevents the random appearance of 'printout.txt'
|
||||
(Philip Kendall).
|
||||
|
||||
2004-02-19 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Fuse 0.6.2.1 released.
|
||||
|
||||
* Compilation fixes:
|
||||
+ sdljoystick.h missing from tarball (thanks, Owen Dunn).
|
||||
+ Link failure if a widget UI in use and lib765 not available
|
||||
(thanks, Jamie Glendinning).
|
||||
+ Compilation failure if ROMSDIR defined (Darren Salt).
|
||||
|
||||
* Bugfixes:
|
||||
+ Use of the SDL icons could cause screen corruption (Simon
|
||||
Tatham).
|
||||
+ The reverse page mapping for 0xc000 - 0xffff would
|
||||
occasionally be wrong on the +2A/+3 (Philip Kendall).
|
||||
|
||||
* Miscellaneous:
|
||||
+ Allow selectable devices to be used for the real joysticks
|
||||
(Darren Salt).
|
||||
+ Use glib 2.0 if available (Darren Salt).
|
||||
+ Allow ROMSDIR to be set when configuring (Darren Salt).
|
||||
|
||||
2004-02-11 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Fuse 0.6.2 released.
|
||||
|
||||
* New features:
|
||||
+ Real joystick support (Darren Salt, Fredrick Meunier).
|
||||
+ The 'pokefinder' (Philip Kendall).
|
||||
+ Black and white TV mode for the GTK+ and SDL user interfaces
|
||||
(Fredrick Meunier).
|
||||
+ The Timex 1.5x scaler and the reappearance of 3x3 mode for
|
||||
the GTK+ UI (Fredrick Meunier, Philip Kendall).
|
||||
+ A simple memory browser (Philip Kendall).
|
||||
+ Writes to disk will not affect the underlying file unless
|
||||
explicitly requested by the user (Philip Kendall).
|
||||
+ Status bar for the GTK+ UI, and status icons for the
|
||||
SDL UI (Philip Kendall/Fredrick Meunier).
|
||||
+ Options to disable the GTK+ confirmation dialogs and the
|
||||
printer emulation (Philip Kendall).
|
||||
|
||||
* Z80 core improvements:
|
||||
+ Improved memory handling. Should be both quicker and more
|
||||
flexible.
|
||||
+ Support for retriggered interrupts.
|
||||
+ Don't allow interrupts after an EI instruction.
|
||||
+ If using gcc, use the "computed goto" feature for a small
|
||||
performance enhancement.
|
||||
(Philip Kendall).
|
||||
|
||||
* Debugger improvements:
|
||||
+ Better error recovery after a malformed command.
|
||||
+ New 'pending events' pane. Double-clicking on an event will
|
||||
cause emulation to run until that event occurs.
|
||||
+ Breakpoints can now be set relative to a RAM page, rather than
|
||||
purely by address.
|
||||
+ Breakpoints can now be set to trigger a specified number of
|
||||
tstates after the start of the current frame.
|
||||
+ Double-clicking on an entry in the stack display will cause
|
||||
emulation to run to that address.
|
||||
+ Allow individual panes to be hidden.
|
||||
+ Correct behaviour if the debugger window is closed via window
|
||||
manager functions, rather than by the 'close' button.
|
||||
+ More sensibly sized monospace font under GTK+ 2.x.
|
||||
(Philip Kendall).
|
||||
|
||||
* RZX improvements:
|
||||
+ Option to always embed an RZX snapshot.
|
||||
+ Make it possible to record a non-competition mode RZX file
|
||||
after having recorded one in competition mode.
|
||||
+ Add some small bits of system information (operating system,
|
||||
libspectrum version, libgcrypt version) into the RZX custom
|
||||
data.
|
||||
(Philip Kendall).
|
||||
|
||||
* Miscellaneous improvements:
|
||||
+ The GTK+ file selector now remembers the last directory
|
||||
it was used for.
|
||||
+ The GTK+ tape browser no longer stops emulation.
|
||||
+ Look for ROMs and library files relative to the Fuse
|
||||
executable, not relative to the current directory. Helps when
|
||||
dealing with a non-installed copy of Fuse.
|
||||
+ Use $TMPDIR for temporary files if it's specified.
|
||||
+ Warn if the current tape has been modified before its contents
|
||||
are lost.
|
||||
(Philip Kendall).
|
||||
|
||||
* Minor bugfixes:
|
||||
+ Make writes to the screen work when it is paged in other than
|
||||
at 0x4000 (Philip Kendall).
|
||||
+ Make reading from both Timex joysticks simultaneously work
|
||||
correctly (Fredrick Meunier).
|
||||
+ Remove a possible segfault caused by the tape initialisation
|
||||
code trying to access the tape beeper before the beeper code
|
||||
has been fully initialised (Witold Filipczyk, Fredrick Meunier).
|
||||
+ Get the pause lengths correct when writing PSG files
|
||||
(Russell Marks, Philip Kendall).
|
||||
+ Pressing F3 in the SVGAlib UI will now open all file types as
|
||||
it does in the other UIs (Philip Kendall).
|
||||
+ Don't segfault if there are empty string entries in Fuse's
|
||||
config file (Philip Kendall).
|
||||
+ QNX6 compilation fixes (Mike Gorchak).
|
||||
|
||||
2003-09-30 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Fuse 0.6.1.1 released.
|
||||
|
||||
* Make the SVGAlib UI compile (Philip Kendall/Russell Marks, with
|
||||
thanks to Josetxu Malanda).
|
||||
|
||||
* Various RZX-related bugfixes (Philip Kendall/Russell Marks)
|
||||
|
||||
2003-09-13 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Fuse 0.6.1 released.
|
||||
|
||||
* A Z80 core rewrite such that it's now generated from the regular
|
||||
patterns in the instruction set. This shouldn't have any effect
|
||||
as yet, but will make performance enhancements easier to do in
|
||||
the future (Philip Kendall).
|
||||
|
||||
* On the TC2068, the ROM traps apply only when in the EXROM and
|
||||
memory contention applies only in the HOME bank (Fredrick
|
||||
Meunier).
|
||||
|
||||
* On the 128K Spectrum, use the correct port mask when checking
|
||||
for contention on the 'memory control' port (Philip Kendall).
|
||||
|
||||
* RZX competition mode (Philip Kendall).
|
||||
|
||||
* Add AY logging to .psg files (Matthew Westcott)
|
||||
|
||||
* Optionally autoload +3 and TRDOS disks when they're inserted
|
||||
(Philip Kendall).
|
||||
|
||||
* Fall back to read(2) and malloc(3) if mmap(2) fails or is
|
||||
unavailable (Philip Kendall).
|
||||
|
||||
* Add 'out' and 'tbreakpoint' commands, conditional breakpoints
|
||||
and the ability to use general numeric expression to the GTK+
|
||||
debugger (Philip Kendall).
|
||||
|
||||
* Allow Fuse to work with GTK+ 2.x (Marek Januszewski).
|
||||
|
||||
* Add a scrollbar to the GTK+ debugger's disassembly window
|
||||
(Philip Kendall).
|
||||
|
||||
* New AdvMAME3x graphics scaler (Fredrick Meunier/ScummVM team)
|
||||
|
||||
* In the GTK+ UI, deactivate menu items when they're not
|
||||
appropriate (Philip Kendall).
|
||||
|
||||
* Make bright black be the same as 'normal' black in the
|
||||
framebuffer user interface (Witold Filipczyk).
|
||||
|
||||
* Add confirmation dialogs before resetting or quitting under the
|
||||
GTK+ UI (Philip Kendall).
|
||||
|
||||
2003-05-31 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Fuse 0.6.0.1 released
|
||||
|
||||
* [SECURITY] Fix race conditions in trdos.c which could be used
|
||||
to overwrite any file owned by the user running Fuse (Philip
|
||||
Kendall).
|
||||
|
||||
* Fix a off-by-one error in the AdvMame2x scaler (Fredrick
|
||||
Meunier/ScummVM team).
|
||||
|
||||
2003-04-27 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Fuse 0.6.0 released.
|
||||
|
||||
* Pentagon 128 support (Fredrick Meunier, with thanks also to
|
||||
Dmitry Sanarin for Glukalka from which the TR-DOS emulation was
|
||||
taken).
|
||||
|
||||
* TC2068 support (Witold Filipczyk/Darren Salt/Fredrick Meunier).
|
||||
|
||||
* Graphics filters: essentially arbitrary filters which can be
|
||||
applied to the Spectrum's screen to give scanlines, smoothing
|
||||
and all sorts of other possiblities (mostly Fredrick Meunier
|
||||
and Philip Kendall; based on the same feature in ScummVM).
|
||||
|
||||
* Transparent monitor/debugger (Philip Kendall).
|
||||
|
||||
* A rewrite of the display code to update only those rectangles
|
||||
which have been changed, rather than entire lines. Performance
|
||||
improvement, and also allows effects similar to flipping between
|
||||
the 128K Spectrum's two screens to work much better (Fredrick
|
||||
Meunier/Philip Kendall).
|
||||
|
||||
* New SDL user interface (Fredrick Meunier).
|
||||
|
||||
* 16K Spectrum support (Fredrick Meunier).
|
||||
|
||||
* Load and save .scr files, including vbSpec's Timex mode
|
||||
extensions (Fredrick Meunier).
|
||||
|
||||
* Selectable ROMs for each machine type (Philip Kendall).
|
||||
|
||||
* Optionally writable 'ROM's (Philip Kendall).
|
||||
|
||||
* Get the behaviour of the TC2048 video modes correct (Witold
|
||||
Filipczyk).
|
||||
|
||||
* Optional frame-skipping on output (Fredrick Meunier).
|
||||
|
||||
* New --(no-)aspect-hint option to not give aspect hints to the
|
||||
window manager under GTK+ or Xlib UIs. Useful for some window
|
||||
managers which otherwise won't let you resize Fuse's window
|
||||
(Philip Kendall/Russell Marks).
|
||||
|
||||
* Lots of other minor bug fixes/improvements (everyone mentioned
|
||||
above).
|
||||
|
||||
2002-12-09 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Fuse 0.5.1 released
|
||||
|
||||
* Separate out libspectrum (the file format handling) into its own
|
||||
library; changes occurring solely in libspectrum's code will not
|
||||
be listed in this ChangeLog. For structural reasons, the glib
|
||||
replacement code is also in libspectrum (Philip Kendall).
|
||||
|
||||
* Also separate the Fuse utilities (tzxlist, etc) into their
|
||||
own package (Philip Kendall).
|
||||
|
||||
* Add ability to load and save +2, +2A, +3 and TC2048 snapshots;
|
||||
also load Pentagon snaps as 128K (Philip Kendall).
|
||||
|
||||
* Add ability to automatically start tapes loading when they're
|
||||
opened (Philip Kendall).
|
||||
|
||||
* If filenames without options are given on the command line,
|
||||
attempt to load them as the right sort of file (Philip Kendall).
|
||||
|
||||
* Use libspectrum's machine numbering and capabilities facilities
|
||||
(Philip Kendall).
|
||||
|
||||
* Make the framebuffer UI work (Darren Salt).
|
||||
|
||||
* Add File/Recording/Record from snap option to begin input
|
||||
recording from a snapshot (Philip Kendall).
|
||||
|
||||
* Fix possible segfault when displaying the keyboard widget
|
||||
(Russell Marks).
|
||||
|
||||
* Make widgets handle their window being resized (Darren Salt).
|
||||
|
||||
* Redraw the display only if the data has actually changed; can
|
||||
give a nice performance improvement (Philip Kendall).
|
||||
|
||||
* Z80 core fixes on SCF, DEC, HALT and INC SP (Boris Donko).
|
||||
|
||||
* Memory pages 1, 3, 5 and 7 (not 4, 5, 6 and 7) are contended
|
||||
on the 128K/+2 (Philip Kendall, with thanks to Steve Snake and
|
||||
Mark Woodmass).
|
||||
|
||||
* Get the mask right for the 128K/+2 memory control port (Philip
|
||||
Kendall, with thanks to Mark Woodmass).
|
||||
|
||||
* Add File/Save Screen option to save the current screen to a .png
|
||||
file (Philip Kendall).
|
||||
|
||||
* Additional options to configure to make it easier to have the
|
||||
support libraries (libspectrum, lib765, libdsk, etc) in
|
||||
non-system directories (Philip Kendall).
|
||||
|
||||
* Make keysyms.c be UI-specific, rather than containing
|
||||
information for all UIs (Darren Salt).
|
||||
|
||||
* Add support for loadable/savable configuration; you'll need
|
||||
libxml2 installed (Philip Kendall).
|
||||
|
||||
* Add a Tape Browser widget (Philip Kendall).
|
||||
|
||||
* Put the keyboard help in a separate window when using the GTK+
|
||||
UI (Philip Kendall).
|
||||
|
||||
* Changable emulation speed (Philip Kendall).
|
||||
|
||||
* Change to lib765 0.3.0 for Mac OS X compatibility
|
||||
(Frederick Meunier).
|
||||
|
||||
* Reset the Timex's SCLD when loading snapshot (Philip Kendall,
|
||||
Frederick Meunier).
|
||||
|
||||
* Timex machines have no loading noise (Frederick Meunier).
|
||||
|
||||
* Distribute glibc's getopt so that long options are available
|
||||
even if the native libc doesn't provide them (Philip Kendall).
|
||||
|
||||
2002-08-22 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Version 0.5.0 released
|
||||
|
||||
* Support for RZX v0.12 (Recording/playback code by Philip
|
||||
Kendall, file support by Darren Salt and Philip Kendall).
|
||||
|
||||
* +3 support using John Elliott's lib765 and libdsk libraries
|
||||
(Darren Salt/Philip Kendall).
|
||||
|
||||
* TC2048 support (Fredrick Meunier).
|
||||
|
||||
* Z80 core fixes: timing of OTDR and interrupt routines,
|
||||
R register during interrupt and HALT and contention of
|
||||
LD (nnnn),A (Philip Kendall, with thanks to Mark Woodmass
|
||||
and Boris Donko).
|
||||
|
||||
* Sound improvements: add beeper pseudo stereo and remove
|
||||
beeper fade out (Russell Marks).
|
||||
|
||||
* Add two new utilities for dealing with RZX files: rzxdump(1) and
|
||||
rzxtool(1) (Philip Kendall).
|
||||
|
||||
* Support for TZX raw data blocks (Darren Salt).
|
||||
|
||||
* Patches to make Fuse compile and run on OS X. You'll need the
|
||||
latest version of the auto* tools, XFree86 and GTK+ 1.2
|
||||
installed (Fredrick Meunier).
|
||||
|
||||
* Add an explanation of Fuse's main emulation loop and events
|
||||
system to hacking/implementation_notes.txt
|
||||
|
||||
* Add optional use of 640x480 mode with the SVGAlib UI (Darren
|
||||
Salt/Philip Kendall).
|
||||
|
||||
* Lots of other minor bugfixes (Darren Salt, Russell Marks,
|
||||
Philip Kendall and probably some other people as well).
|
||||
|
||||
2002-03-26 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Version 0.4.2 released
|
||||
|
||||
* Simple support for a very limited form of RZX files (Philip
|
||||
Kendall).
|
||||
|
||||
* Sound support for OpenBSD and Solaris (Alexander Yurchenko).
|
||||
|
||||
* Use the MIT-SHM extension if available under the Xlib UI
|
||||
(originally from Darren Salt, extensively rewritten by Philip
|
||||
Kendall).
|
||||
|
||||
* A new Options/Sound menu, giving the option to turn sound on
|
||||
and off (Philip Kendall).
|
||||
|
||||
* Under the GTK+ UI, press F1 to get a pop-up main menu (Russell
|
||||
Marks).
|
||||
|
||||
* Add the ability to select which device to use for sound output
|
||||
(Philip Kendall).
|
||||
|
||||
* Create a dialog box when errors occur (idea from Darren Salt,
|
||||
written by Philip Kendall).
|
||||
|
||||
* Titles for the GTK+ UI file selection dialog boxes (Darren
|
||||
Salt).
|
||||
|
||||
* Update the man page (Russell Marks).
|
||||
|
||||
* Fix the segfault which could occur if you pressed Page Down in
|
||||
the file selector widget with less than a full screen of files
|
||||
in (Philip Kendall).
|
||||
|
||||
* Get the R register emulation correct if a DDxx or FDxx
|
||||
instruction doesn't use IX or IY (Philip Kendall).
|
||||
|
||||
* Get the timings of tape edges write (previously, we could be
|
||||
slow by up to (length of last instruction) t-states) (Philip
|
||||
Kendall).
|
||||
|
||||
* Don't write to the printer unless we get a valid stop bit
|
||||
(Russell Marks).
|
||||
|
||||
* Open the sound devices non-blocking to avoid hangs on some
|
||||
systems (reported by Erik Kunze, fixed by Alexander Yurchenko).
|
||||
|
||||
* Don't write SLT data to .z80 files unless some actually exists
|
||||
(reported by Russell Marks, fixed by Philip Kendall).
|
||||
|
||||
* Search a system-wide directory for the ROMs; see Debian's
|
||||
spectrum-roms package for why this will be useful (Philip
|
||||
Kendall).
|
||||
|
||||
* Get the lengths of ROMs correct when munmap(2)ing them (Darren
|
||||
Salt/Philip Kendall).
|
||||
|
||||
* Add a small document describing the preferred coding style for
|
||||
Fuse (Philip Kendall).
|
||||
|
||||
2002-02-04 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Version 0.4.1 released.
|
||||
|
||||
* Add contention of memory and io ports. Should make multicolour
|
||||
effects better (Philip Kendall).
|
||||
|
||||
* Emulation of reading from unattached ports (e.g. #FF). Makes some
|
||||
more games (e.g. Sidewize) work (Philip Kendall).
|
||||
|
||||
* Add a keyboard picture -- see the Help menu (Philip Kendall,
|
||||
Russell Marks).
|
||||
|
||||
* Support for .slt files (Philip Kendall, Darren Salt).
|
||||
|
||||
* Support for the ZX Printer (48K), serial printer (128K/+2)
|
||||
and parallel printer (+2A) (Russell Marks).
|
||||
|
||||
* Add the ability to select a machine type directly, rather than
|
||||
cycling through the available machines (Philip Kendall).
|
||||
|
||||
* Add command-line options; see the man page for details (Philip
|
||||
Kendall).
|
||||
|
||||
* Lots of improvements to the widgets to make them much more
|
||||
similar to the GTK+ menus (Philip Kendall).
|
||||
|
||||
* Cleaner shutdown on 'impossible' conditions; especially useful
|
||||
with the SVGAlib UI (Philip Kendall).
|
||||
|
||||
* Add 'tape rewind' and 'tape clear' options (Philip Kendall).
|
||||
|
||||
* Make tzxlist able to deal with multiple files, and give it
|
||||
a man page (Darren Salt).
|
||||
|
||||
* Man page update (Russell Marks).
|
||||
|
||||
* Remove coredump if an empty .tzx file was loaded (Philip Kendall).
|
||||
|
||||
* Various bits of codebase reorganisation. Most significant is the
|
||||
move of each UI to its own directory (Philip Kendall).
|
||||
|
||||
* Fix a fairly major thinko in libspectrum which meant that it
|
||||
was using approximately twice as much memory as it needed to
|
||||
(Philip Kendall).
|
||||
|
||||
* Things probably of more interest to developers:
|
||||
+ A --enable-warnings option to configure to turn on lots more
|
||||
warning options if you're using gcc.
|
||||
+ Detect gcc properly in configure.in.
|
||||
+ Remove many of the warnings generated when --enable-warnings
|
||||
is used.
|
||||
+ Add a hacking/ui.txt file giving details on how to implement
|
||||
a new UI for Fuse.
|
||||
(Philip Kendall).
|
||||
|
||||
2001-12-20 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Version 0.4.0 released.
|
||||
|
||||
* The big one: .tzx support. Fuse will now read in all the common
|
||||
block types from .tzx files (Philip Kendall).
|
||||
|
||||
* Ability to write out tape files (Philip Kendall).
|
||||
|
||||
* Various improvements to the widget dialog boxes: cursor keys,
|
||||
Page Up, Page Down, Home and End all do what you would expect,
|
||||
remove the use of `scandir' function to improve inter-Unix
|
||||
compatibility, append `/' to directories to make them more
|
||||
obvious, stop the hangs if you tried to start a widget whilst
|
||||
one was active. (Philip Kendall, Russell Marks).
|
||||
|
||||
* .z80 snapshots: deal with the case of the end marker being
|
||||
preceded by 0x00 or 0x00 0xed (Philip Kendall).
|
||||
|
||||
* Lots of sound improvements (Russell Marks).
|
||||
|
||||
* Addition of tzxlist utility to list the blocks found in a .tzx
|
||||
file (Philip Kendall).
|
||||
|
||||
* Have a man page (Russell Marks).
|
||||
|
||||
* Emulation of the AY-3-8912's register 15 (Russell Marks).
|
||||
|
||||
* Kempston joystick emulation (Russell Marks).
|
||||
|
||||
2001-10-07 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Versions 0.3.2 and 0.3.2.1 released.
|
||||
|
||||
* Added file selection dialog boxes for snapshot and tape loading,
|
||||
and (GTK+ only) snapshot saving (Philip Kendall, Matan Ziv-Av).
|
||||
|
||||
* Allowed changing of Issue 2/3 keyboard at run-time. (Philip
|
||||
Kendall).
|
||||
|
||||
* Basically complete rewrite of the tape handling routines (Philip
|
||||
Kendall).
|
||||
|
||||
* Allow `slow' tape loading with border effects, sound, et al.
|
||||
(Philip Kendall).
|
||||
|
||||
* Changed the default install location to `/usr/local' (Philip
|
||||
Kendall).
|
||||
|
||||
* Generate keysyms.c from keysyms.dat; allows me automatically
|
||||
keep the Xlib/GTK+ and svgalib key tables in sync (Philip
|
||||
Kendall).
|
||||
|
||||
* Beginnings of `widgets': dialog boxes etc. for non-GTK+ user
|
||||
interfaces (Matan Ziv-Av, Philip Kendall).
|
||||
|
||||
2001-08-13 Philip Kendall <pak21-fuse@srcf.ucam.org>
|
||||
|
||||
* Version 0.3.1 released.
|
||||
|
||||
* Removed need for glib (but it's still used if present)
|
||||
(Matan Ziv-Av).
|
||||
|
||||
* Separated OSS (Linux) specific sound code out into separate
|
||||
files, removed most floating-point calculations from the AY
|
||||
code, added support for 16-bit only devices, and added some
|
||||
AY subsampling (Russell Marks).
|
||||
|
||||
* Fuse now runs on a StrongARM 1110, using the new framebuffer
|
||||
UI (Matan Ziv-Av).
|
||||
|
||||
* Major tidy-up of display.c and event.c (Philip Kendall).
|
||||
|
||||
* Implemented a `lazy write' scheme for the screen. Makes
|
||||
rainbowing effects _much_ faster (and helps elsewhere as
|
||||
well) (Philip Kendall).
|
||||
|
||||
* Further improvements to the lazy write scheme - consecutive
|
||||
lines which have changed are copied to the screen in one
|
||||
block, rather than as separate lines (Philip Kendall).
|
||||
|
||||
* Complete rewrite of the snapshot code; now handles .z80
|
||||
and .sna snapshots (Philip Kendall).
|
||||
|
||||
* Started separating some bits of code into subdirectories;
|
||||
currently `libspectrum' for the snapshot code, and `z80'
|
||||
for the Z80 core (Philip Kendall).
|
||||
|
||||
* Added `AUTHORS' file (Philip Kendall).
|
||||
|
||||
* Large rewrite of the code for changing machine type
|
||||
(Philip Kendall).
|
||||
|
||||
* Made `make install' work (Philip Kendall).
|
||||
|
||||
2001-01-31 Philip Kendall <pak@ast.cam.ac.uk>
|
||||
|
||||
* Version 0.3.0 released.
|
||||
|
||||
* Fixed a large bug in the 48K snapshot saving routine.
|
||||
|
||||
* Added rudimentary GTK+ interface.
|
||||
|
||||
* Added svgalib interface (thanks to Matan Ziv-Av).
|
||||
|
||||
* Made peripheral emulation much more modular, and added proper
|
||||
decoding of ports.
|
||||
|
||||
* Fixing timings for INI, OUTI, IND, OUTD and the repeated
|
||||
versions (they were all one T-state too short).
|
||||
|
||||
* Sound support under Linux (thanks to Russell Marks and Matan
|
||||
Ziv-Av).
|
||||
|
||||
2000-12-17 Philip Kendall <pak@ast.cam.ac.uk>
|
||||
|
||||
* Version 0.2.1 released.
|
||||
|
||||
* 2x2 and 3x3 displays now available.
|
||||
|
||||
* Border emulation is back (with rainbowing).
|
||||
|
||||
* Better keyboard emulation -- Abu Simbel Profanation now works
|
||||
(and Issue 2 emulation is now available as a compile-time
|
||||
option). Thanks to Santiago Romero for putting me on the track
|
||||
of this bug.
|
||||
|
||||
* Rewrite of Z80 core: one function call now runs the Z80 core
|
||||
until something interesting happens, as determined by a list of
|
||||
`events'. Thanks to Miklos Szeredi's `SpectEmu' for the
|
||||
inspiration for this change.
|
||||
|
||||
2000-09-27 Philip Kendall <pak@ast.cam.ac.uk>
|
||||
|
||||
* Version 0.2.0 released
|
||||
|
||||
* Lots of other changes as well.
|
||||
|
||||
* Loads of changes to remove Allegro and replace it with Xlib calls.
|
||||
|
||||
1999-08-22 Philip Kendall <pak@ast.cam.ac.uk>
|
||||
|
||||
* Version 0.1.3 released.
|
||||
|
||||
* Added +2A emulation.
|
||||
|
||||
* Can now save snapshots.
|
||||
|
||||
* Screen rainbowing effects present.
|
||||
|
||||
* Console version runs at the correct speed (almost. It runs at
|
||||
50.00Hz, rather than the correct 50.01Hz (128K/+2) or 50.08Hz
|
||||
(48K) ).
|
||||
|
||||
* Added ROM trap to read from tape files.
|
||||
|
||||
* Other bug fixes/improvements.
|
||||
|
||||
1999-08-03 Philip Kendall <pak@ast.cam.ac.uk>
|
||||
|
||||
* Version 0.1.2 released.
|
||||
|
||||
* Added support for running on the Linux console (Thanks here go
|
||||
to Thomas Harte). Console version does not eat up 100% of CPU
|
||||
time :-)
|
||||
|
||||
* Added +2 emulation (Just 128K emulation with different ROMs!)
|
||||
|
||||
* Flashing characters implemented.
|
||||
|
||||
* Bug fixes/improvements (Thanks to Erik Kunze for some helpful
|
||||
suggestions)
|
||||
|
||||
1999-07-19 Philip Kendall <pak@ast.cam.ac.uk>
|
||||
|
||||
* Version 0.1.1 released.
|
||||
|
||||
* Added border emulation.
|
||||
|
||||
1999-07-18 Philip Kendall <pak@ast.cam.ac.uk>
|
||||
|
||||
* Version 0.1.0 released.
|
||||
|
||||
$Id: ChangeLog 3957 2009-01-14 19:52:20Z pak21 $
|
|
@ -0,0 +1,217 @@
|
|||
# Process this file with automake to produce Makefile.in
|
||||
## Copyright (c) 1999-2008 Philip Kendall
|
||||
|
||||
## $Id: Makefile.am 3894 2008-12-10 09:45:32Z pak21 $
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
##
|
||||
## Author contact information:
|
||||
##
|
||||
## E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
bin_PROGRAMS = fuse
|
||||
|
||||
SUBDIRS = @COMPAT_SUBDIR@ \
|
||||
debugger \
|
||||
disk \
|
||||
hacking \
|
||||
lib \
|
||||
machines \
|
||||
man \
|
||||
perl \
|
||||
pokefinder \
|
||||
roms \
|
||||
sound \
|
||||
timer \
|
||||
ui \
|
||||
unittests \
|
||||
z80
|
||||
|
||||
DIST_SUBDIRS = debugger \
|
||||
disk \
|
||||
hacking \
|
||||
lib \
|
||||
machines \
|
||||
man \
|
||||
perl \
|
||||
pokefinder \
|
||||
roms \
|
||||
sound \
|
||||
timer \
|
||||
ui \
|
||||
unittests \
|
||||
z80
|
||||
|
||||
fuse_SOURCES = ay.c \
|
||||
dck.c \
|
||||
display.c \
|
||||
divide.c \
|
||||
event.c \
|
||||
fuse.c \
|
||||
ide.c \
|
||||
if1.c \
|
||||
if2.c \
|
||||
input.c \
|
||||
joystick.c \
|
||||
kempmouse.c \
|
||||
keyboard.c \
|
||||
loader.c \
|
||||
machine.c \
|
||||
memory.c \
|
||||
mempool.c \
|
||||
menu.c \
|
||||
module.c \
|
||||
periph.c \
|
||||
printer.c \
|
||||
profile.c \
|
||||
psg.c \
|
||||
rzx.c \
|
||||
scld.c \
|
||||
screenshot.c \
|
||||
settings.c \
|
||||
simpleide.c \
|
||||
slt.c \
|
||||
snapshot.c \
|
||||
sound.c \
|
||||
spectrum.c \
|
||||
tape.c \
|
||||
ui.c \
|
||||
uidisplay.c \
|
||||
ula.c \
|
||||
utils.c \
|
||||
windres.rc \
|
||||
zxatasp.c \
|
||||
zxcf.c
|
||||
|
||||
if COMPAT_DIRNAME
|
||||
fuse_SOURCES += compat/dirname.c
|
||||
endif
|
||||
|
||||
if COMPAT_GETOPT
|
||||
fuse_SOURCES += compat/getopt.c compat/getopt1.c
|
||||
endif
|
||||
|
||||
if COMPAT_MKSTEMP
|
||||
fuse_SOURCES += compat/mkstemp.c
|
||||
endif
|
||||
|
||||
EXTRA_fuse_SOURCES = windres.rc
|
||||
|
||||
fuse_LDADD = debugger/libdebugger.a \
|
||||
@UI_LIBS@ \
|
||||
machines/libmachines.a \
|
||||
disk/libdisk.a \
|
||||
pokefinder/libpokefinder.a \
|
||||
sound/libsound.a \
|
||||
ui/scaler/libscaler.a \
|
||||
unittests/libunittests.a \
|
||||
debugger/libdebugger.a \
|
||||
timer/libtimer.a \
|
||||
z80/libz80.a \
|
||||
@LIBSPEC_LIBS@ \
|
||||
@GLIB_LIBS@ \
|
||||
@PNG_LIBS@ \
|
||||
@SOUND_LIBS@ \
|
||||
@SAMPLERATE_LIBS@ \
|
||||
@SDL_LIBS@ \
|
||||
@X_LIBS@ \
|
||||
@XML_LIBS@ \
|
||||
compat/@COMPAT_OSNAME@/libcompatos.a \
|
||||
@WINDRES_OBJ@
|
||||
|
||||
fuse_DEPENDENCIES = @UI_LIBS@ \
|
||||
compat/@COMPAT_OSNAME@/libcompatos.a
|
||||
disk/libdisk.a \
|
||||
debugger/libdebugger.a \
|
||||
machines/libmachines.a \
|
||||
sound/libsound.a \
|
||||
unittests/libunittests.a\
|
||||
z80/libz80.a \
|
||||
@WINDRES_OBJ@
|
||||
|
||||
BUILT_SOURCES = settings.c settings.h
|
||||
|
||||
windres.o: windres.rc winfuse.ico
|
||||
@WINDRES@ -I$(srcdir) -I. $(srcdir)/windres.rc windres.o
|
||||
|
||||
settings.c: settings.pl settings.dat
|
||||
@PERL@ -I$(srcdir)/perl $(srcdir)/settings.pl $(srcdir)/settings.dat > $@.tmp && mv $@.tmp $@
|
||||
|
||||
settings.h: settings-header.pl settings.dat
|
||||
@PERL@ -I$(srcdir)/perl $(srcdir)/settings-header.pl $(srcdir)/settings.dat > $@.tmp && mv $@.tmp $@
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ \
|
||||
@XML_CFLAGS@ @SAMPLERATE_CFLAGS@ -DFUSEDATADIR="\"${pkgdatadir}\"" @SDL_CFLAGS@
|
||||
|
||||
noinst_HEADERS = ay.h \
|
||||
bitmap.h \
|
||||
compat.h \
|
||||
dck.h \
|
||||
display.h \
|
||||
divide.h \
|
||||
event.h \
|
||||
fuse.h \
|
||||
ide.h \
|
||||
if1.h \
|
||||
if2.h \
|
||||
input.h \
|
||||
keyboard.h \
|
||||
kempmouse.h \
|
||||
loader.h \
|
||||
machine.h \
|
||||
memory.h \
|
||||
mempool.h \
|
||||
menu.h \
|
||||
module.h \
|
||||
periph.h \
|
||||
psg.h \
|
||||
rzx.h \
|
||||
screenshot.h \
|
||||
settings.h \
|
||||
simpleide.h \
|
||||
slt.h \
|
||||
snapshot.h \
|
||||
sound.h \
|
||||
spectrum.h \
|
||||
tape.h \
|
||||
utils.h \
|
||||
joystick.h \
|
||||
printer.h \
|
||||
profile.h \
|
||||
scld.h \
|
||||
ula.h \
|
||||
zxatasp.h \
|
||||
zxcf.h
|
||||
|
||||
EXTRA_DIST = AUTHORS \
|
||||
README \
|
||||
THANKS \
|
||||
keysyms.dat \
|
||||
keysyms.pl \
|
||||
menu_data.dat \
|
||||
menu_data.pl \
|
||||
settings.pl \
|
||||
settings-header.pl \
|
||||
settings.dat \
|
||||
winfuse.ico
|
||||
|
||||
CLEANFILES = settings.c \
|
||||
settings.h
|
||||
|
||||
AM_CPPFLAGS =
|
||||
|
||||
include compat/Makefile.am
|
|
@ -0,0 +1,997 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# Process this file with automake to produce Makefile.in
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
bin_PROGRAMS = fuse$(EXEEXT)
|
||||
@COMPAT_DIRNAME_TRUE@am__append_1 = compat/dirname.c
|
||||
@COMPAT_GETOPT_TRUE@am__append_2 = compat/getopt.c compat/getopt1.c
|
||||
@COMPAT_MKSTEMP_TRUE@am__append_3 = compat/mkstemp.c
|
||||
DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \
|
||||
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/compat/Makefile.am $(srcdir)/config.h.in \
|
||||
$(top_srcdir)/configure AUTHORS COPYING ChangeLog THANKS \
|
||||
config.guess config.sub depcomp install-sh ltmain.sh missing \
|
||||
ylwrap
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am__fuse_SOURCES_DIST = ay.c dck.c display.c divide.c event.c fuse.c \
|
||||
ide.c if1.c if2.c input.c joystick.c kempmouse.c keyboard.c \
|
||||
loader.c machine.c memory.c mempool.c menu.c module.c periph.c \
|
||||
printer.c profile.c psg.c rzx.c scld.c screenshot.c settings.c \
|
||||
simpleide.c slt.c snapshot.c sound.c spectrum.c tape.c ui.c \
|
||||
uidisplay.c ula.c utils.c windres.rc zxatasp.c zxcf.c \
|
||||
compat/dirname.c compat/getopt.c compat/getopt1.c \
|
||||
compat/mkstemp.c
|
||||
@COMPAT_DIRNAME_TRUE@am__objects_1 = dirname.$(OBJEXT)
|
||||
@COMPAT_GETOPT_TRUE@am__objects_2 = getopt.$(OBJEXT) getopt1.$(OBJEXT)
|
||||
@COMPAT_MKSTEMP_TRUE@am__objects_3 = mkstemp.$(OBJEXT)
|
||||
am_fuse_OBJECTS = ay.$(OBJEXT) dck.$(OBJEXT) display.$(OBJEXT) \
|
||||
divide.$(OBJEXT) event.$(OBJEXT) fuse.$(OBJEXT) ide.$(OBJEXT) \
|
||||
if1.$(OBJEXT) if2.$(OBJEXT) input.$(OBJEXT) joystick.$(OBJEXT) \
|
||||
kempmouse.$(OBJEXT) keyboard.$(OBJEXT) loader.$(OBJEXT) \
|
||||
machine.$(OBJEXT) memory.$(OBJEXT) mempool.$(OBJEXT) \
|
||||
menu.$(OBJEXT) module.$(OBJEXT) periph.$(OBJEXT) \
|
||||
printer.$(OBJEXT) profile.$(OBJEXT) psg.$(OBJEXT) \
|
||||
rzx.$(OBJEXT) scld.$(OBJEXT) screenshot.$(OBJEXT) \
|
||||
settings.$(OBJEXT) simpleide.$(OBJEXT) slt.$(OBJEXT) \
|
||||
snapshot.$(OBJEXT) sound.$(OBJEXT) spectrum.$(OBJEXT) \
|
||||
tape.$(OBJEXT) ui.$(OBJEXT) uidisplay.$(OBJEXT) ula.$(OBJEXT) \
|
||||
utils.$(OBJEXT) zxatasp.$(OBJEXT) zxcf.$(OBJEXT) \
|
||||
$(am__objects_1) $(am__objects_2) $(am__objects_3)
|
||||
fuse_OBJECTS = $(am_fuse_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(fuse_SOURCES) $(EXTRA_fuse_SOURCES)
|
||||
DIST_SOURCES = $(am__fuse_SOURCES_DIST) $(EXTRA_fuse_SOURCES)
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOLOAD_SNAPS = @AUTOLOAD_SNAPS@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPAT_OSNAME = @COMPAT_OSNAME@
|
||||
COMPAT_SUBDIR = @COMPAT_SUBDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_CONFIG = @GLIB_CONFIG@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSPEC_CFLAGS = @LIBSPEC_CFLAGS@
|
||||
LIBSPEC_LIBS = @LIBSPEC_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
|
||||
SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_CONFIG = @SDL_CONFIG@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOUND_LIBADD = @SOUND_LIBADD@
|
||||
SOUND_LIBS = @SOUND_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TIMER_LIBADD = @TIMER_LIBADD@
|
||||
UI = @UI@
|
||||
UI_LIBS = @UI_LIBS@
|
||||
VERSION = @VERSION@
|
||||
WIDGET = @WIDGET@
|
||||
WINDRES = @WINDRES@
|
||||
WINDRES_OBJ = @WINDRES_OBJ@
|
||||
XMKMF = @XMKMF@
|
||||
XML2_CONFIG = @XML2_CONFIG@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
SUBDIRS = @COMPAT_SUBDIR@ \
|
||||
debugger \
|
||||
disk \
|
||||
hacking \
|
||||
lib \
|
||||
machines \
|
||||
man \
|
||||
perl \
|
||||
pokefinder \
|
||||
roms \
|
||||
sound \
|
||||
timer \
|
||||
ui \
|
||||
unittests \
|
||||
z80
|
||||
|
||||
DIST_SUBDIRS = debugger disk hacking lib machines man perl pokefinder \
|
||||
roms sound timer ui unittests z80 compat/amiga compat/morphos \
|
||||
compat/unix compat/win32
|
||||
fuse_SOURCES = ay.c dck.c display.c divide.c event.c fuse.c ide.c \
|
||||
if1.c if2.c input.c joystick.c kempmouse.c keyboard.c loader.c \
|
||||
machine.c memory.c mempool.c menu.c module.c periph.c \
|
||||
printer.c profile.c psg.c rzx.c scld.c screenshot.c settings.c \
|
||||
simpleide.c slt.c snapshot.c sound.c spectrum.c tape.c ui.c \
|
||||
uidisplay.c ula.c utils.c windres.rc zxatasp.c zxcf.c \
|
||||
$(am__append_1) $(am__append_2) $(am__append_3)
|
||||
EXTRA_fuse_SOURCES = windres.rc compat/dirname.c compat/getopt.c \
|
||||
compat/getopt1.c compat/mkstemp.c
|
||||
fuse_LDADD = debugger/libdebugger.a \
|
||||
@UI_LIBS@ \
|
||||
machines/libmachines.a \
|
||||
disk/libdisk.a \
|
||||
pokefinder/libpokefinder.a \
|
||||
sound/libsound.a \
|
||||
ui/scaler/libscaler.a \
|
||||
unittests/libunittests.a \
|
||||
debugger/libdebugger.a \
|
||||
timer/libtimer.a \
|
||||
z80/libz80.a \
|
||||
@LIBSPEC_LIBS@ \
|
||||
@GLIB_LIBS@ \
|
||||
@PNG_LIBS@ \
|
||||
@SOUND_LIBS@ \
|
||||
@SAMPLERATE_LIBS@ \
|
||||
@SDL_LIBS@ \
|
||||
@X_LIBS@ \
|
||||
@XML_LIBS@ \
|
||||
compat/@COMPAT_OSNAME@/libcompatos.a \
|
||||
@WINDRES_OBJ@
|
||||
|
||||
fuse_DEPENDENCIES = @UI_LIBS@ \
|
||||
compat/@COMPAT_OSNAME@/libcompatos.a
|
||||
|
||||
BUILT_SOURCES = settings.c settings.h
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ \
|
||||
@XML_CFLAGS@ @SAMPLERATE_CFLAGS@ -DFUSEDATADIR="\"${pkgdatadir}\"" @SDL_CFLAGS@
|
||||
|
||||
noinst_HEADERS = ay.h bitmap.h compat.h dck.h display.h divide.h \
|
||||
event.h fuse.h ide.h if1.h if2.h input.h keyboard.h \
|
||||
kempmouse.h loader.h machine.h memory.h mempool.h menu.h \
|
||||
module.h periph.h psg.h rzx.h screenshot.h settings.h \
|
||||
simpleide.h slt.h snapshot.h sound.h spectrum.h tape.h utils.h \
|
||||
joystick.h printer.h profile.h scld.h ula.h zxatasp.h zxcf.h \
|
||||
compat/getopt.h
|
||||
EXTRA_DIST = AUTHORS \
|
||||
README \
|
||||
THANKS \
|
||||
keysyms.dat \
|
||||
keysyms.pl \
|
||||
menu_data.dat \
|
||||
menu_data.pl \
|
||||
settings.pl \
|
||||
settings-header.pl \
|
||||
settings.dat \
|
||||
winfuse.ico
|
||||
|
||||
CLEANFILES = settings.c \
|
||||
settings.h
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)/compat
|
||||
all: $(BUILT_SOURCES) config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/compat/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
|| test -f $$p1 \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f $$p $$f"; \
|
||||
rm -f $$p $$f ; \
|
||||
done
|
||||
fuse$(EXEEXT): $(fuse_OBJECTS) $(fuse_DEPENDENCIES)
|
||||
@rm -f fuse$(EXEEXT)
|
||||
$(LINK) $(fuse_OBJECTS) $(fuse_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ay.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dck.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/display.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/divide.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fuse.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ide.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/if1.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/if2.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/joystick.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kempmouse.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyboard.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loader.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machine.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mempool.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menu.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/periph.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printer.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psg.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rzx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scld.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/screenshot.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/settings.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simpleide.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slt.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snapshot.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sound.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spectrum.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tape.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ui.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uidisplay.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ula.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zxatasp.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zxcf.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
dirname.o: compat/dirname.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dirname.o -MD -MP -MF $(DEPDIR)/dirname.Tpo -c -o dirname.o `test -f 'compat/dirname.c' || echo '$(srcdir)/'`compat/dirname.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dirname.Tpo $(DEPDIR)/dirname.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/dirname.c' object='dirname.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dirname.o `test -f 'compat/dirname.c' || echo '$(srcdir)/'`compat/dirname.c
|
||||
|
||||
dirname.obj: compat/dirname.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dirname.obj -MD -MP -MF $(DEPDIR)/dirname.Tpo -c -o dirname.obj `if test -f 'compat/dirname.c'; then $(CYGPATH_W) 'compat/dirname.c'; else $(CYGPATH_W) '$(srcdir)/compat/dirname.c'; fi`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dirname.Tpo $(DEPDIR)/dirname.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/dirname.c' object='dirname.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dirname.obj `if test -f 'compat/dirname.c'; then $(CYGPATH_W) 'compat/dirname.c'; else $(CYGPATH_W) '$(srcdir)/compat/dirname.c'; fi`
|
||||
|
||||
getopt.o: compat/getopt.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.o -MD -MP -MF $(DEPDIR)/getopt.Tpo -c -o getopt.o `test -f 'compat/getopt.c' || echo '$(srcdir)/'`compat/getopt.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/getopt.Tpo $(DEPDIR)/getopt.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/getopt.c' object='getopt.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.o `test -f 'compat/getopt.c' || echo '$(srcdir)/'`compat/getopt.c
|
||||
|
||||
getopt.obj: compat/getopt.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt.obj -MD -MP -MF $(DEPDIR)/getopt.Tpo -c -o getopt.obj `if test -f 'compat/getopt.c'; then $(CYGPATH_W) 'compat/getopt.c'; else $(CYGPATH_W) '$(srcdir)/compat/getopt.c'; fi`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/getopt.Tpo $(DEPDIR)/getopt.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/getopt.c' object='getopt.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt.obj `if test -f 'compat/getopt.c'; then $(CYGPATH_W) 'compat/getopt.c'; else $(CYGPATH_W) '$(srcdir)/compat/getopt.c'; fi`
|
||||
|
||||
getopt1.o: compat/getopt1.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt1.o -MD -MP -MF $(DEPDIR)/getopt1.Tpo -c -o getopt1.o `test -f 'compat/getopt1.c' || echo '$(srcdir)/'`compat/getopt1.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/getopt1.Tpo $(DEPDIR)/getopt1.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/getopt1.c' object='getopt1.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt1.o `test -f 'compat/getopt1.c' || echo '$(srcdir)/'`compat/getopt1.c
|
||||
|
||||
getopt1.obj: compat/getopt1.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT getopt1.obj -MD -MP -MF $(DEPDIR)/getopt1.Tpo -c -o getopt1.obj `if test -f 'compat/getopt1.c'; then $(CYGPATH_W) 'compat/getopt1.c'; else $(CYGPATH_W) '$(srcdir)/compat/getopt1.c'; fi`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/getopt1.Tpo $(DEPDIR)/getopt1.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/getopt1.c' object='getopt1.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o getopt1.obj `if test -f 'compat/getopt1.c'; then $(CYGPATH_W) 'compat/getopt1.c'; else $(CYGPATH_W) '$(srcdir)/compat/getopt1.c'; fi`
|
||||
|
||||
mkstemp.o: compat/mkstemp.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mkstemp.o -MD -MP -MF $(DEPDIR)/mkstemp.Tpo -c -o mkstemp.o `test -f 'compat/mkstemp.c' || echo '$(srcdir)/'`compat/mkstemp.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mkstemp.Tpo $(DEPDIR)/mkstemp.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/mkstemp.c' object='mkstemp.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mkstemp.o `test -f 'compat/mkstemp.c' || echo '$(srcdir)/'`compat/mkstemp.c
|
||||
|
||||
mkstemp.obj: compat/mkstemp.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mkstemp.obj -MD -MP -MF $(DEPDIR)/mkstemp.Tpo -c -o mkstemp.obj `if test -f 'compat/mkstemp.c'; then $(CYGPATH_W) 'compat/mkstemp.c'; else $(CYGPATH_W) '$(srcdir)/compat/mkstemp.c'; fi`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/mkstemp.Tpo $(DEPDIR)/mkstemp.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='compat/mkstemp.c' object='mkstemp.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mkstemp.obj `if test -f 'compat/mkstemp.c'; then $(CYGPATH_W) 'compat/mkstemp.c'; else $(CYGPATH_W) '$(srcdir)/compat/mkstemp.c'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d $(distdir) || mkdir $(distdir)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-lzma: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) check-recursive
|
||||
all-am: Makefile $(PROGRAMS) $(HEADERS) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-hdr distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-binPROGRAMS \
|
||||
clean-generic clean-libtool ctags ctags-recursive dist \
|
||||
dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \
|
||||
dist-zip distcheck distclean distclean-compile \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-binPROGRAMS install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-binPROGRAMS
|
||||
|
||||
disk/libdisk.a \
|
||||
debugger/libdebugger.a \
|
||||
machines/libmachines.a \
|
||||
sound/libsound.a \
|
||||
unittests/libunittests.a\
|
||||
z80/libz80.a \
|
||||
@WINDRES_OBJ@
|
||||
|
||||
windres.o: windres.rc winfuse.ico
|
||||
@WINDRES@ -I$(srcdir) -I. $(srcdir)/windres.rc windres.o
|
||||
|
||||
settings.c: settings.pl settings.dat
|
||||
@PERL@ -I$(srcdir)/perl $(srcdir)/settings.pl $(srcdir)/settings.dat > $@.tmp && mv $@.tmp $@
|
||||
|
||||
settings.h: settings-header.pl settings.dat
|
||||
@PERL@ -I$(srcdir)/perl $(srcdir)/settings-header.pl $(srcdir)/settings.dat > $@.tmp && mv $@.tmp $@
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,155 @@
|
|||
The Free Unix Spectrum Emulator (Fuse) 0.10.0.2
|
||||
===============================================
|
||||
|
||||
Fuse (the Free Unix Spectrum Emulator) was originally, and somewhat
|
||||
unsurprisingly, an emulator of the ZX Spectrum (a popular 1980s home
|
||||
computer, especially in the UK) for Unix. However, it has now also
|
||||
been ported to Mac OS X, which may or may not count as a Unix variant
|
||||
depending on your advocacy position and Windows which definitely isn't
|
||||
a Unix variant. Fuse also emulates some of the better-known ZX Spectrum
|
||||
clones as well.
|
||||
|
||||
What Fuse does have:
|
||||
|
||||
* Accurate Spectrum 16K/48K/128K/+2/+2A/+3 emulation.
|
||||
* Working Spectrum +3e and SE, Timex TC2048, TC2068 and TS2068,
|
||||
Pentagon 128, "512" (Pentagon 128 with extra memory) and 1024 and
|
||||
Scorpion ZS 256 emulation.
|
||||
* Runs at true Speccy speed on any computer you're likely to try it on.
|
||||
* Support for loading from .tzx files, including accelerated loading.
|
||||
* Sound (on systems supporting the Open Sound System, SDL, or OpenBSD/
|
||||
Solaris's /dev/audio).
|
||||
* Emulation of most of the common joysticks used on the Spectrum
|
||||
(including Kempston, Sinclair and Cursor joysticks).
|
||||
* Emulation of some of the printers you could attach to a Spectrum.
|
||||
* Support for the RZX input recording file format, including
|
||||
rollback and 'competition mode'.
|
||||
* Emulation of the DivIDE, Interface I, Kempston mouse, Spectrum +3e,
|
||||
ZXATASP, ZXCF, Beta 128 and +D interfaces.
|
||||
|
||||
Help! <xyz> doesn't work
|
||||
------------------------
|
||||
|
||||
If you're having a problem using/running/building Fuse, the two places
|
||||
you're most likely to get help are the development mailing list
|
||||
<fuse-emulator-devel@lists.sf.net> or the official forums at
|
||||
<http://sourceforge.net/forum/?group_id=91293>.
|
||||
|
||||
What you'll need to run Fuse
|
||||
----------------------------
|
||||
|
||||
Unix, Linux, BSD, etc.
|
||||
|
||||
Required:
|
||||
|
||||
* X, SDL, svgalib or framebuffer support. If you have GTK+, you'll get
|
||||
a (much) nicer user interface under X.
|
||||
* libspectrum: this is available from
|
||||
http://fuse-emulator.sourceforge.net/libspectrum.php
|
||||
|
||||
Optional:
|
||||
|
||||
* Other libraries will give you some extended functionality:
|
||||
* libgcrypt: the ability to digitally sign input recordings (note that
|
||||
Fuse requires version 1.1.42 or later).
|
||||
* libpng: the ability to save screenshots
|
||||
* libxml2: the ability to load and save Fuse's current configuration
|
||||
* zlib: support for compressed RZX files
|
||||
* samplerate: support for better beeper sound quality; get it from
|
||||
http://www.mega-nerd.com/SRC/
|
||||
|
||||
If you've used Fuse prior to version 0.5.0, note that the external
|
||||
utilities (tzxlist, etc) are now available separately from Fuse
|
||||
itself. See http://fuse-emulator.sourceforge.net/ for details.
|
||||
|
||||
Mac OS X
|
||||
|
||||
* Either the native port by Fredrick Meunier, or the original version
|
||||
will compile on OS X 10.3 (Panther) or later.
|
||||
|
||||
Windows
|
||||
|
||||
* The Win32 and SDL UIs can be used under Windows, but the Win32 UI is
|
||||
incomplete.
|
||||
|
||||
Building Fuse
|
||||
-------------
|
||||
|
||||
To compile Fuse (see below for instructions for the OS X native port):
|
||||
|
||||
$ ./configure
|
||||
|
||||
There are now some options you can give to configure; `configure
|
||||
--help' will list them all, but the most important are:
|
||||
|
||||
--with-fb Use the framebuffer interface, rather than GTK+.
|
||||
--with-sdl Use the SDL interface, rather than GTK+.
|
||||
--with-svgalib Use the SVGAlib interface.
|
||||
--without-gtk Use the plain Xlib interface.
|
||||
|
||||
If glib is installed on your system, Fuse will use this for a couple
|
||||
of things; however, it isn't necessary as libspectrum provides
|
||||
replacements for all the routines used by Fuse.
|
||||
|
||||
Another useful option is `--with-local-prefix=DIRECTORY' which allows
|
||||
you to specify that you have some the the libraries needed by Fuse in
|
||||
`<DIRECTORY>/lib' and the necessary header files in
|
||||
`<DIRECTORY>/include'. If you specify the `--prefix' option to tell
|
||||
Fuse to install itself somewhere other than in /usr/local, that
|
||||
directory will automatically be searched as well.
|
||||
|
||||
Then just:
|
||||
|
||||
$ make
|
||||
|
||||
and then
|
||||
|
||||
$ make install
|
||||
|
||||
if you want to place Fuse into the main directories on your system
|
||||
(under /usr/local by default, although you can change this with the
|
||||
--prefix argument to 'configure'). You'll probably need to be root to
|
||||
do this bit.
|
||||
|
||||
Once you've got Fuse configured and built, read the man page :-)
|
||||
|
||||
Note that if you're using version of Fuse from CVS rather than one of
|
||||
the released tarballs, you'll need to run `autogen.sh' before running
|
||||
'configure' for the first time.
|
||||
|
||||
Building the OS X version of Fuse
|
||||
---------------------------------
|
||||
|
||||
The native Cocoa port by Fredrick Meunier <fredm@spamcop.net> comes as
|
||||
a set of Xcode projects for libgcrypt, libspectrum and Fuse itself.
|
||||
|
||||
Closing comments
|
||||
----------------
|
||||
|
||||
Fuse has its own home page, which you can find at:
|
||||
|
||||
http://fuse-emulator.sourceforge.net/
|
||||
|
||||
and contains much of the information listed here.
|
||||
|
||||
News of new versions of Fuse (and other important Fuse-related
|
||||
announcements) are distributed via the fuse-emulator-announce mailing
|
||||
list on SourceForge; see
|
||||
http://lists.sourceforge.net/lists/listinfo/fuse-emulator-announce
|
||||
for details on how to subscribe and the like.
|
||||
|
||||
If you've got any bug reports, suggestions or the like for Fuse, or
|
||||
just want to get involved in the development, this is coordinated via
|
||||
the fuse-emulator-devel mailing list,
|
||||
http://lists.sourceforge.net/lists/listinfo/fuse-emulator-devel
|
||||
and the Fuse project page on SourceForge,
|
||||
http://sourceforge.net/projects/fuse-emulator/
|
||||
|
||||
If you're interested in more general Speccy related discussions, visit
|
||||
the Usenet group 'comp.sys.sinclair', but do read the FAQ
|
||||
( http://www.worldofspectrum.org/faq/index.html ) first!
|
||||
|
||||
Philip Kendall <philip-fuse@shadowmagic.org.uk>
|
||||
14 January 2009
|
||||
|
||||
$Id: README 3957 2009-01-14 19:52:20Z pak21 $
|
|
@ -0,0 +1,104 @@
|
|||
Some thanks (in alphabetical order):
|
||||
|
||||
* Stuart Brady: for the Scorpion emulation and HP-UX sound support
|
||||
(see `AUTHORS')
|
||||
|
||||
* Michael Bukin: for XWinAllegro, which was used by previous versions of
|
||||
Fuse for the graphical display.
|
||||
(http://www.canvaslink.com/allegro/xwinallegro/)
|
||||
|
||||
* Ian Collier: the source to his xz80
|
||||
(http://www.comlab.ox.ac.uk/oucl/users/ian.collier/Spectrum/index.html)
|
||||
was very helpful for getting the z80 opcodes right; also the ZX Printer
|
||||
emulation is based on xz80's.
|
||||
|
||||
* Boris Donko: for various Z80 core fixes: missing memory contention
|
||||
on LD (nnnn),A instruction, flags on SCF and FLAG_V on DEC, and
|
||||
timing of INC SP.
|
||||
|
||||
* John Elliott: for lib765, which provides Fuse's emulation of the +3's
|
||||
FDC, and libdsk which provides support for more disk image formats:
|
||||
see http://www.seasip.demon.co.uk/Unix/LibDsk/
|
||||
|
||||
* Ivan Ruiz Etxabe: for helping test RZX competition mode recording.
|
||||
|
||||
* Martin Garton: making the GTK+ user interface compatible with GTK+ 2.0,
|
||||
although I then went and broke it in other ways.
|
||||
|
||||
* Ian Greenway: for information about reading from unattached ports. If
|
||||
you've got an Amiga, you may well like to check out Ian's Spectrum
|
||||
Emulator, ASp: http://www.greew.freeserve.co.uk/ASp.html
|
||||
|
||||
* Shawn Hargreaves: for Allegro (http://www.talula.demon.co.uk/allegro/)
|
||||
(again, used by previous versions of Fuse for the graphical display)
|
||||
|
||||
* Steven Harrison: for helping track down why the SDL sound routines
|
||||
weren't working on IRIX.
|
||||
|
||||
* Thomas Harte: for the much faster console display routines (Not present
|
||||
in the current version).
|
||||
|
||||
* Erik Kunze: for lots of helpful hints on how to program under Unix.
|
||||
|
||||
* Garry Lancaster: for the simple 8-bit IDE, ZXATASP and ZXCF
|
||||
emulations (see `AUTHORS')
|
||||
|
||||
* Gerton Lunter: his wonderful z80
|
||||
(ftp://ftp.worldofspectrum.org/pub/sinclair/emulators/pc/dos/z80-400.zip)
|
||||
got me started on this emulation lark all those years ago...
|
||||
|
||||
* Anders Holmberg: for reporting a bug in the z80 v1.45 load routines. Anders
|
||||
has done what is basically a port of Fuse 0.4.0 to the PocketPC: see
|
||||
http://pocketclive.emuunlim.com/
|
||||
|
||||
* Russell Marks: for various bits of code (see `AUTHORS')
|
||||
|
||||
* Fredrick Meunier: for TC2048 support and more (see `AUTHORS')
|
||||
|
||||
* Catalin Mihaila: for writing an SDL user interface for Fuse. Not in
|
||||
the code as this has already been done by Fred :-(
|
||||
|
||||
* David Muriel: for helping test RZX competition mode recording.
|
||||
|
||||
* Santiago Romero: for putting me on the track of a bug in Fuse's keyboard
|
||||
emulation.
|
||||
|
||||
* Mark Round: for reporting a bug with respect to Solaris sound detection.
|
||||
|
||||
* Darren Salt: quite a few bits of code (see `AUTHORS')
|
||||
|
||||
* Dmitry Sanarin: the author of Glukalka (http://glukalka.sf.net/),
|
||||
from which Fuse's TR-DOS emulation code was taken.
|
||||
|
||||
* Steve Snake (via Mark Woodmass): for pointing out which memory pages
|
||||
on the 128K machine are actually contended. Grab Steve's emulator, Klive,
|
||||
from http://www.worldofspectrum.org/emulators.html#pcwin
|
||||
|
||||
* Ludvig Strigeus and The ScummVM project wrote the original version of
|
||||
the code which is used as the graphics scalers. For ScummVM, check out
|
||||
http://www.scummvm.org/
|
||||
|
||||
* Gergely Szasz: Interface I/microdrive emulation, the 'movie' code and the
|
||||
ao sound driver (see `AUTHORS')
|
||||
|
||||
* Miklos Szeredi: his `SpectEmu' (http://www.inf.bme.hu/~mszeredi/spectemu/)
|
||||
gave the inspiration for an important rewrite of the Z80 core, and was
|
||||
also _very_ useful whilst trying to track down some bugs.
|
||||
|
||||
* Martijn van der Heide: for World of Spectrum
|
||||
(http://www.worldofspectrum.org/) -- simply the best Speccy Web site out
|
||||
there.
|
||||
|
||||
* Witold Filipczyk: for TC2068 support and more (see `AUTHORS')
|
||||
|
||||
* Mark Woodmass: for putting me on the track of (and finding the
|
||||
solution to) bugs with regard to Fuse's R register emulation during
|
||||
HALTs and interrupts and Fuse's mask for the memory control port on
|
||||
the 128K/+2 machines. Mark's another one who's written an emulator:
|
||||
see 'SPIN' at http://www.worldofspectrum.org/emulators.html#pcwin
|
||||
|
||||
* Alexander Yurchenko: for the OpenBSD/Solaris sound code (see `AUTHORS')
|
||||
|
||||
* Matan Ziv-Av: for various bits of code (see `AUTHORS')
|
||||
|
||||
$Id: THANKS 2433 2004-11-28 21:58:44Z pak21 $
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,165 @@
|
|||
/* ay.c: AY-8-3912 routines
|
||||
Copyright (c) 1999-2004 Philip Kendall
|
||||
|
||||
$Id: ay.c 3494 2008-01-15 16:37:50Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "compat.h"
|
||||
#include "machine.h"
|
||||
#include "module.h"
|
||||
#include "printer.h"
|
||||
#include "psg.h"
|
||||
#include "sound.h"
|
||||
|
||||
/* Unused bits in the AY registers are silently zeroed out; these masks
|
||||
accomplish this */
|
||||
static const libspectrum_byte mask[ AY_REGISTERS ] = {
|
||||
|
||||
0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0x1f, 0xff,
|
||||
0x1f, 0x1f, 0x1f, 0xff, 0xff, 0x0f, 0xff, 0xff,
|
||||
|
||||
};
|
||||
|
||||
static void ay_reset( int hard_reset );
|
||||
static void ay_from_snapshot( libspectrum_snap *snap );
|
||||
static void ay_to_snapshot( libspectrum_snap *snap );
|
||||
|
||||
static module_info_t ay_module_info = {
|
||||
|
||||
ay_reset,
|
||||
NULL,
|
||||
NULL,
|
||||
ay_from_snapshot,
|
||||
ay_to_snapshot,
|
||||
|
||||
};
|
||||
|
||||
int
|
||||
ay_init( void )
|
||||
{
|
||||
module_register( &ay_module_info );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
ay_reset( int hard_reset GCC_UNUSED )
|
||||
{
|
||||
ayinfo *ay = &machine_current->ay;
|
||||
|
||||
ay->current_register = 0;
|
||||
memset( ay->registers, 0, sizeof( ay->registers ) );
|
||||
}
|
||||
|
||||
/* What happens when the AY register port (traditionally 0xfffd on the 128K
|
||||
machines) is read from */
|
||||
libspectrum_byte
|
||||
ay_registerport_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
int current;
|
||||
const libspectrum_byte port_input = 0xbf; /* always allow serial output */
|
||||
|
||||
*attached = 1;
|
||||
|
||||
current = machine_current->ay.current_register;
|
||||
|
||||
/* The AY I/O ports return input directly from the port when in
|
||||
input mode; but in output mode, they return an AND between the
|
||||
register value and the port input. So, allow for this when
|
||||
reading R14... */
|
||||
|
||||
if( current == 14 ) {
|
||||
if(machine_current->ay.registers[7] & 0x40)
|
||||
return (port_input & machine_current->ay.registers[14]);
|
||||
else
|
||||
return port_input;
|
||||
}
|
||||
|
||||
/* R15 is simpler to do, as the 8912 lacks the second I/O port, and
|
||||
the input-mode input is always 0xff */
|
||||
if( current == 15 && !( machine_current->ay.registers[7] & 0x80 ) )
|
||||
return 0xff;
|
||||
|
||||
/* Otherwise return register value, appropriately masked */
|
||||
return machine_current->ay.registers[ current ] & mask[ current ];
|
||||
}
|
||||
|
||||
/* And when it's written to */
|
||||
void
|
||||
ay_registerport_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
machine_current->ay.current_register = (b & 15);
|
||||
}
|
||||
|
||||
/* What happens when the AY data port (traditionally 0xbffd on the 128K
|
||||
machines) is written to; no corresponding read function as this
|
||||
always returns 0xff */
|
||||
void
|
||||
ay_dataport_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
int current;
|
||||
|
||||
current = machine_current->ay.current_register;
|
||||
|
||||
machine_current->ay.registers[ current ] = b & mask[ current ];
|
||||
sound_ay_write( current, b, tstates );
|
||||
if( psg_recording ) psg_write_register( current, b );
|
||||
|
||||
if( current == 14 ) printer_serial_write( b );
|
||||
}
|
||||
|
||||
static void
|
||||
ay_from_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if( machine_current->capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_AY ) {
|
||||
|
||||
ay_registerport_write( 0xfffd,
|
||||
libspectrum_snap_out_ay_registerport( snap ) );
|
||||
|
||||
for( i = 0; i < AY_REGISTERS; i++ ) {
|
||||
machine_current->ay.registers[i] =
|
||||
libspectrum_snap_ay_registers( snap, i );
|
||||
sound_ay_write( i, machine_current->ay.registers[i], 0 );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ay_to_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
libspectrum_snap_set_out_ay_registerport(
|
||||
snap, machine_current->ay.current_register
|
||||
);
|
||||
|
||||
for( i = 0; i < AY_REGISTERS; i++ )
|
||||
libspectrum_snap_set_ay_registers( snap, i,
|
||||
machine_current->ay.registers[i] );
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/* ay.h: AY-8-3912 routines
|
||||
Copyright (c) 1999-2004 Philip Kendall
|
||||
|
||||
$Id: ay.h 2993 2007-06-17 13:54:49Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_AY_H
|
||||
#define FUSE_AY_H
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#define AY_REGISTERS 16
|
||||
|
||||
typedef struct ayinfo {
|
||||
int current_register;
|
||||
libspectrum_byte registers[ AY_REGISTERS ];
|
||||
} ayinfo;
|
||||
|
||||
int ay_init( void );
|
||||
|
||||
libspectrum_byte ay_registerport_read( libspectrum_word port, int *attached );
|
||||
void ay_registerport_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
void ay_dataport_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
#endif /* #ifndef FUSE_AY_H */
|
|
@ -0,0 +1,49 @@
|
|||
/* bitmap.h: Bitmap routines
|
||||
Copyright (c) 2007 Stuart Brady
|
||||
|
||||
$Id: bitmap.h 3218 2007-10-21 23:25:23Z zubzero $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
Stuart: sdbrady@ntlworld.com
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_BITMAP_H
|
||||
#define FUSE_BITMAP_H
|
||||
|
||||
inline static void
|
||||
bitmap_set( libspectrum_byte *b, const size_t n )
|
||||
{
|
||||
b[ n / 8 ] |= ( 1 << ( n % 8 ) );
|
||||
}
|
||||
|
||||
inline static void
|
||||
bitmap_reset( libspectrum_byte *b, const size_t n )
|
||||
{
|
||||
b[ n / 8 ] &= ~( 1 << ( n % 8 ) );
|
||||
}
|
||||
|
||||
inline static int
|
||||
bitmap_test( const libspectrum_byte *b, const size_t n )
|
||||
{
|
||||
return b[ n / 8 ] & ( 1 << ( n % 8 ) );
|
||||
}
|
||||
|
||||
#endif /* #ifndef FUSE_BITMAP_H */
|
|
@ -0,0 +1,89 @@
|
|||
/* compat.h: various compatibility bits
|
||||
Copyright (c) 2003-2008 Philip Kendall
|
||||
|
||||
$Id: compat.h 3687 2008-06-23 11:55:23Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_COMPAT_H
|
||||
#define FUSE_COMPAT_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <utils.h>
|
||||
|
||||
/* Remove the gcc-specific incantations if we're not using gcc */
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define GCC_UNUSED __attribute__ ((unused))
|
||||
#define GCC_PRINTF( fmtstring, args ) __attribute__ ((format( printf, fmtstring, args )))
|
||||
#define GCC_NORETURN __attribute__ ((noreturn))
|
||||
|
||||
#else /* #ifdef __GNUC__ */
|
||||
|
||||
#define GCC_UNUSED
|
||||
#define GCC_PRINTF( fmtstring, args )
|
||||
#define GCC_NORETURN
|
||||
|
||||
#endif /* #ifdef __GNUC__ */
|
||||
|
||||
#ifndef HAVE_DIRNAME
|
||||
char *dirname( char *path );
|
||||
#endif /* #ifndef HAVE_DIRNAME */
|
||||
|
||||
#if !defined HAVE_GETOPT_LONG && !defined AMIGA && !defined __MORPHOS__
|
||||
#include "compat/getopt.h"
|
||||
#endif /* #ifndef HAVE_GETOPT_LONG */
|
||||
|
||||
#ifndef HAVE_MKSTEMP
|
||||
int mkstemp( char *template );
|
||||
#endif /* #ifndef HAVE_MKSTEMP */
|
||||
|
||||
/* That which separates components in a path name */
|
||||
#ifdef WIN32
|
||||
#define FUSE_DIR_SEP_CHR '\\'
|
||||
#define FUSE_DIR_SEP_STR "\\"
|
||||
#else
|
||||
#define FUSE_DIR_SEP_CHR '/'
|
||||
#define FUSE_DIR_SEP_STR "/"
|
||||
#endif
|
||||
|
||||
int compat_osname( char *buffer, size_t length );
|
||||
const char* compat_get_temp_path( void );
|
||||
const char* compat_get_home_path( void );
|
||||
int compat_is_absolute_path( const char *path );
|
||||
|
||||
#ifndef UI_WII
|
||||
typedef int compat_fd;
|
||||
#else /* #ifndef UI_WII */
|
||||
typedef FILE* compat_fd;
|
||||
#endif /* #ifndef UI_WII */
|
||||
|
||||
extern const compat_fd COMPAT_FILE_OPEN_FAILED;
|
||||
|
||||
compat_fd compat_file_open( const char *path, int write );
|
||||
off_t compat_file_get_length( compat_fd fd );
|
||||
int compat_file_read( compat_fd fd, utils_file *file );
|
||||
int compat_file_write( compat_fd fd, const unsigned char *buffer,
|
||||
size_t length );
|
||||
int compat_file_close( compat_fd fd );
|
||||
|
||||
#endif /* #ifndef FUSE_COMPAT_H */
|
|
@ -0,0 +1,36 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## Copyright (c) 2003-2007 Philip Kendall
|
||||
|
||||
## $Id: Makefile.am 3283 2007-11-09 12:21:06Z fredm $
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
##
|
||||
## Author contact information:
|
||||
##
|
||||
## E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AM_CPPFLAGS += -I$(srcdir)/compat
|
||||
|
||||
DIST_SUBDIRS += compat/amiga \
|
||||
compat/morphos \
|
||||
compat/unix \
|
||||
compat/win32
|
||||
|
||||
EXTRA_fuse_SOURCES += compat/dirname.c \
|
||||
compat/getopt.c \
|
||||
compat/getopt1.c \
|
||||
compat/mkstemp.c
|
||||
|
||||
noinst_HEADERS += compat/getopt.h
|
|
@ -0,0 +1,34 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## Copyright (c) 2007-2008 Philip Kendall
|
||||
|
||||
## $Id: Makefile.am 3687 2008-06-23 11:55:23Z pak21 $
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
##
|
||||
## Author contact information:
|
||||
##
|
||||
## E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)/../..
|
||||
|
||||
noinst_LIBRARIES = libcompatos.a
|
||||
|
||||
libcompatos_a_SOURCES = ../unix/file.c \
|
||||
osname.c \
|
||||
paths.c
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
|
@ -0,0 +1,501 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = compat/amiga
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
libcompatos_a_AR = $(AR) $(ARFLAGS)
|
||||
libcompatos_a_LIBADD =
|
||||
am_libcompatos_a_OBJECTS = file.$(OBJEXT) osname.$(OBJEXT) \
|
||||
paths.$(OBJEXT)
|
||||
libcompatos_a_OBJECTS = $(am_libcompatos_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libcompatos_a_SOURCES)
|
||||
DIST_SOURCES = $(libcompatos_a_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOLOAD_SNAPS = @AUTOLOAD_SNAPS@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPAT_OSNAME = @COMPAT_OSNAME@
|
||||
COMPAT_SUBDIR = @COMPAT_SUBDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_CONFIG = @GLIB_CONFIG@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSPEC_CFLAGS = @LIBSPEC_CFLAGS@
|
||||
LIBSPEC_LIBS = @LIBSPEC_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
|
||||
SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_CONFIG = @SDL_CONFIG@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOUND_LIBADD = @SOUND_LIBADD@
|
||||
SOUND_LIBS = @SOUND_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TIMER_LIBADD = @TIMER_LIBADD@
|
||||
UI = @UI@
|
||||
UI_LIBS = @UI_LIBS@
|
||||
VERSION = @VERSION@
|
||||
WIDGET = @WIDGET@
|
||||
WINDRES = @WINDRES@
|
||||
WINDRES_OBJ = @WINDRES_OBJ@
|
||||
XMKMF = @XMKMF@
|
||||
XML2_CONFIG = @XML2_CONFIG@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
AM_CPPFLAGS = -I$(srcdir)/../..
|
||||
noinst_LIBRARIES = libcompatos.a
|
||||
libcompatos_a_SOURCES = ../unix/file.c \
|
||||
osname.c \
|
||||
paths.c
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign compat/amiga/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign compat/amiga/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libcompatos.a: $(libcompatos_a_OBJECTS) $(libcompatos_a_DEPENDENCIES)
|
||||
-rm -f libcompatos.a
|
||||
$(libcompatos_a_AR) libcompatos.a $(libcompatos_a_OBJECTS) $(libcompatos_a_LIBADD)
|
||||
$(RANLIB) libcompatos.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osname.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paths.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
file.o: ../unix/file.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.o -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.o `test -f '../unix/file.c' || echo '$(srcdir)/'`../unix/file.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../unix/file.c' object='file.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.o `test -f '../unix/file.c' || echo '$(srcdir)/'`../unix/file.c
|
||||
|
||||
file.obj: ../unix/file.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.obj -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.obj `if test -f '../unix/file.c'; then $(CYGPATH_W) '../unix/file.c'; else $(CYGPATH_W) '$(srcdir)/../unix/file.c'; fi`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../unix/file.c' object='file.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.obj `if test -f '../unix/file.c'; then $(CYGPATH_W) '../unix/file.c'; else $(CYGPATH_W) '$(srcdir)/../unix/file.c'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,61 @@
|
|||
/* osname.c: Get a representation of the OS we're running on
|
||||
Copyright (c) 1999-2007 Philip Kendall
|
||||
|
||||
$Id: osname.c 3578 2008-03-22 20:51:36Z zubzero $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/expansion.h>
|
||||
|
||||
#include "ui/ui.h"
|
||||
|
||||
struct Library *ExpansionBase;
|
||||
struct ExpansionIFace *IExpansion;
|
||||
|
||||
int compat_osname( char *buffer, size_t length )
|
||||
{
|
||||
STRPTR machine;
|
||||
|
||||
if( ExpansionBase = IExec->OpenLibrary( "expansion.library", 52 ) ) {
|
||||
if( IExpansion = ( struct ExpansionIFace * ) IExec->GetInterface( ExpansionBase,"main",1,NULL ) ) {
|
||||
|
||||
IExpansion->GetMachineInfoTags( GMIT_MachineString, &machine,
|
||||
TAG_DONE );
|
||||
|
||||
snprintf( buffer, length, "%s %s %s", "AmigaOS", machine, "4.0" );
|
||||
|
||||
IExec->DropInterface( ( struct Interface * )IExpansion );
|
||||
}
|
||||
IExec->CloseLibrary( ExpansionBase );
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/* paths.c: Path-related compatibility routines
|
||||
Copyright (c) 1999-2007 Philip Kendall
|
||||
|
||||
$Id: paths.c 3844 2008-11-19 21:31:07Z fredm $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
const char*
|
||||
compat_get_temp_path( void )
|
||||
{
|
||||
return "T:";
|
||||
}
|
||||
|
||||
const char*
|
||||
compat_get_home_path( void )
|
||||
{
|
||||
return "PROGDIR:settings";
|
||||
}
|
||||
|
||||
int
|
||||
compat_is_absolute_path( const char *path )
|
||||
{
|
||||
return strchr(path,':');
|
||||
}
|
|
@ -0,0 +1,99 @@
|
|||
/* dirname - return directory part of PATH.
|
||||
Copyright (C) 1996, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
This file was part of the GNU C Library, version 2.3.2.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
Very slightly modified for use in Fuse by Philip Kendall, 2004.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "fuse.h"
|
||||
|
||||
static char *
|
||||
__memrchr (char *s, int c, size_t n)
|
||||
{
|
||||
for (s += n - 1; n; n--, s--)
|
||||
if (*s == c)
|
||||
return s;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
dirname (char *path)
|
||||
{
|
||||
static const char dot[] = ".";
|
||||
char *last_slash;
|
||||
|
||||
/* Find last '/'. */
|
||||
last_slash = path != NULL ? strrchr (path, FUSE_DIR_SEP_CHR) : NULL;
|
||||
|
||||
if (last_slash != NULL && last_slash != path && last_slash[1] == '\0')
|
||||
{
|
||||
/* Determine whether all remaining characters are slashes. */
|
||||
char *runp;
|
||||
|
||||
for (runp = last_slash; runp != path; --runp)
|
||||
if (runp[-1] != FUSE_DIR_SEP_CHR)
|
||||
break;
|
||||
|
||||
/* The '/' is the last character, we have to look further. */
|
||||
if (runp != path)
|
||||
last_slash = __memrchr (path, FUSE_DIR_SEP_CHR, runp - path);
|
||||
}
|
||||
|
||||
if (last_slash != NULL)
|
||||
{
|
||||
/* Determine whether all remaining characters are slashes. */
|
||||
char *runp;
|
||||
|
||||
for (runp = last_slash; runp != path; --runp)
|
||||
if (runp[-1] != FUSE_DIR_SEP_CHR)
|
||||
break;
|
||||
|
||||
/* Terminate the path. */
|
||||
if (runp == path)
|
||||
{
|
||||
/* The last slash is the first character in the string. We have to
|
||||
return "/". As a special case we have to return "//" if there
|
||||
are exactly two slashes at the beginning of the string. See
|
||||
XBD 4.10 Path Name Resolution for more information. */
|
||||
if (last_slash == path + 1)
|
||||
++last_slash;
|
||||
else
|
||||
last_slash = path + 1;
|
||||
}
|
||||
else
|
||||
last_slash = runp;
|
||||
|
||||
last_slash[0] = '\0';
|
||||
}
|
||||
else
|
||||
/* This assignment is ill-designed but the XPG specs require to
|
||||
return a string containing "." in any case no directory part is
|
||||
found and so a static and constant string is required. */
|
||||
path = (char *) dot;
|
||||
|
||||
return path;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,181 @@
|
|||
/* Declarations for getopt.
|
||||
Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
|
||||
#ifndef __need_getopt
|
||||
# define _GETOPT_H 1
|
||||
#endif
|
||||
|
||||
/* If __GNU_LIBRARY__ is not already defined, either we are being used
|
||||
standalone, or this is the first header included in the source file.
|
||||
If we are being used with glibc, we need to include <features.h>, but
|
||||
that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
|
||||
not defined, include <ctype.h>, which will pull in <features.h> for us
|
||||
if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
|
||||
doesn't flood the namespace with stuff the way some other headers do.) */
|
||||
#if !defined __GNU_LIBRARY__
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* For communication from `getopt' to the caller.
|
||||
When `getopt' finds an option that takes an argument,
|
||||
the argument value is returned here.
|
||||
Also, when `ordering' is RETURN_IN_ORDER,
|
||||
each non-option ARGV-element is returned here. */
|
||||
|
||||
extern char *optarg;
|
||||
|
||||
/* Index in ARGV of the next element to be scanned.
|
||||
This is used for communication to and from the caller
|
||||
and for communication between successive calls to `getopt'.
|
||||
|
||||
On entry to `getopt', zero means this is the first call; initialize.
|
||||
|
||||
When `getopt' returns -1, this is the index of the first of the
|
||||
non-option elements that the caller should itself scan.
|
||||
|
||||
Otherwise, `optind' communicates from one call to the next
|
||||
how much of ARGV has been scanned so far. */
|
||||
|
||||
extern int optind;
|
||||
|
||||
/* Callers store zero here to inhibit the error message `getopt' prints
|
||||
for unrecognized options. */
|
||||
|
||||
extern int opterr;
|
||||
|
||||
/* Set to an option character which was unrecognized. */
|
||||
|
||||
extern int optopt;
|
||||
|
||||
#ifndef __need_getopt
|
||||
/* Describe the long-named options requested by the application.
|
||||
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||
of `struct option' terminated by an element containing a name which is
|
||||
zero.
|
||||
|
||||
The field `has_arg' is:
|
||||
no_argument (or 0) if the option does not take an argument,
|
||||
required_argument (or 1) if the option requires an argument,
|
||||
optional_argument (or 2) if the option takes an optional argument.
|
||||
|
||||
If the field `flag' is not NULL, it points to a variable that is set
|
||||
to the value given in the field `val' when the option is found, but
|
||||
left unchanged if the option is not found.
|
||||
|
||||
To have a long-named option do something other than set an `int' to
|
||||
a compiled-in constant, such as set a value from `optarg', set the
|
||||
option's `flag' field to zero and its `val' field to a nonzero
|
||||
value (the equivalent single-letter option character, if there is
|
||||
one). For long options that have a zero `flag' field, `getopt'
|
||||
returns the contents of the `val' field. */
|
||||
|
||||
struct option
|
||||
{
|
||||
# if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||
const char *name;
|
||||
# else
|
||||
char *name;
|
||||
# endif
|
||||
/* has_arg can't be an enum because some compilers complain about
|
||||
type mismatches in all the code that assumes it is an int. */
|
||||
int has_arg;
|
||||
int *flag;
|
||||
int val;
|
||||
};
|
||||
|
||||
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||
|
||||
# define no_argument 0
|
||||
# define required_argument 1
|
||||
# define optional_argument 2
|
||||
#endif /* need getopt */
|
||||
|
||||
|
||||
/* Get definitions and prototypes for functions to process the
|
||||
arguments in ARGV (ARGC of them, minus the program name) for
|
||||
options given in OPTS.
|
||||
|
||||
Return the option character from OPTS just read. Return -1 when
|
||||
there are no more options. For unrecognized options, or options
|
||||
missing arguments, `optopt' is set to the option letter, and '?' is
|
||||
returned.
|
||||
|
||||
The OPTS string is a list of characters which are recognized option
|
||||
letters, optionally followed by colons, specifying that that letter
|
||||
takes an argument, to be placed in `optarg'.
|
||||
|
||||
If a letter in OPTS is followed by two colons, its argument is
|
||||
optional. This behavior is specific to the GNU `getopt'.
|
||||
|
||||
The argument `--' causes premature termination of argument
|
||||
scanning, explicitly telling `getopt' that there are no more
|
||||
options.
|
||||
|
||||
If OPTS begins with `--', then non-option arguments are treated as
|
||||
arguments to the option '\0'. This behavior is specific to the GNU
|
||||
`getopt'. */
|
||||
|
||||
#if (defined __STDC__ && __STDC__) || defined __cplusplus
|
||||
# ifdef __GNU_LIBRARY__
|
||||
/* Many other libraries have conflicting prototypes for getopt, with
|
||||
differences in the consts, in stdlib.h. To avoid compilation
|
||||
errors, only prototype getopt for the GNU C library. */
|
||||
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
|
||||
# else /* not __GNU_LIBRARY__ */
|
||||
extern int getopt ();
|
||||
# endif /* __GNU_LIBRARY__ */
|
||||
|
||||
# ifndef __need_getopt
|
||||
extern int getopt_long (int ___argc, char *const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind);
|
||||
extern int getopt_long_only (int ___argc, char *const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind);
|
||||
|
||||
/* Internal only. Users should not call this directly. */
|
||||
extern int _getopt_internal (int ___argc, char *const *___argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind,
|
||||
int __long_only);
|
||||
# endif
|
||||
#else /* not __STDC__ */
|
||||
extern int getopt ();
|
||||
# ifndef __need_getopt
|
||||
extern int getopt_long ();
|
||||
extern int getopt_long_only ();
|
||||
|
||||
extern int _getopt_internal ();
|
||||
# endif
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Make sure we later can get all the definitions and declarations. */
|
||||
#undef __need_getopt
|
||||
|
||||
#endif /* getopt.h */
|
|
@ -0,0 +1,198 @@
|
|||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
Modifications copyright (c) 2003 Philip Kendall
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
# include <getopt.h>
|
||||
#else
|
||||
# include "getopt.h"
|
||||
#endif
|
||||
|
||||
#if !defined __STDC__ || !__STDC__
|
||||
/* This is a separate conditional since some stdc systems
|
||||
reject `defined (const)'. */
|
||||
#ifndef const
|
||||
#define const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
Library, but also included in many other GNU distributions. Compiling
|
||||
and linking in this code is a waste when using the GNU C library
|
||||
(especially if it is a shared library). Rather than having every GNU
|
||||
program understand `configure --with-gnu-libc' and omit the object files,
|
||||
it is simpler to just do this in the source for each such file. */
|
||||
|
||||
#define GETOPT_INTERFACE_VERSION 2
|
||||
#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
|
||||
#include <gnu-versions.h>
|
||||
#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
|
||||
#define ELIDE_CODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ELIDE_CODE
|
||||
|
||||
|
||||
/* This needs to come after some library #include
|
||||
to get __GNU_LIBRARY__ defined. */
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
int
|
||||
getopt_long (argc, argv, options, long_options, opt_index)
|
||||
int argc;
|
||||
char *const *argv;
|
||||
const char *options;
|
||||
const struct option *long_options;
|
||||
int *opt_index;
|
||||
{
|
||||
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
|
||||
}
|
||||
|
||||
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
|
||||
If an option that starts with '-' (not '--') doesn't match a long option,
|
||||
but does match a short option, it is parsed as a short option
|
||||
instead. */
|
||||
|
||||
int
|
||||
getopt_long_only (argc, argv, options, long_options, opt_index)
|
||||
int argc;
|
||||
char *const *argv;
|
||||
const char *options;
|
||||
const struct option *long_options;
|
||||
int *opt_index;
|
||||
{
|
||||
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
|
||||
}
|
||||
|
||||
# ifdef _LIBC
|
||||
libc_hidden_def (getopt_long)
|
||||
libc_hidden_def (getopt_long_only)
|
||||
# endif
|
||||
|
||||
#endif /* Not ELIDE_CODE. */
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int c;
|
||||
int digit_optind = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
int this_option_optind = optind ? optind : 1;
|
||||
int option_index = 0;
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"add", 1, 0, 0},
|
||||
{"append", 0, 0, 0},
|
||||
{"delete", 1, 0, 0},
|
||||
{"verbose", 0, 0, 0},
|
||||
{"create", 0, 0, 0},
|
||||
{"file", 1, 0, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
c = getopt_long (argc, argv, "abc:d:0123456789",
|
||||
long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0:
|
||||
printf ("option %s", long_options[option_index].name);
|
||||
if (optarg)
|
||||
printf (" with arg %s", optarg);
|
||||
printf ("\n");
|
||||
break;
|
||||
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
case '3':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
case '7':
|
||||
case '8':
|
||||
case '9':
|
||||
if (digit_optind != 0 && digit_optind != this_option_optind)
|
||||
printf ("digits occur in two different argv-elements.\n");
|
||||
digit_optind = this_option_optind;
|
||||
printf ("option %c\n", c);
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
printf ("option a\n");
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
printf ("option b\n");
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
printf ("option c with value `%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
printf ("option d with value `%s'\n", optarg);
|
||||
break;
|
||||
|
||||
case '?':
|
||||
break;
|
||||
|
||||
default:
|
||||
printf ("?? getopt returned character code 0%o ??\n", c);
|
||||
}
|
||||
}
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
printf ("non-option ARGV-elements: ");
|
||||
while (optind < argc)
|
||||
printf ("%s ", argv[optind++]);
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
#endif /* TEST */
|
|
@ -0,0 +1,109 @@
|
|||
/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
Modifications (c) 2003 Philip Kendall
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#define uint64_t libspectrum_qword
|
||||
|
||||
/* These are the characters used in temporary filenames. */
|
||||
static const char letters[] =
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
/* Generate a temporary file name based on TMPL. TMPL must match the
|
||||
rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
|
||||
does not exist at the time of the call to __gen_tempname. TMPL is
|
||||
overwritten with the result.
|
||||
|
||||
We use a clever algorithm to get hard-to-predict names. */
|
||||
int
|
||||
mkstemp (char *tmpl)
|
||||
{
|
||||
int len;
|
||||
char *XXXXXX;
|
||||
static uint64_t value;
|
||||
uint64_t random_time_bits;
|
||||
unsigned int count;
|
||||
int fd = -1;
|
||||
int save_errno = errno;
|
||||
|
||||
/* A lower bound on the number of temporary files to attempt to
|
||||
generate. The maximum total number of temporary file names that
|
||||
can exist for a given template is 62**6. It should never be
|
||||
necessary to try all these combinations. Instead if a reasonable
|
||||
number of names is tried (we define reasonable as 62**3) fail to
|
||||
give the system administrator the chance to remove the problems. */
|
||||
unsigned int attempts = 62 * 62 * 62;
|
||||
|
||||
len = strlen (tmpl);
|
||||
if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* This is where the Xs start. */
|
||||
XXXXXX = &tmpl[len - 6];
|
||||
|
||||
/* Get some more or less random data. */
|
||||
value += time (NULL) ^ getpid ();
|
||||
|
||||
for (count = 0; count < attempts; value += 7777, ++count)
|
||||
{
|
||||
uint64_t v = value;
|
||||
|
||||
/* Fill in the random bits. */
|
||||
XXXXXX[0] = letters[v % 62];
|
||||
v /= 62;
|
||||
XXXXXX[1] = letters[v % 62];
|
||||
v /= 62;
|
||||
XXXXXX[2] = letters[v % 62];
|
||||
v /= 62;
|
||||
XXXXXX[3] = letters[v % 62];
|
||||
v /= 62;
|
||||
XXXXXX[4] = letters[v % 62];
|
||||
v /= 62;
|
||||
XXXXXX[5] = letters[v % 62];
|
||||
|
||||
fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL | O_BINARY, S_IRUSR | S_IWUSR);
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
errno = save_errno;
|
||||
return fd;
|
||||
}
|
||||
else if (errno != EEXIST)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* We got out of the loop because we ran out of combinations to try. */
|
||||
errno = EEXIST;
|
||||
return -1;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## Copyright (c) 2007-2008 Philip Kendall
|
||||
|
||||
## $Id: Makefile.am 3687 2008-06-23 11:55:23Z pak21 $
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
##
|
||||
## Author contact information:
|
||||
##
|
||||
## E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)/../..
|
||||
|
||||
noinst_LIBRARIES = libcompatos.a
|
||||
|
||||
libcompatos_a_SOURCES = ../unix/file.c \
|
||||
osname.c \
|
||||
../amiga/paths.c
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
|
@ -0,0 +1,515 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = compat/morphos
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
libcompatos_a_AR = $(AR) $(ARFLAGS)
|
||||
libcompatos_a_LIBADD =
|
||||
am_libcompatos_a_OBJECTS = file.$(OBJEXT) osname.$(OBJEXT) \
|
||||
paths.$(OBJEXT)
|
||||
libcompatos_a_OBJECTS = $(am_libcompatos_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libcompatos_a_SOURCES)
|
||||
DIST_SOURCES = $(libcompatos_a_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOLOAD_SNAPS = @AUTOLOAD_SNAPS@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPAT_OSNAME = @COMPAT_OSNAME@
|
||||
COMPAT_SUBDIR = @COMPAT_SUBDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_CONFIG = @GLIB_CONFIG@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSPEC_CFLAGS = @LIBSPEC_CFLAGS@
|
||||
LIBSPEC_LIBS = @LIBSPEC_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
|
||||
SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_CONFIG = @SDL_CONFIG@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOUND_LIBADD = @SOUND_LIBADD@
|
||||
SOUND_LIBS = @SOUND_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TIMER_LIBADD = @TIMER_LIBADD@
|
||||
UI = @UI@
|
||||
UI_LIBS = @UI_LIBS@
|
||||
VERSION = @VERSION@
|
||||
WIDGET = @WIDGET@
|
||||
WINDRES = @WINDRES@
|
||||
WINDRES_OBJ = @WINDRES_OBJ@
|
||||
XMKMF = @XMKMF@
|
||||
XML2_CONFIG = @XML2_CONFIG@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
AM_CPPFLAGS = -I$(srcdir)/../..
|
||||
noinst_LIBRARIES = libcompatos.a
|
||||
libcompatos_a_SOURCES = ../unix/file.c \
|
||||
osname.c \
|
||||
../amiga/paths.c
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign compat/morphos/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign compat/morphos/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libcompatos.a: $(libcompatos_a_OBJECTS) $(libcompatos_a_DEPENDENCIES)
|
||||
-rm -f libcompatos.a
|
||||
$(libcompatos_a_AR) libcompatos.a $(libcompatos_a_OBJECTS) $(libcompatos_a_LIBADD)
|
||||
$(RANLIB) libcompatos.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osname.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paths.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
file.o: ../unix/file.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.o -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.o `test -f '../unix/file.c' || echo '$(srcdir)/'`../unix/file.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../unix/file.c' object='file.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.o `test -f '../unix/file.c' || echo '$(srcdir)/'`../unix/file.c
|
||||
|
||||
file.obj: ../unix/file.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.obj -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.obj `if test -f '../unix/file.c'; then $(CYGPATH_W) '../unix/file.c'; else $(CYGPATH_W) '$(srcdir)/../unix/file.c'; fi`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../unix/file.c' object='file.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.obj `if test -f '../unix/file.c'; then $(CYGPATH_W) '../unix/file.c'; else $(CYGPATH_W) '$(srcdir)/../unix/file.c'; fi`
|
||||
|
||||
paths.o: ../amiga/paths.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT paths.o -MD -MP -MF $(DEPDIR)/paths.Tpo -c -o paths.o `test -f '../amiga/paths.c' || echo '$(srcdir)/'`../amiga/paths.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/paths.Tpo $(DEPDIR)/paths.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../amiga/paths.c' object='paths.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o paths.o `test -f '../amiga/paths.c' || echo '$(srcdir)/'`../amiga/paths.c
|
||||
|
||||
paths.obj: ../amiga/paths.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT paths.obj -MD -MP -MF $(DEPDIR)/paths.Tpo -c -o paths.obj `if test -f '../amiga/paths.c'; then $(CYGPATH_W) '../amiga/paths.c'; else $(CYGPATH_W) '$(srcdir)/../amiga/paths.c'; fi`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/paths.Tpo $(DEPDIR)/paths.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../amiga/paths.c' object='paths.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o paths.obj `if test -f '../amiga/paths.c'; then $(CYGPATH_W) '../amiga/paths.c'; else $(CYGPATH_W) '$(srcdir)/../amiga/paths.c'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,36 @@
|
|||
/* osname.c: Get a representation of the OS we're running on
|
||||
Copyright (c) 1999-2007 Philip Kendall
|
||||
|
||||
$Id: osname.c 3139 2007-09-03 10:27:57Z fredm $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int compat_osname( char *buffer, size_t length )
|
||||
{
|
||||
snprintf( buffer, length, "%s %s %s", "MorphOS", "Pegasos", "1.4.4" );
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## Copyright (c) 2007-2008 Philip Kendall
|
||||
|
||||
## $Id: Makefile.am 3687 2008-06-23 11:55:23Z pak21 $
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
##
|
||||
## Author contact information:
|
||||
##
|
||||
## E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)/../..
|
||||
|
||||
noinst_LIBRARIES = libcompatos.a
|
||||
|
||||
libcompatos_a_SOURCES = file.c \
|
||||
osname.c \
|
||||
paths.c
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
|
@ -0,0 +1,487 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = compat/unix
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
libcompatos_a_AR = $(AR) $(ARFLAGS)
|
||||
libcompatos_a_LIBADD =
|
||||
am_libcompatos_a_OBJECTS = file.$(OBJEXT) osname.$(OBJEXT) \
|
||||
paths.$(OBJEXT)
|
||||
libcompatos_a_OBJECTS = $(am_libcompatos_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libcompatos_a_SOURCES)
|
||||
DIST_SOURCES = $(libcompatos_a_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOLOAD_SNAPS = @AUTOLOAD_SNAPS@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPAT_OSNAME = @COMPAT_OSNAME@
|
||||
COMPAT_SUBDIR = @COMPAT_SUBDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_CONFIG = @GLIB_CONFIG@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSPEC_CFLAGS = @LIBSPEC_CFLAGS@
|
||||
LIBSPEC_LIBS = @LIBSPEC_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
|
||||
SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_CONFIG = @SDL_CONFIG@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOUND_LIBADD = @SOUND_LIBADD@
|
||||
SOUND_LIBS = @SOUND_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TIMER_LIBADD = @TIMER_LIBADD@
|
||||
UI = @UI@
|
||||
UI_LIBS = @UI_LIBS@
|
||||
VERSION = @VERSION@
|
||||
WIDGET = @WIDGET@
|
||||
WINDRES = @WINDRES@
|
||||
WINDRES_OBJ = @WINDRES_OBJ@
|
||||
XMKMF = @XMKMF@
|
||||
XML2_CONFIG = @XML2_CONFIG@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
AM_CPPFLAGS = -I$(srcdir)/../..
|
||||
noinst_LIBRARIES = libcompatos.a
|
||||
libcompatos_a_SOURCES = file.c \
|
||||
osname.c \
|
||||
paths.c
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign compat/unix/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign compat/unix/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libcompatos.a: $(libcompatos_a_OBJECTS) $(libcompatos_a_DEPENDENCIES)
|
||||
-rm -f libcompatos.a
|
||||
$(libcompatos_a_AR) libcompatos.a $(libcompatos_a_OBJECTS) $(libcompatos_a_LIBADD)
|
||||
$(RANLIB) libcompatos.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osname.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paths.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,108 @@
|
|||
/* file.c: File-related compatibility routines
|
||||
Copyright (c) 2008 Philip Kendall
|
||||
|
||||
$Id: file.c 3894 2008-12-10 09:45:32Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "compat.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
/* Certain brain damaged operating systems (DOS/Windows) treat text
|
||||
and binary files different in open(2) and need to be given the
|
||||
O_BINARY flag to tell them it's a binary file */
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif /* #ifndef O_BINARY */
|
||||
|
||||
const compat_fd COMPAT_FILE_OPEN_FAILED = -1;
|
||||
|
||||
compat_fd
|
||||
compat_file_open( const char *path, int write )
|
||||
{
|
||||
int flags = O_BINARY;
|
||||
flags |= write ? O_WRONLY | O_CREAT | O_TRUNC : O_RDONLY;
|
||||
return open( path, flags, 0666 );
|
||||
}
|
||||
|
||||
off_t
|
||||
compat_file_get_length( compat_fd fd )
|
||||
{
|
||||
struct stat file_info;
|
||||
|
||||
if( fstat( fd, &file_info ) ) {
|
||||
ui_error( UI_ERROR_ERROR, "couldn't stat file: %s", strerror( errno ) );
|
||||
return -1;
|
||||
}
|
||||
|
||||
return file_info.st_size;
|
||||
}
|
||||
|
||||
int
|
||||
compat_file_read( compat_fd fd, utils_file *file )
|
||||
{
|
||||
ssize_t bytes = read( fd, file->buffer, file->length );
|
||||
if( bytes != file->length ) {
|
||||
if( bytes == -1 ) {
|
||||
ui_error( UI_ERROR_ERROR, "error reading file: %s", strerror( errno ) );
|
||||
} else {
|
||||
ui_error( UI_ERROR_ERROR,
|
||||
"error reading file: expected %ld bytes, but read only %ld",
|
||||
(unsigned long)file->length, (unsigned long)bytes );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
compat_file_write( compat_fd fd, const unsigned char *buffer, size_t length )
|
||||
{
|
||||
ssize_t bytes = write( fd, buffer, length );
|
||||
if( bytes != length ) {
|
||||
if( bytes == -1 ) {
|
||||
ui_error( UI_ERROR_ERROR, "error writing file: %s", strerror( errno ) );
|
||||
} else {
|
||||
ui_error( UI_ERROR_ERROR,
|
||||
"error writing file: expected %ld bytes, but wrote only %ld",
|
||||
(unsigned long)length, (unsigned long)bytes );
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
compat_file_close( compat_fd fd )
|
||||
{
|
||||
return close( fd );
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/* osname.c: Get a representation of the OS we're running on
|
||||
Copyright (c) 1999-2007 Philip Kendall
|
||||
|
||||
$Id: osname.c 3626 2008-05-23 10:30:30Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include "ui/ui.h"
|
||||
|
||||
int compat_osname( char *buffer, size_t length )
|
||||
{
|
||||
struct utsname osname;
|
||||
int error;
|
||||
|
||||
error = uname( &osname );
|
||||
if( error < 0 ) {
|
||||
ui_error( UI_ERROR_ERROR, "error getting system information: %s",
|
||||
strerror( errno ) );
|
||||
return 1;
|
||||
}
|
||||
|
||||
snprintf( buffer, length, "%s %s %s", osname.sysname, osname.machine,
|
||||
osname.release );
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/* paths.c: Path-related compatibility routines
|
||||
Copyright (c) 1999-2007 Philip Kendall
|
||||
|
||||
$Id: paths.c 3253 2007-10-26 02:02:17Z zubzero $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
const char*
|
||||
compat_get_temp_path( void )
|
||||
{
|
||||
const char *dir;
|
||||
|
||||
/* Use TMPDIR if specified, if not /tmp */
|
||||
dir = getenv( "TMPDIR" ); if( dir ) return dir;
|
||||
return "/tmp";
|
||||
}
|
||||
|
||||
const char*
|
||||
compat_get_home_path( void )
|
||||
{
|
||||
const char *dir;
|
||||
dir = getenv( "HOME" ); if( dir ) return dir;
|
||||
return ".";
|
||||
}
|
||||
|
||||
int
|
||||
compat_is_absolute_path( const char *path )
|
||||
{
|
||||
return path[0] == '/';
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## Copyright (c) 2007-2008 Philip Kendall
|
||||
|
||||
## $Id: Makefile.am 3687 2008-06-23 11:55:23Z pak21 $
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
##
|
||||
## Author contact information:
|
||||
##
|
||||
## E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)/../..
|
||||
|
||||
noinst_LIBRARIES = libcompatos.a
|
||||
|
||||
libcompatos_a_SOURCES = ../unix/file.c \
|
||||
osname.c \
|
||||
paths.c
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
|
@ -0,0 +1,501 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = compat/win32
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
libcompatos_a_AR = $(AR) $(ARFLAGS)
|
||||
libcompatos_a_LIBADD =
|
||||
am_libcompatos_a_OBJECTS = file.$(OBJEXT) osname.$(OBJEXT) \
|
||||
paths.$(OBJEXT)
|
||||
libcompatos_a_OBJECTS = $(am_libcompatos_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libcompatos_a_SOURCES)
|
||||
DIST_SOURCES = $(libcompatos_a_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOLOAD_SNAPS = @AUTOLOAD_SNAPS@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPAT_OSNAME = @COMPAT_OSNAME@
|
||||
COMPAT_SUBDIR = @COMPAT_SUBDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_CONFIG = @GLIB_CONFIG@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSPEC_CFLAGS = @LIBSPEC_CFLAGS@
|
||||
LIBSPEC_LIBS = @LIBSPEC_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
|
||||
SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_CONFIG = @SDL_CONFIG@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOUND_LIBADD = @SOUND_LIBADD@
|
||||
SOUND_LIBS = @SOUND_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TIMER_LIBADD = @TIMER_LIBADD@
|
||||
UI = @UI@
|
||||
UI_LIBS = @UI_LIBS@
|
||||
VERSION = @VERSION@
|
||||
WIDGET = @WIDGET@
|
||||
WINDRES = @WINDRES@
|
||||
WINDRES_OBJ = @WINDRES_OBJ@
|
||||
XMKMF = @XMKMF@
|
||||
XML2_CONFIG = @XML2_CONFIG@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
AM_CPPFLAGS = -I$(srcdir)/../..
|
||||
noinst_LIBRARIES = libcompatos.a
|
||||
libcompatos_a_SOURCES = ../unix/file.c \
|
||||
osname.c \
|
||||
paths.c
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign compat/win32/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign compat/win32/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libcompatos.a: $(libcompatos_a_OBJECTS) $(libcompatos_a_DEPENDENCIES)
|
||||
-rm -f libcompatos.a
|
||||
$(libcompatos_a_AR) libcompatos.a $(libcompatos_a_OBJECTS) $(libcompatos_a_LIBADD)
|
||||
$(RANLIB) libcompatos.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osname.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paths.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
file.o: ../unix/file.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.o -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.o `test -f '../unix/file.c' || echo '$(srcdir)/'`../unix/file.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../unix/file.c' object='file.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.o `test -f '../unix/file.c' || echo '$(srcdir)/'`../unix/file.c
|
||||
|
||||
file.obj: ../unix/file.c
|
||||
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT file.obj -MD -MP -MF $(DEPDIR)/file.Tpo -c -o file.obj `if test -f '../unix/file.c'; then $(CYGPATH_W) '../unix/file.c'; else $(CYGPATH_W) '$(srcdir)/../unix/file.c'; fi`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/file.Tpo $(DEPDIR)/file.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../unix/file.c' object='file.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o file.obj `if test -f '../unix/file.c'; then $(CYGPATH_W) '../unix/file.c'; else $(CYGPATH_W) '$(srcdir)/../unix/file.c'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,58 @@
|
|||
/* osname.c: Get a representation of the OS we're running on
|
||||
Copyright (c) 1999-2007 Philip Kendall
|
||||
|
||||
$Id: osname.c 3315 2007-11-20 03:01:59Z zubzero $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "ui/ui.h"
|
||||
|
||||
int compat_osname( char *osname, size_t length )
|
||||
{
|
||||
OSVERSIONINFO buf;
|
||||
char *windows_name;
|
||||
int error;
|
||||
|
||||
buf.dwOSVersionInfoSize = sizeof( buf );
|
||||
error = GetVersionEx( &buf );
|
||||
if( error == 0 ) {
|
||||
ui_error( UI_ERROR_ERROR, "error getting system information." );
|
||||
return 1;
|
||||
}
|
||||
|
||||
switch( buf.dwPlatformId ) {
|
||||
case VER_PLATFORM_WIN32_NT: windows_name = "NT"; break;
|
||||
case VER_PLATFORM_WIN32_WINDOWS: windows_name = "95/98"; break;
|
||||
case VER_PLATFORM_WIN32s: windows_name = "3.1"; break;
|
||||
default: windows_name = "unknown"; break;
|
||||
}
|
||||
|
||||
/* The casts to int work around a suspected Wine (or MinGW) bug */
|
||||
snprintf( osname, length, "Windows %s %i.%i build %i %s",
|
||||
windows_name, (int)buf.dwMajorVersion, (int)buf.dwMinorVersion,
|
||||
(int)buf.dwBuildNumber, buf.szCSDVersion );
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/* paths.c: Path-related compatibility routines
|
||||
Copyright (c) 1999-2007 Philip Kendall
|
||||
|
||||
$Id: paths.c 3253 2007-10-26 02:02:17Z zubzero $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
const char*
|
||||
compat_get_temp_path( void )
|
||||
{
|
||||
const char *dir;
|
||||
|
||||
/* Something close to this algorithm specified at
|
||||
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/gettemppath.asp
|
||||
*/
|
||||
dir = getenv( "TMP" ); if( dir ) return dir;
|
||||
dir = getenv( "TEMP" ); if( dir ) return dir;
|
||||
return ".";
|
||||
}
|
||||
|
||||
const char*
|
||||
compat_get_home_path( void )
|
||||
{
|
||||
const char *dir;
|
||||
dir = getenv( "USERPROFILE" ); if( dir ) return dir;
|
||||
dir = getenv( "WINDIR" ); if( dir ) return dir;
|
||||
return ".";
|
||||
}
|
||||
|
||||
int
|
||||
compat_is_absolute_path( const char *path )
|
||||
{
|
||||
if( path[0] == '\\' ) return 1;
|
||||
if( path[0] && path[1] == ':' ) return 1;
|
||||
return 0;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,180 @@
|
|||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* DirectX 7 or higher is required */
|
||||
#undef DIRECTSOUND_VERSION
|
||||
|
||||
/* Define to 1 if you have the `dirname' function. */
|
||||
#undef HAVE_DIRNAME
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Defined if we've got enough memory to compile z80_ops.c */
|
||||
#undef HAVE_ENOUGH_MEMORY
|
||||
|
||||
/* Define to 1 if you have the `fsync' function. */
|
||||
#undef HAVE_FSYNC
|
||||
|
||||
/* Define to 1 if you have the `geteuid' function. */
|
||||
#undef HAVE_GETEUID
|
||||
|
||||
/* Define to 1 if you have the `getopt_long' function. */
|
||||
#undef HAVE_GETOPT_LONG
|
||||
|
||||
/* Defined if gpm in use */
|
||||
#undef HAVE_GPM_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <jsw.h> header file. */
|
||||
#undef HAVE_JSW_H
|
||||
|
||||
/* Define to 1 if you have the <libgen.h> header file. */
|
||||
#undef HAVE_LIBGEN_H
|
||||
|
||||
/* Define to 1 if you have the <libspectrum.h> header file. */
|
||||
#undef HAVE_LIBSPECTRUM_H
|
||||
|
||||
/* Defined if we've got glib */
|
||||
#undef HAVE_LIB_GLIB
|
||||
|
||||
/* Defined if we've got libxml2 */
|
||||
#undef HAVE_LIB_XML2
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `mkstemp' function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define to 1 if you have libsamplerate. */
|
||||
#undef HAVE_SAMPLERATE
|
||||
|
||||
/* Define to 1 if you have the <siginfo.h> header file. */
|
||||
#undef HAVE_SIGINFO_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/audioio.h> header file. */
|
||||
#undef HAVE_SYS_AUDIOIO_H
|
||||
|
||||
/* Define to 1 if you have the <sys/audio.h> header file. */
|
||||
#undef HAVE_SYS_AUDIO_H
|
||||
|
||||
/* Define to 1 if you have the <sys/soundcard.h> header file. */
|
||||
#undef HAVE_SYS_SOUNDCARD_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/XShm.h> header file. */
|
||||
#undef HAVE_X11_EXTENSIONS_XSHM_H
|
||||
|
||||
/* Defined if no sound code is present */
|
||||
#undef NO_SOUND
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Location of the ROM images */
|
||||
#undef ROMSDIR
|
||||
|
||||
/* Defined if the sound code uses a fifo */
|
||||
#undef SOUND_FIFO
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* The header needed to define the timer type */
|
||||
#undef TIMER_HEADER
|
||||
|
||||
/* The type needed for the timer routines */
|
||||
#undef TIMER_TYPE
|
||||
|
||||
/* Defined if framebuffer UI in use */
|
||||
#undef UI_FB
|
||||
|
||||
/* Defined if GTK+ UI (either 1.2 or 2.x) is in use */
|
||||
#undef UI_GTK
|
||||
|
||||
/* Defined if the SDL UI in use */
|
||||
#undef UI_SDL
|
||||
|
||||
/* Defined if svgalib UI in use */
|
||||
#undef UI_SVGA
|
||||
|
||||
/* Defined if Win32 UI in use */
|
||||
#undef UI_WIN32
|
||||
|
||||
/* Defined if Xlib UI in use */
|
||||
#undef UI_X
|
||||
|
||||
/* Defined if we're using hardware joysticks */
|
||||
#undef USE_JOYSTICK
|
||||
|
||||
/* Defined if we're going to be using the installed libpng */
|
||||
#undef USE_LIBPNG
|
||||
|
||||
/* Defined if we're using a widget-based UI */
|
||||
#undef USE_WIDGET
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Minimal supported version of Windows is 95 or NT4 */
|
||||
#undef WINVER
|
||||
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
||||
|
||||
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
||||
`char[]'. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
/* Internet Explorer is 4.0 or higher is required */
|
||||
#undef _WIN32_IE
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
#ifndef __cplusplus
|
||||
#undef inline
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,662 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl $Id: configure.in 3957 2009-01-14 19:52:20Z pak21 $
|
||||
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
dnl the Free Software Foundation; either version 2 of the License, or
|
||||
dnl (at your option) any later version.
|
||||
dnl
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU General Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License along
|
||||
dnl with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
dnl
|
||||
dnl Author contact information:
|
||||
dnl
|
||||
dnl E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AC_INIT(fuse.c)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
dnl Use automake to produce `Makefile.in'
|
||||
AM_INIT_AUTOMAKE(fuse, 0.10.0.2)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_RANLIB
|
||||
AC_PATH_PROG(PERL, perl)
|
||||
AC_SUBST(PERL)
|
||||
AM_PROG_LEX
|
||||
AC_PROG_YACC
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
dnl Check for Win32 resource tool
|
||||
AC_CHECK_TOOL(WINDRES, windres, no)
|
||||
AC_SUBST(WINDRES)
|
||||
if test "$WINDRES" != no; then
|
||||
WINDRES_OBJ="windres.o"
|
||||
fi
|
||||
AC_SUBST(WINDRES_OBJ)
|
||||
|
||||
dnl Generate commandy.h
|
||||
YFLAGS="$YFLAGS -d"
|
||||
AC_SUBST(YFLAGS)
|
||||
|
||||
dnl Check for big endianness
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(
|
||||
libgen.h \
|
||||
siginfo.h \
|
||||
strings.h \
|
||||
sys/soundcard.h \
|
||||
sys/audio.h \
|
||||
sys/audioio.h
|
||||
)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_INLINE
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_CHECK_FUNCS(dirname geteuid getopt_long mkstemp fsync)
|
||||
|
||||
dnl Allow the user to say that various libraries are in one place
|
||||
AC_ARG_WITH(local-prefix,
|
||||
[ --with-local-prefix=PFX local libraries installed in PFX (optional)],
|
||||
CPPFLAGS="$CPPFLAGS -I$withval/include"; LDFLAGS="$LDFLAGS -L$withval/lib",
|
||||
if test "$prefix" != "NONE"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$prefix/include"; LDFLAGS="$LDFLAGS -L$prefix/lib"
|
||||
fi)
|
||||
|
||||
dnl Select a user interface
|
||||
|
||||
dnl Try various UI options; set the `ui' variable when we've got one
|
||||
dnl we like, and then don't look at the other options
|
||||
|
||||
AC_PATH_XTRA
|
||||
|
||||
dnl Look for Win32 UI (default=no)
|
||||
AC_MSG_CHECKING(whether Win32 UI requested)
|
||||
AC_ARG_WITH(win32,
|
||||
[ --with-win32 use Win32 for user interface],
|
||||
if test "$withval" = no; then win32=no; else win32=yes; fi,
|
||||
win32=no)
|
||||
AC_MSG_RESULT($win32)
|
||||
if test "$win32" = yes; then
|
||||
AC_CHECK_HEADER(windows.h,
|
||||
LIBS="$LIBS -mwindows -lcomctl32";
|
||||
AC_DEFINE([UI_WIN32], 1, [Defined if Win32 UI in use])
|
||||
AC_DEFINE([WINVER], 0x0400, [Minimal supported version of Windows is 95 or NT4])
|
||||
AC_DEFINE([_WIN32_IE], 0x400, [Internet Explorer is 4.0 or higher is required])
|
||||
UI=win32; UI_LIBS="ui/win32/libuiwin32.a",
|
||||
AC_MSG_ERROR([Win32 UI not found]))
|
||||
fi
|
||||
|
||||
dnl Look for svgalib (default=no)
|
||||
AC_MSG_CHECKING(whether svgalib UI requested)
|
||||
AC_ARG_WITH(svgalib,
|
||||
[ --with-svgalib use svgalib for user interface],
|
||||
if test "$withval" = no; then svgalib=no; else svgalib=yes; fi,
|
||||
svgalib=no)
|
||||
AC_MSG_RESULT($svgalib)
|
||||
if test "$svgalib" = yes; then
|
||||
AC_CHECK_HEADER(vga.h,
|
||||
LIBS="$LIBS -lvga";
|
||||
AC_DEFINE([UI_SVGA], 1, [Defined if svgalib UI in use])
|
||||
AC_DEFINE([USE_WIDGET], 1,
|
||||
[Defined if we're using a widget-based UI])
|
||||
UI=svga; WIDGET=widget;
|
||||
UI_LIBS="ui/svga/libuisvga.a ui/widget/libwidget.a",
|
||||
AC_MSG_ERROR([svgalib not found]))
|
||||
fi
|
||||
|
||||
dnl Look for framebuffer interface for SA1110 (default=no)
|
||||
if test -z "$UI"; then
|
||||
AC_MSG_CHECKING(whether framebuffer UI requested)
|
||||
AC_ARG_WITH(fb,
|
||||
[ --with-fb use framebuffer for user interface],
|
||||
if test "$withval" = no; then fb=no; else fb=yes; fi,
|
||||
fb=no)
|
||||
AC_MSG_RESULT($fb)
|
||||
if test "$fb" = yes; then
|
||||
AC_DEFINE([UI_FB], 1, [Defined if framebuffer UI in use])
|
||||
AC_DEFINE([USE_WIDGET], 1, [Defined if we're using a widget-based UI])
|
||||
UI=fb; WIDGET=widget;
|
||||
UI_LIBS="ui/fb/libuifb.a ui/widget/libwidget.a"
|
||||
dnl Look for libgpm (default=yes)
|
||||
AC_MSG_CHECKING(whether gpm requested)
|
||||
AC_ARG_WITH(gpm,
|
||||
[ --without-gpm don't use libgpm for e.g. Kempston mouse],
|
||||
if test "$withval" = no; then gpm=no; else gpm=yes; fi,
|
||||
gpm=yes)
|
||||
AC_MSG_RESULT($gpm)
|
||||
dnl Note: we use libdl to get libgpm at runtime
|
||||
if test "$gpm" = yes; then
|
||||
AC_CHECK_HEADER(gpm.h,
|
||||
UI_LIBS="$UI_LIBS -ldl";
|
||||
AC_DEFINE([HAVE_GPM_H], 1, [Defined if gpm in use]),
|
||||
AC_MSG_ERROR([libgpm not found]))
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Look for SDL (default=no)
|
||||
if test -z "$UI"; then
|
||||
AC_MSG_CHECKING(whether SDL UI requested)
|
||||
AC_ARG_WITH(sdl,
|
||||
[ --with-sdl use SDL for user interface],
|
||||
if test "$withval" = no; then sdl=no; else sdl=yes; fi,
|
||||
sdl=no)
|
||||
AC_MSG_RESULT($sdl)
|
||||
if test "$sdl" = yes; then
|
||||
SDL_VERSION=1.2.4
|
||||
AM_PATH_SDL($SDL_VERSION,
|
||||
AC_DEFINE([UI_SDL], 1, [Defined if the SDL UI in use])
|
||||
AC_DEFINE([USE_WIDGET], 1,
|
||||
[Defined if we're using a widget-based UI])
|
||||
UI=sdl; WIDGET=widget;
|
||||
UI_LIBS="ui/sdl/libuisdl.a ui/widget/libwidget.a",
|
||||
AC_MSG_ERROR([SDL version $SDL_VERSION not found]))
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Look for GTK+ (default=yes)
|
||||
if test -z "$UI"; then
|
||||
AC_MSG_CHECKING(whether GTK+ UI requested)
|
||||
AC_ARG_WITH(gtk,
|
||||
[ --without-gtk don't use GTK+ for user interface],
|
||||
if test "$withval" = no; then gtk=no; else gtk=yes; fi,
|
||||
gtk=yes)
|
||||
AC_MSG_RESULT($gtk)
|
||||
if test "$gtk" = yes; then
|
||||
AM_PATH_GTK_2_0(2.0.0,
|
||||
AC_DEFINE([UI_GTK], 1,
|
||||
[Defined if GTK+ UI (either 1.2 or 2.x) is in use])
|
||||
AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib])
|
||||
UI=gtk; UI_LIBS="ui/gtk/libuigtk.la",
|
||||
AC_MSG_WARN([GTK+ not found. Reverting to Xlib]))
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$UI" = gtk; then
|
||||
AC_PATH_XTRA
|
||||
fi
|
||||
|
||||
dnl Look for Xlib UI (default=yes)
|
||||
if test -z "$UI"; then
|
||||
if test "$with_x" = no; then
|
||||
AC_MSG_ERROR([Please specify --with-svgalib or --with-fb, not --without-x.])
|
||||
fi
|
||||
AC_PATH_XTRA
|
||||
CFLAGS="$CFLAGS $X_CFLAGS";
|
||||
LDFLAGS="$LDFLAGS $X_LIBS";
|
||||
LIBS="$LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS";
|
||||
|
||||
dnl This apparently needed for SVR4 systems to link correctly
|
||||
dnl Basically the same as a part of AC_PATH_XTRA, but using `gethostname'
|
||||
dnl instead of `gethostbyname'.
|
||||
dnl Thanks to Erik Kunze for pointing out this problem
|
||||
AC_CHECK_FUNC(gethostname)
|
||||
if test $ac_cv_func_gethostname = no; then
|
||||
AC_CHECK_LIB(nsl, gethostname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
|
||||
fi
|
||||
AC_CHECK_FUNC(connect)
|
||||
if test $ac_cv_func_connect = no; then
|
||||
AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
|
||||
$X_EXTRA_LIBS)
|
||||
fi
|
||||
|
||||
dnl Check for the MIT-SHM extension
|
||||
AC_CHECK_HEADERS( X11/extensions/XShm.h )
|
||||
AC_CHECK_LIB( Xext, XShmAttach, LIBS="$LIBS -lXext" )
|
||||
|
||||
AC_DEFINE([UI_X], 1, [Defined if Xlib UI in use])
|
||||
UI=xlib; WIDGET=widget;
|
||||
AC_DEFINE([USE_WIDGET], 1, [Defined if we're using a widget-based UI])
|
||||
UI_LIBS="ui/xlib/libuixlib.a ui/widget/libwidget.a"
|
||||
fi
|
||||
|
||||
AC_SUBST(UI)
|
||||
AC_SUBST(UI_LIBS)
|
||||
AC_SUBST(WIDGET)
|
||||
|
||||
# If we're not using GTK+, must either find glib or use the replacement
|
||||
# (as supplied by libspectrum)
|
||||
if test "$UI" != gtk; then
|
||||
AC_MSG_CHECKING(whether to use glib)
|
||||
AC_ARG_WITH(glib,
|
||||
[ --without-glib don't use glib],
|
||||
if test "$withval" = no; then glib=no; else glib=yes; fi,
|
||||
glib=yes)
|
||||
AC_MSG_RESULT($glib)
|
||||
if test "$glib" = yes; then
|
||||
glib2=no
|
||||
AM_PATH_GLIB_2_0(
|
||||
2.0.0,
|
||||
glib2=yes
|
||||
AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib])
|
||||
LIBS="$LIBS `pkg-config --libs glib-2.0`",
|
||||
)
|
||||
if test "$glib2" = no; then
|
||||
AM_PATH_GLIB(
|
||||
1.2.0,
|
||||
AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib])
|
||||
LIBS="$LIBS `glib-config --libs`",
|
||||
AC_MSG_WARN(glib not found - using libspectrum's replacement)
|
||||
)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Check that libspectrum is available
|
||||
AC_ARG_WITH(libspectrum-prefix,
|
||||
[ --with-libspectrum-prefix=PFX where libspectrum is installed (optional)],
|
||||
LIBSPEC_CFLAGS=-I$withval/include; LIBSPEC_LIBS=-L$withval/lib,
|
||||
LIBSPEC_CFLAGS=""; LIBSPEC_LIBS="")
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $LIBSPEC_CFLAGS $GTK_CFLAGS $GLIB_CFLAGS"
|
||||
AC_CHECK_HEADERS(libspectrum.h,LIBSPEC_LIBS="$LIBSPEC_LIBS -lspectrum",
|
||||
AC_MSG_ERROR(Sorry - I need libspectrum to be available))
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
AC_SUBST(LIBSPEC_CFLAGS)
|
||||
AC_SUBST(LIBSPEC_LIBS)
|
||||
|
||||
dnl Check if supplied libspectrum has support for compressed szx files
|
||||
AC_MSG_CHECKING(whether libspectrum supports compressed szx snaps)
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $LIBSPEC_CFLAGS"
|
||||
AC_TRY_COMPILE([#include <libspectrum.h>],[
|
||||
void test()
|
||||
{
|
||||
int test = LIBSPECTRUM_SUPPORTS_ZLIB_COMPRESSION;
|
||||
}
|
||||
],
|
||||
AUTOLOAD_SNAPS=compressed; AC_MSG_RESULT(yes),
|
||||
AUTOLOAD_SNAPS=uncompressed; AC_MSG_RESULT(no))
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
AC_SUBST(AUTOLOAD_SNAPS)
|
||||
AC_LINK_FILES([
|
||||
lib/"$AUTOLOAD_SNAPS"/disk_plus3.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_128.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_16.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_2048.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_2068.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_48.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_plus2.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_plus2a.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_plus3.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_plus3e.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_pentagon.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_scorpion.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_se.szx
|
||||
lib/"$AUTOLOAD_SNAPS"/tape_ts2068.szx],
|
||||
[lib/disk_plus3.szx
|
||||
lib/tape_128.szx
|
||||
lib/tape_16.szx
|
||||
lib/tape_2048.szx
|
||||
lib/tape_2068.szx
|
||||
lib/tape_48.szx
|
||||
lib/tape_plus2.szx
|
||||
lib/tape_plus2a.szx
|
||||
lib/tape_plus3.szx
|
||||
lib/tape_plus3e.szx
|
||||
lib/tape_pentagon.szx
|
||||
lib/tape_scorpion.szx
|
||||
lib/tape_se.szx
|
||||
lib/tape_ts2068.szx])
|
||||
|
||||
dnl Check if a version of libpng which supplies png_write_png is available
|
||||
AC_CHECK_LIB( png, png_write_png,
|
||||
[AC_CHECK_HEADER(
|
||||
png.h,
|
||||
[AC_DEFINE([USE_LIBPNG], 1, [Defined if we're going to be using the installed libpng]) PNG_LIBS='-lpng -lm -lz'],
|
||||
[AC_MSG_WARN(png.h not found - saving screenshots disabled)]
|
||||
)],
|
||||
[AC_MSG_WARN(png_write_png not found - saving screenshots disabled)],
|
||||
[-lm -lz]
|
||||
)
|
||||
AC_SUBST(PNG_LIBS)
|
||||
|
||||
dnl Check if a version of libasound which supplies pcm is available
|
||||
AC_MSG_CHECKING(whether ALSA requested)
|
||||
AC_ARG_WITH(alsa,
|
||||
[ --without-alsa don't use libasound (ALSA)],
|
||||
if test "$withval" = no; then libasound=no; else libasound=yes; fi,
|
||||
libasound=yes)
|
||||
AC_MSG_RESULT($libasound)
|
||||
if test "$libasound" = yes; then
|
||||
AC_CHECK_LIB( asound, snd_pcm_hw_params_set_period_size_near,
|
||||
[AC_CHECK_HEADER(
|
||||
alsa/asoundlib.h,
|
||||
[alsa_available=yes],
|
||||
[AC_MSG_WARN(alsa/asoundlib.h not found - no ALSA output)]
|
||||
)],
|
||||
[AC_MSG_WARN(snd_pcm_hw_params_set_period_size_near not found - no ALSA output)]
|
||||
)
|
||||
fi
|
||||
|
||||
dnl Check if a version of libao which supplies ao_open_live is available
|
||||
AC_MSG_CHECKING(whether libao requested)
|
||||
AC_ARG_WITH(libao,
|
||||
[ --with-libao use libao for sound output],
|
||||
if test "$withval" = no; then libao=no; else libao=yes; fi,
|
||||
libao=no)
|
||||
AC_MSG_RESULT($libao)
|
||||
if test "$libao" = yes; then
|
||||
AC_CHECK_LIB( ao, ao_open_live,
|
||||
[AC_CHECK_HEADER(
|
||||
ao/ao.h,
|
||||
[ao_available=yes],
|
||||
[AC_MSG_WARN(ao/ao.h not found - no libao sound output)]
|
||||
)],
|
||||
[AC_MSG_WARN(ao_open_live not found - no libao sound output)]
|
||||
)
|
||||
fi
|
||||
|
||||
dnl Check if DirectSound is available
|
||||
AC_CHECK_HEADER(
|
||||
dsound.h,
|
||||
[dxsound_available=yes],
|
||||
[AC_MSG_WARN(dsound.h not found - no DirectSound output)],
|
||||
[#define DIRECTSOUND_VERSION 0x0700]
|
||||
)
|
||||
|
||||
dnl Check if MS Windows Multimedia API sound is available
|
||||
AC_CHECK_HEADER(
|
||||
mmsystem.h,
|
||||
[win32sound_available=yes],
|
||||
[AC_MSG_WARN(mmsystem.h not found - no MS Windows Multimedia API sound output)],
|
||||
[#include <windows.h>]
|
||||
)
|
||||
|
||||
dnl Check if libsamplerate is available
|
||||
AC_MSG_CHECKING(whether libsamplerate support requested)
|
||||
AC_ARG_WITH(libsamplerate,
|
||||
[ --without-libsamplerate don't use libsamplerate],
|
||||
if test "$withval" = no; then libsamplerate=no; else libsamplerate=yes; fi,
|
||||
libsamplerate=yes)
|
||||
AC_MSG_RESULT($libsamplerate)
|
||||
if test "$libsamplerate" = yes; then
|
||||
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.0,
|
||||
AC_DEFINE([HAVE_SAMPLERATE],1,[Define to 1 if you have libsamplerate.]),
|
||||
[AC_MSG_NOTICE([libsamplerate not present.])])
|
||||
fi
|
||||
|
||||
AC_SUBST(SAMPLERATE_CFLAGS)
|
||||
AC_SUBST(SAMPLERATE_LIBS)
|
||||
|
||||
dnl Check if CoreAudio is available
|
||||
AC_CHECK_HEADER(
|
||||
CoreAudio/AudioHardware.h,
|
||||
[coreaudio_available=yes],
|
||||
[AC_MSG_WARN(CoreAudio/AudioHardware.h not found - no CoreAudio sound output)]
|
||||
)
|
||||
|
||||
dnl
|
||||
dnl Decide which sound routines to use
|
||||
dnl
|
||||
|
||||
AC_MSG_CHECKING(which sound routines to use)
|
||||
if test "$UI" = sdl; then
|
||||
SOUND_LIBADD='sdlsound.$(OBJEXT)' SOUND_LIBS='' sound_fifo=yes
|
||||
AC_MSG_RESULT(SDL)
|
||||
elif test "$dxsound_available" = yes; then
|
||||
SOUND_LIBADD='dxsound.$(OBJEXT)' SOUND_LIBS='-ldsound -lole32 -ldxguid'
|
||||
AC_MSG_RESULT(DirectX)
|
||||
AC_DEFINE([DIRECTSOUND_VERSION], 0x0700, [DirectX 7 or higher is required])
|
||||
elif test "$win32sound_available" = yes; then
|
||||
SOUND_LIBADD='win32sound.$(OBJEXT)' SOUND_LIBS='-lwinmm'
|
||||
AC_MSG_RESULT(win32sound)
|
||||
elif test "$alsa_available" = yes; then
|
||||
SOUND_LIBADD='alsasound.$(OBJEXT)' SOUND_LIBS='-lasound'
|
||||
AC_MSG_RESULT(ALSA)
|
||||
elif test "$ao_available" = yes; then
|
||||
SOUND_LIBADD='aosound.$(OBJEXT)' SOUND_LIBS='-lao'
|
||||
AC_MSG_RESULT(libao)
|
||||
elif test "$ac_cv_header_dsound_h" = yes; then
|
||||
# Later selection between these two
|
||||
SOUND_LIBADD='sunsound.$(OBJEXT) hpsound.$(OBJEXT)' SOUND_LIBS=''
|
||||
AC_MSG_RESULT(Solaris or HP/UX)
|
||||
elif test "$ac_cv_header_sys_soundcard_h" = yes; then
|
||||
SOUND_LIBADD='osssound.$(OBJEXT)' SOUND_LIBS=''
|
||||
AC_MSG_RESULT(OSS)
|
||||
elif test "$ac_cv_header_sys_audioio_h" = yes; then
|
||||
dnl OpenBSD
|
||||
SOUND_LIBADD='sunsound.$(OBJEXT)' SOUND_LIBS=''
|
||||
AC_MSG_RESULT(OpenBSD)
|
||||
elif test "$coreaudio_available" = yes; then
|
||||
SOUND_LIBADD='coreaudiosound.$(OBJEXT)' SOUND_LIBS='-framework CoreAudio -framework AudioUnit -framework CoreServices' sound_fifo=yes
|
||||
AC_MSG_RESULT(CoreAudio)
|
||||
else
|
||||
SOUND_LIBADD='nullsound.$(OBJEXT)' SOUND_LIBS=''
|
||||
AC_MSG_RESULT(none)
|
||||
AC_DEFINE([NO_SOUND], 1, [Defined if no sound code is present])
|
||||
fi
|
||||
|
||||
if test "$sound_fifo" = yes; then
|
||||
dnl Strange construct used here as += doesn't seem to work on OS X
|
||||
SOUND_LIBADD="$SOUND_LIBADD"' sfifo.$(OBJEXT)'
|
||||
AC_DEFINE([SOUND_FIFO], 1, [Defined if the sound code uses a fifo])
|
||||
fi
|
||||
|
||||
AC_SUBST(SOUND_LIBADD)
|
||||
AC_SUBST(SOUND_LIBS)
|
||||
|
||||
dnl Are we supplying the ROMs or relying on another package?
|
||||
AC_MSG_CHECKING(where to find the Spectrum ROM images)
|
||||
AC_ARG_WITH(roms-dir,
|
||||
[ --with-roms-dir=DIR location of the Spectrum ROM images],
|
||||
,
|
||||
unset withval
|
||||
)
|
||||
if test "$withval" = ""; then
|
||||
echo 'we supply them'
|
||||
else
|
||||
echo "$withval"
|
||||
AC_DEFINE_UNQUOTED(ROMSDIR, "$withval", [Location of the ROM images])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether hardware joystick support requested)
|
||||
AC_ARG_WITH(joystick,
|
||||
[ --without-joystick use a real joystick for Kempston emulation etc.],
|
||||
if test "$withval" = no; then stick=no; else stick=yes; fi,
|
||||
stick=yes)
|
||||
AC_MSG_RESULT($stick)
|
||||
if test "$stick" = yes; then
|
||||
dnl We prefer to use UI-specific joystick code. (Default.)
|
||||
dnl If there is none, or you override this here, we use libjsw.
|
||||
dnl (svgalib appears to dislike switched joysticks on the parallel port...)
|
||||
case "$UI" in
|
||||
svga|sdl|win32)
|
||||
dnl Libraries such as svgalib provide their own joystick code.
|
||||
AC_MSG_CHECKING([whether to use $UI's joystick support])
|
||||
AC_ARG_ENABLE(ui-joystick,
|
||||
[ --enable-ui-joystick use UI-specific joystick code (where supported)],
|
||||
if test "$enableval" = no; then libjsw=yes; else libjsw=no; fi,
|
||||
libjsw=no)
|
||||
if test "$libjsw" = yes; then
|
||||
AC_MSG_RESULT([no, use libjsw])
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE([USE_JOYSTICK], 1, [Defined if we're using hardware joysticks])
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
dnl Our only option is libjsw.
|
||||
libjsw=yes
|
||||
;;
|
||||
esac
|
||||
if test "$libjsw" = yes; then
|
||||
dnl Look for libjsw. If missing, use QAOP<space>.
|
||||
AC_CHECK_HEADERS(jsw.h,
|
||||
LIBS="$LIBS -ljsw";
|
||||
AC_DEFINE([USE_JOYSTICK], 1,
|
||||
[Defined if we're using hardware joysticks]),
|
||||
AC_MSG_WARN(jsw.h not found - joystick support disabled))
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl See if libxml2 is available (for the config file handling)
|
||||
AC_MSG_CHECKING(whether libxml2 support requested)
|
||||
AC_ARG_WITH(libxml2,
|
||||
[ --without-libxml2 use a libxml2 for settings],
|
||||
if test "$withval" = no; then libxml2=no; else libxml2=yes; fi,
|
||||
libxml2=yes)
|
||||
AC_MSG_RESULT($libxml2)
|
||||
if test "$libxml2" = yes; then
|
||||
AM_PATH_XML2(2.0.0,AC_DEFINE([HAVE_LIB_XML2], 1,
|
||||
[Defined if we've got libxml2]),
|
||||
AC_WARN(libxml2 not found - config file use disabled))
|
||||
fi
|
||||
|
||||
dnl Work out which timer routines to use
|
||||
AC_MSG_CHECKING(which timer routines to use)
|
||||
if test "$UI" = sdl; then
|
||||
TIMER_LIBADD='sdl.$(OBJEXT)'
|
||||
timer_header='<SDL.h>'
|
||||
timer_type='Uint32'
|
||||
AC_MSG_RESULT(SDL)
|
||||
else
|
||||
case "$target_os" in
|
||||
mingw32*)
|
||||
TIMER_LIBADD='win32.$(OBJEXT)'
|
||||
timer_header='<windows.h>'
|
||||
timer_type='DWORD'
|
||||
AC_MSG_RESULT(Win32)
|
||||
;;
|
||||
*)
|
||||
TIMER_LIBADD='unix.$(OBJEXT)'
|
||||
timer_header='<sys/time.h>'
|
||||
timer_type='struct timeval'
|
||||
AC_MSG_RESULT(unix)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
AC_SUBST(TIMER_LIBADD)
|
||||
AC_DEFINE_UNQUOTED([TIMER_HEADER], $timer_header, [The header needed to define the timer type])
|
||||
AC_DEFINE_UNQUOTED([TIMER_TYPE], $timer_type, [The type needed for the timer routines])
|
||||
|
||||
dnl Work out which standard routines we're missing
|
||||
AC_MSG_CHECKING(which standard routines we're missing)
|
||||
missing_routines=''
|
||||
if test "$ac_cv_func_dirname" = no; then
|
||||
missing_routines="$missing_routines"'dirname '
|
||||
fi
|
||||
AM_CONDITIONAL(COMPAT_DIRNAME, test "$ac_cv_func_dirname" = no)
|
||||
if test "$ac_cv_func_getopt_long" = no; then
|
||||
case "$target_os" in
|
||||
amigaos|morphos)
|
||||
dnl Our getopt_long replacement doesn't work, so don't use it
|
||||
;;
|
||||
*)
|
||||
compat_getopt=yes
|
||||
missing_routines="$missing_routines"'getopt_long '
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AM_CONDITIONAL(COMPAT_GETOPT, test "$compat_getopt" = yes)
|
||||
if test "$ac_cv_func_mkstemp" = no; then
|
||||
missing_routines="$missing_routines"'mkstemp '
|
||||
fi
|
||||
AM_CONDITIONAL(COMPAT_MKSTEMP, test "$ac_cv_func_mkstemp" = no)
|
||||
if test "x$missing_routines" = x; then
|
||||
missing_routines='(none)'
|
||||
fi
|
||||
AC_MSG_RESULT($missing_routines)
|
||||
|
||||
dnl Work out which compatibility routines to use
|
||||
AC_MSG_CHECKING(which compatibility routines to use)
|
||||
case "$target_os" in
|
||||
amigaos)
|
||||
COMPAT_OSNAME='amiga'
|
||||
;;
|
||||
morphos)
|
||||
COMPAT_OSNAME='morphos'
|
||||
;;
|
||||
mingw32*)
|
||||
COMPAT_OSNAME='win32'
|
||||
;;
|
||||
*)
|
||||
COMPAT_OSNAME='unix'
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT($COMPAT_OSNAME)
|
||||
COMPAT_SUBDIR="compat/$COMPAT_OSNAME"
|
||||
AC_SUBST(COMPAT_SUBDIR)
|
||||
AC_SUBST(COMPAT_OSNAME)
|
||||
|
||||
dnl Do we want the low memory compile?
|
||||
AC_MSG_CHECKING(whether low memory compile requested)
|
||||
AC_ARG_ENABLE(smallmem,
|
||||
[ --enable-smallmem low memory compile needed],
|
||||
if test "$enableval" = yes; then
|
||||
smallmem=yes;
|
||||
else
|
||||
smallmem=no;
|
||||
fi,
|
||||
smallmem=no)
|
||||
if test "$smallmem" = no; then
|
||||
AC_DEFINE([HAVE_ENOUGH_MEMORY], 1, [Defined if we've got enough memory to compile z80_ops.c])
|
||||
fi
|
||||
AC_MSG_RESULT($smallmem)
|
||||
|
||||
dnl Do we want lots of warning messages?
|
||||
AC_MSG_CHECKING(whether lots of warnings requested)
|
||||
AC_ARG_ENABLE(warnings,
|
||||
[ --enable-warnings give lots of warnings if using gcc],
|
||||
if test "$enableval" = yes; then
|
||||
warnings=yes;
|
||||
else
|
||||
warnings=no;
|
||||
fi,
|
||||
warnings=no)
|
||||
AC_MSG_RESULT($warnings)
|
||||
|
||||
dnl If it appears we're using gcc as our compiler, turn on warnings
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
dnl And possibly lots of warnings
|
||||
if test "$warnings" = yes; then
|
||||
CFLAGS="$CFLAGS -Wstrict-prototypes -Wmissing-prototypes -Winline -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -W -Wsign-compare"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_OUTPUT(Makefile \
|
||||
compat/amiga/Makefile \
|
||||
compat/morphos/Makefile \
|
||||
compat/unix/Makefile \
|
||||
compat/win32/Makefile \
|
||||
debugger/Makefile \
|
||||
disk/Makefile \
|
||||
hacking/Makefile \
|
||||
lib/Makefile \
|
||||
machines/Makefile \
|
||||
man/Makefile \
|
||||
perl/Makefile \
|
||||
perl/Fuse/Makefile \
|
||||
pokefinder/Makefile \
|
||||
roms/Makefile \
|
||||
sound/Makefile \
|
||||
timer/Makefile \
|
||||
ui/Makefile \
|
||||
ui/fb/Makefile \
|
||||
ui/gtk/Makefile \
|
||||
ui/svga/Makefile \
|
||||
ui/sdl/Makefile \
|
||||
ui/scaler/Makefile \
|
||||
ui/widget/Makefile \
|
||||
ui/win32/Makefile \
|
||||
ui/win32/icons/Makefile \
|
||||
ui/xlib/Makefile \
|
||||
unittests/Makefile \
|
||||
z80/Makefile \
|
||||
z80/tests/Makefile)
|
|
@ -0,0 +1,184 @@
|
|||
/* dck.c: dock snapshot (Warajevo .DCK) handling routines
|
||||
Copyright (c) 2003-2004 Darren Salt, Fredrick Meunier, Philip Kendall
|
||||
|
||||
$Id: dck.c 3703 2008-06-30 20:36:11Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
Darren: linux@youmustbejoking.demon.co.uk
|
||||
Fred: fredm@spamcop.net
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "dck.h"
|
||||
#include "machine.h"
|
||||
#include "memory.h"
|
||||
#include "settings.h"
|
||||
#include "scld.h"
|
||||
#include "ui/ui.h"
|
||||
#include "utils.h"
|
||||
#include "debugger/debugger.h"
|
||||
|
||||
/* Dock cart inserted? */
|
||||
int dck_active = 0;
|
||||
|
||||
int
|
||||
dck_insert( const char *filename )
|
||||
{
|
||||
int error;
|
||||
|
||||
if ( !( libspectrum_machine_capabilities( machine_current->machine ) &
|
||||
LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_DOCK ) ) {
|
||||
ui_error( UI_ERROR_ERROR, "This machine does not support the dock" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
error = settings_set_string( &settings_current.dck_file, filename );
|
||||
if( error ) return error;
|
||||
|
||||
machine_reset( 0 );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
dck_eject( void )
|
||||
{
|
||||
if ( !( libspectrum_machine_capabilities( machine_current->machine ) &
|
||||
LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_DOCK ) ) {
|
||||
ui_error( UI_ERROR_ERROR, "This machine does not support the dock" );
|
||||
return;
|
||||
}
|
||||
|
||||
if( settings_current.dck_file ) free( settings_current.dck_file );
|
||||
settings_current.dck_file = NULL;
|
||||
|
||||
dck_active = 0;
|
||||
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_CARTRIDGE_DOCK_EJECT, 0 );
|
||||
|
||||
machine_reset( 0 );
|
||||
}
|
||||
|
||||
int
|
||||
dck_reset( void )
|
||||
{
|
||||
utils_file file;
|
||||
size_t num_block = 0;
|
||||
libspectrum_dck *dck;
|
||||
int error;
|
||||
|
||||
dck_active = 0;
|
||||
|
||||
if( !settings_current.dck_file ) {
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_CARTRIDGE_DOCK_EJECT, 0 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
dck = libspectrum_dck_alloc();
|
||||
|
||||
error = utils_read_file( settings_current.dck_file, &file );
|
||||
if( error ) { libspectrum_dck_free( dck, 0 ); return error; }
|
||||
|
||||
error = libspectrum_dck_read2( dck, file.buffer, file.length,
|
||||
settings_current.dck_file );
|
||||
if( error ) {
|
||||
utils_close_file( &file ); libspectrum_dck_free( dck, 0 ); return error;
|
||||
}
|
||||
|
||||
if( utils_close_file( &file ) ) {
|
||||
libspectrum_dck_free( dck, 0 );
|
||||
return 1;
|
||||
}
|
||||
|
||||
while( dck->dck[num_block] != NULL ) {
|
||||
memory_page **mem;
|
||||
int i;
|
||||
|
||||
switch( dck->dck[num_block]->bank ) {
|
||||
case LIBSPECTRUM_DCK_BANK_HOME:
|
||||
mem = memory_map_home;
|
||||
break;
|
||||
case LIBSPECTRUM_DCK_BANK_DOCK:
|
||||
mem = memory_map_dock;
|
||||
break;
|
||||
case LIBSPECTRUM_DCK_BANK_EXROM:
|
||||
mem = memory_map_exrom;
|
||||
break;
|
||||
default:
|
||||
ui_error( UI_ERROR_INFO, "Sorry, bank ID %i is unsupported",
|
||||
dck->dck[num_block]->bank );
|
||||
libspectrum_dck_free( dck, 0 );
|
||||
return 1;
|
||||
}
|
||||
|
||||
for( i = 0; i < 8; i++ ) {
|
||||
|
||||
switch( dck->dck[num_block]->access[i] ) {
|
||||
|
||||
case LIBSPECTRUM_DCK_PAGE_NULL:
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_DCK_PAGE_ROM:
|
||||
mem[i]->page = memory_pool_allocate( MEMORY_PAGE_SIZE );
|
||||
if( !mem[i]->page ) return 1;
|
||||
memcpy( mem[i]->page, dck->dck[num_block]->pages[i],
|
||||
MEMORY_PAGE_SIZE );
|
||||
mem[i]->writable = 0;
|
||||
mem[i]->source = MEMORY_SOURCE_CARTRIDGE;
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_DCK_PAGE_RAM_EMPTY:
|
||||
case LIBSPECTRUM_DCK_PAGE_RAM:
|
||||
/* Because the scr and snapshot code depends on the standard
|
||||
memory map being in the RAM[] array, we just copy RAM
|
||||
blocks from the HOME bank into the appropriate page; in
|
||||
other cases, we allocate ourselves a new page to store the
|
||||
contents in */
|
||||
if( !(dck->dck[num_block]->bank == LIBSPECTRUM_DCK_BANK_HOME && i>1) ) {
|
||||
mem[i]->page = memory_pool_allocate( MEMORY_PAGE_SIZE );
|
||||
if( !mem[i]->page ) return 1;
|
||||
mem[i]->writable = 1;
|
||||
}
|
||||
|
||||
mem[i]->source = MEMORY_SOURCE_CARTRIDGE;
|
||||
memcpy( mem[i]->page, dck->dck[num_block]->pages[i],
|
||||
MEMORY_PAGE_SIZE );
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
num_block++;
|
||||
}
|
||||
|
||||
dck_active = 1;
|
||||
|
||||
/* Make the menu item to eject the cartridge active */
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_CARTRIDGE_DOCK_EJECT, 1 );
|
||||
|
||||
return libspectrum_dck_free( dck, 0 );
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/* dck.h: dock snapshot (Warajevo .DCK) handling routines
|
||||
Copyright (c) 2003 Darren Salt, Fredrick Meunier
|
||||
|
||||
$Id: dck.h 2889 2007-05-26 17:45:08Z zubzero $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
Darren: linux@youmustbejoking.demon.co.uk
|
||||
Fred: fredm@spamcop.net
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_DCK_H
|
||||
#define FUSE_DCK_H
|
||||
|
||||
/* Dock cart inserted? */
|
||||
extern int dck_active;
|
||||
|
||||
int dck_insert( const char *filename );
|
||||
void dck_eject( void );
|
||||
int dck_reset( void );
|
||||
|
||||
#endif
|
|
@ -0,0 +1,52 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## Copyright (c) 2001-2008 Philip Kendall
|
||||
|
||||
## $Id: Makefile.am 3657 2008-06-08 15:04:37Z pak21 $
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
##
|
||||
## Author contact information:
|
||||
##
|
||||
## E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)/..
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
||||
|
||||
noinst_LIBRARIES = libdebugger.a
|
||||
|
||||
libdebugger_a_SOURCES = breakpoint.c \
|
||||
command.c \
|
||||
commandl.l \
|
||||
commandy.y \
|
||||
debugger.c \
|
||||
disassemble.c \
|
||||
event.c \
|
||||
expression.c \
|
||||
variable.c
|
||||
|
||||
commandl.c: commandy.c
|
||||
commandy.h: commandy.c
|
||||
|
||||
noinst_HEADERS = breakpoint.h \
|
||||
commandy.h \
|
||||
debugger.h \
|
||||
debugger_internals.h
|
||||
|
||||
CLEANFILES = commandl.c \
|
||||
commandy.c \
|
||||
commandy.h
|
|
@ -0,0 +1,532 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = debugger
|
||||
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in commandl.c commandy.c
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
libdebugger_a_AR = $(AR) $(ARFLAGS)
|
||||
libdebugger_a_LIBADD =
|
||||
am_libdebugger_a_OBJECTS = breakpoint.$(OBJEXT) command.$(OBJEXT) \
|
||||
commandl.$(OBJEXT) commandy.$(OBJEXT) debugger.$(OBJEXT) \
|
||||
disassemble.$(OBJEXT) event.$(OBJEXT) expression.$(OBJEXT) \
|
||||
variable.$(OBJEXT)
|
||||
libdebugger_a_OBJECTS = $(am_libdebugger_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
|
||||
LTLEXCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
|
||||
YLWRAP = $(top_srcdir)/ylwrap
|
||||
YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
|
||||
LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
|
||||
SOURCES = $(libdebugger_a_SOURCES)
|
||||
DIST_SOURCES = $(libdebugger_a_SOURCES)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOLOAD_SNAPS = @AUTOLOAD_SNAPS@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPAT_OSNAME = @COMPAT_OSNAME@
|
||||
COMPAT_SUBDIR = @COMPAT_SUBDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_CONFIG = @GLIB_CONFIG@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSPEC_CFLAGS = @LIBSPEC_CFLAGS@
|
||||
LIBSPEC_LIBS = @LIBSPEC_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
|
||||
SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_CONFIG = @SDL_CONFIG@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOUND_LIBADD = @SOUND_LIBADD@
|
||||
SOUND_LIBS = @SOUND_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TIMER_LIBADD = @TIMER_LIBADD@
|
||||
UI = @UI@
|
||||
UI_LIBS = @UI_LIBS@
|
||||
VERSION = @VERSION@
|
||||
WIDGET = @WIDGET@
|
||||
WINDRES = @WINDRES@
|
||||
WINDRES_OBJ = @WINDRES_OBJ@
|
||||
XMKMF = @XMKMF@
|
||||
XML2_CONFIG = @XML2_CONFIG@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
AM_CPPFLAGS = -I$(srcdir)/..
|
||||
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
|
||||
noinst_LIBRARIES = libdebugger.a
|
||||
libdebugger_a_SOURCES = breakpoint.c \
|
||||
command.c \
|
||||
commandl.l \
|
||||
commandy.y \
|
||||
debugger.c \
|
||||
disassemble.c \
|
||||
event.c \
|
||||
expression.c \
|
||||
variable.c
|
||||
|
||||
noinst_HEADERS = breakpoint.h \
|
||||
commandy.h \
|
||||
debugger.h \
|
||||
debugger_internals.h
|
||||
|
||||
CLEANFILES = commandl.c \
|
||||
commandy.c \
|
||||
commandy.h
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .l .lo .o .obj .y
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign debugger/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign debugger/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libdebugger.a: $(libdebugger_a_OBJECTS) $(libdebugger_a_DEPENDENCIES)
|
||||
-rm -f libdebugger.a
|
||||
$(libdebugger_a_AR) libdebugger.a $(libdebugger_a_OBJECTS) $(libdebugger_a_LIBADD)
|
||||
$(RANLIB) libdebugger.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/breakpoint.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandl.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandy.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugger.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disassemble.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expression.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variable.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
.l.c:
|
||||
$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
|
||||
|
||||
.y.c:
|
||||
$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE)
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES) $(HEADERS)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-rm -f commandl.c
|
||||
-rm -f commandy.c
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am
|
||||
|
||||
|
||||
commandl.c: commandy.c
|
||||
commandy.h: commandy.c
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,656 @@
|
|||
/* breakpoint.c: a debugger breakpoint
|
||||
Copyright (c) 2002-2008 Philip Kendall
|
||||
|
||||
$Id: breakpoint.c 3685 2008-06-21 12:37:24Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "debugger_internals.h"
|
||||
#include "event.h"
|
||||
#include "fuse.h"
|
||||
#include "memory.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
/* The current breakpoints */
|
||||
GSList *debugger_breakpoints;
|
||||
|
||||
/* The next breakpoint ID to use */
|
||||
static size_t next_breakpoint_id;
|
||||
|
||||
/* Textual representations of the breakpoint types and lifetimes */
|
||||
const char *debugger_breakpoint_type_text[] = {
|
||||
"Execute", "Read", "Write", "Port Read", "Port Write", "Time", "Event",
|
||||
};
|
||||
|
||||
const char debugger_breakpoint_type_abbr[][4] = {
|
||||
"Exe", "Rd", "Wr", "PtR", "PtW", "Tm", "Ev",
|
||||
};
|
||||
|
||||
const char *debugger_breakpoint_life_text[] = {
|
||||
"Permanent", "One Shot",
|
||||
};
|
||||
|
||||
const char debugger_breakpoint_life_abbr[][5] = {
|
||||
"Perm", "Once",
|
||||
};
|
||||
|
||||
static int breakpoint_add( debugger_breakpoint_type type,
|
||||
debugger_breakpoint_value value, size_t ignore,
|
||||
debugger_breakpoint_life life,
|
||||
debugger_expression *condition );
|
||||
static int breakpoint_check( debugger_breakpoint *bp,
|
||||
debugger_breakpoint_type type,
|
||||
libspectrum_dword value );
|
||||
static debugger_breakpoint* get_breakpoint_by_id( size_t id );
|
||||
static gint find_breakpoint_by_id( gconstpointer data,
|
||||
gconstpointer user_data );
|
||||
static void remove_time( gpointer data, gpointer user_data );
|
||||
static gint find_breakpoint_by_id( gconstpointer data,
|
||||
gconstpointer user_data );
|
||||
static gint find_breakpoint_by_address( gconstpointer data,
|
||||
gconstpointer user_data );
|
||||
static void free_breakpoint( gpointer data, gpointer user_data );
|
||||
static void add_time_event( gpointer data, gpointer user_data );
|
||||
|
||||
/* Add a breakpoint */
|
||||
int
|
||||
debugger_breakpoint_add_address( debugger_breakpoint_type type, int page,
|
||||
libspectrum_word offset, size_t ignore,
|
||||
debugger_breakpoint_life life,
|
||||
debugger_expression *condition )
|
||||
{
|
||||
debugger_breakpoint_value value;
|
||||
|
||||
switch( type ) {
|
||||
case DEBUGGER_BREAKPOINT_TYPE_EXECUTE:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_READ:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_WRITE:
|
||||
break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "debugger_breakpoint_add_address given type %d",
|
||||
type );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
value.address.page = page;
|
||||
value.address.offset = offset;
|
||||
|
||||
return breakpoint_add( type, value, ignore, life, condition );
|
||||
}
|
||||
|
||||
int
|
||||
debugger_breakpoint_add_port( debugger_breakpoint_type type,
|
||||
libspectrum_word port, libspectrum_word mask,
|
||||
size_t ignore, debugger_breakpoint_life life,
|
||||
debugger_expression *condition )
|
||||
{
|
||||
debugger_breakpoint_value value;
|
||||
|
||||
switch( type ) {
|
||||
case DEBUGGER_BREAKPOINT_TYPE_PORT_READ:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_PORT_WRITE:
|
||||
break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "debugger_breakpoint_add_port given type %d",
|
||||
type );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
value.port.port = port;
|
||||
value.port.mask = mask;
|
||||
|
||||
return breakpoint_add( type, value, ignore, life, condition );
|
||||
}
|
||||
|
||||
int
|
||||
debugger_breakpoint_add_time( debugger_breakpoint_type type,
|
||||
libspectrum_dword tstates, size_t ignore,
|
||||
debugger_breakpoint_life life,
|
||||
debugger_expression *condition )
|
||||
{
|
||||
debugger_breakpoint_value value;
|
||||
|
||||
switch( type ) {
|
||||
case DEBUGGER_BREAKPOINT_TYPE_TIME:
|
||||
break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "debugger_breakpoint_add_time given type %d",
|
||||
type );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
value.time.tstates = tstates;
|
||||
|
||||
return breakpoint_add( type, value, ignore, life, condition );
|
||||
}
|
||||
|
||||
int
|
||||
debugger_breakpoint_add_event( debugger_breakpoint_type type,
|
||||
const char *type_string, const char *detail,
|
||||
size_t ignore, debugger_breakpoint_life life,
|
||||
debugger_expression *condition )
|
||||
{
|
||||
debugger_breakpoint_value value;
|
||||
|
||||
switch( type ) {
|
||||
case DEBUGGER_BREAKPOINT_TYPE_EVENT:
|
||||
break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "%s given type %d", __func__, type );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
if( !debugger_event_is_registered( type_string, detail ) ) {
|
||||
ui_error( UI_ERROR_WARNING, "Event type %s:%s not known", type_string,
|
||||
detail );
|
||||
return 1;
|
||||
}
|
||||
|
||||
value.event.detail = NULL;
|
||||
value.event.type = strdup( type_string );
|
||||
value.event.detail = strdup( detail );
|
||||
if( !value.event.type || !value.event.detail ) {
|
||||
free( value.event.type );
|
||||
free( value.event.detail );
|
||||
return 1;
|
||||
}
|
||||
|
||||
return breakpoint_add( type, value, ignore, life, condition );
|
||||
}
|
||||
|
||||
static int
|
||||
breakpoint_add( debugger_breakpoint_type type, debugger_breakpoint_value value,
|
||||
size_t ignore, debugger_breakpoint_life life,
|
||||
debugger_expression *condition )
|
||||
{
|
||||
debugger_breakpoint *bp;
|
||||
|
||||
bp = malloc( sizeof( *bp ) );
|
||||
if( !bp ) {
|
||||
ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return 1;
|
||||
}
|
||||
|
||||
bp->id = next_breakpoint_id++; bp->type = type;
|
||||
bp->value = value;
|
||||
bp->ignore = ignore; bp->life = life;
|
||||
if( condition ) {
|
||||
bp->condition = debugger_expression_copy( condition );
|
||||
if( !bp->condition ) {
|
||||
free( bp );
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
bp->condition = NULL;
|
||||
}
|
||||
|
||||
bp->commands = NULL;
|
||||
|
||||
debugger_breakpoints = g_slist_append( debugger_breakpoints, bp );
|
||||
|
||||
if( debugger_mode == DEBUGGER_MODE_INACTIVE )
|
||||
debugger_mode = DEBUGGER_MODE_ACTIVE;
|
||||
|
||||
/* If this was a timed breakpoint, set an event to stop emulation
|
||||
at that point */
|
||||
if( type == DEBUGGER_BREAKPOINT_TYPE_TIME ) {
|
||||
int error;
|
||||
|
||||
error = event_add( value.time.tstates, debugger_breakpoint_event );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check whether the debugger should become active at this point */
|
||||
int
|
||||
debugger_check( debugger_breakpoint_type type, libspectrum_dword value )
|
||||
{
|
||||
GSList *ptr; debugger_breakpoint *bp;
|
||||
|
||||
switch( debugger_mode ) {
|
||||
|
||||
case DEBUGGER_MODE_INACTIVE: return 0;
|
||||
|
||||
case DEBUGGER_MODE_ACTIVE:
|
||||
for( ptr = debugger_breakpoints; ptr; ptr = ptr->next ) {
|
||||
|
||||
bp = ptr->data;
|
||||
|
||||
if( breakpoint_check( bp, type, value ) ) {
|
||||
debugger_mode = DEBUGGER_MODE_HALTED;
|
||||
debugger_command_evaluate( bp->commands );
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case DEBUGGER_MODE_HALTED: return 1;
|
||||
|
||||
}
|
||||
|
||||
/* Debugger mode could have been reset by a breakpoint command */
|
||||
return ( debugger_mode == DEBUGGER_MODE_HALTED );
|
||||
}
|
||||
|
||||
static int
|
||||
encode_bank_and_page( debugger_breakpoint_type type, libspectrum_word address )
|
||||
{
|
||||
memory_page *read_write, *page;
|
||||
breakpoint_page_offset offset;
|
||||
|
||||
switch( type ) {
|
||||
case DEBUGGER_BREAKPOINT_TYPE_EXECUTE:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_READ:
|
||||
read_write = memory_map_read;
|
||||
break;
|
||||
|
||||
case DEBUGGER_BREAKPOINT_TYPE_WRITE:
|
||||
read_write = memory_map_write;
|
||||
break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR,
|
||||
"encode_bank_and_page: unexpected breakpoint type %d", type );
|
||||
return -1;
|
||||
}
|
||||
|
||||
page = &read_write[ address >> 13 ];
|
||||
|
||||
switch( page->bank ) {
|
||||
case MEMORY_BANK_HOME:
|
||||
offset = page->writable ? BREAKPOINT_PAGE_RAM : BREAKPOINT_PAGE_ROM;
|
||||
break;
|
||||
case MEMORY_BANK_DOCK: offset = BREAKPOINT_PAGE_DOCK; break;
|
||||
case MEMORY_BANK_EXROM: offset = BREAKPOINT_PAGE_EXROM; break;
|
||||
case MEMORY_BANK_ROMCS: offset = BREAKPOINT_PAGE_ROMCS; break;
|
||||
default: return -1;
|
||||
}
|
||||
|
||||
return offset + page->page_num;
|
||||
}
|
||||
|
||||
int
|
||||
debugger_page_hash( const char *text )
|
||||
{
|
||||
int offset;
|
||||
|
||||
switch( tolower( (unsigned char)text[0] ) ) {
|
||||
|
||||
case 'c': offset = BREAKPOINT_PAGE_ROMCS; break;
|
||||
case 'd': offset = BREAKPOINT_PAGE_DOCK; break;
|
||||
case 'r': offset = BREAKPOINT_PAGE_ROM; break;
|
||||
case 'x': offset = BREAKPOINT_PAGE_EXROM; break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR,
|
||||
"%s:debugger_page_hash: unknown page letter '%c'", __FILE__,
|
||||
text[0] );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
offset += atoi( &text[1] );
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
char*
|
||||
debugger_breakpoint_decode_page( char *buffer, size_t n, int page )
|
||||
{
|
||||
if( page >= BREAKPOINT_PAGE_ROMCS ) {
|
||||
snprintf( buffer, n, "C%d", page - BREAKPOINT_PAGE_ROMCS );
|
||||
} else if( page >= BREAKPOINT_PAGE_EXROM ) {
|
||||
snprintf( buffer, n, "X%d", page - BREAKPOINT_PAGE_EXROM );
|
||||
} else if( page >= BREAKPOINT_PAGE_DOCK ) {
|
||||
snprintf( buffer, n, "D%d", page - BREAKPOINT_PAGE_DOCK );
|
||||
} else if( page >= BREAKPOINT_PAGE_ROM ) {
|
||||
snprintf( buffer, n, "R%d", page - BREAKPOINT_PAGE_ROM );
|
||||
} else if( page >= BREAKPOINT_PAGE_RAM ) {
|
||||
snprintf( buffer, n, "%d", page - BREAKPOINT_PAGE_RAM );
|
||||
} else {
|
||||
snprintf( buffer, n, "[Unknown page %d]", page );
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
int
|
||||
debugger_breakpoint_trigger( debugger_breakpoint *bp )
|
||||
{
|
||||
if( bp->ignore ) { bp->ignore--; return 0; }
|
||||
|
||||
if( bp->condition && !debugger_expression_evaluate( bp->condition ) )
|
||||
return 0;
|
||||
|
||||
if( bp->life == DEBUGGER_BREAKPOINT_LIFE_ONESHOT ) {
|
||||
debugger_breakpoints = g_slist_remove( debugger_breakpoints, bp );
|
||||
free( bp );
|
||||
}
|
||||
|
||||
if( bp->type == DEBUGGER_BREAKPOINT_TYPE_TIME )
|
||||
bp->value.time.triggered = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Check whether 'bp' should trigger if we're looking for a breakpoint
|
||||
of 'type' with parameter 'value'. Returns non-zero if we should trigger */
|
||||
static int
|
||||
breakpoint_check( debugger_breakpoint *bp, debugger_breakpoint_type type,
|
||||
libspectrum_dword value )
|
||||
{
|
||||
int page;
|
||||
|
||||
if( bp->type != type ) return 0;
|
||||
|
||||
switch( type ) {
|
||||
|
||||
case DEBUGGER_BREAKPOINT_TYPE_EXECUTE:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_READ:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_WRITE:
|
||||
|
||||
page = bp->value.address.page;
|
||||
|
||||
/* If page == -1, value must match exactly; otherwise, the page and
|
||||
the offset must match */
|
||||
if( page == -1 ) {
|
||||
if( bp->value.address.offset != value ) return 0;
|
||||
} else {
|
||||
if( page != encode_bank_and_page( type, value ) ) return 0;
|
||||
if( bp->value.address.offset != ( value & 0x3fff ) ) return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
/* Port values must match after masking */
|
||||
case DEBUGGER_BREAKPOINT_TYPE_PORT_READ:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_PORT_WRITE:
|
||||
if( ( value & bp->value.port.mask ) != bp->value.port.port ) return 0;
|
||||
break;
|
||||
|
||||
/* Timed breakpoints trigger if we're past the relevant time */
|
||||
case DEBUGGER_BREAKPOINT_TYPE_TIME:
|
||||
if( bp->value.time.triggered || bp->value.time.tstates > tstates ) return 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "Unknown breakpoint type %d", bp->type );
|
||||
fuse_abort();
|
||||
|
||||
}
|
||||
|
||||
return debugger_breakpoint_trigger( bp );
|
||||
}
|
||||
|
||||
struct remove_t {
|
||||
|
||||
libspectrum_dword tstates;
|
||||
int done;
|
||||
|
||||
};
|
||||
|
||||
/* Remove breakpoint with the given ID */
|
||||
int
|
||||
debugger_breakpoint_remove( size_t id )
|
||||
{
|
||||
debugger_breakpoint *bp;
|
||||
|
||||
bp = get_breakpoint_by_id( id ); if( !bp ) return 1;
|
||||
|
||||
debugger_breakpoints = g_slist_remove( debugger_breakpoints, bp );
|
||||
if( debugger_mode == DEBUGGER_MODE_ACTIVE && !debugger_breakpoints )
|
||||
debugger_mode = DEBUGGER_MODE_INACTIVE;
|
||||
|
||||
/* If this was a timed breakpoint, remove the event as well */
|
||||
if( bp->type == DEBUGGER_BREAKPOINT_TYPE_TIME ) {
|
||||
|
||||
struct remove_t remove;
|
||||
|
||||
remove.tstates = bp->value.time.tstates;
|
||||
remove.done = 0;
|
||||
|
||||
event_foreach( remove_time, &remove );
|
||||
}
|
||||
|
||||
free( bp );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static debugger_breakpoint*
|
||||
get_breakpoint_by_id( size_t id )
|
||||
{
|
||||
GSList *ptr;
|
||||
|
||||
ptr = g_slist_find_custom( debugger_breakpoints, &id,
|
||||
find_breakpoint_by_id );
|
||||
if( !ptr ) {
|
||||
ui_error( UI_ERROR_ERROR, "Breakpoint %ld does not exist",
|
||||
(unsigned long)id );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ptr->data;
|
||||
}
|
||||
|
||||
static gint
|
||||
find_breakpoint_by_id( gconstpointer data, gconstpointer user_data )
|
||||
{
|
||||
const debugger_breakpoint *bp = data;
|
||||
size_t id = *(const size_t*)user_data;
|
||||
|
||||
return bp->id - id;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_time( gpointer data, gpointer user_data )
|
||||
{
|
||||
event_t *event;
|
||||
struct remove_t *remove;
|
||||
|
||||
event = data; remove = user_data;
|
||||
|
||||
if( remove->done ) return;
|
||||
|
||||
if( event->type == debugger_breakpoint_event &&
|
||||
event->tstates == remove->tstates ) {
|
||||
event->type = event_type_null;
|
||||
remove->done = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove all breakpoints at the given address */
|
||||
int
|
||||
debugger_breakpoint_clear( libspectrum_word address )
|
||||
{
|
||||
GSList *ptr;
|
||||
|
||||
int found = 0;
|
||||
|
||||
while( 1 ) {
|
||||
|
||||
ptr = g_slist_find_custom( debugger_breakpoints, &address,
|
||||
find_breakpoint_by_address );
|
||||
if( !ptr ) break;
|
||||
|
||||
found++;
|
||||
|
||||
free_breakpoint( ptr->data, NULL );
|
||||
|
||||
debugger_breakpoints = g_slist_remove( debugger_breakpoints, ptr->data );
|
||||
if( debugger_mode == DEBUGGER_MODE_ACTIVE && !debugger_breakpoints )
|
||||
debugger_mode = DEBUGGER_MODE_INACTIVE;
|
||||
}
|
||||
|
||||
if( !found ) {
|
||||
if( debugger_output_base == 10 ) {
|
||||
ui_error( UI_ERROR_ERROR, "No breakpoint at %d", address );
|
||||
} else {
|
||||
ui_error( UI_ERROR_ERROR, "No breakpoint at 0x%04x", address );
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static gint
|
||||
find_breakpoint_by_address( gconstpointer data, gconstpointer user_data )
|
||||
{
|
||||
const debugger_breakpoint *bp = data;
|
||||
libspectrum_word address = *(const libspectrum_word*)user_data;
|
||||
|
||||
if( bp->type != DEBUGGER_BREAKPOINT_TYPE_EXECUTE &&
|
||||
bp->type != DEBUGGER_BREAKPOINT_TYPE_READ &&
|
||||
bp->type != DEBUGGER_BREAKPOINT_TYPE_WRITE )
|
||||
return 1;
|
||||
|
||||
/* Ignore all page-specific breakpoints */
|
||||
if( bp->value.address.page != -1 ) return 1;
|
||||
|
||||
return bp->value.address.offset - address;
|
||||
}
|
||||
|
||||
/* Remove all breakpoints */
|
||||
int
|
||||
debugger_breakpoint_remove_all( void )
|
||||
{
|
||||
g_slist_foreach( debugger_breakpoints, free_breakpoint, NULL );
|
||||
g_slist_free( debugger_breakpoints ); debugger_breakpoints = NULL;
|
||||
|
||||
if( debugger_mode == DEBUGGER_MODE_ACTIVE )
|
||||
debugger_mode = DEBUGGER_MODE_INACTIVE;
|
||||
|
||||
/* Restart the breakpoint numbering */
|
||||
next_breakpoint_id = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
free_breakpoint( gpointer data, gpointer user_data GCC_UNUSED )
|
||||
{
|
||||
debugger_breakpoint *bp = data;
|
||||
|
||||
switch( bp->type ) {
|
||||
case DEBUGGER_BREAKPOINT_TYPE_EVENT:
|
||||
free( bp->value.event.type );
|
||||
free( bp->value.event.detail );
|
||||
break;
|
||||
|
||||
case DEBUGGER_BREAKPOINT_TYPE_EXECUTE:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_READ:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_WRITE:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_PORT_READ:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_PORT_WRITE:
|
||||
case DEBUGGER_BREAKPOINT_TYPE_TIME:
|
||||
/* No action needed */
|
||||
break;
|
||||
}
|
||||
|
||||
if( bp->condition ) debugger_expression_delete( bp->condition );
|
||||
if( bp->commands ) free( bp->commands );
|
||||
|
||||
free( bp );
|
||||
}
|
||||
|
||||
/* Ignore breakpoint 'id' the next 'ignore' times it hits */
|
||||
int
|
||||
debugger_breakpoint_ignore( size_t id, size_t ignore )
|
||||
{
|
||||
debugger_breakpoint *bp;
|
||||
|
||||
bp = get_breakpoint_by_id( id ); if( !bp ) return 1;
|
||||
|
||||
bp->ignore = ignore;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set the breakpoint's conditional expression */
|
||||
int
|
||||
debugger_breakpoint_set_condition( size_t id, debugger_expression *condition )
|
||||
{
|
||||
debugger_breakpoint *bp;
|
||||
|
||||
bp = get_breakpoint_by_id( id ); if( !bp ) return 1;
|
||||
|
||||
if( bp->condition ) debugger_expression_delete( bp->condition );
|
||||
|
||||
if( condition ) {
|
||||
bp->condition = debugger_expression_copy( condition );
|
||||
if( !bp->condition ) return 1;
|
||||
} else {
|
||||
bp->condition = NULL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
debugger_breakpoint_set_commands( size_t id, const char *commands )
|
||||
{
|
||||
debugger_breakpoint *bp = get_breakpoint_by_id( id );
|
||||
if( !bp ) return 1;
|
||||
|
||||
free( bp->commands );
|
||||
bp->commands = strdup( commands );
|
||||
if( !bp->commands ) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Add events corresponding to all the time events to happen during
|
||||
this frame */
|
||||
int
|
||||
debugger_add_time_events( void )
|
||||
{
|
||||
g_slist_foreach( debugger_breakpoints, add_time_event, NULL );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
add_time_event( gpointer data, gpointer user_data GCC_UNUSED )
|
||||
{
|
||||
debugger_breakpoint *bp = data;
|
||||
|
||||
if( bp->type == DEBUGGER_BREAKPOINT_TYPE_TIME ) {
|
||||
bp->value.time.triggered = 0;
|
||||
event_add( bp->value.time.tstates, debugger_breakpoint_event );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
debugger_breakpoint_time_fn( libspectrum_dword tstates, int type GCC_UNUSED,
|
||||
void *user_data GCC_UNUSED )
|
||||
{
|
||||
debugger_check( DEBUGGER_BREAKPOINT_TYPE_TIME, 0 );
|
||||
}
|
|
@ -0,0 +1,149 @@
|
|||
/* breakpoint.h: a debugger breakpoint
|
||||
Copyright (c) 2002-2008 Philip Kendall
|
||||
|
||||
$Id: breakpoint.h 3662 2008-06-09 11:19:29Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_DEBUGGER_BREAKPOINT_H
|
||||
#define FUSE_DEBUGGER_BREAKPOINT_H
|
||||
|
||||
/* Types of breakpoint */
|
||||
typedef enum debugger_breakpoint_type {
|
||||
DEBUGGER_BREAKPOINT_TYPE_EXECUTE,
|
||||
DEBUGGER_BREAKPOINT_TYPE_READ,
|
||||
DEBUGGER_BREAKPOINT_TYPE_WRITE,
|
||||
DEBUGGER_BREAKPOINT_TYPE_PORT_READ,
|
||||
DEBUGGER_BREAKPOINT_TYPE_PORT_WRITE,
|
||||
DEBUGGER_BREAKPOINT_TYPE_TIME,
|
||||
DEBUGGER_BREAKPOINT_TYPE_EVENT,
|
||||
} debugger_breakpoint_type;
|
||||
|
||||
extern const char *debugger_breakpoint_type_text[];
|
||||
extern const char debugger_breakpoint_type_abbr[][4];
|
||||
|
||||
/* Lifetime of a breakpoint */
|
||||
typedef enum debugger_breakpoint_life {
|
||||
DEBUGGER_BREAKPOINT_LIFE_PERMANENT,
|
||||
DEBUGGER_BREAKPOINT_LIFE_ONESHOT,
|
||||
} debugger_breakpoint_life;
|
||||
|
||||
extern const char *debugger_breakpoint_life_text[];
|
||||
extern const char debugger_breakpoint_life_abbr[][5];
|
||||
|
||||
typedef struct debugger_breakpoint_address {
|
||||
|
||||
int page;
|
||||
libspectrum_word offset;
|
||||
|
||||
} debugger_breakpoint_address;
|
||||
|
||||
/* Offsets used to encode various bank types in the above 'page' variable */
|
||||
typedef enum breakpoint_page_offset {
|
||||
BREAKPOINT_PAGE_RAM = 0,
|
||||
BREAKPOINT_PAGE_ROM = 32,
|
||||
BREAKPOINT_PAGE_DOCK = 40,
|
||||
BREAKPOINT_PAGE_EXROM = 48,
|
||||
BREAKPOINT_PAGE_ROMCS = 56,
|
||||
} breakpoint_page_offset;
|
||||
|
||||
typedef struct debugger_breakpoint_port {
|
||||
|
||||
libspectrum_word port;
|
||||
libspectrum_word mask;
|
||||
|
||||
} debugger_breakpoint_port;
|
||||
|
||||
typedef struct debugger_breakpoint_time {
|
||||
libspectrum_dword tstates;
|
||||
int triggered;
|
||||
} debugger_breakpoint_time;
|
||||
|
||||
typedef struct debugger_event_t {
|
||||
char *type;
|
||||
char *detail;
|
||||
} debugger_event_t;
|
||||
|
||||
typedef union debugger_breakpoint_value {
|
||||
|
||||
debugger_breakpoint_address address;
|
||||
debugger_breakpoint_port port;
|
||||
debugger_breakpoint_time time;
|
||||
debugger_event_t event;
|
||||
|
||||
} debugger_breakpoint_value;
|
||||
|
||||
typedef struct debugger_expression debugger_expression;
|
||||
|
||||
/* The breakpoint structure */
|
||||
typedef struct debugger_breakpoint {
|
||||
size_t id;
|
||||
|
||||
debugger_breakpoint_type type;
|
||||
debugger_breakpoint_value value;
|
||||
|
||||
size_t ignore; /* Ignore this breakpoint this many times */
|
||||
debugger_breakpoint_life life;
|
||||
debugger_expression *condition; /* Conditional expression to activate this
|
||||
breakpoint */
|
||||
|
||||
char *commands;
|
||||
|
||||
} debugger_breakpoint;
|
||||
|
||||
/* The current breakpoints */
|
||||
extern GSList *debugger_breakpoints;
|
||||
|
||||
int debugger_check( debugger_breakpoint_type type, libspectrum_dword value );
|
||||
|
||||
/* Add a new breakpoint */
|
||||
int
|
||||
debugger_breakpoint_add_address(
|
||||
debugger_breakpoint_type type, int page, libspectrum_word offset,
|
||||
size_t ignore, debugger_breakpoint_life life, debugger_expression *condition
|
||||
);
|
||||
|
||||
int
|
||||
debugger_breakpoint_add_port(
|
||||
debugger_breakpoint_type type, libspectrum_word port, libspectrum_word mask,
|
||||
size_t ignore, debugger_breakpoint_life life, debugger_expression *condition
|
||||
);
|
||||
|
||||
int
|
||||
debugger_breakpoint_add_time(
|
||||
debugger_breakpoint_type type, libspectrum_dword tstates,
|
||||
size_t ignore, debugger_breakpoint_life life, debugger_expression *condition
|
||||
);
|
||||
|
||||
int
|
||||
debugger_breakpoint_add_event(
|
||||
debugger_breakpoint_type type, const char *type_string, const char *detail,
|
||||
size_t ignore, debugger_breakpoint_life life, debugger_expression *condition
|
||||
);
|
||||
|
||||
/* Add events corresponding to all the time breakpoints to happen
|
||||
during this frame */
|
||||
int debugger_add_time_events( void );
|
||||
|
||||
char*
|
||||
debugger_breakpoint_decode_page( char *buffer, size_t n, int page );
|
||||
|
||||
#endif /* #ifndef FUSE_DEBUGGER_BREAKPOINT_H */
|
|
@ -0,0 +1,286 @@
|
|||
/* command.c: Parse a debugger command
|
||||
Copyright (c) 2002-2008 Philip Kendall
|
||||
|
||||
$Id: command.c 3631 2008-05-26 12:22:29Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "debugger.h"
|
||||
#include "debugger_internals.h"
|
||||
#include "mempool.h"
|
||||
#include "ui/ui.h"
|
||||
#include "z80/z80.h"
|
||||
#include "z80/z80_macros.h"
|
||||
|
||||
/* The last debugger command we were given to execute */
|
||||
static char *command_buffer = NULL;
|
||||
|
||||
/* And a pointer as to how much we've parsed */
|
||||
static char *command_ptr;
|
||||
|
||||
int yyparse( void );
|
||||
int yywrap( void );
|
||||
|
||||
/* Evaluate the debugger command given in 'command' */
|
||||
int
|
||||
debugger_command_evaluate( const char *command )
|
||||
{
|
||||
if( !command ) return 0;
|
||||
|
||||
if( command_buffer ) free( command_buffer );
|
||||
|
||||
command_buffer = strdup( command );
|
||||
if( !command_buffer ) {
|
||||
ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Start parsing at the start of the given command */
|
||||
command_ptr = command_buffer;
|
||||
|
||||
/* Parse the command */
|
||||
yyparse();
|
||||
|
||||
/* And free any memory we allocated while parsing */
|
||||
mempool_free( debugger_memory_pool );
|
||||
|
||||
ui_debugger_update();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Utility functions called from the flex scanner */
|
||||
|
||||
int
|
||||
yywrap( void )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Called to get up to 'max_size' bytes of the command to be parsed */
|
||||
int
|
||||
debugger_command_input( char *buf, int *result, int max_size )
|
||||
{
|
||||
size_t length = strlen( command_ptr );
|
||||
|
||||
if( !length ) {
|
||||
return 0;
|
||||
} else if( length < (size_t)max_size ) {
|
||||
memcpy( buf, command_ptr, length );
|
||||
*result = length; command_ptr += length;
|
||||
return 1;
|
||||
} else {
|
||||
memcpy( buf, command_ptr, max_size );
|
||||
*result = max_size; command_ptr += max_size;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Convert a register name to a useful index value */
|
||||
int
|
||||
debugger_register_hash( const char *name )
|
||||
{
|
||||
int hash = 0x0000, primed = 0;
|
||||
size_t length;
|
||||
const char *ptr;
|
||||
|
||||
length = strlen( name );
|
||||
|
||||
if( name[ length - 1 ] == '\'' ) { primed = 1; length--; }
|
||||
|
||||
for( ptr = name; ptr < name + length; ptr++ ) {
|
||||
hash <<= 8; hash |= tolower( *ptr );
|
||||
}
|
||||
|
||||
if( primed ) hash |= 0x8000;
|
||||
|
||||
switch( hash ) {
|
||||
case 0x0061: case 0x8061: /* A, A' */
|
||||
case 0x0066: case 0x8066: /* F, F' */
|
||||
case 0x0062: case 0x8062: /* B, B' */
|
||||
case 0x0063: case 0x8063: /* C, C' */
|
||||
case 0x0064: case 0x8064: /* D, D' */
|
||||
case 0x0065: case 0x8065: /* E, E' */
|
||||
case 0x0068: case 0x8068: /* H, H' */
|
||||
case 0x006c: case 0x806c: /* L, L' */
|
||||
case 0x6166: case 0xe166: /* AF, AF' */
|
||||
case 0x6263: case 0xe263: /* BC, BC' */
|
||||
case 0x6465: case 0xe465: /* DE, DE' */
|
||||
case 0x686c: case 0xe86c: /* HL, HL' */
|
||||
case 0x7370: /* SP */
|
||||
case 0x7063: /* PC */
|
||||
case 0x6978: /* IX */
|
||||
case 0x6979: /* IY */
|
||||
return hash;
|
||||
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Utility functions called by the bison parser */
|
||||
|
||||
/* The error callback if yyparse finds an error */
|
||||
void
|
||||
yyerror( const char *s )
|
||||
{
|
||||
ui_error( UI_ERROR_ERROR, "Invalid debugger command: %s", s );
|
||||
}
|
||||
|
||||
/* Get the value of a register */
|
||||
libspectrum_word
|
||||
debugger_register_get( int which )
|
||||
{
|
||||
switch( which ) {
|
||||
|
||||
/* 8-bit registers */
|
||||
case 0x0061: return A;
|
||||
case 0x8061: return A_;
|
||||
case 0x0066: return F;
|
||||
case 0x8066: return F_;
|
||||
case 0x0062: return B;
|
||||
case 0x8062: return B_;
|
||||
case 0x0063: return C;
|
||||
case 0x8063: return C_;
|
||||
case 0x0064: return D;
|
||||
case 0x8064: return D_;
|
||||
case 0x0065: return E;
|
||||
case 0x8065: return E_;
|
||||
case 0x0068: return H;
|
||||
case 0x8068: return H_;
|
||||
case 0x006c: return L;
|
||||
case 0x806c: return L_;
|
||||
|
||||
/* 16-bit registers */
|
||||
case 0x6166: return AF;
|
||||
case 0xe166: return AF_;
|
||||
case 0x6263: return BC;
|
||||
case 0xe263: return BC_;
|
||||
case 0x6465: return DE;
|
||||
case 0xe465: return DE_;
|
||||
case 0x686c: return HL;
|
||||
case 0xe86c: return HL_;
|
||||
|
||||
case 0x7370: return SP;
|
||||
case 0x7063: return PC;
|
||||
case 0x6978: return IX;
|
||||
case 0x6979: return IY;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "attempt to get unknown register '%d'", which );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the value of a register */
|
||||
void
|
||||
debugger_register_set( int which, libspectrum_word value )
|
||||
{
|
||||
switch( which ) {
|
||||
|
||||
/* 8-bit registers */
|
||||
case 0x0061: A = value; break;
|
||||
case 0x8061: A_ = value; break;
|
||||
case 0x0066: F = value; break;
|
||||
case 0x8066: F_ = value; break;
|
||||
case 0x0062: B = value; break;
|
||||
case 0x8062: B_ = value; break;
|
||||
case 0x0063: C = value; break;
|
||||
case 0x8063: C_ = value; break;
|
||||
case 0x0064: D = value; break;
|
||||
case 0x8064: D_ = value; break;
|
||||
case 0x0065: E = value; break;
|
||||
case 0x8065: E_ = value; break;
|
||||
case 0x0068: H = value; break;
|
||||
case 0x8068: H_ = value; break;
|
||||
case 0x006c: L = value; break;
|
||||
case 0x806c: L_ = value; break;
|
||||
|
||||
/* 16-bit registers */
|
||||
case 0x6166: AF = value; break;
|
||||
case 0xe166: AF_ = value; break;
|
||||
case 0x6263: BC = value; break;
|
||||
case 0xe263: BC_ = value; break;
|
||||
case 0x6465: DE = value; break;
|
||||
case 0xe465: DE_ = value; break;
|
||||
case 0x686c: HL = value; break;
|
||||
case 0xe86c: HL_ = value; break;
|
||||
|
||||
case 0x7370: SP = value; break;
|
||||
case 0x7063: PC = value; break;
|
||||
case 0x6978: IX = value; break;
|
||||
case 0x6979: IY = value; break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "attempt to set unknown register '%d'", which );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the textual representation of a register */
|
||||
const char *
|
||||
debugger_register_text( int which )
|
||||
{
|
||||
switch( which ) {
|
||||
|
||||
/* 8-bit registers */
|
||||
case 0x0061: return "A";
|
||||
case 0x8061: return "A'";
|
||||
case 0x0066: return "F";
|
||||
case 0x8066: return "F'";
|
||||
case 0x0062: return "B";
|
||||
case 0x8062: return "B'";
|
||||
case 0x0063: return "C";
|
||||
case 0x8063: return "C'";
|
||||
case 0x0064: return "D";
|
||||
case 0x8064: return "D'";
|
||||
case 0x0065: return "E";
|
||||
case 0x8065: return "E'";
|
||||
case 0x0068: return "H";
|
||||
case 0x8068: return "H'";
|
||||
case 0x006c: return "L";
|
||||
case 0x806c: return "L'";
|
||||
|
||||
/* 16-bit registers */
|
||||
case 0x6166: return "AF";
|
||||
case 0xe166: return "AF'";
|
||||
case 0x6263: return "BC";
|
||||
case 0xe263: return "BC'";
|
||||
case 0x6465: return "DE";
|
||||
case 0xe465: return "DE'";
|
||||
case 0x686c: return "HL";
|
||||
case 0xe86c: return "HL'";
|
||||
|
||||
case 0x7370: return "SP";
|
||||
case 0x7063: return "PC";
|
||||
case 0x6978: return "IX";
|
||||
case 0x6979: return "IY";
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "attempt to get unknown register '%d'", which );
|
||||
return "(invalid)";
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,162 @@
|
|||
/* commandl.l: Debugger command lexical scanner
|
||||
Copyright (c) 2002-2008 Philip Kendall
|
||||
|
||||
$Id: commandl.l 3712 2008-07-06 11:45:24Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
%{
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "debugger.h"
|
||||
#include "debugger_internals.h"
|
||||
#include "mempool.h"
|
||||
|
||||
#include "commandy.h"
|
||||
|
||||
#define YY_INPUT(buf,result,max_size) \
|
||||
{ \
|
||||
if( !debugger_command_input( buf, &result, max_size ) ) result = YY_NULL; \
|
||||
}
|
||||
|
||||
#define YY_NO_INPUT
|
||||
|
||||
%}
|
||||
|
||||
ID [a-z][a-z0-9]+
|
||||
|
||||
%option caseless
|
||||
|
||||
%s COMMANDSTATE1
|
||||
%x COMMANDSTATE2
|
||||
|
||||
%%
|
||||
|
||||
ba|bas|base { return BASE; }
|
||||
br|bre|brea|break|breakp|breakpo|breakpoi|breakpoin|breakpoint { return BREAK;}
|
||||
co|con|cont|contin|continu|continue { return CONTINUE; }
|
||||
com|comm|comma|comman|command|commands { BEGIN(COMMANDSTATE1); return COMMANDS; }
|
||||
cond|condi|condit|conditi|conditio|condition { return CONDITION; }
|
||||
cl|cle|clea|clear { return CLEAR; }
|
||||
del|dele|delet|delete { return DEBUGGER_DELETE; }
|
||||
di|dis|disa|disas|disass|disasse|disassm|disassmb|diasassmbl|disassemble {
|
||||
return DISASSEMBLE; }
|
||||
ev|eve|even|event { return EVENT; }
|
||||
ex|exi|exit { return EXIT; }
|
||||
fi|fin|fini|finis|finish { return FINISH; }
|
||||
if { return IF; }
|
||||
i|ig|ign|igno|ignor|ignore { return DEBUGGER_IGNORE; }
|
||||
n|ne|nex|next { return NEXT; }
|
||||
o|ou|out { return DEBUGGER_OUT; } /* Different name to avoid clashing
|
||||
with OUT from z80/z80_macros.h */
|
||||
p|po|por|port { return PORT; }
|
||||
pr|pri|prin|print { return DEBUGGER_PRINT; }
|
||||
r|re|rea|read { return READ; }
|
||||
se|set { return SET; }
|
||||
s|st|ste|step { return STEP; }
|
||||
t|tb|tbr|tbre|tbrea|tbreak|tbreakp|tbreakpo|tbreakpoi|tbreakpoin|tbreakpoint {
|
||||
return TBREAK; }
|
||||
ti|tim|time { return TIME; }
|
||||
w|wr|wri|writ|write { return WRITE; }
|
||||
|
||||
a|b|c|d|e|f|h|l { yylval.reg = debugger_register_hash( yytext );
|
||||
return DEBUGGER_REGISTER; }
|
||||
|
||||
"a'"|"b'"|"c'"|"d'"|"e'"|"f'"|"h'"|"l'" {
|
||||
yylval.reg = debugger_register_hash( yytext );
|
||||
return DEBUGGER_REGISTER; }
|
||||
|
||||
af|bc|de|hl|"af\'"|"bc\'"|"de\'"|"hl\'" {
|
||||
yylval.reg = debugger_register_hash( yytext );
|
||||
return DEBUGGER_REGISTER; }
|
||||
|
||||
sp|pc|ix|iy { yylval.reg = debugger_register_hash( yytext );
|
||||
return DEBUGGER_REGISTER; }
|
||||
|
||||
"(" { return '('; }
|
||||
")" { return ')'; }
|
||||
|
||||
"!" { yylval.token = '!'; return NEGATE; }
|
||||
"~" { yylval.token = '~'; return NEGATE; }
|
||||
|
||||
/* The hex constants used here are the appropriate Unicode characters */
|
||||
|
||||
"==" { yylval.token = DEBUGGER_TOKEN_EQUAL_TO; return EQUALITY; }
|
||||
"!=" { yylval.token = DEBUGGER_TOKEN_NOT_EQUAL_TO;
|
||||
return EQUALITY; }
|
||||
|
||||
"<" { yylval.token = '<'; return COMPARISON; }
|
||||
">" { yylval.token = '>'; return COMPARISON; }
|
||||
"<=" { yylval.token = DEBUGGER_TOKEN_LESS_THAN_OR_EQUAL_TO;
|
||||
return COMPARISON; }
|
||||
">=" { yylval.token = DEBUGGER_TOKEN_GREATER_THAN_OR_EQUAL_TO;
|
||||
return COMPARISON; }
|
||||
|
||||
"+" { return '+'; }
|
||||
"-" { return '-'; }
|
||||
"*" { yylval.token = '*'; return TIMES_DIVIDE; }
|
||||
"/" { yylval.token = '/'; return TIMES_DIVIDE; }
|
||||
|
||||
"&" { return '&'; }
|
||||
"^" { return '^'; }
|
||||
"|" { return '|'; }
|
||||
|
||||
"&&" { return LOGICAL_AND; }
|
||||
"||" { return LOGICAL_OR; }
|
||||
|
||||
":" { return ':'; }
|
||||
|
||||
$[[:xdigit:]]+ { yylval.integer = strtol( yytext+1, NULL, 16 );
|
||||
if( YY_START == COMMANDSTATE1 ) BEGIN( COMMANDSTATE2 );
|
||||
return NUMBER; }
|
||||
0x[[:xdigit:]]+ { yylval.integer = strtol( yytext+2, NULL, 16 );
|
||||
if( YY_START == COMMANDSTATE1 ) BEGIN( COMMANDSTATE2 );
|
||||
return NUMBER; }
|
||||
[[:digit:]]+ { yylval.integer = atoi( yytext );
|
||||
if( YY_START == COMMANDSTATE1 ) BEGIN( COMMANDSTATE2 );
|
||||
return NUMBER; }
|
||||
|
||||
[cdrx][[:digit:]]+ { yylval.integer = debugger_page_hash( yytext ); return PAGE; }
|
||||
|
||||
{ID} { yylval.string = mempool_strdup( debugger_memory_pool, yytext ); return STRING; }
|
||||
${ID} { yylval.string = mempool_strdup( debugger_memory_pool, yytext + 1 ); return VARIABLE; }
|
||||
|
||||
\n { return '\n'; }
|
||||
|
||||
[ ]+ /* Swallow whitespace */
|
||||
|
||||
. { if( 0 ) unput( '\0' ); /* Prevent warning about yyunput
|
||||
being defined and not used */
|
||||
return DEBUGGER_ERROR; }
|
||||
|
||||
/* Debugger command parsing */
|
||||
|
||||
<COMMANDSTATE2>{
|
||||
|
||||
end { BEGIN(INITIAL); return DEBUGGER_END; }
|
||||
|
||||
[^\n]* { yylval.string = mempool_strdup( debugger_memory_pool, yytext ); return STRING; }
|
||||
\n { return '\n'; }
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,148 @@
|
|||
/* A Bison parser, made by GNU Bison 2.3. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
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., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
under terms of your choice, so long as that work isn't itself a
|
||||
parser generator using the skeleton or a modified version thereof
|
||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
||||
the parser skeleton itself, you may (at your option) remove this
|
||||
special exception, which will cause the skeleton and the resulting
|
||||
Bison output files to be licensed under the GNU General Public
|
||||
License without this special exception.
|
||||
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
||||
know about them. */
|
||||
enum yytokentype {
|
||||
LOGICAL_OR = 258,
|
||||
LOGICAL_AND = 259,
|
||||
COMPARISON = 260,
|
||||
EQUALITY = 261,
|
||||
NEGATE = 262,
|
||||
TIMES_DIVIDE = 263,
|
||||
BASE = 264,
|
||||
BREAK = 265,
|
||||
TBREAK = 266,
|
||||
CLEAR = 267,
|
||||
COMMANDS = 268,
|
||||
CONDITION = 269,
|
||||
CONTINUE = 270,
|
||||
DEBUGGER_DELETE = 271,
|
||||
DISASSEMBLE = 272,
|
||||
DEBUGGER_END = 273,
|
||||
EVENT = 274,
|
||||
EXIT = 275,
|
||||
FINISH = 276,
|
||||
IF = 277,
|
||||
DEBUGGER_IGNORE = 278,
|
||||
NEXT = 279,
|
||||
DEBUGGER_OUT = 280,
|
||||
PORT = 281,
|
||||
DEBUGGER_PRINT = 282,
|
||||
READ = 283,
|
||||
SET = 284,
|
||||
STEP = 285,
|
||||
TIME = 286,
|
||||
WRITE = 287,
|
||||
PAGE = 288,
|
||||
DEBUGGER_REGISTER = 289,
|
||||
NUMBER = 290,
|
||||
STRING = 291,
|
||||
VARIABLE = 292,
|
||||
DEBUGGER_ERROR = 293
|
||||
};
|
||||
#endif
|
||||
/* Tokens. */
|
||||
#define LOGICAL_OR 258
|
||||
#define LOGICAL_AND 259
|
||||
#define COMPARISON 260
|
||||
#define EQUALITY 261
|
||||
#define NEGATE 262
|
||||
#define TIMES_DIVIDE 263
|
||||
#define BASE 264
|
||||
#define BREAK 265
|
||||
#define TBREAK 266
|
||||
#define CLEAR 267
|
||||
#define COMMANDS 268
|
||||
#define CONDITION 269
|
||||
#define CONTINUE 270
|
||||
#define DEBUGGER_DELETE 271
|
||||
#define DISASSEMBLE 272
|
||||
#define DEBUGGER_END 273
|
||||
#define EVENT 274
|
||||
#define EXIT 275
|
||||
#define FINISH 276
|
||||
#define IF 277
|
||||
#define DEBUGGER_IGNORE 278
|
||||
#define NEXT 279
|
||||
#define DEBUGGER_OUT 280
|
||||
#define PORT 281
|
||||
#define DEBUGGER_PRINT 282
|
||||
#define READ 283
|
||||
#define SET 284
|
||||
#define STEP 285
|
||||
#define TIME 286
|
||||
#define WRITE 287
|
||||
#define PAGE 288
|
||||
#define DEBUGGER_REGISTER 289
|
||||
#define NUMBER 290
|
||||
#define STRING 291
|
||||
#define VARIABLE 292
|
||||
#define DEBUGGER_ERROR 293
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
#line 46 "commandy.y"
|
||||
{
|
||||
|
||||
int token;
|
||||
int reg;
|
||||
|
||||
libspectrum_dword integer;
|
||||
char *string;
|
||||
|
||||
debugger_breakpoint_type bptype;
|
||||
debugger_breakpoint_life bplife;
|
||||
struct { int value1; libspectrum_word value2; } pair;
|
||||
|
||||
debugger_expression* exp;
|
||||
|
||||
}
|
||||
/* Line 1489 of yacc.c. */
|
||||
#line 141 "commandy.h"
|
||||
YYSTYPE;
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
|
|
@ -0,0 +1,303 @@
|
|||
/* commandy.y: Parse a debugger command
|
||||
Copyright (c) 2002-2008 Philip Kendall
|
||||
|
||||
$Id: commandy.y 3657 2008-06-08 15:04:37Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
%{
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h> /* Needed by NetBSD yacc */
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "debugger.h"
|
||||
#include "debugger_internals.h"
|
||||
#include "mempool.h"
|
||||
#include "ui/ui.h"
|
||||
#include "z80/z80.h"
|
||||
#include "z80/z80_macros.h"
|
||||
|
||||
#define YYDEBUG 1
|
||||
#define YYERROR_VERBOSE
|
||||
|
||||
%}
|
||||
|
||||
%union {
|
||||
|
||||
int token;
|
||||
int reg;
|
||||
|
||||
libspectrum_dword integer;
|
||||
char *string;
|
||||
|
||||
debugger_breakpoint_type bptype;
|
||||
debugger_breakpoint_life bplife;
|
||||
struct { int value1; libspectrum_word value2; } pair;
|
||||
|
||||
debugger_expression* exp;
|
||||
|
||||
}
|
||||
|
||||
%debug
|
||||
|
||||
/* Tokens as returned from the Flex scanner (commandl.l) */
|
||||
|
||||
/* Some tokens are named DEBUGGER_* to avoid clashes with <windows.h> */
|
||||
|
||||
%token LOGICAL_OR /* || */
|
||||
%token LOGICAL_AND /* && */
|
||||
%token <token> COMPARISON /* < > <= >= */
|
||||
%token <token> EQUALITY /* == != */
|
||||
%token <token> NEGATE /* ! ~ */
|
||||
%token <token> TIMES_DIVIDE /* * / */
|
||||
|
||||
%token BASE
|
||||
%token BREAK
|
||||
%token TBREAK
|
||||
%token CLEAR
|
||||
%token COMMANDS
|
||||
%token CONDITION
|
||||
%token CONTINUE
|
||||
%token DEBUGGER_DELETE
|
||||
%token DISASSEMBLE
|
||||
%token DEBUGGER_END
|
||||
%token EVENT
|
||||
%token EXIT
|
||||
%token FINISH
|
||||
%token IF
|
||||
%token DEBUGGER_IGNORE
|
||||
%token NEXT
|
||||
%token DEBUGGER_OUT
|
||||
%token PORT
|
||||
%token DEBUGGER_PRINT
|
||||
%token READ
|
||||
%token SET
|
||||
%token STEP
|
||||
%token TIME
|
||||
%token WRITE
|
||||
|
||||
%token <integer> PAGE
|
||||
%token <reg> DEBUGGER_REGISTER
|
||||
|
||||
%token <integer> NUMBER
|
||||
|
||||
%token <string> STRING
|
||||
%token <string> VARIABLE
|
||||
|
||||
%token DEBUGGER_ERROR
|
||||
|
||||
/* Derived types */
|
||||
|
||||
%type <bplife> breakpointlife
|
||||
%type <bptype> breakpointtype
|
||||
%type <integer> pageornumber
|
||||
%type <pair> breakpointpair
|
||||
%type <bptype> portbreakpointtype
|
||||
%type <integer> numberorpc
|
||||
%type <integer> number
|
||||
|
||||
%type <exp> optionalcondition
|
||||
|
||||
%type <exp> expressionornull
|
||||
%type <exp> expression;
|
||||
|
||||
%type <string> debuggercommand
|
||||
%type <string> debuggercommands
|
||||
|
||||
/* Operator precedences */
|
||||
|
||||
/* Low precedence */
|
||||
|
||||
%left LOGICAL_OR
|
||||
%left LOGICAL_AND
|
||||
%left '|'
|
||||
%left '^'
|
||||
%left '&'
|
||||
%left EQUALITY
|
||||
%left COMPARISON
|
||||
%left '+' '-'
|
||||
%left TIMES_DIVIDE
|
||||
%right NEGATE /* Unary minus, unary plus, !, ~ */
|
||||
|
||||
/* High precedence */
|
||||
|
||||
%%
|
||||
|
||||
input: /* empty */
|
||||
| command
|
||||
| error
|
||||
| input '\n' command
|
||||
;
|
||||
|
||||
command: BASE number { debugger_output_base = $2; }
|
||||
| breakpointlife breakpointtype breakpointpair optionalcondition {
|
||||
debugger_breakpoint_add_address( $2, $3.value1, $3.value2, 0, $1,
|
||||
$4 );
|
||||
}
|
||||
| breakpointlife PORT portbreakpointtype breakpointpair optionalcondition {
|
||||
int mask; libspectrum_word port;
|
||||
mask = $4.value1; port = $4.value2;
|
||||
if( mask == -1 ) mask = ( port < 0x100 ? 0x00ff : 0xffff );
|
||||
debugger_breakpoint_add_port( $3, port, mask, 0, $1, $5 );
|
||||
}
|
||||
| breakpointlife TIME number optionalcondition {
|
||||
debugger_breakpoint_add_time( DEBUGGER_BREAKPOINT_TYPE_TIME,
|
||||
$3, 0, $1, $4 );
|
||||
}
|
||||
| breakpointlife EVENT STRING ':' STRING optionalcondition {
|
||||
debugger_breakpoint_add_event( DEBUGGER_BREAKPOINT_TYPE_EVENT,
|
||||
$3, $5, 0, $1, $6 );
|
||||
}
|
||||
| CLEAR numberorpc { debugger_breakpoint_clear( $2 ); }
|
||||
| COMMANDS number '\n' debuggercommands DEBUGGER_END { debugger_breakpoint_set_commands( $2, $4 ); }
|
||||
| CONDITION NUMBER expressionornull {
|
||||
debugger_breakpoint_set_condition( $2, $3 );
|
||||
}
|
||||
| CONTINUE { debugger_run(); }
|
||||
| DEBUGGER_DELETE { debugger_breakpoint_remove_all(); }
|
||||
| DEBUGGER_DELETE number { debugger_breakpoint_remove( $2 ); }
|
||||
| DISASSEMBLE number { ui_debugger_disassemble( $2 ); }
|
||||
| EXIT { debugger_exit_emulator(); }
|
||||
| FINISH { debugger_breakpoint_exit(); }
|
||||
| DEBUGGER_IGNORE NUMBER number {
|
||||
debugger_breakpoint_ignore( $2, $3 );
|
||||
}
|
||||
| NEXT { debugger_next(); }
|
||||
| DEBUGGER_OUT number NUMBER { debugger_port_write( $2, $3 ); }
|
||||
| DEBUGGER_PRINT number { printf( "0x%x\n", $2 ); }
|
||||
| SET NUMBER number { debugger_poke( $2, $3 ); }
|
||||
| SET DEBUGGER_REGISTER number { debugger_register_set( $2, $3 ); }
|
||||
| SET VARIABLE number { debugger_variable_set( $2, $3 ); }
|
||||
| STEP { debugger_step(); }
|
||||
;
|
||||
|
||||
breakpointlife: BREAK { $$ = DEBUGGER_BREAKPOINT_LIFE_PERMANENT; }
|
||||
| TBREAK { $$ = DEBUGGER_BREAKPOINT_LIFE_ONESHOT; }
|
||||
;
|
||||
|
||||
breakpointtype: /* empty */ { $$ = DEBUGGER_BREAKPOINT_TYPE_EXECUTE; }
|
||||
| READ { $$ = DEBUGGER_BREAKPOINT_TYPE_READ; }
|
||||
| WRITE { $$ = DEBUGGER_BREAKPOINT_TYPE_WRITE; }
|
||||
;
|
||||
|
||||
breakpointpair: numberorpc { $$.value1 = -1; $$.value2 = $1; }
|
||||
| pageornumber ':' number { $$.value1 = $1; $$.value2 = $3; }
|
||||
;
|
||||
|
||||
pageornumber: PAGE { $$ = $1; }
|
||||
| number { $$ = $1; }
|
||||
|
||||
portbreakpointtype: READ { $$ = DEBUGGER_BREAKPOINT_TYPE_PORT_READ; }
|
||||
| WRITE { $$ = DEBUGGER_BREAKPOINT_TYPE_PORT_WRITE; }
|
||||
;
|
||||
|
||||
optionalcondition: /* empty */ { $$ = NULL; }
|
||||
| IF expression { $$ = $2; }
|
||||
;
|
||||
|
||||
numberorpc: /* empty */ { $$ = PC; }
|
||||
| number { $$ = $1; }
|
||||
;
|
||||
|
||||
expressionornull: /* empty */ { $$ = NULL; }
|
||||
| expression { $$ = $1; }
|
||||
;
|
||||
|
||||
number: expression { $$ = debugger_expression_evaluate( $1 ); }
|
||||
;
|
||||
|
||||
expression: NUMBER { $$ = debugger_expression_new_number( $1, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| DEBUGGER_REGISTER { $$ = debugger_expression_new_register( $1, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| VARIABLE { $$ = debugger_expression_new_variable( $1, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| '(' expression ')' { $$ = $2; }
|
||||
| '+' expression %prec NEGATE { $$ = $2; }
|
||||
| '-' expression %prec NEGATE {
|
||||
$$ = debugger_expression_new_unaryop( '-', $2, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| NEGATE expression {
|
||||
$$ = debugger_expression_new_unaryop( $1, $2, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression '+' expression {
|
||||
$$ = debugger_expression_new_binaryop( '+', $1, $3, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression '-' expression {
|
||||
$$ = debugger_expression_new_binaryop( '-', $1, $3, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression TIMES_DIVIDE expression {
|
||||
$$ = debugger_expression_new_binaryop( $2, $1, $3, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression EQUALITY expression {
|
||||
$$ = debugger_expression_new_binaryop( $2, $1, $3, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression COMPARISON expression {
|
||||
$$ = debugger_expression_new_binaryop( $2, $1, $3, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression '&' expression {
|
||||
$$ = debugger_expression_new_binaryop( '&', $1, $3, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression '^' expression {
|
||||
$$ = debugger_expression_new_binaryop( '^', $1, $3, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression '|' expression {
|
||||
$$ = debugger_expression_new_binaryop( '|', $1, $3, debugger_memory_pool );
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression LOGICAL_AND expression {
|
||||
$$ = debugger_expression_new_binaryop(
|
||||
DEBUGGER_TOKEN_LOGICAL_AND, $1, $3, debugger_memory_pool
|
||||
);
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
| expression LOGICAL_OR expression {
|
||||
$$ = debugger_expression_new_binaryop(
|
||||
DEBUGGER_TOKEN_LOGICAL_OR, $1, $3, debugger_memory_pool
|
||||
);
|
||||
if( !$$ ) YYABORT;
|
||||
}
|
||||
;
|
||||
|
||||
debuggercommands: debuggercommand { $$ = $1; }
|
||||
| debuggercommands debuggercommand {
|
||||
$$ = mempool_alloc( debugger_memory_pool, strlen( $1 ) + strlen( $2 ) + 2 );
|
||||
sprintf( $$, "%s\n%s", $1, $2 );
|
||||
}
|
||||
|
||||
debuggercommand: STRING '\n'
|
||||
|
||||
%%
|
|
@ -0,0 +1,186 @@
|
|||
/* debugger.c: Fuse's monitor/debugger
|
||||
Copyright (c) 2002-2008 Philip Kendall
|
||||
|
||||
$Id: debugger.c 3686 2008-06-21 14:33:22Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "debugger.h"
|
||||
#include "debugger_internals.h"
|
||||
#include "event.h"
|
||||
#include "fuse.h"
|
||||
#include "memory.h"
|
||||
#include "mempool.h"
|
||||
#include "periph.h"
|
||||
#include "ui/ui.h"
|
||||
#include "z80/z80.h"
|
||||
#include "z80/z80_macros.h"
|
||||
|
||||
/* The current activity state of the debugger */
|
||||
enum debugger_mode_t debugger_mode;
|
||||
|
||||
/* Which base should we display things in */
|
||||
int debugger_output_base;
|
||||
|
||||
/* Memory pool used by the lexer and parser */
|
||||
int debugger_memory_pool;
|
||||
|
||||
/* The event type used for time breakpoints */
|
||||
int debugger_breakpoint_event;
|
||||
|
||||
int
|
||||
debugger_init( void )
|
||||
{
|
||||
int error;
|
||||
|
||||
debugger_breakpoints = NULL;
|
||||
debugger_output_base = 16;
|
||||
|
||||
debugger_memory_pool = mempool_register_pool();
|
||||
if( debugger_memory_pool == -1 ) return 1;
|
||||
|
||||
debugger_breakpoint_event = event_register( debugger_breakpoint_time_fn, "Breakpoint" );
|
||||
if( debugger_breakpoint_event == -1 ) return 1;
|
||||
|
||||
error = debugger_event_init();
|
||||
if( error ) return error;
|
||||
|
||||
error = debugger_variable_init();
|
||||
if( error ) return error;
|
||||
|
||||
error = debugger_reset();
|
||||
if( error ) return error;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
debugger_reset( void )
|
||||
{
|
||||
debugger_breakpoint_remove_all();
|
||||
debugger_mode = DEBUGGER_MODE_INACTIVE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
debugger_end( void )
|
||||
{
|
||||
debugger_breakpoint_remove_all();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Activate the debugger */
|
||||
int
|
||||
debugger_trap( void )
|
||||
{
|
||||
return ui_debugger_activate();
|
||||
}
|
||||
|
||||
/* Step one instruction */
|
||||
int
|
||||
debugger_step( void )
|
||||
{
|
||||
debugger_mode = DEBUGGER_MODE_HALTED;
|
||||
ui_debugger_deactivate( 0 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Step to the next instruction, ignoring CALLs etc */
|
||||
int
|
||||
debugger_next( void )
|
||||
{
|
||||
size_t length;
|
||||
|
||||
/* Find out how long the current instruction is */
|
||||
debugger_disassemble( NULL, 0, &length, PC );
|
||||
|
||||
/* And add a breakpoint after that */
|
||||
debugger_breakpoint_add_address( DEBUGGER_BREAKPOINT_TYPE_EXECUTE, -1,
|
||||
PC + length, 0,
|
||||
DEBUGGER_BREAKPOINT_LIFE_ONESHOT, NULL );
|
||||
|
||||
debugger_run();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set debugger_mode so that emulation will occur */
|
||||
int
|
||||
debugger_run( void )
|
||||
{
|
||||
debugger_mode = debugger_breakpoints ?
|
||||
DEBUGGER_MODE_ACTIVE :
|
||||
DEBUGGER_MODE_INACTIVE;
|
||||
ui_debugger_deactivate( 1 );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Exit from the last CALL etc by setting a oneshot breakpoint at
|
||||
(SP) and then starting emulation */
|
||||
int
|
||||
debugger_breakpoint_exit( void )
|
||||
{
|
||||
libspectrum_word target;
|
||||
|
||||
target = readbyte_internal( SP ) + 0x100 * readbyte_internal( SP+1 );
|
||||
|
||||
if( debugger_breakpoint_add_address(
|
||||
DEBUGGER_BREAKPOINT_TYPE_EXECUTE, -1, target, 0,
|
||||
DEBUGGER_BREAKPOINT_LIFE_ONESHOT, NULL
|
||||
)
|
||||
)
|
||||
return 1;
|
||||
|
||||
if( debugger_run() ) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Poke a value into RAM */
|
||||
int
|
||||
debugger_poke( libspectrum_word address, libspectrum_byte value )
|
||||
{
|
||||
writebyte_internal( address, value );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Write a value to a port */
|
||||
int
|
||||
debugger_port_write( libspectrum_word port, libspectrum_byte value )
|
||||
{
|
||||
writeport_internal( port, value );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Exit the emulator */
|
||||
void
|
||||
debugger_exit_emulator( void )
|
||||
{
|
||||
fuse_exiting = 1;
|
||||
|
||||
/* Ensure we break out of the main Z80 loop immediately */
|
||||
event_add( 0, event_type_null );
|
||||
|
||||
debugger_run();
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/* debugger.h: Fuse's monitor/debugger
|
||||
Copyright (c) 2002-2008 Philip Kendall
|
||||
|
||||
$Id: debugger.h 3632 2008-05-26 19:51:17Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_DEBUGGER_H
|
||||
#define FUSE_DEBUGGER_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_LIB_GLIB
|
||||
#include <glib.h>
|
||||
#endif /* #ifdef HAVE_LIB_GLIB */
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "breakpoint.h"
|
||||
|
||||
/* The current state of the debugger */
|
||||
enum debugger_mode_t
|
||||
{
|
||||
DEBUGGER_MODE_INACTIVE, /* No breakpoint set */
|
||||
DEBUGGER_MODE_ACTIVE, /* Breakpoint set, but emulator running */
|
||||
DEBUGGER_MODE_HALTED, /* Execution not happening */
|
||||
};
|
||||
|
||||
extern enum debugger_mode_t debugger_mode;
|
||||
|
||||
/* Which base should we display things in */
|
||||
extern int debugger_output_base;
|
||||
|
||||
int debugger_init( void );
|
||||
int debugger_reset( void );
|
||||
|
||||
int debugger_end( void );
|
||||
|
||||
int debugger_trap( void ); /* Activate the debugger */
|
||||
|
||||
int debugger_step( void ); /* Single step */
|
||||
int debugger_next( void ); /* Go to next instruction, ignoring CALL etc */
|
||||
int debugger_run( void ); /* Set debugger_mode so that emulation will occur */
|
||||
|
||||
/* Disassemble the instruction at 'address', returning its length in
|
||||
'*length' */
|
||||
void debugger_disassemble( char *buffer, size_t buflen, size_t *length,
|
||||
libspectrum_word address );
|
||||
|
||||
/* Evaluate a debugger command */
|
||||
int debugger_command_evaluate( const char *command );
|
||||
|
||||
/* Get a deparsed expression */
|
||||
int debugger_expression_deparse( char *buffer, size_t length,
|
||||
const debugger_expression *exp );
|
||||
|
||||
/* Register an event type with the debugger */
|
||||
int debugger_event_register( const char *type, const char *detail );
|
||||
|
||||
/* Fire off a debugger event */
|
||||
void debugger_event( int event_code );
|
||||
|
||||
#endif /* #ifndef FUSE_DEBUGGER_H */
|
|
@ -0,0 +1,112 @@
|
|||
/* debugger_internals.h: The internals of Fuse's monitor/debugger
|
||||
Copyright (c) 2002-2008 Philip Kendall
|
||||
|
||||
$Id: debugger_internals.h 3681 2008-06-16 09:40:29Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_DEBUGGER_INTERNALS_H
|
||||
#define FUSE_DEBUGGER_INTERNALS_H
|
||||
|
||||
#include "debugger.h"
|
||||
|
||||
/* Memory pool used by the lexer and parser */
|
||||
extern int debugger_memory_pool;
|
||||
|
||||
/* The event type used to trigger time breakpoints */
|
||||
extern int debugger_breakpoint_event;
|
||||
|
||||
void debugger_breakpoint_time_fn( libspectrum_dword tstates, int type, void *user_data );
|
||||
|
||||
int debugger_breakpoint_remove( size_t id );
|
||||
int debugger_breakpoint_remove_all( void );
|
||||
int debugger_breakpoint_clear( libspectrum_word address );
|
||||
int debugger_breakpoint_exit( void );
|
||||
int debugger_breakpoint_ignore( size_t id, size_t ignore );
|
||||
int debugger_breakpoint_set_condition( size_t id,
|
||||
debugger_expression *condition );
|
||||
int debugger_breakpoint_set_commands( size_t id, const char *commands );
|
||||
int debugger_breakpoint_trigger( debugger_breakpoint *bp );
|
||||
|
||||
int debugger_poke( libspectrum_word address, libspectrum_byte value );
|
||||
int debugger_port_write( libspectrum_word address, libspectrum_byte value );
|
||||
|
||||
int debugger_register_hash( const char *reg );
|
||||
libspectrum_word debugger_register_get( int which );
|
||||
void debugger_register_set( int which, libspectrum_word value );
|
||||
const char* debugger_register_text( int which );
|
||||
|
||||
void debugger_exit_emulator( void );
|
||||
|
||||
/* Utility functions called by the flex scanner */
|
||||
|
||||
int debugger_command_input( char *buf, int *result, int max_size );
|
||||
int debugger_page_hash( const char *text );
|
||||
int yylex( void );
|
||||
void yyerror( const char *s );
|
||||
|
||||
/* The semantic values of some tokens */
|
||||
|
||||
typedef enum debugger_token {
|
||||
|
||||
/* Chosen to match up with Unicode values */
|
||||
DEBUGGER_TOKEN_LOGICAL_AND = 0x2227,
|
||||
DEBUGGER_TOKEN_LOGICAL_OR = 0x2228,
|
||||
|
||||
DEBUGGER_TOKEN_EQUAL_TO = 0x225f,
|
||||
DEBUGGER_TOKEN_NOT_EQUAL_TO = 0x2260,
|
||||
|
||||
DEBUGGER_TOKEN_LESS_THAN_OR_EQUAL_TO = 0x2264,
|
||||
DEBUGGER_TOKEN_GREATER_THAN_OR_EQUAL_TO = 0x2265,
|
||||
|
||||
} debugger_token;
|
||||
|
||||
/* Numeric expression stuff */
|
||||
|
||||
debugger_expression*
|
||||
debugger_expression_new_number( libspectrum_dword number, int pool );
|
||||
debugger_expression* debugger_expression_new_register( int which, int pool );
|
||||
debugger_expression*
|
||||
debugger_expression_new_unaryop( int operation, debugger_expression *operand, int pool );
|
||||
debugger_expression*
|
||||
debugger_expression_new_binaryop( int operation, debugger_expression *operand1,
|
||||
debugger_expression *operand2, int pool );
|
||||
debugger_expression*
|
||||
debugger_expression_new_variable( const char *name, int pool );
|
||||
|
||||
debugger_expression* debugger_expression_copy( debugger_expression *src );
|
||||
void debugger_expression_delete( debugger_expression* expression );
|
||||
|
||||
libspectrum_dword
|
||||
debugger_expression_evaluate( debugger_expression* expression );
|
||||
|
||||
/* Event handling */
|
||||
|
||||
int debugger_event_init( void );
|
||||
int debugger_event_is_registered( const char *type, const char *detail );
|
||||
|
||||
/* Variables handling */
|
||||
|
||||
int debugger_variable_init( void );
|
||||
void debugger_variable_set( const char *name, libspectrum_dword value );
|
||||
libspectrum_dword debugger_variable_get( const char *name );
|
||||
|
||||
#endif /* #ifndef FUSE_DEBUGGER_INTERNALS_H */
|
|
@ -0,0 +1,778 @@
|
|||
/* disassemble.c: Fuse's disassembler
|
||||
Copyright (c) 2002-2003 Darren Salt, Philip Kendall
|
||||
|
||||
$Id: disassemble.c 3115 2007-08-19 02:49:14Z fredm $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Darren: linux@youmustbejoking.demon.co.uk
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "debugger.h"
|
||||
#include "fuse.h"
|
||||
#include "memory.h"
|
||||
|
||||
/* Used to flag whether we're after a DD or FD prefix */
|
||||
enum hl_type { USE_HL, USE_IX, USE_IY };
|
||||
|
||||
static void disassemble_main( libspectrum_word address, char *buffer,
|
||||
size_t buflen, size_t *length,
|
||||
enum hl_type use_hl );
|
||||
static void disassemble_00xxxxxx( libspectrum_word address, char *buffer,
|
||||
size_t buflen, size_t *length,
|
||||
enum hl_type use_hl );
|
||||
static void disassemble_00xxx010( libspectrum_word address, char *buffer,
|
||||
size_t buflen, size_t *length,
|
||||
enum hl_type use_hl );
|
||||
static void disassemble_00xxx110( libspectrum_word address, char *buffer,
|
||||
size_t buflen, size_t *length,
|
||||
enum hl_type use_hl );
|
||||
static void disassemble_11xxxxxx( libspectrum_word address, char *buffer,
|
||||
size_t buflen, size_t *length,
|
||||
enum hl_type use_hl );
|
||||
static void disassemble_11xxx001( libspectrum_byte b, char *buffer,
|
||||
size_t buflen, size_t *length,
|
||||
enum hl_type use_hl );
|
||||
static void disassemble_11xxx011( libspectrum_word address, char *buffer,
|
||||
size_t buflen, size_t *length,
|
||||
enum hl_type use_hl );
|
||||
static void disassemble_11xxx101( libspectrum_word address, char *buffer,
|
||||
size_t buflen, size_t *length,
|
||||
enum hl_type use_hl );
|
||||
static void disassemble_cb( libspectrum_word address, char *buffer,
|
||||
size_t buflen, size_t *length );
|
||||
static void disassemble_ed( libspectrum_word address, char *buffer,
|
||||
size_t buflen, size_t *length );
|
||||
static void disassemble_ddfd_cb( libspectrum_word address, char offset,
|
||||
enum hl_type use_hl, char *buffer,
|
||||
size_t buflen, size_t *length );
|
||||
|
||||
static void get_byte( char *buffer, size_t buflen, libspectrum_byte b );
|
||||
static void get_word( char *buffer, size_t buflen, libspectrum_word address );
|
||||
static void get_offset( char *buffer, size_t buflen, libspectrum_word address,
|
||||
libspectrum_byte offset );
|
||||
|
||||
static const char *reg_pair( libspectrum_byte b, enum hl_type use_hl );
|
||||
static const char *hl_ix_iy( enum hl_type use_hl );
|
||||
static void ix_iy_offset( char *buffer, size_t buflen, enum hl_type use_hl,
|
||||
libspectrum_byte offset );
|
||||
|
||||
static int source_reg( libspectrum_word address, enum hl_type use_hl,
|
||||
char *buffer, size_t buflen );
|
||||
static int dest_reg( libspectrum_word address, enum hl_type use_hl,
|
||||
char *buffer, size_t buflen );
|
||||
static int single_reg( int i, enum hl_type use_hl, libspectrum_byte offset,
|
||||
char *buffer, size_t buflen );
|
||||
|
||||
static const char *addition_op( libspectrum_byte b );
|
||||
static const char *condition( libspectrum_byte b );
|
||||
static const char *rotate_op( libspectrum_byte b );
|
||||
static const char *bit_op( libspectrum_byte b );
|
||||
static int bit_op_bit( libspectrum_byte b );
|
||||
|
||||
/* A very thin wrapper to avoid exposing the USE_HL constant */
|
||||
void
|
||||
debugger_disassemble( char *buffer, size_t buflen, size_t *length,
|
||||
libspectrum_word address )
|
||||
{
|
||||
disassemble_main( address, buffer, buflen, length, USE_HL );
|
||||
}
|
||||
|
||||
/* Disassemble one instruction */
|
||||
static void
|
||||
disassemble_main( libspectrum_word address, char *buffer, size_t buflen,
|
||||
size_t *length, enum hl_type use_hl )
|
||||
{
|
||||
libspectrum_byte b;
|
||||
char buffer2[40], buffer3[40];
|
||||
|
||||
b = readbyte_internal( address );
|
||||
|
||||
if( b < 0x40 ) {
|
||||
disassemble_00xxxxxx( address, buffer, buflen, length, use_hl );
|
||||
} else if( b == 0x76 ) {
|
||||
snprintf( buffer, buflen, "HALT" ); *length = 1;
|
||||
} else if( b < 0x80 ) {
|
||||
|
||||
if( ( b & 0x07 ) == 0x06 ) { /* LD something,(HL) */
|
||||
dest_reg( address, USE_HL, buffer2, 40 );
|
||||
source_reg( address, use_hl, buffer3, 40 );
|
||||
*length = ( use_hl == USE_HL ? 1 : 2 );
|
||||
} else if( ( ( b >> 3 ) & 0x07 ) == 0x06 ) { /* LD (HL),something */
|
||||
dest_reg( address, use_hl, buffer2, 40 );
|
||||
source_reg( address, USE_HL, buffer3, 40 );
|
||||
*length = ( use_hl == USE_HL ? 1 : 2 );
|
||||
} else { /* Does not involve (HL) at all */
|
||||
dest_reg( address, use_hl, buffer2, 40 );
|
||||
source_reg( address, use_hl, buffer3, 40 );
|
||||
*length = 1;
|
||||
}
|
||||
/* Note LD (HL),(HL) does not exist */
|
||||
|
||||
snprintf( buffer, buflen, "LD %s,%s", buffer2, buffer3 );
|
||||
|
||||
} else if( b < 0xc0 ) {
|
||||
*length = 1 + source_reg( address, use_hl, buffer2, 40 );
|
||||
snprintf( buffer, buflen, addition_op( b ), buffer2 );
|
||||
} else {
|
||||
disassemble_11xxxxxx( address, buffer, buflen, length, use_hl );
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble something of the form 00xxxxxx */
|
||||
static void
|
||||
disassemble_00xxxxxx( libspectrum_word address, char *buffer, size_t buflen,
|
||||
size_t *length, enum hl_type use_hl )
|
||||
{
|
||||
const char *opcode_00xxx000[] = {
|
||||
"NOP", "EX AF,AF'", "DJNZ ", "JR ", "JR NZ,", "JR Z,", "JR NC,", "JR C,"
|
||||
};
|
||||
const char *opcode_00xxx111[] = {
|
||||
"RLCA", "RRCA", "RLA", "RRA", "DAA", "CPL", "SCF", "CCF"
|
||||
};
|
||||
char buffer2[40], buffer3[40];
|
||||
|
||||
libspectrum_byte b = readbyte_internal( address );
|
||||
|
||||
switch( b & 0x0f ) {
|
||||
|
||||
case 0x00: case 0x08:
|
||||
if( b <= 0x08 ) {
|
||||
snprintf( buffer, buflen, opcode_00xxx000[ b >> 3 ] ); *length = 1;
|
||||
} else {
|
||||
get_offset( buffer2, 40, address + 2, readbyte_internal( address + 1 ) );
|
||||
snprintf( buffer, buflen, "%s%s", opcode_00xxx000[ b >> 3 ], buffer2 );
|
||||
*length = 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "LD %s,%s", reg_pair( b, use_hl ), buffer2 );
|
||||
*length = 3;
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
disassemble_00xxx010( address, buffer, buflen, length, use_hl );
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
snprintf( buffer, buflen, "INC %s", reg_pair( b, use_hl ) ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x04: case 0x0c:
|
||||
*length = 1 + dest_reg( address, use_hl, buffer2, 40 );
|
||||
snprintf( buffer, buflen, "INC %s", buffer2 );
|
||||
break;
|
||||
|
||||
case 0x05: case 0x0d:
|
||||
*length = 1 + dest_reg( address, use_hl, buffer2, 40 );
|
||||
snprintf( buffer, buflen, "DEC %s", buffer2 );
|
||||
break;
|
||||
|
||||
case 0x06: case 0x0e:
|
||||
*length = 2 + dest_reg( address, use_hl, buffer2, 40 );
|
||||
get_byte( buffer3, 40, readbyte_internal( address + *length - 1 ) );
|
||||
snprintf( buffer, buflen, "LD %s,%s", buffer2, buffer3 );
|
||||
break;
|
||||
|
||||
case 0x07: case 0x0f:
|
||||
snprintf( buffer, buflen, "%s", opcode_00xxx111[ b >> 3 ] ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x09:
|
||||
snprintf( buffer, buflen, "ADD %s,%s", hl_ix_iy( use_hl ),
|
||||
reg_pair( b, use_hl ) );
|
||||
*length = 1;
|
||||
break;
|
||||
|
||||
case 0x0a:
|
||||
disassemble_00xxx110( address, buffer, buflen, length, use_hl );
|
||||
break;
|
||||
|
||||
case 0x0b:
|
||||
snprintf( buffer, buflen, "DEC %s", reg_pair( b, use_hl ) );
|
||||
*length = 1;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble something of the form 00xxx010 */
|
||||
static void
|
||||
disassemble_00xxx010( libspectrum_word address, char *buffer, size_t buflen,
|
||||
size_t *length, enum hl_type use_hl )
|
||||
{
|
||||
char buffer2[40];
|
||||
libspectrum_byte b = readbyte_internal( address );
|
||||
|
||||
switch( b >> 4 ) {
|
||||
|
||||
case 0: case 1:
|
||||
snprintf( buffer, buflen, "LD (%s),A", reg_pair( b, use_hl ) );
|
||||
*length = 1;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "LD (%s),%s", buffer2, hl_ix_iy( use_hl ) );
|
||||
*length = 3;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "LD (%s),A", buffer2 ); *length = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble something of the form 00xxx110 */
|
||||
static void
|
||||
disassemble_00xxx110( libspectrum_word address, char *buffer, size_t buflen,
|
||||
size_t *length, enum hl_type use_hl )
|
||||
{
|
||||
char buffer2[40];
|
||||
libspectrum_byte b = readbyte_internal( address );
|
||||
|
||||
switch( b >> 4 ) {
|
||||
|
||||
case 0: case 1:
|
||||
snprintf( buffer, buflen, "LD A,(%s)", reg_pair( b, use_hl ) );
|
||||
*length = 1;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "LD %s,(%s)", hl_ix_iy( use_hl ), buffer2 );
|
||||
*length = 3;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "LD A,(%s)", buffer2 ); *length = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble something of the form 11xxxxxx */
|
||||
static void
|
||||
disassemble_11xxxxxx( libspectrum_word address, char *buffer, size_t buflen,
|
||||
size_t *length, enum hl_type use_hl )
|
||||
{
|
||||
char buffer2[40];
|
||||
libspectrum_byte b = readbyte_internal( address );
|
||||
|
||||
switch( b & 0x07 ) {
|
||||
|
||||
case 0x00:
|
||||
snprintf( buffer, buflen, "RET %s", condition( b ) ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
disassemble_11xxx001( b, buffer, buflen, length, use_hl );
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "JP %s,%s", condition( b ), buffer2 );
|
||||
*length = 3;
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
disassemble_11xxx011( address, buffer, buflen, length, use_hl );
|
||||
break;
|
||||
|
||||
case 0x04:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "CALL %s,%s", condition( b ), buffer2 );
|
||||
*length = 3;
|
||||
break;
|
||||
|
||||
case 0x05:
|
||||
disassemble_11xxx101( address, buffer, buflen, length, use_hl );
|
||||
break;
|
||||
|
||||
case 0x06:
|
||||
get_byte( buffer2, 40, readbyte_internal( address + 1 ) );
|
||||
snprintf( buffer, buflen, addition_op( b ), buffer2 );
|
||||
*length = 2;
|
||||
break;
|
||||
|
||||
case 0x07:
|
||||
snprintf( buffer, buflen, "RST %X", 0x08 * ( ( b >> 3 ) - 0x18 ) );
|
||||
*length = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble something for the form 11xxx001 */
|
||||
static void
|
||||
disassemble_11xxx001( libspectrum_byte b, char *buffer, size_t buflen,
|
||||
size_t *length, enum hl_type use_hl )
|
||||
{
|
||||
switch( ( b >> 3 ) - 0x18 ) {
|
||||
|
||||
case 0x00: case 0x02: case 0x04:
|
||||
snprintf( buffer, buflen, "POP %s", reg_pair( b, use_hl ) ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x01: snprintf( buffer, buflen, "RET" ); *length = 1; break;
|
||||
case 0x03: snprintf( buffer, buflen, "EXX" ); *length = 1; break;
|
||||
|
||||
case 0x05:
|
||||
snprintf( buffer, buflen, "JP %s", hl_ix_iy( use_hl ) ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x06: snprintf( buffer, buflen, "POP AF" ); *length = 1; break;
|
||||
|
||||
case 0x07:
|
||||
snprintf( buffer, buflen, "LD SP,%s", hl_ix_iy( use_hl ) ); *length = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble something for the form 11xxx011 */
|
||||
static void
|
||||
disassemble_11xxx011( libspectrum_word address, char *buffer, size_t buflen,
|
||||
size_t *length, enum hl_type use_hl )
|
||||
{
|
||||
char buffer2[40];
|
||||
libspectrum_byte b = readbyte_internal( address );
|
||||
|
||||
switch( ( b >> 3 ) - 0x18 ) {
|
||||
|
||||
case 0x00:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "JP %s", buffer2 ); *length = 3;
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
if( use_hl != USE_HL ) {
|
||||
char offset = readbyte_internal( address + 1 );
|
||||
disassemble_ddfd_cb( address+2, offset, use_hl, buffer, buflen,
|
||||
length );
|
||||
(*length) += 2;
|
||||
} else {
|
||||
disassemble_cb( address+1, buffer, buflen, length ); (*length)++;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
get_byte( buffer2, 40, readbyte_internal( address + 1 ) );
|
||||
snprintf( buffer, buflen, "OUT (%s),A", buffer2 ); *length = 2;
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
get_byte( buffer2, 40, readbyte_internal( address + 1 ) );
|
||||
snprintf( buffer, buflen, "IN A,(%s)", buffer2 ); *length = 2;
|
||||
break;
|
||||
|
||||
case 0x04:
|
||||
snprintf( buffer, buflen, "EX (SP),%s", hl_ix_iy( use_hl ) ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x05:
|
||||
/* Note: does not get modified by DD or FD */
|
||||
snprintf( buffer, buflen, "EX DE,HL" ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x06:
|
||||
snprintf( buffer, buflen, "DI" ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x07:
|
||||
snprintf( buffer, buflen, "EI" ); *length = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble something for the form 11xxx101 */
|
||||
static void
|
||||
disassemble_11xxx101( libspectrum_word address, char *buffer, size_t buflen,
|
||||
size_t *length, enum hl_type use_hl )
|
||||
{
|
||||
char buffer2[40];
|
||||
libspectrum_byte b = readbyte_internal( address );
|
||||
|
||||
switch( ( b >> 3 ) - 0x18 ) {
|
||||
|
||||
case 0x00: case 0x02: case 0x04:
|
||||
snprintf( buffer, buflen, "PUSH %s", reg_pair( b, use_hl ) ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x01:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "CALL %s", buffer2 ); *length = 3;
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
disassemble_main( address+1, buffer, buflen, length, USE_IX ); (*length)++;
|
||||
break;
|
||||
|
||||
case 0x05:
|
||||
disassemble_ed( address+1, buffer, buflen, length ); (*length)++;
|
||||
break;
|
||||
|
||||
case 0x06:
|
||||
snprintf( buffer, buflen, "PUSH AF" ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x07:
|
||||
disassemble_main( address+1, buffer, buflen, length, USE_IY ); (*length)++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble an instruction after a CB prefix */
|
||||
static void
|
||||
disassemble_cb( libspectrum_word address, char *buffer, size_t buflen,
|
||||
size_t *length )
|
||||
{
|
||||
char buffer2[40];
|
||||
libspectrum_byte b = readbyte_internal( address );
|
||||
|
||||
source_reg( address, USE_HL, buffer2, 40 );
|
||||
|
||||
if( b < 0x40 ) {
|
||||
snprintf( buffer, buflen, "%s %s", rotate_op( b ), buffer2 );
|
||||
*length = 1;
|
||||
} else {
|
||||
snprintf( buffer, buflen, "%s %d,%s", bit_op( b ), bit_op_bit( b ),
|
||||
buffer2 );
|
||||
*length = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble an instruction after an ED prefix */
|
||||
static void
|
||||
disassemble_ed( libspectrum_word address, char *buffer, size_t buflen,
|
||||
size_t *length )
|
||||
{
|
||||
libspectrum_byte b;
|
||||
char buffer2[40];
|
||||
|
||||
const char *opcode_01xxx111[] = {
|
||||
"LD I,A", "LD R,A", "LD A,I", "LD A,R", "RRD", "RLD", "NOPD", "NOPD"
|
||||
};
|
||||
|
||||
/* Note 0xbc to 0xbf removed before this table is used */
|
||||
const char *opcode_101xxxxx[] = {
|
||||
"LDI", "CPI", "INI", "OUTI", "NOPD", "NOPD", "NOPD", "NOPD",
|
||||
"LDD", "CPD", "IND", "OUTD", "NOPD", "NOPD", "NOPD", "NOPD",
|
||||
"LDIR", "CPIR", "INIR", "OTIR", "NOPD", "NOPD", "NOPD", "NOPD",
|
||||
"LDDR", "CPDR", "INDR", "OTDR"
|
||||
};
|
||||
|
||||
/* The order in which the IM x instructions appear */
|
||||
const int im_modes[] = { 0, 0, 1, 2 };
|
||||
|
||||
b = readbyte_internal( address );
|
||||
|
||||
if( b < 0x40 || b > 0xbb ) {
|
||||
snprintf( buffer, buflen, "NOPD" ); *length = 1;
|
||||
} else if( b < 0x80 ) {
|
||||
|
||||
switch( b & 0x0f ) {
|
||||
|
||||
case 0x00: case 0x08:
|
||||
if( b == 0x70 ) {
|
||||
snprintf( buffer, buflen, "IN F,(C)" ); *length = 1;
|
||||
} else {
|
||||
dest_reg( address, USE_HL, buffer2, 40 );
|
||||
snprintf( buffer, buflen, "IN %s,(C)", buffer2 ); *length = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x01: case 0x09:
|
||||
if( b == 0x71 ) {
|
||||
snprintf( buffer, buflen, "OUT (C),0" ); *length = 1;
|
||||
} else {
|
||||
dest_reg( address, USE_HL, buffer2, 40 );
|
||||
snprintf( buffer, buflen, "OUT (C),%s", buffer2 ); *length = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
snprintf( buffer, buflen, "SBC HL,%s", reg_pair( b, USE_HL ) );
|
||||
*length = 1;
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "LD (%s),%s", buffer2, reg_pair( b, USE_HL ) );
|
||||
*length = 3;
|
||||
break;
|
||||
|
||||
case 0x04: case 0x0c:
|
||||
snprintf( buffer, buflen, "NEG" ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x05: case 0x0d:
|
||||
snprintf( buffer, buflen, "RETN" ); *length = 1;
|
||||
break;
|
||||
|
||||
case 0x06: case 0x0e:
|
||||
snprintf( buffer, buflen, "IM %d", im_modes[ ( b >> 3 ) & 0x03 ] );
|
||||
*length = 1;
|
||||
break;
|
||||
|
||||
case 0x07: case 0x0f:
|
||||
snprintf( buffer, buflen, opcode_01xxx111[ ( b >> 3 ) & 0x07 ] );
|
||||
*length = 1;
|
||||
break;
|
||||
|
||||
case 0x0a:
|
||||
snprintf( buffer, buflen, "ADC HL,%s", reg_pair( b, USE_HL ) );
|
||||
*length = 1;
|
||||
break;
|
||||
|
||||
case 0x0b:
|
||||
get_word( buffer2, 40, address + 1 );
|
||||
snprintf( buffer, buflen, "LD %s,(%s)", reg_pair( b, USE_HL ), buffer2 );
|
||||
*length = 3;
|
||||
break;
|
||||
|
||||
}
|
||||
} else if( b < 0xa0 ) {
|
||||
snprintf( buffer, buflen, "NOPD" ); *length = 1; *length = 1;
|
||||
} else {
|
||||
/* Note: 0xbc to 0xbf already removed */
|
||||
snprintf( buffer, buflen, opcode_101xxxxx[ b & 0x1f ] ); *length = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disassemble an instruction after DD/FD CB prefixes */
|
||||
static void
|
||||
disassemble_ddfd_cb( libspectrum_word address, char offset,
|
||||
enum hl_type use_hl, char *buffer, size_t buflen,
|
||||
size_t *length )
|
||||
{
|
||||
libspectrum_byte b = readbyte_internal( address );
|
||||
char buffer2[40], buffer3[40];
|
||||
|
||||
if( b < 0x40 ) {
|
||||
if( ( b & 0x07 ) == 0x06 ) {
|
||||
ix_iy_offset( buffer2, 40, use_hl, offset );
|
||||
snprintf( buffer, buflen, "%s %s", rotate_op( b ), buffer2 );
|
||||
*length = 1;
|
||||
} else {
|
||||
source_reg( address, USE_HL, buffer2, 40 );
|
||||
ix_iy_offset( buffer3, 40, use_hl, offset );
|
||||
snprintf( buffer, buflen, "LD %s,%s %s", buffer2,
|
||||
rotate_op( b ), buffer3 );
|
||||
*length = 1;
|
||||
}
|
||||
} else if( b < 0x80 ) {
|
||||
ix_iy_offset( buffer2, 40, use_hl, offset );
|
||||
snprintf( buffer, buflen, "BIT %d,%s", ( b >> 3 ) & 0x07, buffer2 );
|
||||
*length = 1;
|
||||
} else {
|
||||
if( ( b & 0x07 ) == 0x06 ) {
|
||||
ix_iy_offset( buffer2, 40, use_hl, offset );
|
||||
snprintf( buffer, buflen, "%s %d,%s", bit_op( b ), bit_op_bit( b ),
|
||||
buffer2 );
|
||||
*length = 1;
|
||||
} else {
|
||||
source_reg( address, USE_HL, buffer2, 40 );
|
||||
ix_iy_offset( buffer3, 40, use_hl, offset );
|
||||
snprintf( buffer, buflen, "LD %s,%s %s", buffer2, bit_op( b ), buffer3 );
|
||||
*length = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Get a text representation of a one-byte number */
|
||||
static void
|
||||
get_byte( char *buffer, size_t buflen, libspectrum_byte b )
|
||||
{
|
||||
snprintf( buffer, buflen, debugger_output_base == 10 ? "%d" : "%02X", b );
|
||||
}
|
||||
|
||||
/* Get a text representation of an (LSB) two-byte number */
|
||||
static void
|
||||
get_word( char *buffer, size_t buflen, libspectrum_word address )
|
||||
{
|
||||
libspectrum_word w;
|
||||
|
||||
w = readbyte_internal( address + 1 ); w <<= 8;
|
||||
w += readbyte_internal( address );
|
||||
|
||||
snprintf( buffer, buflen, debugger_output_base == 10 ? "%d" : "%04X", w );
|
||||
}
|
||||
|
||||
/* Get a text representation of ( 'address' + 'offset' ) */
|
||||
static void
|
||||
get_offset( char *buffer, size_t buflen, libspectrum_word address,
|
||||
libspectrum_byte offset )
|
||||
{
|
||||
address += ( offset >= 0x80 ? offset-0x100 : offset );
|
||||
snprintf( buffer, buflen, debugger_output_base == 10 ? "%d" : "%04X",
|
||||
address );
|
||||
}
|
||||
|
||||
/* Select the appropriate register pair from BC, DE, HL (or IX, IY) or
|
||||
SP, depending on bits 4 and 5 of the opcode */
|
||||
static const char *
|
||||
reg_pair( libspectrum_byte b, enum hl_type use_hl )
|
||||
{
|
||||
switch( ( b >> 4 ) & 0x03 ) {
|
||||
case 0: return "BC";
|
||||
case 1: return "DE";
|
||||
case 2: return hl_ix_iy( use_hl );
|
||||
case 3: return "SP";
|
||||
}
|
||||
return "* INTERNAL ERROR *"; /* Should never happen */
|
||||
}
|
||||
|
||||
/* Get whichever of HL, IX or IY is in use here */
|
||||
static const char *
|
||||
hl_ix_iy( enum hl_type use_hl )
|
||||
{
|
||||
switch( use_hl ) {
|
||||
case USE_HL: return "HL";
|
||||
case USE_IX: return "IX";
|
||||
case USE_IY: return "IY";
|
||||
}
|
||||
return "* INTERNAL ERROR *"; /* Should never happen */
|
||||
}
|
||||
|
||||
/* Get a text representation of '(IX+03)' or similar things */
|
||||
static void
|
||||
ix_iy_offset( char *buffer, size_t buflen, enum hl_type use_hl,
|
||||
libspectrum_byte offset )
|
||||
{
|
||||
if( offset < 0x80 ) {
|
||||
snprintf( buffer, buflen,
|
||||
debugger_output_base == 10 ? "(%s+%d)" : "(%s+%02X)",
|
||||
hl_ix_iy( use_hl ), offset );
|
||||
} else {
|
||||
snprintf( buffer, buflen,
|
||||
debugger_output_base == 10 ? "(%s-%d)" : "(%s-%02X)",
|
||||
hl_ix_iy( use_hl ), 0x100 - offset );
|
||||
}
|
||||
}
|
||||
|
||||
/* Get an 8-bit register, based on bits 0-2 of the opcode at 'address' */
|
||||
static int
|
||||
source_reg( libspectrum_word address, enum hl_type use_hl, char *buffer,
|
||||
size_t buflen )
|
||||
{
|
||||
return single_reg( readbyte_internal( address ) & 0x07, use_hl,
|
||||
readbyte_internal( address + 1 ), buffer, buflen );
|
||||
}
|
||||
|
||||
/* Get an 8-bit register, based on bits 3-5 of the opcode at 'address' */
|
||||
static int
|
||||
dest_reg( libspectrum_word address, enum hl_type use_hl, char *buffer,
|
||||
size_t buflen )
|
||||
{
|
||||
return single_reg( ( readbyte_internal( address ) >> 3 ) & 0x07, use_hl,
|
||||
readbyte_internal( address + 1 ), buffer, buflen );
|
||||
}
|
||||
|
||||
/* Get an 8-bit register name, including (HL). Also substitutes
|
||||
IXh, IXl and (IX+nn) and the IY versions if appropriate */
|
||||
static int
|
||||
single_reg( int i, enum hl_type use_hl, libspectrum_byte offset,
|
||||
char *buffer, size_t buflen )
|
||||
{
|
||||
char buffer2[40];
|
||||
|
||||
if( i == 0x04 && use_hl != USE_HL ) {
|
||||
snprintf( buffer, buflen, "%sh", hl_ix_iy( use_hl ) );
|
||||
return 0;
|
||||
} else if( i == 0x05 && use_hl != USE_HL ) {
|
||||
snprintf( buffer, buflen, "%sl", hl_ix_iy( use_hl ) );
|
||||
return 0;
|
||||
} else if( i == 0x06 && use_hl != USE_HL ) {
|
||||
ix_iy_offset( buffer2, 40, use_hl, offset );
|
||||
snprintf( buffer, buflen, "%s", buffer2 );
|
||||
return 1;
|
||||
} else {
|
||||
const char *regs[] = { "B", "C", "D", "E", "H", "L", "(HL)", "A" };
|
||||
snprintf( buffer, buflen, regs[i] );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Various lookup tables for opcodes */
|
||||
|
||||
/* Addition/subtraction opcodes:
|
||||
10xxxrrr: 'xxx' selects the opcode and 'rrr' the register to be added
|
||||
11xxx110: 'xxx' selects the opcode and add a constant
|
||||
*/
|
||||
static const char *
|
||||
addition_op( libspectrum_byte b )
|
||||
{
|
||||
const char *ops[] = { "ADD A,%s", "ADC A,%s", "SUB %s", "SBC A,%s",
|
||||
"AND %s", "XOR %s", "OR %s", "CP %s" };
|
||||
return ops[ ( b >> 3 ) & 0x07 ];
|
||||
}
|
||||
|
||||
/* Conditions for jumps, etc:
|
||||
11xxx000: RET condition
|
||||
11xxx010: JP condition,nnnn
|
||||
11xxx100: CALL condition,nnnn
|
||||
*/
|
||||
static const char *
|
||||
condition( libspectrum_byte b )
|
||||
{
|
||||
const char *conds[] = { "NZ", "Z", "NC", "C", "PO", "PE", "P", "M" };
|
||||
return conds[ ( b >> 3 ) & 0x07 ];
|
||||
}
|
||||
|
||||
/* Shift/rotate operations:
|
||||
CB 00xxxrrr: 'xxx' selects the opcode and 'rrr' the register
|
||||
DD/FD CB <offset> 00xxxrrr: the documented rotate/shifts on (IX+nn) etc
|
||||
and the undocumented rotate-and-store opcodes
|
||||
*/
|
||||
static const char *
|
||||
rotate_op( libspectrum_byte b )
|
||||
{
|
||||
const char *ops[] = { "RLC", "RRC", "RL", "RR", "SLA", "SRA", "SLL", "SRL" };
|
||||
return ops[ b >> 3 ];
|
||||
}
|
||||
|
||||
/* Bit operations:
|
||||
CB oobbbrrr: 'oo' (not 00) selects operation
|
||||
'bbb' selects bit
|
||||
'rrr' selects register
|
||||
DD/FD CB <offset> oobbbrrr: the documented bit ops on (IX+nn) etc and the
|
||||
undocumented bit-op-and store
|
||||
*/
|
||||
static const char *
|
||||
bit_op( libspectrum_byte b )
|
||||
{
|
||||
const char *ops[] = { "BIT", "RES", "SET" };
|
||||
return ops[ ( b >> 6 ) - 1 ];
|
||||
}
|
||||
|
||||
/* Which bit is used by a BIT, RES or SET with this opcode (bits 3-5) */
|
||||
static int
|
||||
bit_op_bit( libspectrum_byte b )
|
||||
{
|
||||
return ( b >> 3 ) & 0x07;
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
/* event.c: Debugger events
|
||||
Copyright (c) 2008 Philip Kendall
|
||||
|
||||
$Id$
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_LIB_GLIB
|
||||
#include <glib.h>
|
||||
#endif /* #ifdef HAVE_LIB_GLIB */
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "debugger_internals.h"
|
||||
#include "fuse.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
static GArray *registered_events;
|
||||
|
||||
int
|
||||
debugger_event_init( void )
|
||||
{
|
||||
registered_events = g_array_new( FALSE, FALSE, sizeof( debugger_event_t ) );
|
||||
if( !registered_events ) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
debugger_event_register( const char *type, const char *detail )
|
||||
{
|
||||
debugger_event_t event;
|
||||
|
||||
event.detail = NULL;
|
||||
event.type = strdup( type );
|
||||
event.detail = strdup( detail );
|
||||
if( !event.type || !event.detail ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
free( event.type );
|
||||
free( event.detail );
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_array_append_val( registered_events, event );
|
||||
|
||||
return registered_events->len - 1;
|
||||
}
|
||||
|
||||
static int
|
||||
event_matches( debugger_event_t *event, const char *type, const char *detail )
|
||||
{
|
||||
if( strcasecmp( type, event->type ) ) return 0;
|
||||
if( strcmp( detail, "*" ) == 0 ) return 1;
|
||||
return strcasecmp( detail, event->detail ) == 0;
|
||||
}
|
||||
|
||||
int
|
||||
debugger_event_is_registered( const char *type, const char *detail )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for( i = 0; i < registered_events->len; i++ ) {
|
||||
debugger_event_t event =
|
||||
g_array_index( registered_events, debugger_event_t, i );
|
||||
|
||||
if( event_matches( &event, type, detail ) ) return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
debugger_event( int event_code )
|
||||
{
|
||||
debugger_event_t event;
|
||||
GSList *ptr;
|
||||
|
||||
if( event_code >= registered_events->len ) {
|
||||
ui_error( UI_ERROR_ERROR, "internal error: invalid debugger event %d",
|
||||
event_code );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
event = g_array_index( registered_events, debugger_event_t, event_code );
|
||||
|
||||
for( ptr = debugger_breakpoints; ptr; ptr = ptr->next ) {
|
||||
debugger_breakpoint *bp = ptr->data;
|
||||
if( bp->type != DEBUGGER_BREAKPOINT_TYPE_EVENT ) continue;
|
||||
|
||||
if( event_matches( &bp->value.event, event.type, event.detail ) &&
|
||||
debugger_breakpoint_trigger( bp ) ) {
|
||||
debugger_mode = DEBUGGER_MODE_HALTED;
|
||||
debugger_command_evaluate( bp->commands );
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,659 @@
|
|||
/* expression.c: A numeric expression
|
||||
Copyright (c) 2003-2008 Philip Kendall
|
||||
|
||||
$Id: expression.c 3669 2008-06-12 23:02:19Z fredm $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "debugger_internals.h"
|
||||
#include "fuse.h"
|
||||
#include "mempool.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
typedef enum expression_type {
|
||||
|
||||
DEBUGGER_EXPRESSION_TYPE_INTEGER,
|
||||
DEBUGGER_EXPRESSION_TYPE_REGISTER,
|
||||
DEBUGGER_EXPRESSION_TYPE_UNARYOP,
|
||||
DEBUGGER_EXPRESSION_TYPE_BINARYOP,
|
||||
DEBUGGER_EXPRESSION_TYPE_VARIABLE,
|
||||
|
||||
} expression_type;
|
||||
|
||||
enum precedence_t {
|
||||
|
||||
/* Lowest precedence */
|
||||
PRECEDENCE_LOGICAL_OR,
|
||||
PRECEDENCE_LOGICAL_AND,
|
||||
PRECEDENCE_BITWISE_OR,
|
||||
PRECEDENCE_BITWISE_XOR,
|
||||
PRECEDENCE_BITWISE_AND,
|
||||
PRECEDENCE_EQUALITY,
|
||||
PRECEDENCE_COMPARISON,
|
||||
PRECEDENCE_ADDITION,
|
||||
PRECEDENCE_MULTIPLICATION,
|
||||
PRECEDENCE_NEGATE,
|
||||
|
||||
PRECEDENCE_ATOMIC,
|
||||
/* Highest precedence */
|
||||
|
||||
};
|
||||
|
||||
struct unaryop_type {
|
||||
|
||||
int operation;
|
||||
debugger_expression *op;
|
||||
|
||||
};
|
||||
|
||||
struct binaryop_type {
|
||||
|
||||
int operation;
|
||||
debugger_expression *op1, *op2;
|
||||
|
||||
};
|
||||
|
||||
struct debugger_expression {
|
||||
|
||||
expression_type type;
|
||||
enum precedence_t precedence;
|
||||
|
||||
union {
|
||||
int integer;
|
||||
int reg;
|
||||
struct unaryop_type unaryop;
|
||||
struct binaryop_type binaryop;
|
||||
char *variable;
|
||||
} types;
|
||||
|
||||
};
|
||||
|
||||
static libspectrum_dword evaluate_unaryop( struct unaryop_type *unaryop );
|
||||
static libspectrum_dword evaluate_binaryop( struct binaryop_type *binary );
|
||||
|
||||
static int deparse_unaryop( char *buffer, size_t length,
|
||||
const struct unaryop_type *unaryop );
|
||||
static int deparse_binaryop( char *buffer, size_t length,
|
||||
const struct binaryop_type *binaryop );
|
||||
static int
|
||||
brackets_necessary( int top_operation, debugger_expression *operand );
|
||||
static int is_non_associative( int operation );
|
||||
|
||||
static enum precedence_t
|
||||
unaryop_precedence( int operation )
|
||||
{
|
||||
switch( operation ) {
|
||||
|
||||
case '!': case '~': case '-': return PRECEDENCE_NEGATE;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "unknown unary operator %d", operation );
|
||||
fuse_abort();
|
||||
}
|
||||
}
|
||||
|
||||
static enum precedence_t
|
||||
binaryop_precedence( int operation )
|
||||
{
|
||||
switch( operation ) {
|
||||
|
||||
case DEBUGGER_TOKEN_LOGICAL_OR: return PRECEDENCE_LOGICAL_OR;
|
||||
case DEBUGGER_TOKEN_LOGICAL_AND: return PRECEDENCE_LOGICAL_AND;
|
||||
case '|': return PRECEDENCE_BITWISE_OR;
|
||||
case '^': return PRECEDENCE_BITWISE_XOR;
|
||||
case '&': return PRECEDENCE_BITWISE_AND;
|
||||
case '+': case '-': return PRECEDENCE_ADDITION;
|
||||
case '*': case '/': return PRECEDENCE_MULTIPLICATION;
|
||||
|
||||
case DEBUGGER_TOKEN_EQUAL_TO:
|
||||
case DEBUGGER_TOKEN_NOT_EQUAL_TO:
|
||||
return PRECEDENCE_EQUALITY;
|
||||
|
||||
case '<': case '>':
|
||||
case DEBUGGER_TOKEN_LESS_THAN_OR_EQUAL_TO:
|
||||
case DEBUGGER_TOKEN_GREATER_THAN_OR_EQUAL_TO:
|
||||
return PRECEDENCE_COMPARISON;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "unknown binary operator %d", operation );
|
||||
fuse_abort();
|
||||
}
|
||||
}
|
||||
|
||||
debugger_expression*
|
||||
debugger_expression_new_number( libspectrum_dword number, int pool )
|
||||
{
|
||||
debugger_expression *exp;
|
||||
|
||||
exp = mempool_alloc( pool, sizeof( *exp ) );
|
||||
if( !exp ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
exp->type = DEBUGGER_EXPRESSION_TYPE_INTEGER;
|
||||
exp->precedence = PRECEDENCE_ATOMIC;
|
||||
exp->types.integer = number;
|
||||
|
||||
return exp;
|
||||
}
|
||||
|
||||
debugger_expression*
|
||||
debugger_expression_new_register( int which, int pool )
|
||||
{
|
||||
debugger_expression *exp;
|
||||
|
||||
exp = mempool_alloc( pool, sizeof( *exp ) );
|
||||
if( !exp ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
exp->type = DEBUGGER_EXPRESSION_TYPE_REGISTER;
|
||||
exp->precedence = PRECEDENCE_ATOMIC;
|
||||
exp->types.reg = which;
|
||||
|
||||
return exp;
|
||||
}
|
||||
|
||||
debugger_expression*
|
||||
debugger_expression_new_binaryop( int operation, debugger_expression *operand1,
|
||||
debugger_expression *operand2, int pool )
|
||||
{
|
||||
debugger_expression *exp;
|
||||
|
||||
exp = mempool_alloc( pool, sizeof( *exp ) );
|
||||
if( !exp ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
exp->type = DEBUGGER_EXPRESSION_TYPE_BINARYOP;
|
||||
exp->precedence = binaryop_precedence( operation );
|
||||
|
||||
exp->types.binaryop.operation = operation;
|
||||
exp->types.binaryop.op1 = operand1;
|
||||
exp->types.binaryop.op2 = operand2;
|
||||
|
||||
return exp;
|
||||
}
|
||||
|
||||
|
||||
debugger_expression*
|
||||
debugger_expression_new_unaryop( int operation, debugger_expression *operand,
|
||||
int pool )
|
||||
{
|
||||
debugger_expression *exp;
|
||||
|
||||
exp = mempool_alloc( pool, sizeof( *exp ) );
|
||||
if( !exp ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
exp->type = DEBUGGER_EXPRESSION_TYPE_UNARYOP;
|
||||
exp->precedence = unaryop_precedence( operation );
|
||||
|
||||
exp->types.unaryop.operation = operation;
|
||||
exp->types.unaryop.op = operand;
|
||||
|
||||
return exp;
|
||||
}
|
||||
|
||||
debugger_expression*
|
||||
debugger_expression_new_variable( const char *name, int pool )
|
||||
{
|
||||
debugger_expression *exp;
|
||||
|
||||
exp = mempool_alloc( pool, sizeof( *exp ) );
|
||||
if( !exp ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
exp->type = DEBUGGER_EXPRESSION_TYPE_VARIABLE;
|
||||
exp->precedence = PRECEDENCE_ATOMIC;
|
||||
|
||||
exp->types.variable = mempool_strdup( pool, name );
|
||||
if( !exp->types.variable ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return exp;
|
||||
}
|
||||
|
||||
void
|
||||
debugger_expression_delete( debugger_expression *exp )
|
||||
{
|
||||
switch( exp->type ) {
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_INTEGER:
|
||||
case DEBUGGER_EXPRESSION_TYPE_REGISTER:
|
||||
break;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_UNARYOP:
|
||||
debugger_expression_delete( exp->types.unaryop.op );
|
||||
break;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_BINARYOP:
|
||||
debugger_expression_delete( exp->types.binaryop.op1 );
|
||||
debugger_expression_delete( exp->types.binaryop.op2 );
|
||||
break;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_VARIABLE:
|
||||
free( exp->types.variable );
|
||||
break;
|
||||
}
|
||||
|
||||
free( exp );
|
||||
}
|
||||
|
||||
debugger_expression*
|
||||
debugger_expression_copy( debugger_expression *src )
|
||||
{
|
||||
debugger_expression *dest;
|
||||
|
||||
dest = malloc( sizeof( *dest ) );
|
||||
if( !dest ) return NULL;
|
||||
|
||||
dest->type = src->type;
|
||||
dest->precedence = src->precedence;
|
||||
|
||||
switch( dest->type ) {
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_INTEGER:
|
||||
dest->types.integer = src->types.integer;
|
||||
break;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_REGISTER:
|
||||
dest->types.reg = src->types.reg;
|
||||
break;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_UNARYOP:
|
||||
dest->types.unaryop.operation = src->types.unaryop.operation;
|
||||
dest->types.unaryop.op = debugger_expression_copy( src->types.unaryop.op );
|
||||
if( !dest->types.unaryop.op ) {
|
||||
free( dest );
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_BINARYOP:
|
||||
dest->types.binaryop.operation = src->types.binaryop.operation;
|
||||
dest->types.binaryop.op1 =
|
||||
debugger_expression_copy( src->types.binaryop.op1 );
|
||||
if( !dest->types.binaryop.op1 ) {
|
||||
free( dest );
|
||||
return NULL;
|
||||
}
|
||||
dest->types.binaryop.op2 =
|
||||
debugger_expression_copy( src->types.binaryop.op2 );
|
||||
if( !dest->types.binaryop.op2 ) {
|
||||
debugger_expression_delete( dest->types.binaryop.op1 );
|
||||
free( dest );
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_VARIABLE:
|
||||
dest->types.variable = strdup( src->types.variable );
|
||||
if( !dest->types.variable ) {
|
||||
free( dest );
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
libspectrum_dword
|
||||
debugger_expression_evaluate( debugger_expression *exp )
|
||||
{
|
||||
switch( exp->type ) {
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_INTEGER:
|
||||
return exp->types.integer;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_REGISTER:
|
||||
return debugger_register_get( exp->types.reg );
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_UNARYOP:
|
||||
return evaluate_unaryop( &( exp->types.unaryop ) );
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_BINARYOP:
|
||||
return evaluate_binaryop( &( exp->types.binaryop ) );
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_VARIABLE:
|
||||
return debugger_variable_get( exp->types.variable );
|
||||
|
||||
}
|
||||
|
||||
ui_error( UI_ERROR_ERROR, "unknown expression type %d", exp->type );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
static libspectrum_dword
|
||||
evaluate_unaryop( struct unaryop_type *unary )
|
||||
{
|
||||
switch( unary->operation ) {
|
||||
|
||||
case '!': return !debugger_expression_evaluate( unary->op );
|
||||
case '~': return ~debugger_expression_evaluate( unary->op );
|
||||
case '-': return -debugger_expression_evaluate( unary->op );
|
||||
|
||||
}
|
||||
|
||||
ui_error( UI_ERROR_ERROR, "unknown unary operator %d", unary->operation );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
static libspectrum_dword
|
||||
evaluate_binaryop( struct binaryop_type *binary )
|
||||
{
|
||||
switch( binary->operation ) {
|
||||
|
||||
case '+': return debugger_expression_evaluate( binary->op1 ) +
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case '-': return debugger_expression_evaluate( binary->op1 ) -
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case '*': return debugger_expression_evaluate( binary->op1 ) *
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case '/': return debugger_expression_evaluate( binary->op1 ) /
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case DEBUGGER_TOKEN_EQUAL_TO:
|
||||
return debugger_expression_evaluate( binary->op1 ) ==
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case DEBUGGER_TOKEN_NOT_EQUAL_TO:
|
||||
return debugger_expression_evaluate( binary->op1 ) !=
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case '>': return debugger_expression_evaluate( binary->op1 ) >
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case '<': return debugger_expression_evaluate( binary->op1 ) <
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case DEBUGGER_TOKEN_LESS_THAN_OR_EQUAL_TO:
|
||||
return debugger_expression_evaluate( binary->op1 ) <=
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case DEBUGGER_TOKEN_GREATER_THAN_OR_EQUAL_TO:
|
||||
return debugger_expression_evaluate( binary->op1 ) >=
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case '&': return debugger_expression_evaluate( binary->op1 ) &
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case '^': return debugger_expression_evaluate( binary->op1 ) ^
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case '|': return debugger_expression_evaluate( binary->op1 ) |
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case DEBUGGER_TOKEN_LOGICAL_AND:
|
||||
return debugger_expression_evaluate( binary->op1 ) &&
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
case DEBUGGER_TOKEN_LOGICAL_OR:
|
||||
return debugger_expression_evaluate( binary->op1 ) ||
|
||||
debugger_expression_evaluate( binary->op2 );
|
||||
|
||||
}
|
||||
|
||||
ui_error( UI_ERROR_ERROR, "unknown binary operator %d", binary->operation );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
int
|
||||
debugger_expression_deparse( char *buffer, size_t length,
|
||||
const debugger_expression *exp )
|
||||
{
|
||||
switch( exp->type ) {
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_INTEGER:
|
||||
if( debugger_output_base == 10 ) {
|
||||
snprintf( buffer, length, "%d", exp->types.integer );
|
||||
} else {
|
||||
snprintf( buffer, length, "0x%x", exp->types.integer );
|
||||
}
|
||||
return 0;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_REGISTER:
|
||||
snprintf( buffer, length, "%s", debugger_register_text( exp->types.reg ) );
|
||||
return 0;
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_UNARYOP:
|
||||
return deparse_unaryop( buffer, length, &( exp->types.unaryop ) );
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_BINARYOP:
|
||||
return deparse_binaryop( buffer, length, &( exp->types.binaryop ) );
|
||||
|
||||
case DEBUGGER_EXPRESSION_TYPE_VARIABLE:
|
||||
snprintf( buffer, length, "$%s", exp->types.variable );
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
ui_error( UI_ERROR_ERROR, "unknown expression type %d", exp->type );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
static int
|
||||
deparse_unaryop( char *buffer, size_t length,
|
||||
const struct unaryop_type *unaryop )
|
||||
{
|
||||
char *operand_buffer; const char *operation_string = NULL;
|
||||
int brackets;
|
||||
|
||||
int error;
|
||||
|
||||
operand_buffer = malloc( length );
|
||||
if( !operand_buffer ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return 1;
|
||||
}
|
||||
|
||||
error = debugger_expression_deparse( operand_buffer, length, unaryop->op );
|
||||
if( error ) { free( operand_buffer ); return error; }
|
||||
|
||||
switch( unaryop->operation ) {
|
||||
case '!': operation_string = "!"; break;
|
||||
case '~': operation_string = "~"; break;
|
||||
case '-': operation_string = "-"; break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "unknown unary operation %d",
|
||||
unaryop->operation );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
brackets = ( unaryop->op->precedence <
|
||||
unaryop_precedence( unaryop->operation ) );
|
||||
|
||||
snprintf( buffer, length, "%s%s%s%s", operation_string,
|
||||
brackets ? "( " : "", operand_buffer,
|
||||
brackets ? " )" : "" );
|
||||
|
||||
free( operand_buffer );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
deparse_binaryop( char *buffer, size_t length,
|
||||
const struct binaryop_type *binaryop )
|
||||
{
|
||||
char *operand1_buffer, *operand2_buffer; const char *operation_string = NULL;
|
||||
int brackets_necessary1, brackets_necessary2;
|
||||
|
||||
int error;
|
||||
|
||||
operand1_buffer = malloc( 2 * length );
|
||||
if( !operand1_buffer ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return 1;
|
||||
}
|
||||
operand2_buffer = &operand1_buffer[ length ];
|
||||
|
||||
error = debugger_expression_deparse( operand1_buffer, length,
|
||||
binaryop->op1 );
|
||||
if( error ) { free( operand1_buffer ); return error; }
|
||||
|
||||
error = debugger_expression_deparse( operand2_buffer, length,
|
||||
binaryop->op2 );
|
||||
if( error ) { free( operand1_buffer ); return error; }
|
||||
|
||||
switch( binaryop->operation ) {
|
||||
case '+': operation_string = "+"; break;
|
||||
case '-': operation_string = "-"; break;
|
||||
case '*': operation_string = "*"; break;
|
||||
case '/': operation_string = "/"; break;
|
||||
case DEBUGGER_TOKEN_EQUAL_TO: operation_string = "=="; break;
|
||||
case DEBUGGER_TOKEN_NOT_EQUAL_TO: operation_string = "!="; break;
|
||||
case '<': operation_string = "<"; break;
|
||||
case '>': operation_string = ">"; break;
|
||||
case DEBUGGER_TOKEN_LESS_THAN_OR_EQUAL_TO: operation_string = "<="; break;
|
||||
case DEBUGGER_TOKEN_GREATER_THAN_OR_EQUAL_TO: operation_string = ">="; break;
|
||||
case '&': operation_string = "&"; break;
|
||||
case '^': operation_string = "^"; break;
|
||||
case '|': operation_string = "|"; break;
|
||||
case DEBUGGER_TOKEN_LOGICAL_AND: operation_string = "&&"; break;
|
||||
case DEBUGGER_TOKEN_LOGICAL_OR: operation_string = "||"; break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "unknown binary operation %d",
|
||||
binaryop->operation );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
brackets_necessary1 = brackets_necessary( binaryop->operation,
|
||||
binaryop->op1 );
|
||||
brackets_necessary2 = brackets_necessary( binaryop->operation,
|
||||
binaryop->op2 );
|
||||
|
||||
snprintf( buffer, length, "%s%s%s %s %s%s%s",
|
||||
brackets_necessary1 ? "( " : "", operand1_buffer,
|
||||
brackets_necessary1 ? " )" : "",
|
||||
operation_string,
|
||||
brackets_necessary2 ? "( " : "", operand2_buffer,
|
||||
brackets_necessary2 ? " )" : "" );
|
||||
|
||||
free( operand1_buffer );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* When deparsing, do we need to put brackets around `operand' when
|
||||
being used as an operand of the binary operation `top_operation'? */
|
||||
static int
|
||||
brackets_necessary( int top_operation, debugger_expression *operand )
|
||||
{
|
||||
enum precedence_t top_precedence, bottom_precedence;
|
||||
|
||||
top_precedence = binaryop_precedence( top_operation );
|
||||
bottom_precedence = operand->precedence;
|
||||
|
||||
/* If the top level operation has a higher precedence than the
|
||||
bottom level operation, we always need brackets */
|
||||
if( top_precedence > bottom_precedence ) return 1;
|
||||
|
||||
/* If the two operations are of equal precedence, we need brackets
|
||||
i) if the top level operation is non-associative, or
|
||||
ii) if the operand is a non-associative operation
|
||||
|
||||
Note the assumption here that all things with a precedence equal to
|
||||
a binary operator are also binary operators
|
||||
|
||||
Strictly, we don't need brackets in either of these cases, but
|
||||
otherwise the user is going to have to remember operator
|
||||
left-right associativity; I think things are clearer with
|
||||
brackets in.
|
||||
*/
|
||||
if( top_precedence == bottom_precedence ) {
|
||||
|
||||
if( is_non_associative( top_operation ) ) return 1;
|
||||
|
||||
/* Sanity check */
|
||||
if( operand->type != DEBUGGER_EXPRESSION_TYPE_BINARYOP ) {
|
||||
ui_error( UI_ERROR_ERROR,
|
||||
"binary operator has same precedence as non-binary operator" );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
return is_non_associative( operand->types.binaryop.operation );
|
||||
}
|
||||
|
||||
/* Otherwise (ie if the top level operation is of lower precedence
|
||||
than the bottom, or both operators have equal precedence and
|
||||
everything is associative) we don't need brackets */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Is a binary operator non-associative? */
|
||||
static int
|
||||
is_non_associative( int operation )
|
||||
{
|
||||
switch( operation ) {
|
||||
|
||||
/* Simple cases */
|
||||
case '+': case '*': return 0;
|
||||
case '-': case '/': return 1;
|
||||
|
||||
/* None of the comparison operators are associative due to them
|
||||
returning truth values */
|
||||
case DEBUGGER_TOKEN_EQUAL_TO:
|
||||
case DEBUGGER_TOKEN_NOT_EQUAL_TO:
|
||||
case '<': case '>':
|
||||
case DEBUGGER_TOKEN_LESS_THAN_OR_EQUAL_TO:
|
||||
case DEBUGGER_TOKEN_GREATER_THAN_OR_EQUAL_TO:
|
||||
return 1;
|
||||
|
||||
/* The logical operators are associative */
|
||||
case DEBUGGER_TOKEN_LOGICAL_AND: return 0;
|
||||
case DEBUGGER_TOKEN_LOGICAL_OR: return 0;
|
||||
|
||||
/* The bitwise operators are also associative (consider them as
|
||||
vectorised logical operators) */
|
||||
case '&': return 0;
|
||||
case '^': return 0;
|
||||
case '|': return 0;
|
||||
|
||||
}
|
||||
|
||||
/* Should never get here */
|
||||
ui_error( UI_ERROR_ERROR, "unknown binary operation %d", operation );
|
||||
fuse_abort();
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
/* variable.c: Debugger variables
|
||||
Copyright (c) 2008 Philip Kendall
|
||||
|
||||
$Id$
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_LIB_GLIB
|
||||
#include <glib.h>
|
||||
#endif /* #ifdef HAVE_LIB_GLIB */
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "debugger_internals.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
static GHashTable *debugger_variables;
|
||||
|
||||
int
|
||||
debugger_variable_init( void )
|
||||
{
|
||||
debugger_variables = g_hash_table_new( g_str_hash, g_str_equal );
|
||||
if( !debugger_variables ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
debugger_variable_set( const char *name, libspectrum_dword value )
|
||||
{
|
||||
/* Check if we need to allocate memory for this key */
|
||||
if( !g_hash_table_lookup( debugger_variables, name ) ) {
|
||||
name = strdup( name );
|
||||
if( !name ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Cast is safe as we have either taken a copy of the key, or know that
|
||||
it already exists so we're not going to use it */
|
||||
g_hash_table_insert( debugger_variables, (char*)name, GINT_TO_POINTER(value) );
|
||||
}
|
||||
|
||||
libspectrum_dword
|
||||
debugger_variable_get( const char *name )
|
||||
{
|
||||
gpointer v = g_hash_table_lookup( debugger_variables, name );
|
||||
|
||||
return v ? GPOINTER_TO_INT(v) : 0;
|
||||
}
|
|
@ -0,0 +1,589 @@
|
|||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2007-03-29.01
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add `dependent.h:' lines.
|
||||
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mechanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
|
@ -0,0 +1,46 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## Copyright (c) 2007 Stuart Brady
|
||||
|
||||
## $Id: Makefile.am 3584 2008-03-25 10:27:30Z fredm $
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
##
|
||||
## Author contact information:
|
||||
##
|
||||
## E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
AM_CPPFLAGS = -I$(srcdir)/..
|
||||
|
||||
noinst_LIBRARIES = libdisk.a
|
||||
|
||||
INCLUDES = @LIBSPEC_CFLAGS@ @GTK_CFLAGS@ @GLIB_CFLAGS@
|
||||
|
||||
libdisk_a_SOURCES = beta.c \
|
||||
crc.c \
|
||||
disk.c \
|
||||
fdd.c \
|
||||
plusd.c \
|
||||
upd_fdc.c \
|
||||
wd_fdc.c
|
||||
|
||||
noinst_HEADERS = beta.h \
|
||||
crc.h \
|
||||
disk.h \
|
||||
fdd.h \
|
||||
plusd.h \
|
||||
upd_fdc.h \
|
||||
wd_fdc.h
|
|
@ -0,0 +1,507 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = disk
|
||||
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
libdisk_a_AR = $(AR) $(ARFLAGS)
|
||||
libdisk_a_LIBADD =
|
||||
am_libdisk_a_OBJECTS = beta.$(OBJEXT) crc.$(OBJEXT) disk.$(OBJEXT) \
|
||||
fdd.$(OBJEXT) plusd.$(OBJEXT) upd_fdc.$(OBJEXT) \
|
||||
wd_fdc.$(OBJEXT)
|
||||
libdisk_a_OBJECTS = $(am_libdisk_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libdisk_a_SOURCES)
|
||||
DIST_SOURCES = $(libdisk_a_SOURCES)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOLOAD_SNAPS = @AUTOLOAD_SNAPS@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPAT_OSNAME = @COMPAT_OSNAME@
|
||||
COMPAT_SUBDIR = @COMPAT_SUBDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_CONFIG = @GLIB_CONFIG@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSPEC_CFLAGS = @LIBSPEC_CFLAGS@
|
||||
LIBSPEC_LIBS = @LIBSPEC_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
|
||||
SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_CONFIG = @SDL_CONFIG@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOUND_LIBADD = @SOUND_LIBADD@
|
||||
SOUND_LIBS = @SOUND_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TIMER_LIBADD = @TIMER_LIBADD@
|
||||
UI = @UI@
|
||||
UI_LIBS = @UI_LIBS@
|
||||
VERSION = @VERSION@
|
||||
WIDGET = @WIDGET@
|
||||
WINDRES = @WINDRES@
|
||||
WINDRES_OBJ = @WINDRES_OBJ@
|
||||
XMKMF = @XMKMF@
|
||||
XML2_CONFIG = @XML2_CONFIG@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
AM_CPPFLAGS = -I$(srcdir)/..
|
||||
noinst_LIBRARIES = libdisk.a
|
||||
INCLUDES = @LIBSPEC_CFLAGS@ @GTK_CFLAGS@ @GLIB_CFLAGS@
|
||||
libdisk_a_SOURCES = beta.c \
|
||||
crc.c \
|
||||
disk.c \
|
||||
fdd.c \
|
||||
plusd.c \
|
||||
upd_fdc.c \
|
||||
wd_fdc.c
|
||||
|
||||
noinst_HEADERS = beta.h \
|
||||
crc.h \
|
||||
disk.h \
|
||||
fdd.h \
|
||||
plusd.h \
|
||||
upd_fdc.h \
|
||||
wd_fdc.h
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign disk/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign disk/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libdisk.a: $(libdisk_a_OBJECTS) $(libdisk_a_DEPENDENCIES)
|
||||
-rm -f libdisk.a
|
||||
$(libdisk_a_AR) libdisk.a $(libdisk_a_OBJECTS) $(libdisk_a_LIBADD)
|
||||
$(RANLIB) libdisk.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/beta.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disk.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdd.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plusd.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/upd_fdc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wd_fdc.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES) $(HEADERS)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,635 @@
|
|||
/* beta.c: Routines for handling the Beta disk interface
|
||||
Copyright (c) 2004-2008 Stuart Brady
|
||||
|
||||
$Id: beta.c 3681 2008-06-16 09:40:29Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: pak21-fuse@srcf.ucam.org
|
||||
Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England
|
||||
|
||||
Stuart: sdbrady@ntlworld.com
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h> /* Needed for strncasecmp() on QNX6 */
|
||||
#endif /* #ifdef HAVE_STRINGS_H */
|
||||
#include <limits.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "beta.h"
|
||||
#include "compat.h"
|
||||
#include "event.h"
|
||||
#include "machine.h"
|
||||
#include "module.h"
|
||||
#include "settings.h"
|
||||
#include "ui/ui.h"
|
||||
#include "utils.h"
|
||||
#include "wd_fdc.h"
|
||||
#include "z80/z80.h"
|
||||
#include "z80/z80_macros.h"
|
||||
|
||||
int beta_available = 0;
|
||||
int beta_active = 0;
|
||||
int beta_builtin = 0;
|
||||
|
||||
static int beta_index_pulse = 0;
|
||||
|
||||
static int index_event;
|
||||
|
||||
#define BETA_NUM_DRIVES 4
|
||||
|
||||
static wd_fdc *beta_fdc;
|
||||
static wd_fdc_drive beta_drives[ BETA_NUM_DRIVES ];
|
||||
|
||||
const periph_t beta_peripherals[] = {
|
||||
{ 0x00ff, 0x001f, beta_sr_read, beta_cr_write },
|
||||
{ 0x00ff, 0x003f, beta_tr_read, beta_tr_write },
|
||||
{ 0x00ff, 0x005f, beta_sec_read, beta_sec_write },
|
||||
{ 0x00ff, 0x007f, beta_dr_read, beta_dr_write },
|
||||
{ 0x00ff, 0x00ff, beta_sp_read, beta_sp_write },
|
||||
};
|
||||
|
||||
const size_t beta_peripherals_count =
|
||||
sizeof( beta_peripherals ) / sizeof( periph_t );
|
||||
|
||||
static void beta_reset( int hard_reset );
|
||||
static void beta_memory_map( void );
|
||||
static void beta_enabled_snapshot( libspectrum_snap *snap );
|
||||
static void beta_from_snapshot( libspectrum_snap *snap );
|
||||
static void beta_to_snapshot( libspectrum_snap *snap );
|
||||
static void beta_event_index( libspectrum_dword last_tstates, int type,
|
||||
void *user_data );
|
||||
|
||||
static module_info_t beta_module_info = {
|
||||
|
||||
beta_reset,
|
||||
beta_memory_map,
|
||||
beta_enabled_snapshot,
|
||||
beta_from_snapshot,
|
||||
beta_to_snapshot,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
beta_page( void )
|
||||
{
|
||||
beta_active = 1;
|
||||
machine_current->ram.romcs = 1;
|
||||
machine_current->memory_map();
|
||||
}
|
||||
|
||||
void
|
||||
beta_unpage( void )
|
||||
{
|
||||
beta_active = 0;
|
||||
machine_current->ram.romcs = 0;
|
||||
machine_current->memory_map();
|
||||
}
|
||||
|
||||
static void
|
||||
beta_memory_map( void )
|
||||
{
|
||||
if( !beta_active ) return;
|
||||
|
||||
memory_map_read[0] = memory_map_write[0] = memory_map_romcs[ 0 ];
|
||||
memory_map_read[1] = memory_map_write[1] = memory_map_romcs[ 1 ];
|
||||
}
|
||||
|
||||
static void
|
||||
beta_select_drive( int i )
|
||||
{
|
||||
if( beta_fdc->current_drive != &beta_drives[ i & 0x03 ] ) {
|
||||
if( beta_fdc->current_drive != NULL )
|
||||
fdd_select( &beta_fdc->current_drive->fdd, 0 );
|
||||
beta_fdc->current_drive = &beta_drives[ i & 0x03 ];
|
||||
fdd_select( &beta_fdc->current_drive->fdd, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
beta_init( void )
|
||||
{
|
||||
int i;
|
||||
wd_fdc_drive *d;
|
||||
|
||||
beta_fdc = wd_fdc_alloc_fdc( FD1793, 0, WD_FLAG_BETA128 );
|
||||
beta_fdc->current_drive = NULL;
|
||||
|
||||
for( i = 0; i < BETA_NUM_DRIVES; i++ ) {
|
||||
d = &beta_drives[ i ];
|
||||
fdd_init( &d->fdd, FDD_SHUGART, 0, 0 ); /* drive geometry 'autodetect' */
|
||||
d->disk.flag = DISK_FLAG_NONE;
|
||||
}
|
||||
beta_select_drive( 0 );
|
||||
|
||||
beta_fdc->dden = 1;
|
||||
beta_fdc->set_intrq = NULL;
|
||||
beta_fdc->reset_intrq = NULL;
|
||||
beta_fdc->set_datarq = NULL;
|
||||
beta_fdc->reset_datarq = NULL;
|
||||
|
||||
index_event = event_register( beta_event_index, "Beta disk index" );
|
||||
if( index_event == -1 ) return 1;
|
||||
|
||||
module_register( &beta_module_info );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
beta_reset( int hard_reset GCC_UNUSED )
|
||||
{
|
||||
int i;
|
||||
wd_fdc_drive *d;
|
||||
|
||||
event_remove_type( index_event );
|
||||
|
||||
if( !periph_beta128_active ) {
|
||||
beta_active = 0;
|
||||
beta_available = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
beta_available = 1;
|
||||
|
||||
wd_fdc_master_reset( beta_fdc );
|
||||
|
||||
for( i = 0; i < BETA_NUM_DRIVES; i++ ) {
|
||||
d = &beta_drives[ i ];
|
||||
|
||||
d->index_pulse = 0;
|
||||
d->index_interrupt = 0;
|
||||
}
|
||||
|
||||
if( !beta_builtin ) {
|
||||
machine_load_rom_bank( memory_map_romcs, 0, 0,
|
||||
settings_current.rom_beta128,
|
||||
settings_default.rom_beta128, 0x4000 );
|
||||
|
||||
memory_map_romcs[ 0 ].writable = 0;
|
||||
memory_map_romcs[ 1 ].writable = 0;
|
||||
|
||||
memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL;
|
||||
memory_map_romcs[1].source = MEMORY_SOURCE_PERIPHERAL;
|
||||
|
||||
beta_active = 0;
|
||||
}
|
||||
|
||||
/* We can eject disks only if they are currently present */
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_A_EJECT,
|
||||
beta_drives[ BETA_DRIVE_A ].fdd.loaded );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_A_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_A ].fdd.wrprot );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_B_EJECT,
|
||||
beta_drives[ BETA_DRIVE_B ].fdd.loaded );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_B_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_B ].fdd.wrprot );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_C_EJECT,
|
||||
beta_drives[ BETA_DRIVE_C ].fdd.loaded );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_C_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_C ].fdd.wrprot );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_D_EJECT,
|
||||
beta_drives[ BETA_DRIVE_D ].fdd.loaded );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_D_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_D ].fdd.wrprot );
|
||||
|
||||
beta_select_drive( 0 );
|
||||
machine_current->memory_map();
|
||||
beta_event_index( 0, 0, NULL );
|
||||
|
||||
ui_statusbar_update( UI_STATUSBAR_ITEM_DISK, UI_STATUSBAR_STATE_INACTIVE );
|
||||
}
|
||||
|
||||
void
|
||||
beta_end( void )
|
||||
{
|
||||
beta_available = 0;
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
beta_sr_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
if( !beta_active ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
return wd_fdc_sr_read( beta_fdc );
|
||||
}
|
||||
|
||||
void
|
||||
beta_cr_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
if( !beta_active ) return;
|
||||
|
||||
wd_fdc_cr_write( beta_fdc, b );
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
beta_tr_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
if( !beta_active ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
return wd_fdc_tr_read( beta_fdc );
|
||||
}
|
||||
|
||||
void
|
||||
beta_tr_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
if( !beta_active ) return;
|
||||
|
||||
wd_fdc_tr_write( beta_fdc, b );
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
beta_sec_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
if( !beta_active ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
return wd_fdc_sec_read( beta_fdc );
|
||||
}
|
||||
|
||||
void
|
||||
beta_sec_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
if( !beta_active ) return;
|
||||
|
||||
wd_fdc_sec_write( beta_fdc, b );
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
beta_dr_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
if( !beta_active ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
return wd_fdc_dr_read( beta_fdc );
|
||||
}
|
||||
|
||||
void
|
||||
beta_dr_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
if( !beta_active ) return;
|
||||
|
||||
wd_fdc_dr_write( beta_fdc, b );
|
||||
}
|
||||
|
||||
void
|
||||
beta_sp_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
if( !beta_active ) return;
|
||||
|
||||
/* reset 0x04 and then set it to reset controller */
|
||||
beta_select_drive( b & 0x03 );
|
||||
/* 0x08 = block hlt, normally set */
|
||||
wd_fdc_set_hlt( beta_fdc, ( ( b & 0x08 ) ? 1 : 0 ) );
|
||||
fdd_set_head( &beta_fdc->current_drive->fdd, ( ( b & 0x10 ) ? 0 : 1 ) );
|
||||
/* 0x20 = density, reset = FM, set = MFM */
|
||||
beta_fdc->dden = b & 0x20 ? 1 : 0;
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
beta_sp_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
libspectrum_byte b;
|
||||
|
||||
if( !beta_active ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
b = 0;
|
||||
|
||||
if( beta_fdc->intrq )
|
||||
b |= 0x80;
|
||||
|
||||
if( beta_fdc->datarq )
|
||||
b |= 0x40;
|
||||
|
||||
/* we should reset beta_datarq, but we first need to raise it for each byte
|
||||
* transferred in wd_fdc.c */
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
int
|
||||
beta_disk_insert( beta_drive_number which, const char *filename,
|
||||
int autoload )
|
||||
{
|
||||
int error;
|
||||
wd_fdc_drive *d;
|
||||
|
||||
if( which >= BETA_NUM_DRIVES ) {
|
||||
ui_error( UI_ERROR_ERROR, "beta_disk_insert: unknown drive %d",
|
||||
which );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
d = &beta_drives[ which ];
|
||||
|
||||
/* Eject any disk already in the drive */
|
||||
if( d->fdd.loaded ) {
|
||||
/* Abort the insert if we want to keep the current disk */
|
||||
if( beta_disk_eject( which, 0 ) ) return 0;
|
||||
}
|
||||
|
||||
if( filename ) {
|
||||
error = disk_open( &d->disk, filename, 0 );
|
||||
if( error != DISK_OK ) {
|
||||
ui_error( UI_ERROR_ERROR, "Failed to open disk image: %s",
|
||||
disk_strerror( d->disk.status ) );
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
error = disk_new( &d->disk, 2, 80, DISK_DENS_AUTO, DISK_UDI );
|
||||
if( error != DISK_OK ) {
|
||||
ui_error( UI_ERROR_ERROR, "Failed to create disk image: %s",
|
||||
disk_strerror( d->disk.status ) );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
fdd_load( &d->fdd, &d->disk, 0 );
|
||||
|
||||
/* Set the 'eject' item active */
|
||||
switch( which ) {
|
||||
case BETA_DRIVE_A:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_A_EJECT, 1 );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_A_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_A ].fdd.wrprot );
|
||||
break;
|
||||
case BETA_DRIVE_B:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_B_EJECT, 1 );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_B_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_B ].fdd.wrprot );
|
||||
break;
|
||||
case BETA_DRIVE_C:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_C_EJECT, 1 );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_C_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_C ].fdd.wrprot );
|
||||
break;
|
||||
case BETA_DRIVE_D:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_D_EJECT, 1 );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_D_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_D ].fdd.wrprot );
|
||||
break;
|
||||
}
|
||||
|
||||
if( filename && autoload ) {
|
||||
PC = 0;
|
||||
machine_current->ram.last_byte |= 0x10; /* Select ROM 1 */
|
||||
beta_page();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
beta_disk_writeprotect( beta_drive_number which, int wrprot )
|
||||
{
|
||||
wd_fdc_drive *d;
|
||||
|
||||
if( which >= BETA_NUM_DRIVES )
|
||||
return 1;
|
||||
|
||||
d = &beta_drives[ which ];
|
||||
|
||||
if( !d->fdd.loaded )
|
||||
return 1;
|
||||
|
||||
fdd_wrprot( &d->fdd, wrprot );
|
||||
|
||||
/* Set the 'writeprotect' item */
|
||||
switch( which ) {
|
||||
case BETA_DRIVE_A:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_A_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_A ].fdd.wrprot );
|
||||
break;
|
||||
case BETA_DRIVE_B:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_B_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_B ].fdd.wrprot );
|
||||
break;
|
||||
case BETA_DRIVE_C:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_C_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_C ].fdd.wrprot );
|
||||
break;
|
||||
case BETA_DRIVE_D:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_D_WP_SET,
|
||||
!beta_drives[ BETA_DRIVE_D ].fdd.wrprot );
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
beta_disk_eject( beta_drive_number which, int write )
|
||||
{
|
||||
wd_fdc_drive *d;
|
||||
char drive;
|
||||
|
||||
if( which >= BETA_NUM_DRIVES )
|
||||
return 1;
|
||||
|
||||
d = &beta_drives[ which ];
|
||||
|
||||
if( !d->fdd.loaded )
|
||||
return 0;
|
||||
|
||||
if( write ) {
|
||||
|
||||
if( ui_beta_disk_write( which ) ) return 1;
|
||||
|
||||
} else {
|
||||
|
||||
if( d->disk.dirty ) {
|
||||
ui_confirm_save_t confirm;
|
||||
|
||||
switch( which ) {
|
||||
case BETA_DRIVE_A: drive = 'A'; break;
|
||||
case BETA_DRIVE_B: drive = 'B'; break;
|
||||
case BETA_DRIVE_C: drive = 'C'; break;
|
||||
case BETA_DRIVE_D: drive = 'D'; break;
|
||||
default: drive = '?'; break;
|
||||
}
|
||||
|
||||
confirm = ui_confirm_save(
|
||||
"Disk in Beta drive %c: has been modified.\n"
|
||||
"Do you want to save it?",
|
||||
drive
|
||||
);
|
||||
|
||||
switch( confirm ) {
|
||||
|
||||
case UI_CONFIRM_SAVE_SAVE:
|
||||
if( ui_beta_disk_write( which ) ) return 1;
|
||||
break;
|
||||
|
||||
case UI_CONFIRM_SAVE_DONTSAVE: break;
|
||||
case UI_CONFIRM_SAVE_CANCEL: return 1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fdd_unload( &d->fdd );
|
||||
disk_close( &d->disk );
|
||||
|
||||
/* Set the 'eject' item inactive */
|
||||
switch( which ) {
|
||||
case BETA_DRIVE_A:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_A_EJECT, 0 );
|
||||
break;
|
||||
case BETA_DRIVE_B:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_B_EJECT, 0 );
|
||||
break;
|
||||
case BETA_DRIVE_C:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_C_EJECT, 0 );
|
||||
break;
|
||||
case BETA_DRIVE_D:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_BETA_D_EJECT, 0 );
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
beta_disk_write( beta_drive_number which, const char *filename )
|
||||
{
|
||||
wd_fdc_drive *d = &beta_drives[ which ];
|
||||
int error;
|
||||
|
||||
d->disk.type = DISK_TYPE_NONE;
|
||||
error = disk_write( &d->disk, filename );
|
||||
|
||||
if( error != DISK_OK ) {
|
||||
ui_error( UI_ERROR_ERROR, "couldn't write '%s' file: %s", filename,
|
||||
disk_strerror( error ) );
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
beta_event_index( libspectrum_dword last_tstates, int type, void *user_data )
|
||||
{
|
||||
int error;
|
||||
int next_tstates;
|
||||
int i;
|
||||
|
||||
beta_index_pulse = !beta_index_pulse;
|
||||
for( i = 0; i < BETA_NUM_DRIVES; i++ ) {
|
||||
wd_fdc_drive *d = &beta_drives[ i ];
|
||||
|
||||
d->index_pulse = beta_index_pulse;
|
||||
/* disabled, until we have better timing emulation,
|
||||
* to avoid interrupts while reading/writing data */
|
||||
if( !beta_index_pulse && d->index_interrupt ) {
|
||||
wd_fdc_set_intrq( beta_fdc );
|
||||
d->index_interrupt = 0;
|
||||
}
|
||||
}
|
||||
next_tstates = ( beta_index_pulse ? 10 : 190 ) *
|
||||
machine_current->timings.processor_speed / 1000;
|
||||
error = event_add( last_tstates + next_tstates, index_event );
|
||||
if( error ) return;
|
||||
}
|
||||
|
||||
static void
|
||||
beta_enabled_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
if( libspectrum_snap_beta_active( snap ) )
|
||||
settings_current.beta128 = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
beta_from_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
if( !libspectrum_snap_beta_active( snap ) ) return;
|
||||
|
||||
beta_active = libspectrum_snap_beta_paged( snap );
|
||||
|
||||
if( beta_active ) {
|
||||
beta_page();
|
||||
} else {
|
||||
beta_unpage();
|
||||
}
|
||||
|
||||
if( libspectrum_snap_beta_custom_rom( snap ) &&
|
||||
libspectrum_snap_beta_rom( snap, 0 ) &&
|
||||
machine_load_rom_bank_from_buffer(
|
||||
memory_map_romcs, 0, 0,
|
||||
libspectrum_snap_beta_rom( snap, 0 ),
|
||||
MEMORY_PAGE_SIZE * 2,
|
||||
1 ) )
|
||||
return;
|
||||
|
||||
beta_fdc->direction = libspectrum_snap_beta_direction( snap );
|
||||
|
||||
beta_cr_write ( 0x001f, 0 );
|
||||
beta_tr_write ( 0x003f, libspectrum_snap_beta_track ( snap ) );
|
||||
beta_sec_write( 0x005f, libspectrum_snap_beta_sector( snap ) );
|
||||
beta_dr_write ( 0x007f, libspectrum_snap_beta_data ( snap ) );
|
||||
beta_sp_write ( 0x00ff, libspectrum_snap_beta_system( snap ) );
|
||||
}
|
||||
|
||||
void
|
||||
beta_to_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
int attached;
|
||||
wd_fdc *f = beta_fdc;
|
||||
libspectrum_byte *buffer;
|
||||
|
||||
if( !periph_beta128_active ) return;
|
||||
|
||||
libspectrum_snap_set_beta_active( snap, 1 );
|
||||
|
||||
if( memory_map_romcs[0].source == MEMORY_SOURCE_CUSTOMROM ) {
|
||||
size_t rom_length = MEMORY_PAGE_SIZE * 2;
|
||||
|
||||
buffer = malloc( rom_length );
|
||||
if( !buffer ) {
|
||||
ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy( buffer, memory_map_romcs[0].page, MEMORY_PAGE_SIZE );
|
||||
memcpy( buffer + MEMORY_PAGE_SIZE, memory_map_romcs[1].page,
|
||||
MEMORY_PAGE_SIZE );
|
||||
|
||||
libspectrum_snap_set_beta_rom( snap, 0, buffer );
|
||||
libspectrum_snap_set_beta_custom_rom( snap, 1 );
|
||||
}
|
||||
|
||||
libspectrum_snap_set_beta_paged ( snap, beta_active );
|
||||
libspectrum_snap_set_beta_direction( snap, beta_fdc->direction );
|
||||
libspectrum_snap_set_beta_status( snap, beta_sr_read( 0x001f, &attached ) );
|
||||
libspectrum_snap_set_beta_track ( snap, f->track_register );
|
||||
libspectrum_snap_set_beta_sector( snap, f->sector_register );
|
||||
libspectrum_snap_set_beta_data ( snap, f->data_register );
|
||||
libspectrum_snap_set_beta_system( snap, beta_sp_read( 0x00ff, &attached ) );
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
/* beta.h: Routines for handling the Beta disk interface
|
||||
Copyright (c) 2003-2004 Fredrick Meunier, Philip Kendall
|
||||
|
||||
$Id: beta.h 3681 2008-06-16 09:40:29Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
Fred: fredm@spamcop.net
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_BETA_H
|
||||
#define FUSE_BETA_H
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "periph.h"
|
||||
|
||||
extern int beta_available; /* Is the Beta disk interface available for use? */
|
||||
extern int beta_active; /* Is the Beta disk interface enabled? */
|
||||
extern int beta_builtin; /* Is the Beta disk interface built-in? */
|
||||
|
||||
extern const periph_t beta_peripherals[];
|
||||
extern const size_t beta_peripherals_count;
|
||||
|
||||
int beta_init( void );
|
||||
|
||||
void beta_end( void );
|
||||
|
||||
void beta_page( void );
|
||||
void beta_unpage( void );
|
||||
|
||||
void beta_cr_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte beta_sr_read( libspectrum_word port, int *attached );
|
||||
|
||||
libspectrum_byte beta_tr_read( libspectrum_word port, int *attached );
|
||||
void beta_tr_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte beta_sec_read( libspectrum_word port, int *attached );
|
||||
void beta_sec_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte beta_dr_read( libspectrum_word port, int *attached );
|
||||
void beta_dr_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte beta_sp_read( libspectrum_word port, int *attached );
|
||||
void beta_sp_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
typedef enum beta_drive_number {
|
||||
BETA_DRIVE_A = 0,
|
||||
BETA_DRIVE_B,
|
||||
BETA_DRIVE_C,
|
||||
BETA_DRIVE_D,
|
||||
} beta_drive_number;
|
||||
|
||||
int beta_disk_insert( beta_drive_number which, const char *filename,
|
||||
int autoload );
|
||||
int beta_disk_eject( beta_drive_number which, int write );
|
||||
int beta_disk_writeprotect( beta_drive_number which, int wrprot );
|
||||
int beta_disk_write( beta_drive_number which, const char *filename );
|
||||
|
||||
#endif /* #ifndef FUSE_BETA_H */
|
|
@ -0,0 +1,87 @@
|
|||
/* crc.c: Routines for CRC16/CRC32
|
||||
Copyright (c) 2007 Gergely Szasz
|
||||
|
||||
$Id: crc.c 3202 2007-10-16 21:27:07Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
libspectrum_word crc_fdc_table[] = {
|
||||
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
|
||||
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
|
||||
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
|
||||
0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
|
||||
0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
|
||||
0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
|
||||
0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
|
||||
0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
|
||||
0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
|
||||
0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
|
||||
0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
|
||||
0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
|
||||
0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
|
||||
0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
|
||||
0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
|
||||
0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
|
||||
0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
|
||||
0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
|
||||
0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
|
||||
0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
|
||||
0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
|
||||
0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
|
||||
0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
|
||||
0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
|
||||
0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
|
||||
0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
|
||||
0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
|
||||
0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
|
||||
0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
|
||||
0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
|
||||
0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
|
||||
0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
|
||||
};
|
||||
|
||||
/* CRC-16-CCITT: G(x) = x^16 + x^12 + x^5 + 1 */
|
||||
libspectrum_word
|
||||
crc_fdc( libspectrum_word crc, libspectrum_byte data )
|
||||
{
|
||||
return ( ( crc << 8 ) ^ crc_fdc_table[( ( crc >> 8 ) ^ data ) & 0xff] ) &
|
||||
0xffff;
|
||||
}
|
||||
|
||||
libspectrum_signed_dword
|
||||
crc_udi( libspectrum_signed_dword crc, libspectrum_byte data )
|
||||
{
|
||||
int i;
|
||||
libspectrum_signed_dword temp;
|
||||
|
||||
crc ^= (libspectrum_signed_dword)(-1) ^ data;
|
||||
for( i = 8; i > 0; i-- ) {
|
||||
temp = -( crc & 1 );
|
||||
crc >>= 1;
|
||||
crc ^= (libspectrum_dword)0xedb88320 & temp;
|
||||
}
|
||||
crc ^= (libspectrum_signed_dword)(-1);
|
||||
return crc;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/* crc.h: Routines for CRC16/CRC32
|
||||
Copyright (c) 2007 Gergely Szasz
|
||||
|
||||
$Id: crc.h 3183 2007-09-28 18:06:54Z zubzero $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
#ifndef FUSE_CRC_H
|
||||
#define FUSE_CRC_H
|
||||
|
||||
libspectrum_word crc_fdc( libspectrum_word crc, libspectrum_byte data );
|
||||
libspectrum_signed_dword crc_udi( libspectrum_signed_dword crc, libspectrum_byte data );
|
||||
|
||||
#endif /* FUSE_CRC_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,129 @@
|
|||
/* fdd.h: Header for handling raw disk images
|
||||
Copyright (c) 2007 Gergely Szasz
|
||||
|
||||
$Id: disk.h 3583 2008-03-25 09:29:59Z fredm $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_DISK_H
|
||||
#define FUSE_DISK_H
|
||||
|
||||
#include <config.h>
|
||||
|
||||
static const unsigned int DISK_FLAG_NONE = 0x00;
|
||||
static const unsigned int DISK_FLAG_PLUS3_CPC = 0x01; /* try to fix some CPC issue */
|
||||
|
||||
typedef enum disk_error_t {
|
||||
DISK_OK = 0,
|
||||
DISK_IMPL,
|
||||
DISK_MEM,
|
||||
DISK_GEOM,
|
||||
DISK_OPEN,
|
||||
DISK_UNSUP,
|
||||
DISK_RDONLY,
|
||||
DISK_CLOSE,
|
||||
DISK_WRFILE,
|
||||
DISK_WRPART,
|
||||
|
||||
DISK_LAST_ERROR,
|
||||
} disk_error_t;
|
||||
|
||||
typedef enum disk_type_t {
|
||||
DISK_TYPE_NONE = 0,
|
||||
DISK_UDI, /* raw track disk image (our format :-) */
|
||||
DISK_FDI, /* Full Disk Image ALT */
|
||||
DISK_TD0,
|
||||
|
||||
DISK_SDF, /* SAM Disk Format (deprecated) */
|
||||
|
||||
/* DISCiPLE / +D / SAM Coupe */
|
||||
DISK_MGT, /* ALT */
|
||||
DISK_IMG, /* OUT-OUT */
|
||||
DISK_SAD, /* OUT-OUT with geometry header */
|
||||
|
||||
DISK_CPC,
|
||||
DISK_ECPC,
|
||||
|
||||
/* Beta disk interface (TR-DOS) */
|
||||
DISK_TRD,
|
||||
DISK_SCL,
|
||||
|
||||
/* Opus Discovery */
|
||||
DISK_OPD,
|
||||
|
||||
/* Log disk structure (.log) */
|
||||
DISK_LOG,
|
||||
|
||||
DISK_TYPE_LAST,
|
||||
} disk_type_t;
|
||||
|
||||
typedef enum disk_dens_t {
|
||||
DISK_DENS_AUTO = 0,
|
||||
DISK_8_SD, /* 8" SD floppy 5208 MF */
|
||||
DISK_8_DD, /* 8" DD floppy 10416 */
|
||||
DISK_SD, /* 3125 bpt MF */
|
||||
DISK_DD, /* 6250 bpt */
|
||||
DISK_DD_PLUS, /* 6500 bpt e.g. Coin Op Hits */
|
||||
DISK_HD, /* 12500 bpt*/
|
||||
} disk_dens_t;
|
||||
|
||||
typedef struct disk_t {
|
||||
int sides; /* 1 or 2 */
|
||||
int cylinders; /* tracks per side */
|
||||
int bpt; /* bytes per track */
|
||||
int wrprot; /* disk write protect */
|
||||
int dirty; /* disk changed */
|
||||
unsigned int flag;
|
||||
disk_error_t status; /* last error code */
|
||||
libspectrum_byte *data; /* disk data */
|
||||
/* private part */
|
||||
int tlen; /* length of a track with clock marks (bpt + 1/8bpt) */
|
||||
libspectrum_byte *track; /* current track data bytes */
|
||||
libspectrum_byte *clocks; /* clock marks bits */
|
||||
int i; /* index for track and clocks */
|
||||
disk_type_t type; /* DISK_UDI, ... */
|
||||
disk_dens_t density; /* DISK_SD DISK_DD, or DISK_HD */
|
||||
} disk_t;
|
||||
|
||||
const char *disk_strerror( int error );
|
||||
/* create an unformatted disk sides -> (1/2) cylinders -> track/side,
|
||||
dens -> 'density' related to unformatted length of a track (SD = 3125,
|
||||
DD = 6250, HD = 12500, type -> if write this disk we want to convert
|
||||
into this type of image file
|
||||
*/
|
||||
int disk_new( disk_t *d, int sides, int cylinders, disk_dens_t dens, disk_type_t type );
|
||||
/* open a disk image file. if preindex = 1 and the image file not UDI then
|
||||
pre-index gap generated with index mark (0xfc)
|
||||
this time only .mgt(.dsk)/.img/.udi and CPC/extended CPC file format
|
||||
supported
|
||||
*/
|
||||
int disk_open( disk_t *d, const char *filename, int preindex );
|
||||
/* write a disk image file (from the disk buffer). the d->type
|
||||
gives the format of file. if it DISK_TYPE_AUTO, disk_write
|
||||
try to guess from the file name (extension). if fail save as
|
||||
UDI.
|
||||
*/
|
||||
int disk_write( disk_t *d, const char *filename );
|
||||
/* close a disk and free buffers
|
||||
*/
|
||||
void disk_close( disk_t *d );
|
||||
|
||||
#endif /* FUSE_DISK_H */
|
|
@ -0,0 +1,341 @@
|
|||
/* fdd.c: Routines for emulating floppy disk drives
|
||||
Copyright (c) 2007 Gergely Szasz
|
||||
|
||||
$Id: fdd.c 3942 2009-01-10 14:18:46Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "bitmap.h"
|
||||
#include "compat.h"
|
||||
#include "disk/upd_fdc.h"
|
||||
#include "disk/wd_fdc.h"
|
||||
#include "event.h"
|
||||
#include "fdd.h"
|
||||
#include "machine.h"
|
||||
#include "spectrum.h"
|
||||
|
||||
#define FDD_LOAD_FACT 2
|
||||
#define FDD_HEAD_FACT 16 /* load head */
|
||||
#define FDD_STEP_FACT 34
|
||||
|
||||
static const char *fdd_error[] = {
|
||||
"OK",
|
||||
"invalid disk geometry",
|
||||
"read only disk",
|
||||
|
||||
"unknown error code" /* will be the last */
|
||||
};
|
||||
|
||||
static void
|
||||
fdd_event( libspectrum_dword last_tstates, int event, void *user_data );
|
||||
|
||||
static int motor_event;
|
||||
|
||||
int
|
||||
fdd_init_events( void )
|
||||
{
|
||||
int error;
|
||||
|
||||
motor_event = event_register( fdd_event, "FDD motor on" );
|
||||
if( motor_event == -1 ) return 1;
|
||||
|
||||
error = upd_fdc_init_events();
|
||||
if( error ) return error;
|
||||
|
||||
error = wd_fdc_init_events();
|
||||
if( error ) return error;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *
|
||||
fdd_strerror( int error )
|
||||
{
|
||||
if( error >= FDD_LAST_ERROR )
|
||||
error = FDD_LAST_ERROR;
|
||||
return fdd_error[ error ];
|
||||
}
|
||||
|
||||
/*
|
||||
* disk->sides 1 2 1 2 1 2 1 2
|
||||
* d->c_head 0 0 1 1 0 0 1 1
|
||||
* d->upside 0 0 0 0 1 1 1 1
|
||||
*
|
||||
* UNREADABLE 0 0 1 0 1 0 0 0
|
||||
*/
|
||||
|
||||
static void
|
||||
fdd_set_data( fdd_t *d, int fact )
|
||||
{
|
||||
int head = d->upsidedown ? 1 - d->c_head : d->c_head;
|
||||
|
||||
if( !d->loaded )
|
||||
return;
|
||||
|
||||
if( d->unreadable || ( d->disk->sides == 1 && head == 1 ) ||
|
||||
d->c_cylinder >= d->disk->cylinders ) {
|
||||
d->disk->track = NULL;
|
||||
d->disk->clocks = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
d->disk->track = d->disk->data +
|
||||
( d->disk->sides * d->c_cylinder + head ) * d->disk->tlen;
|
||||
d->disk->clocks = d->disk->track + d->disk->bpt;
|
||||
if( fact > 0 ) {
|
||||
/* this generate a bpt/fact +-10% rectangular distribution skip in bytes
|
||||
i know, we should use the higher bits of rand(), but we not
|
||||
keen on _real_ (pseudo)random numbers... ;)
|
||||
*/
|
||||
d->disk->i += d->disk->bpt / fact + d->disk->bpt *
|
||||
( rand() % 10 + rand() % 10 - 9 ) / fact / 100;
|
||||
while( d->disk->i >= d->disk->bpt )
|
||||
d->disk->i -= d->disk->bpt;
|
||||
}
|
||||
d->index = d->disk->i ? 0 : 1;
|
||||
}
|
||||
|
||||
/* initialise fdd */
|
||||
int
|
||||
fdd_init( fdd_t *d, fdd_type_t type, int heads, int cyls )
|
||||
{
|
||||
d->fdd_heads = d->fdd_cylinders = d->c_head = d->c_cylinder = 0;
|
||||
d->upsidedown = d->unreadable = d->loaded = d->auto_geom = d->selected = 0;
|
||||
d->index = d->tr00 = d->wrprot = 1;
|
||||
d->disk = NULL;
|
||||
d->type = type;
|
||||
|
||||
if( heads < 0 || heads > 2 || cyls < 0 || cyls > 83 )
|
||||
return d->status = FDD_GEOM;
|
||||
|
||||
if( heads == 0 || cyls == 0 )
|
||||
d->auto_geom = 1;
|
||||
d->fdd_heads = heads;
|
||||
d->fdd_cylinders = cyls;
|
||||
|
||||
return d->status = FDD_OK;
|
||||
}
|
||||
|
||||
void
|
||||
fdd_motoron( fdd_t *d, int on )
|
||||
{
|
||||
if( !d->loaded )
|
||||
return;
|
||||
on = on > 0 ? 1 : 0;
|
||||
if( d->motoron == on )
|
||||
return;
|
||||
d->motoron = on;
|
||||
/*
|
||||
TEAC FD55 Spec:
|
||||
(13) READY output signal
|
||||
i) The FDD is powered on.
|
||||
ii) Disk is installed.
|
||||
iii)The disk rotates at more than 50% of the rated speed.
|
||||
iv) Two index pulses have been counted after item iii) is
|
||||
satisfied
|
||||
|
||||
Note: Pre-ready is the state that at least one INDEX
|
||||
pulse has been detected after item iii) is satisfied
|
||||
*/
|
||||
event_remove_type_user_data( motor_event, d ); /* remove pending motor-on event for *this* drive */
|
||||
if( on ) {
|
||||
event_add_with_data( tstates + 4 * /* 2 revolution: 2 * 200 / 1000 */
|
||||
machine_current->timings.processor_speed / 10,
|
||||
motor_event, d );
|
||||
} else {
|
||||
event_add_with_data( tstates + 3 * /* 1.5 revolution */
|
||||
machine_current->timings.processor_speed / 10,
|
||||
motor_event, d );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fdd_head_load( fdd_t *d, int load )
|
||||
{
|
||||
if( !d->loaded )
|
||||
return;
|
||||
load = load > 0 ? 1 : 0;
|
||||
if( d->loadhead == load )
|
||||
return;
|
||||
d->loadhead = load;
|
||||
fdd_set_data( d, FDD_HEAD_FACT );
|
||||
}
|
||||
|
||||
void
|
||||
fdd_select( fdd_t *d, int select )
|
||||
{
|
||||
d->selected = select > 0 ? 1 : 0;
|
||||
/*
|
||||
... Drive Select when activated to a logical
|
||||
zero level, will load the R/W head against the
|
||||
diskette enabling contact of the R/W head against
|
||||
the media. ...
|
||||
*/
|
||||
if( d->type == FDD_SHUGART )
|
||||
fdd_head_load( d, d->selected );
|
||||
}
|
||||
|
||||
|
||||
/* load a disk into fdd */
|
||||
int
|
||||
fdd_load( fdd_t *d, disk_t *disk, int upsidedown )
|
||||
{
|
||||
if( disk->sides < 0 || disk->sides > 2 ||
|
||||
disk->cylinders < 0 || disk->cylinders > 83 )
|
||||
return d->status = FDD_GEOM;
|
||||
|
||||
if( d->auto_geom )
|
||||
d->fdd_heads = disk->sides; /* 1 or 2 */
|
||||
if( d->auto_geom )
|
||||
d->fdd_cylinders = disk->cylinders > 42 ? 83 : 42;
|
||||
|
||||
if( disk->cylinders > d->fdd_cylinders )
|
||||
d->unreadable = 1;
|
||||
|
||||
d->disk = disk;
|
||||
d->upsidedown = upsidedown > 0 ? 1 : 0;
|
||||
d->wrprot = d->disk->wrprot; /* write protect */
|
||||
d->loaded = 1;
|
||||
if( d->type == FDD_SHUGART && d->selected )
|
||||
fdd_head_load( d, 1 );
|
||||
|
||||
fdd_set_data( d, FDD_LOAD_FACT );
|
||||
return d->status = FDD_OK;
|
||||
}
|
||||
|
||||
void
|
||||
fdd_unload( fdd_t *d )
|
||||
{
|
||||
d->ready = d->loaded = 0;
|
||||
d->index = d->wrprot = 1;
|
||||
d->disk = NULL;
|
||||
fdd_motoron( d, 0 );
|
||||
if( d->type == FDD_SHUGART && d->selected )
|
||||
fdd_head_load( d, 0 );
|
||||
}
|
||||
|
||||
/* change current head */
|
||||
void
|
||||
fdd_set_head( fdd_t *d, int head )
|
||||
{
|
||||
if( d->fdd_heads == 1 )
|
||||
return;
|
||||
|
||||
head = head > 0 ? 1 : 0;
|
||||
if( d->c_head == head )
|
||||
return;
|
||||
|
||||
d->c_head = head;
|
||||
fdd_set_data( d, 0 );
|
||||
}
|
||||
|
||||
/* change current track dir = 1 / -1 */
|
||||
void
|
||||
fdd_step( fdd_t *d, fdd_dir_t direction )
|
||||
{
|
||||
if( direction == FDD_STEP_OUT ) {
|
||||
if( d->c_cylinder > 0 )
|
||||
d->c_cylinder--;
|
||||
} else { /* direction == FDD_STEP_IN */
|
||||
if( d->c_cylinder < d->fdd_cylinders - 1 )
|
||||
d->c_cylinder++;
|
||||
}
|
||||
if( d->c_cylinder == 0 )
|
||||
d->tr00 = 1;
|
||||
else
|
||||
d->tr00 = 0;
|
||||
|
||||
fdd_set_data( d, FDD_STEP_FACT );
|
||||
}
|
||||
|
||||
/* read/write next byte from/to sector */
|
||||
int
|
||||
fdd_read_write_data( fdd_t *d, fdd_write_t write )
|
||||
{
|
||||
if( !d->selected || !d->ready || !d->loadhead || d->disk->track == NULL ) {
|
||||
if( d->loaded && d->motoron ) { /* spin the disk */
|
||||
if( d->disk->i >= d->disk->bpt ) { /* next data byte */
|
||||
d->disk->i = 0;
|
||||
}
|
||||
if( !write )
|
||||
d->data = 0x100; /* no data */
|
||||
d->disk->i++;
|
||||
d->index = d->disk->i >= d->disk->bpt ? 1 : 0;
|
||||
}
|
||||
return d->status = FDD_OK;
|
||||
}
|
||||
|
||||
if( d->disk->i >= d->disk->bpt ) { /* next data byte */
|
||||
d->disk->i = 0;
|
||||
}
|
||||
if( write ) {
|
||||
if( d->disk->wrprot ) {
|
||||
d->disk->i++;
|
||||
d->index = d->disk->i >= d->disk->bpt ? 1 : 0;
|
||||
return d->status = FDD_RDONLY;
|
||||
}
|
||||
d->disk->track[ d->disk->i ] = d->data & 0x00ff;
|
||||
if( d->data & 0xff00 )
|
||||
bitmap_set( d->disk->clocks, d->disk->i );
|
||||
else
|
||||
bitmap_reset( d->disk->clocks, d->disk->i );
|
||||
d->disk->dirty = 1;
|
||||
} else { /* read */
|
||||
d->data = d->disk->track[ d->disk->i ];
|
||||
if( bitmap_test( d->disk->clocks, d->disk->i ) )
|
||||
d->data |= 0xff00;
|
||||
}
|
||||
d->disk->i++;
|
||||
d->index = d->disk->i >= d->disk->bpt ? 1 : 0;
|
||||
|
||||
return d->status = FDD_OK;
|
||||
}
|
||||
|
||||
void
|
||||
fdd_wrprot( fdd_t *d, int wrprot )
|
||||
{
|
||||
if( !d->loaded )
|
||||
return;
|
||||
|
||||
d->wrprot = d->disk->wrprot = wrprot;
|
||||
}
|
||||
|
||||
void
|
||||
fdd_wait_index_hole( fdd_t *d )
|
||||
{
|
||||
if( !d->selected || !d->ready )
|
||||
return;
|
||||
|
||||
d->disk->i = 0;
|
||||
d->index = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
fdd_event( libspectrum_dword last_tstates GCC_UNUSED, int event,
|
||||
void *user_data )
|
||||
{
|
||||
fdd_t *d = user_data;
|
||||
d->ready = ( d->motoron & d->loaded ); /* 0x01 & 0x01 */
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
/* fdd.h: Header for handling raw disk images
|
||||
Copyright (c) 2007 Gergely Szasz
|
||||
|
||||
$Id: fdd.h 3681 2008-06-16 09:40:29Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_FDD_H
|
||||
#define FUSE_FDD_H
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "event.h"
|
||||
#include "disk.h"
|
||||
|
||||
typedef enum fdd_error_t {
|
||||
FDD_OK = 0,
|
||||
FDD_GEOM,
|
||||
FDD_DATA,
|
||||
FDD_RDONLY,
|
||||
|
||||
FDD_LAST_ERROR,
|
||||
} fdd_error_t;
|
||||
|
||||
typedef enum fdd_type_t {
|
||||
FDD_SHUGART = 0, /* head load when selected */
|
||||
/*
|
||||
.. In a single drive system (program shunt position
|
||||
"MX" shorted), with program shunt position "HL"
|
||||
shorted, Drive Select when activated to a logical
|
||||
zero level, will load the R/W head against the
|
||||
diskette enabling contact of the R/W head against
|
||||
the media. ...
|
||||
|
||||
In a multiple drive system (program shunt position
|
||||
"MX" open), the three input lines (Drive Select 1,
|
||||
Drive Select 2 and Drive select 3) are provided so
|
||||
that the using system may select which drive on
|
||||
the interface is to be used. In this mode of opera-
|
||||
tion only the drive with its Drive Select line active
|
||||
will respond to the input lines and gate the output
|
||||
lines. In addition, the selected drive will load its
|
||||
R/W head if program shunt position "HL" is
|
||||
shorted. ...
|
||||
*/
|
||||
FDD_IBMPC,
|
||||
} fdd_type_t;
|
||||
|
||||
typedef enum fdd_write_t {
|
||||
FDD_READ = 0,
|
||||
FDD_WRITE,
|
||||
} fdd_write_t;
|
||||
|
||||
typedef enum fdd_dir_t {
|
||||
FDD_STEP_OUT = 0,
|
||||
FDD_STEP_IN = 1,
|
||||
} fdd_dir_t;
|
||||
|
||||
typedef struct fdd_t {
|
||||
fdd_type_t type; /* fdd type: Shugart or IBMPC */
|
||||
int auto_geom; /* change geometry according to loading disk */
|
||||
int fdd_heads; /* 1 or 2 */
|
||||
int fdd_cylinders; /* 40/40+/80/80+ */
|
||||
|
||||
int tr00; /* track 0 mark */
|
||||
int index; /* index hole */
|
||||
int wrprot; /* write protect */
|
||||
int data; /* read/write to data byte 0x00nn or 0xffnn */
|
||||
|
||||
disk_t *disk; /* pointer to inserted disk */
|
||||
int loaded; /* disk loaded */
|
||||
int upsidedown; /* flipped disk */
|
||||
int selected; /* Drive Select line active */
|
||||
int ready; /* some disk drive offer a ready signal */
|
||||
|
||||
fdd_error_t status;
|
||||
|
||||
/*--private section, fdc may never use it */
|
||||
int unreadable; /* disk unreadable in this drive */
|
||||
int c_head; /* current head (side) */
|
||||
int c_cylinder; /* current cylinder number (0 -> TR00) */
|
||||
int motoron; /* motor on */
|
||||
int loadhead; /* head loaded */
|
||||
|
||||
} fdd_t;
|
||||
|
||||
/* initialize the event codes */
|
||||
int fdd_init_events( void );
|
||||
|
||||
const char *fdd_strerror( int error );
|
||||
/* initialize the fdd_t struct, and set fdd_heads and cylinders (e.g. 2/83 ) */
|
||||
int fdd_init( fdd_t *d, fdd_type_t type, int heads, int cyls );
|
||||
/* load the given disk into the fdd. if upsidedown = 1, floppy upsidedown in drive :) */
|
||||
int fdd_load( fdd_t *d, disk_t *disk, int upsidedown );
|
||||
/* unload the disk from fdd */
|
||||
void fdd_unload( fdd_t *d );
|
||||
/* set fdd head */
|
||||
void fdd_set_head( fdd_t *d, int head );
|
||||
/* step one track according to d->direction direction. set d->tr00 if reach track 0 */
|
||||
void fdd_step( fdd_t *d, fdd_dir_t direction );
|
||||
/* set floppy position ( upsidedown or not )*/
|
||||
void fdd_motoron( fdd_t *d, int on );
|
||||
/* start (1) or stop (0) spindle motor */
|
||||
void fdd_head_load( fdd_t *d, int load );
|
||||
/* load (1) or unload (0) head */
|
||||
void fdd_select( fdd_t *d, int select );
|
||||
/* select (1) or unselect (0) FDD */
|
||||
void fdd_flip( fdd_t *d, int upsidedown );
|
||||
/* read or write next 1 byte from disk. if read, the read byte go into
|
||||
d->data, if write d->data written to disk. if d->data = 0xffnn then this
|
||||
byte recorded with different clock 'mark'. set d->idx if reach 'index hole'
|
||||
read 0x0100 if disk unreadable or not motor on and/or head not loaded.
|
||||
*/
|
||||
int fdd_read_write_data( fdd_t *d, fdd_write_t write );
|
||||
/* set write protect status on loaded disk */
|
||||
void fdd_wrprot( fdd_t *d, int wrprot );
|
||||
/* to reach index hole */
|
||||
void fdd_wait_index_hole( fdd_t *d );
|
||||
|
||||
#endif /* FUSE_FDD_H */
|
|
@ -0,0 +1,629 @@
|
|||
/* plusd.c: Routines for handling the +D interface
|
||||
Copyright (c) 1999-2007 Stuart Brady, Fredrick Meunier, Philip Kendall,
|
||||
Dmitry Sanarin, Darren Salt
|
||||
|
||||
$Id: plusd.c 3942 2009-01-10 14:18:46Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
Stuart: sdbrady@ntlworld.com
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "compat.h"
|
||||
#include "machine.h"
|
||||
#include "module.h"
|
||||
#include "plusd.h"
|
||||
#include "printer.h"
|
||||
#include "settings.h"
|
||||
#include "ui/ui.h"
|
||||
#include "wd_fdc.h"
|
||||
|
||||
int plusd_available = 0;
|
||||
int plusd_active = 0;
|
||||
|
||||
static int plusd_index_pulse;
|
||||
|
||||
static int index_event;
|
||||
|
||||
#define PLUSD_NUM_DRIVES 2
|
||||
|
||||
static wd_fdc *plusd_fdc;
|
||||
static wd_fdc_drive plusd_drives[ PLUSD_NUM_DRIVES ];
|
||||
|
||||
static libspectrum_byte plusd_ram[ 0x2000 ];
|
||||
|
||||
static void plusd_reset( int hard_reset );
|
||||
static void plusd_memory_map( void );
|
||||
static void plusd_enabled_snapshot( libspectrum_snap *snap );
|
||||
static void plusd_from_snapshot( libspectrum_snap *snap );
|
||||
static void plusd_to_snapshot( libspectrum_snap *snap );
|
||||
static void plusd_event_index( libspectrum_dword last_tstates, int type,
|
||||
void *user_data );
|
||||
|
||||
static module_info_t plusd_module_info = {
|
||||
|
||||
plusd_reset,
|
||||
plusd_memory_map,
|
||||
plusd_enabled_snapshot,
|
||||
plusd_from_snapshot,
|
||||
plusd_to_snapshot,
|
||||
|
||||
};
|
||||
|
||||
static libspectrum_byte plusd_control_register;
|
||||
|
||||
void
|
||||
plusd_page( void )
|
||||
{
|
||||
plusd_active = 1;
|
||||
machine_current->ram.romcs = 1;
|
||||
machine_current->memory_map();
|
||||
}
|
||||
|
||||
void
|
||||
plusd_unpage( void )
|
||||
{
|
||||
plusd_active = 0;
|
||||
machine_current->ram.romcs = 0;
|
||||
machine_current->memory_map();
|
||||
}
|
||||
|
||||
static void
|
||||
plusd_memory_map( void )
|
||||
{
|
||||
if( !plusd_active ) return;
|
||||
|
||||
memory_map_read[ 0 ] = memory_map_write[ 0 ] = memory_map_romcs[ 0 ];
|
||||
memory_map_read[ 1 ] = memory_map_write[ 1 ] = memory_map_romcs[ 1 ];
|
||||
}
|
||||
|
||||
const periph_t plusd_peripherals[] = {
|
||||
/* ---- ---- 1110 0011 */
|
||||
{ 0x00ff, 0x00e3, plusd_sr_read, plusd_cr_write },
|
||||
/* ---- ---- 1110 1011 */
|
||||
{ 0x00ff, 0x00eb, plusd_tr_read, plusd_tr_write },
|
||||
/* ---- ---- 1111 0011 */
|
||||
{ 0x00ff, 0x00f3, plusd_sec_read, plusd_sec_write },
|
||||
/* ---- ---- 1111 1011 */
|
||||
{ 0x00ff, 0x00fb, plusd_dr_read, plusd_dr_write },
|
||||
|
||||
/* ---- ---- 1110 1111 */
|
||||
{ 0x00ff, 0x00ef, NULL, plusd_cn_write },
|
||||
/* ---- ---- 1110 0111 */
|
||||
{ 0x00ff, 0x00e7, plusd_mem_read, plusd_mem_write },
|
||||
/* 0000 0000 1111 0111 */
|
||||
{ 0x00ff, 0x00f7, plusd_printer_read, plusd_printer_write },
|
||||
};
|
||||
|
||||
const size_t plusd_peripherals_count =
|
||||
sizeof( plusd_peripherals ) / sizeof( periph_t );
|
||||
|
||||
int
|
||||
plusd_init( void )
|
||||
{
|
||||
int i;
|
||||
wd_fdc_drive *d;
|
||||
|
||||
plusd_fdc = wd_fdc_alloc_fdc( WD1770, 0, WD_FLAG_NONE );
|
||||
|
||||
for( i = 0; i < PLUSD_NUM_DRIVES; i++ ) {
|
||||
d = &plusd_drives[ i ];
|
||||
fdd_init( &d->fdd, FDD_SHUGART, 0, 0 ); /* drive geometry 'autodetect' */
|
||||
d->disk.flag = DISK_FLAG_NONE;
|
||||
}
|
||||
|
||||
plusd_fdc->current_drive = &plusd_drives[ 0 ];
|
||||
fdd_select( &plusd_drives[ 0 ].fdd, 1 );
|
||||
plusd_fdc->dden = 1;
|
||||
plusd_fdc->set_intrq = NULL;
|
||||
plusd_fdc->reset_intrq = NULL;
|
||||
plusd_fdc->set_datarq = NULL;
|
||||
plusd_fdc->reset_datarq = NULL;
|
||||
plusd_fdc->iface = NULL;
|
||||
|
||||
index_event = event_register( plusd_event_index, "+D index" );
|
||||
|
||||
module_register( &plusd_module_info );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
plusd_reset( int hard_reset )
|
||||
{
|
||||
int i;
|
||||
wd_fdc_drive *d;
|
||||
|
||||
plusd_active = 0;
|
||||
plusd_available = 0;
|
||||
|
||||
event_remove_type( index_event );
|
||||
|
||||
if( !periph_plusd_active )
|
||||
return;
|
||||
|
||||
machine_load_rom_bank( memory_map_romcs, 0, 0,
|
||||
settings_current.rom_plusd,
|
||||
settings_default.rom_plusd, 0x2000 );
|
||||
|
||||
memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL;
|
||||
|
||||
memory_map_romcs[1].page = plusd_ram;
|
||||
memory_map_romcs[1].source = MEMORY_SOURCE_PERIPHERAL;
|
||||
|
||||
machine_current->ram.romcs = 0;
|
||||
|
||||
memory_map_romcs[ 0 ].writable = 0;
|
||||
memory_map_romcs[ 1 ].writable = 1;
|
||||
|
||||
plusd_available = 1;
|
||||
plusd_active = 1;
|
||||
plusd_index_pulse = 0;
|
||||
|
||||
if( hard_reset )
|
||||
memset( plusd_ram, 0, 0x2000 );
|
||||
|
||||
wd_fdc_master_reset( plusd_fdc );
|
||||
|
||||
for( i = 0; i < PLUSD_NUM_DRIVES; i++ ) {
|
||||
d = &plusd_drives[ i ];
|
||||
|
||||
d->index_pulse = 0;
|
||||
d->index_interrupt = 0;
|
||||
}
|
||||
|
||||
/* We can eject disks only if they are currently present */
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_1_EJECT,
|
||||
plusd_drives[ PLUSD_DRIVE_1 ].fdd.loaded );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_1_WP_SET,
|
||||
!plusd_drives[ PLUSD_DRIVE_1 ].fdd.wrprot );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_2_EJECT,
|
||||
plusd_drives[ PLUSD_DRIVE_2 ].fdd.loaded );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_2_WP_SET,
|
||||
!plusd_drives[ PLUSD_DRIVE_2 ].fdd.wrprot );
|
||||
|
||||
plusd_fdc->current_drive = &plusd_drives[ 0 ];
|
||||
fdd_select( &plusd_drives[ 0 ].fdd, 1 );
|
||||
machine_current->memory_map();
|
||||
plusd_event_index( 0, index_event, NULL );
|
||||
|
||||
ui_statusbar_update( UI_STATUSBAR_ITEM_DISK, UI_STATUSBAR_STATE_INACTIVE );
|
||||
}
|
||||
|
||||
void
|
||||
plusd_end( void )
|
||||
{
|
||||
plusd_available = 0;
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
plusd_sr_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
if( !plusd_available ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
return wd_fdc_sr_read( plusd_fdc );
|
||||
}
|
||||
|
||||
void
|
||||
plusd_cr_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
if( !plusd_available ) return;
|
||||
|
||||
wd_fdc_cr_write( plusd_fdc, b );
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
plusd_tr_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
if( !plusd_available ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
return wd_fdc_tr_read( plusd_fdc );
|
||||
}
|
||||
|
||||
void
|
||||
plusd_tr_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
if( !plusd_available ) return;
|
||||
|
||||
wd_fdc_tr_write( plusd_fdc, b );
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
plusd_sec_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
if( !plusd_available ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
return wd_fdc_sec_read( plusd_fdc );
|
||||
}
|
||||
|
||||
void
|
||||
plusd_sec_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
if( !plusd_available ) return;
|
||||
|
||||
wd_fdc_sec_write( plusd_fdc, b );
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
plusd_dr_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
if( !plusd_available ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
return wd_fdc_dr_read( plusd_fdc );
|
||||
}
|
||||
|
||||
void
|
||||
plusd_dr_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
if( !plusd_available ) return;
|
||||
|
||||
wd_fdc_dr_write( plusd_fdc, b );
|
||||
}
|
||||
|
||||
void
|
||||
plusd_cn_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b )
|
||||
{
|
||||
int drive, side;
|
||||
int i;
|
||||
|
||||
if( !plusd_available ) return;
|
||||
|
||||
plusd_control_register = b;
|
||||
|
||||
drive = ( b & 0x03 ) == 2 ? 1 : 0;
|
||||
side = ( b & 0x80 ) ? 1 : 0;
|
||||
|
||||
/* TODO: set current_drive to NULL when bits 0 and 1 of b are '00' or '11' */
|
||||
for( i = 0; i < PLUSD_NUM_DRIVES; i++ ) {
|
||||
fdd_set_head( &plusd_drives[ i ].fdd, side );
|
||||
}
|
||||
fdd_select( &plusd_drives[ (!drive) ].fdd, 0 );
|
||||
fdd_select( &plusd_drives[ drive ].fdd, 1 );
|
||||
|
||||
if( plusd_fdc->current_drive != &plusd_drives[ drive ] ) {
|
||||
if( plusd_fdc->current_drive->fdd.motoron ) { /* swap motoron */
|
||||
fdd_motoron( &plusd_drives[ (!drive) ].fdd, 0 );
|
||||
fdd_motoron( &plusd_drives[ drive ].fdd, 1 );
|
||||
}
|
||||
plusd_fdc->current_drive = &plusd_drives[ drive ];
|
||||
}
|
||||
|
||||
printer_parallel_strobe_write( b & 0x40 );
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
plusd_mem_read( libspectrum_word port GCC_UNUSED, int *attached GCC_UNUSED )
|
||||
{
|
||||
if( !plusd_available ) return 0xff;
|
||||
|
||||
/* should we set *attached = 1? */
|
||||
|
||||
plusd_page();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
plusd_mem_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b GCC_UNUSED )
|
||||
{
|
||||
if( !plusd_available ) return;
|
||||
|
||||
plusd_unpage();
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
plusd_printer_read( libspectrum_word port GCC_UNUSED, int *attached )
|
||||
{
|
||||
if( !plusd_available ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
|
||||
/* bit 7 = busy. other bits high? */
|
||||
|
||||
if(!settings_current.printer)
|
||||
return(0xff); /* no printer attached */
|
||||
|
||||
return(0x7f); /* never busy */
|
||||
}
|
||||
|
||||
void
|
||||
plusd_printer_write( libspectrum_word port, libspectrum_byte b )
|
||||
{
|
||||
if( !plusd_available ) return;
|
||||
|
||||
printer_parallel_write( port, b );
|
||||
}
|
||||
|
||||
int
|
||||
plusd_disk_insert( plusd_drive_number which, const char *filename,
|
||||
int autoload )
|
||||
{
|
||||
int error;
|
||||
wd_fdc_drive *d;
|
||||
|
||||
if( which >= PLUSD_NUM_DRIVES ) {
|
||||
ui_error( UI_ERROR_ERROR, "plusd_disk_insert: unknown drive %d",
|
||||
which );
|
||||
fuse_abort();
|
||||
}
|
||||
|
||||
d = &plusd_drives[ which ];
|
||||
|
||||
/* Eject any disk already in the drive */
|
||||
if( d->fdd.loaded ) {
|
||||
/* Abort the insert if we want to keep the current disk */
|
||||
if( plusd_disk_eject( which, 0 ) ) return 0;
|
||||
}
|
||||
|
||||
if( filename ) {
|
||||
error = disk_open( &d->disk, filename, 0 );
|
||||
if( error != DISK_OK ) {
|
||||
ui_error( UI_ERROR_ERROR, "Failed to open disk image: %s",
|
||||
disk_strerror( error ) );
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
error = disk_new( &d->disk, 2, 80, DISK_DENS_AUTO, DISK_UDI );
|
||||
if( error != DISK_OK ) {
|
||||
ui_error( UI_ERROR_ERROR, "Failed to create disk image: %s",
|
||||
disk_strerror( error ) );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
fdd_load( &d->fdd, &d->disk, 0 );
|
||||
|
||||
/* Set the 'eject' item active */
|
||||
switch( which ) {
|
||||
case PLUSD_DRIVE_1:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_1_EJECT, 1 );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_1_WP_SET,
|
||||
!plusd_drives[ PLUSD_DRIVE_1 ].fdd.wrprot );
|
||||
break;
|
||||
case PLUSD_DRIVE_2:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_2_EJECT, 1 );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_2_WP_SET,
|
||||
!plusd_drives[ PLUSD_DRIVE_2 ].fdd.wrprot );
|
||||
break;
|
||||
}
|
||||
|
||||
if( filename && autoload ) {
|
||||
/* XXX */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
plusd_disk_eject( plusd_drive_number which, int write )
|
||||
{
|
||||
wd_fdc_drive *d;
|
||||
|
||||
if( which >= PLUSD_NUM_DRIVES )
|
||||
return 1;
|
||||
|
||||
d = &plusd_drives[ which ];
|
||||
|
||||
if( d->disk.type == DISK_TYPE_NONE )
|
||||
return 0;
|
||||
|
||||
if( write ) {
|
||||
|
||||
if( ui_plusd_disk_write( which ) ) return 1;
|
||||
|
||||
} else {
|
||||
|
||||
if( d->disk.dirty ) {
|
||||
|
||||
ui_confirm_save_t confirm = ui_confirm_save(
|
||||
"Disk in +D drive %c has been modified.\n"
|
||||
"Do you want to save it?",
|
||||
which == PLUSD_DRIVE_1 ? '1' : '2'
|
||||
);
|
||||
|
||||
switch( confirm ) {
|
||||
|
||||
case UI_CONFIRM_SAVE_SAVE:
|
||||
if( ui_plusd_disk_write( which ) ) return 1;
|
||||
break;
|
||||
|
||||
case UI_CONFIRM_SAVE_DONTSAVE: break;
|
||||
case UI_CONFIRM_SAVE_CANCEL: return 1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fdd_unload( &d->fdd );
|
||||
disk_close( &d->disk );
|
||||
|
||||
/* Set the 'eject' item inactive */
|
||||
switch( which ) {
|
||||
case PLUSD_DRIVE_1:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_1_EJECT, 0 );
|
||||
break;
|
||||
case PLUSD_DRIVE_2:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_2_EJECT, 0 );
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
plusd_disk_writeprotect( plusd_drive_number which, int wrprot )
|
||||
{
|
||||
wd_fdc_drive *d;
|
||||
|
||||
if( which >= PLUSD_NUM_DRIVES )
|
||||
return 1;
|
||||
|
||||
d = &plusd_drives[ which ];
|
||||
|
||||
if( !d->fdd.loaded )
|
||||
return 1;
|
||||
|
||||
fdd_wrprot( &d->fdd, wrprot );
|
||||
|
||||
/* Update the 'write protect' menu item */
|
||||
switch( which ) {
|
||||
case PLUSD_DRIVE_1:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_1_WP_SET,
|
||||
!plusd_drives[ PLUSD_DRIVE_1 ].fdd.wrprot );
|
||||
break;
|
||||
case PLUSD_DRIVE_2:
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_DISK_PLUSD_2_WP_SET,
|
||||
!plusd_drives[ PLUSD_DRIVE_2 ].fdd.wrprot );
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
plusd_disk_write( plusd_drive_number which, const char *filename )
|
||||
{
|
||||
wd_fdc_drive *d = &plusd_drives[ which ];
|
||||
int error;
|
||||
|
||||
d->disk.type = DISK_TYPE_NONE;
|
||||
error = disk_write( &d->disk, filename );
|
||||
|
||||
if( error != DISK_OK ) {
|
||||
ui_error( UI_ERROR_ERROR, "couldn't write '%s' file: %s", filename,
|
||||
disk_strerror( error ) );
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
plusd_event_index( libspectrum_dword last_tstates, int type GCC_UNUSED,
|
||||
void *user_data GCC_UNUSED )
|
||||
{
|
||||
int next_tstates;
|
||||
int i;
|
||||
|
||||
plusd_index_pulse = !plusd_index_pulse;
|
||||
for( i = 0; i < PLUSD_NUM_DRIVES; i++ ) {
|
||||
wd_fdc_drive *d = &plusd_drives[ i ];
|
||||
|
||||
d->index_pulse = plusd_index_pulse;
|
||||
if( !plusd_index_pulse && d->index_interrupt ) {
|
||||
wd_fdc_set_intrq( plusd_fdc );
|
||||
d->index_interrupt = 0;
|
||||
}
|
||||
}
|
||||
next_tstates = ( plusd_index_pulse ? 10 : 190 ) *
|
||||
machine_current->timings.processor_speed / 1000;
|
||||
event_add( last_tstates + next_tstates, index_event );
|
||||
}
|
||||
|
||||
static libspectrum_byte *
|
||||
alloc_and_copy_page( libspectrum_byte* source_page )
|
||||
{
|
||||
libspectrum_byte *buffer;
|
||||
buffer = malloc( MEMORY_PAGE_SIZE );
|
||||
if( !buffer ) {
|
||||
ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__,
|
||||
__LINE__ );
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy( buffer, source_page, MEMORY_PAGE_SIZE );
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static void
|
||||
plusd_enabled_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
if( libspectrum_snap_plusd_active( snap ) )
|
||||
settings_current.plusd = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
plusd_from_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
if( !libspectrum_snap_plusd_active( snap ) ) return;
|
||||
|
||||
if( libspectrum_snap_plusd_custom_rom( snap ) &&
|
||||
libspectrum_snap_plusd_rom( snap, 0 ) &&
|
||||
machine_load_rom_bank_from_buffer(
|
||||
memory_map_romcs, 0, 0,
|
||||
libspectrum_snap_plusd_rom( snap, 0 ),
|
||||
MEMORY_PAGE_SIZE,
|
||||
1 ) )
|
||||
return;
|
||||
|
||||
if( libspectrum_snap_plusd_ram( snap, 0 ) ) {
|
||||
memcpy( plusd_ram,
|
||||
libspectrum_snap_plusd_ram( snap, 0 ), 0x2000 );
|
||||
}
|
||||
|
||||
plusd_fdc->direction = libspectrum_snap_beta_direction( snap );
|
||||
|
||||
plusd_cr_write ( 0x00e3, libspectrum_snap_plusd_status ( snap ) );
|
||||
plusd_tr_write ( 0x00eb, libspectrum_snap_plusd_track ( snap ) );
|
||||
plusd_sec_write( 0x00f3, libspectrum_snap_plusd_sector ( snap ) );
|
||||
plusd_dr_write ( 0x00fb, libspectrum_snap_plusd_data ( snap ) );
|
||||
plusd_cn_write ( 0x00ef, libspectrum_snap_plusd_control( snap ) );
|
||||
|
||||
if( libspectrum_snap_plusd_paged( snap ) ) {
|
||||
plusd_page();
|
||||
} else {
|
||||
plusd_unpage();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
plusd_to_snapshot( libspectrum_snap *snap GCC_UNUSED )
|
||||
{
|
||||
libspectrum_byte *buffer;
|
||||
|
||||
if( !periph_plusd_active ) return;
|
||||
|
||||
libspectrum_snap_set_plusd_active( snap, 1 );
|
||||
|
||||
buffer = alloc_and_copy_page( memory_map_romcs[0].page );
|
||||
if( !buffer ) return;
|
||||
libspectrum_snap_set_plusd_rom( snap, 0, buffer );
|
||||
if( memory_map_romcs[0].source == MEMORY_SOURCE_CUSTOMROM )
|
||||
libspectrum_snap_set_plusd_custom_rom( snap, 1 );
|
||||
|
||||
buffer = alloc_and_copy_page( plusd_ram );
|
||||
if( !buffer ) return;
|
||||
libspectrum_snap_set_plusd_ram( snap, 0, buffer );
|
||||
|
||||
libspectrum_snap_set_plusd_paged ( snap, plusd_active );
|
||||
libspectrum_snap_set_plusd_direction( snap, plusd_fdc->direction );
|
||||
libspectrum_snap_set_plusd_status( snap, plusd_fdc->status_register );
|
||||
libspectrum_snap_set_plusd_track ( snap, plusd_fdc->track_register );
|
||||
libspectrum_snap_set_plusd_sector( snap, plusd_fdc->sector_register );
|
||||
libspectrum_snap_set_plusd_data ( snap, plusd_fdc->data_register );
|
||||
libspectrum_snap_set_plusd_control( snap, plusd_control_register );
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/* plusd.h: Routines for handling the +D interface
|
||||
Copyright (c) 2005-2007 Stuart Brady
|
||||
|
||||
$Id: plusd.h 3681 2008-06-16 09:40:29Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
Stuart: sdbrady@ntlworld.com
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_PLUSD_H
|
||||
#define FUSE_PLUSD_H
|
||||
|
||||
#include <config.h>
|
||||
|
||||
typedef enum plusd_drive_number {
|
||||
PLUSD_DRIVE_1 = 0,
|
||||
PLUSD_DRIVE_2,
|
||||
} plusd_drive_number;
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "periph.h"
|
||||
|
||||
extern int plusd_available; /* Is the +D available for use? */
|
||||
extern int plusd_active; /* +D enabled? */
|
||||
|
||||
extern const periph_t plusd_peripherals[];
|
||||
extern const size_t plusd_peripherals_count;
|
||||
|
||||
int plusd_init( void );
|
||||
void plusd_end( void );
|
||||
|
||||
void plusd_page( void );
|
||||
void plusd_unpage( void );
|
||||
|
||||
libspectrum_byte plusd_sr_read( libspectrum_word port, int *attached );
|
||||
void plusd_cr_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte plusd_tr_read( libspectrum_word port, int *attached );
|
||||
void plusd_tr_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte plusd_sec_read( libspectrum_word port, int *attached );
|
||||
void plusd_sec_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte plusd_dr_read( libspectrum_word port, int *attached );
|
||||
void plusd_dr_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte plusd_joy_read( libspectrum_word port, int *attached );
|
||||
void plusd_cn_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte plusd_mem_read( libspectrum_word port, int *attached );
|
||||
void plusd_mem_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte plusd_printer_read( libspectrum_word port, int *attached );
|
||||
void plusd_printer_write( libspectrum_word port, libspectrum_byte b );
|
||||
|
||||
int plusd_disk_insert( plusd_drive_number which, const char *filename,
|
||||
int autoload );
|
||||
int plusd_disk_eject( plusd_drive_number which, int write );
|
||||
int plusd_disk_write( plusd_drive_number which, const char *filename );
|
||||
int plusd_disk_writeprotect( plusd_drive_number which, int wrprot );
|
||||
|
||||
#endif /* #ifndef FUSE_PLUSD_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,182 @@
|
|||
/* upd_fdc.h: NEC floppy disk controller emulation
|
||||
Copyright (c) 2003-2007 Stuart Brady, Fredrick Meunier, Philip Kendall,
|
||||
Gergely Szasz
|
||||
|
||||
$Id: upd_fdc.h 3681 2008-06-16 09:40:29Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
Stuart: sdbrady@ntlworld.com
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_UPD_FDC_H
|
||||
#define FUSE_UPD_FDC_H
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "event.h"
|
||||
#include "fdd.h"
|
||||
#include "fuse.h"
|
||||
|
||||
typedef enum upd_type_t {
|
||||
UPD765A = 0,
|
||||
UPD765B,
|
||||
} upd_type_t;
|
||||
|
||||
typedef enum upd_clock_t {
|
||||
UPD_CLOCK_4MHZ = 0,
|
||||
UPD_CLOCK_8MHZ,
|
||||
} upd_clock_t;
|
||||
|
||||
typedef enum upd_scan_t {
|
||||
UPD_SCAN_EQ = 0,
|
||||
UPD_SCAN_LO,
|
||||
UPD_SCAN_HI,
|
||||
} upd_scan_t;
|
||||
|
||||
typedef enum upd_cmd_id_t {
|
||||
/* ----v computer READ at execution phase*/
|
||||
UPD_CMD_READ_DATA = 0, /* (non)deleted */
|
||||
UPD_CMD_READ_DIAG,
|
||||
/* ----v computer WRITE at execution phase*/
|
||||
UPD_CMD_WRITE_DATA, /* (non)deleted */
|
||||
UPD_CMD_WRITE_ID, /* :) format */
|
||||
UPD_CMD_SCAN, /* equal/low-or-equal/high-or-equal */
|
||||
/* ----v NO data transfer at execution phase */
|
||||
UPD_CMD_READ_ID,
|
||||
/* ----v NO RW head contact */
|
||||
UPD_CMD_RECALIBRATE,
|
||||
UPD_CMD_SENSE_INT,
|
||||
UPD_CMD_SPECIFY,
|
||||
UPD_CMD_SENSE_DRIVE,
|
||||
UPD_CMD_VERSION,
|
||||
UPD_CMD_SEEK,
|
||||
UPD_CMD_INVALID,
|
||||
} upd_cmd_id_t;
|
||||
|
||||
typedef struct upd_cmd_t {
|
||||
upd_cmd_id_t id; /* command ID */
|
||||
libspectrum_byte mask; /* && mask */
|
||||
libspectrum_byte value; /* == value */
|
||||
int cmd_length; /* command length */
|
||||
int res_length; /* result length */
|
||||
} upd_cmd_t;
|
||||
|
||||
typedef enum upd_intrq_t {
|
||||
UPD_INTRQ_NONE = 0,
|
||||
UPD_INTRQ_RESULT,
|
||||
UPD_INTRQ_EXE,
|
||||
UPD_INTRQ_READY,
|
||||
UPD_INTRQ_SEEK,
|
||||
} upd_intrq_t;
|
||||
|
||||
typedef struct upd_fdc_drive {
|
||||
fdd_t fdd; /* floppy disk drive */
|
||||
disk_t disk; /* the floppy disk itself */
|
||||
} upd_fdc_drive;
|
||||
|
||||
typedef struct upd_fdc {
|
||||
upd_fdc_drive *current_drive;
|
||||
upd_fdc_drive *drive[4]; /* UPD765 control 4 drives */
|
||||
|
||||
upd_type_t type; /* UPD765A UPD765B */
|
||||
upd_clock_t clock; /* clock rate ( 4/8 MHz ) */
|
||||
|
||||
int stp_rate; /* stepping rate ms */
|
||||
int hut_time; /* head unload time ms */
|
||||
int hld_time; /* head load time ms */
|
||||
int non_dma; /* operating mode */
|
||||
int first_rw; /* first sector alway read/write even EOT < R */
|
||||
|
||||
int spin_cycles;
|
||||
fdd_dir_t direction; /* 0 = spindlewards, 1 = rimwards */
|
||||
upd_intrq_t intrq; /* last INTRQ status */
|
||||
int datarq; /* DRQ line status */
|
||||
|
||||
enum upd_fdc_state {
|
||||
UPD_FDC_STATE_CMD = 0,
|
||||
UPD_FDC_STATE_EXE,
|
||||
UPD_FDC_STATE_RES,
|
||||
} state;
|
||||
|
||||
int id_track;
|
||||
int id_head;
|
||||
int id_sector;
|
||||
int id_length; /* sector length code 0, 1, 2, 3 */
|
||||
int sector_length; /* sector length from length code */
|
||||
int ddam; /* read a deleted data mark */
|
||||
int rev; /* revolution counter */
|
||||
int head_load; /* head state */
|
||||
int read_id; /* searching an IDAM */
|
||||
enum upd_fdc_am_type {
|
||||
UPD_FDC_AM_NONE = 0,
|
||||
UPD_FDC_AM_ID,
|
||||
} id_mark;
|
||||
|
||||
unsigned int last_sector_read;/* for Speedlock 'random' sector hack */
|
||||
int do_error; /* for Speedlock 'random' sector hack */
|
||||
|
||||
/* state during transfer */
|
||||
int data_offset;
|
||||
|
||||
int cycle; /* read/write cycle num */
|
||||
int del_data; /* READ/WRITE deleted data */
|
||||
int mt; /* multitrack operations */
|
||||
int mf; /* MFM mode */
|
||||
int sk; /* skip deleted/not deleted data */
|
||||
int hd; /* physical head address */
|
||||
int us; /* unit select 0-3 */
|
||||
int pcn[4]; /* present cylinder numbers */
|
||||
int ncn[4]; /* new cylinder numbers */
|
||||
int rec[4]; /* recalibrate store pcns */
|
||||
int seek[4]; /* seek status for 4 drive */
|
||||
int rlen; /* expected record length */
|
||||
upd_scan_t scan; /* SCAN type: eq/lo/hi */
|
||||
|
||||
upd_cmd_t *cmd; /* current command */
|
||||
|
||||
libspectrum_byte command_register; /* command register */
|
||||
libspectrum_byte data_register[9]; /* data registers */
|
||||
libspectrum_byte main_status; /* main status register */
|
||||
libspectrum_byte status_register[4]; /* status registers */
|
||||
|
||||
libspectrum_byte sense_int_res[2]; /* result bytes for SENSE INTERRUPT */
|
||||
|
||||
libspectrum_word crc; /* to hold crc */
|
||||
|
||||
void ( *set_intrq ) ( struct upd_fdc *f );
|
||||
void ( *reset_intrq ) ( struct upd_fdc *f );
|
||||
void ( *set_datarq ) ( struct upd_fdc *f );
|
||||
void ( *reset_datarq ) ( struct upd_fdc *f );
|
||||
|
||||
} upd_fdc;
|
||||
|
||||
int upd_fdc_init_events( void );
|
||||
|
||||
/* allocate an fdc */
|
||||
upd_fdc *upd_fdc_alloc_fdc( upd_type_t type, upd_clock_t clock );
|
||||
void upd_fdc_master_reset( upd_fdc *f );
|
||||
|
||||
libspectrum_byte upd_fdc_read_status( upd_fdc *f );
|
||||
|
||||
libspectrum_byte upd_fdc_read_data( upd_fdc *f );
|
||||
void upd_fdc_write_data( upd_fdc *f, libspectrum_byte b );
|
||||
|
||||
#endif /* #ifndef FUSE_UPD_FDC_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,169 @@
|
|||
/* wd_fdc.h: Western Digital floppy disk controller emulation
|
||||
Copyright (c) 2003-2007 Stuart Brady, Fredrick Meunier, Philip Kendall,
|
||||
Gergely Szasz
|
||||
|
||||
$Id: wd_fdc.h 3681 2008-06-16 09:40:29Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
Philip: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
Stuart: sdbrady@ntlworld.com
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_WD_FDC_H
|
||||
#define FUSE_WD_FDC_H
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "event.h"
|
||||
#include "fdd.h"
|
||||
#include "fuse.h"
|
||||
|
||||
static const int WD_FDC_SR_MOTORON = 1<<7; /* Motor on */
|
||||
static const int WD_FDC_SR_WRPROT = 1<<6; /* Write-protect */
|
||||
static const int WD_FDC_SR_SPINUP = 1<<5; /* Record type / Spin-up complete */
|
||||
static const int WD_FDC_SR_RNF = 1<<4; /* Record Not Found */
|
||||
static const int WD_FDC_SR_CRCERR = 1<<3; /* CRC error */
|
||||
static const int WD_FDC_SR_LOST = 1<<2; /* Lost data */
|
||||
static const int WD_FDC_SR_IDX_DRQ = 1<<1; /* Index pulse / Data request */
|
||||
static const int WD_FDC_SR_BUSY = 1<<0; /* Busy (command under execution) */
|
||||
|
||||
static const int WD_FLAG_NONE = 0;
|
||||
static const int WD_FLAG_BETA128 = 1<<0; /* Beta128 connects HLD output pin to READY input pin and
|
||||
MOTOR ON pin on FDD interface */
|
||||
|
||||
typedef enum wd_type_t {
|
||||
WD1773 = 0, /* WD1773 */
|
||||
FD1793,
|
||||
WD1770,
|
||||
WD1772,
|
||||
} wd_type_t;
|
||||
|
||||
extern int wd_fdc_index_pulse;
|
||||
extern int wd_fdc_index_interrupt;
|
||||
|
||||
typedef struct wd_fdc_drive {
|
||||
fdd_t fdd; /* floppy disk drive */
|
||||
disk_t disk; /* the floppy disk itself */
|
||||
int index_pulse;
|
||||
int index_interrupt;
|
||||
|
||||
} wd_fdc_drive;
|
||||
|
||||
typedef struct wd_fdc {
|
||||
wd_fdc_drive *current_drive;
|
||||
|
||||
wd_type_t type; /* WD1770, WD1772, WD1773 */
|
||||
|
||||
int rates[ 4 ];
|
||||
int spin_cycles;
|
||||
fdd_dir_t direction; /* 0 = spindlewards, 1 = rimwards */
|
||||
int dden; /* SD/DD -> FM/MFM */
|
||||
int intrq; /* INTRQ line status */
|
||||
int datarq; /* DRQ line status */
|
||||
int head_load; /* WD1773/FD1793 */
|
||||
int hlt; /* WD1773/FD1793 Head Load Timing input pin */
|
||||
int hlt_time; /* "... When a logic high is found on the HLT input
|
||||
the head is assumed to be enganged. It is typically
|
||||
derived from a 1 shot triggered by HLD ..."
|
||||
if hlt_time > 0 it means trigger time in ms, if = 0
|
||||
then hlt should be set with wd_fdc_set_hlt() */
|
||||
unsigned int flags; /* Beta128 connects HLD output pin to READY input pin and
|
||||
MOTOR ON pin on FDD interface */
|
||||
|
||||
enum wd_fdc_state {
|
||||
WD_FDC_STATE_NONE = 0,
|
||||
WD_FDC_STATE_SEEK,
|
||||
WD_FDC_STATE_SEEK_DELAY,
|
||||
WD_FDC_STATE_VERIFY,
|
||||
WD_FDC_STATE_READ,
|
||||
WD_FDC_STATE_WRITE,
|
||||
WD_FDC_STATE_READTRACK,
|
||||
WD_FDC_STATE_WRITETRACK,
|
||||
WD_FDC_STATE_READID,
|
||||
} state;
|
||||
|
||||
int read_id; /* FDC try to read a DAM */
|
||||
|
||||
enum wd_fdc_status_type {
|
||||
WD_FDC_STATUS_TYPE1,
|
||||
WD_FDC_STATUS_TYPE2,
|
||||
} status_type;
|
||||
|
||||
enum wd_fdc_am_type {
|
||||
WD_FDC_AM_NONE = 0,
|
||||
WD_FDC_AM_INDEX,
|
||||
WD_FDC_AM_ID,
|
||||
WD_FDC_AM_DATA,
|
||||
} id_mark;
|
||||
|
||||
int id_track;
|
||||
int id_head;
|
||||
int id_sector;
|
||||
int id_length; /* sector length code 0, 1, 2, 3 */
|
||||
int sector_length; /* sector length from length code */
|
||||
int ddam; /* read a deleted data mark */
|
||||
int rev; /* revolution counter */
|
||||
|
||||
/* state during transfer */
|
||||
int data_check_head; /* -1 no check, 0/1 wait side 0 or 1 */
|
||||
int data_multisector;
|
||||
int data_offset;
|
||||
|
||||
libspectrum_byte command_register; /* command register */
|
||||
libspectrum_byte status_register; /* status register */
|
||||
libspectrum_byte track_register; /* track register */
|
||||
libspectrum_byte sector_register; /* sector register */
|
||||
libspectrum_byte data_register; /* data register */
|
||||
|
||||
libspectrum_word crc; /* to hold crc */
|
||||
|
||||
void ( *set_intrq ) ( struct wd_fdc *f );
|
||||
void ( *reset_intrq ) ( struct wd_fdc *f );
|
||||
void ( *set_datarq ) ( struct wd_fdc *f );
|
||||
void ( *reset_datarq ) ( struct wd_fdc *f );
|
||||
void *iface;
|
||||
|
||||
} wd_fdc;
|
||||
|
||||
int wd_fdc_init_events( void );
|
||||
|
||||
/* allocate an fdc */
|
||||
wd_fdc *wd_fdc_alloc_fdc( wd_type_t type, int hlt_time, unsigned int flags );
|
||||
void wd_fdc_master_reset( wd_fdc *f );
|
||||
|
||||
libspectrum_byte wd_fdc_sr_read( wd_fdc *f );
|
||||
void wd_fdc_cr_write( wd_fdc *f, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte wd_fdc_tr_read( wd_fdc *f );
|
||||
void wd_fdc_tr_write( wd_fdc *f, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte wd_fdc_sec_read( wd_fdc *f );
|
||||
void wd_fdc_sec_write( wd_fdc *f, libspectrum_byte b );
|
||||
|
||||
libspectrum_byte wd_fdc_dr_read( wd_fdc *f );
|
||||
void wd_fdc_dr_write( wd_fdc *f, libspectrum_byte b );
|
||||
|
||||
void wd_fdc_set_intrq( wd_fdc *f );
|
||||
void wd_fdc_reset_intrq( wd_fdc *f );
|
||||
void wd_fdc_set_datarq( wd_fdc *f );
|
||||
void wd_fdc_reset_datarq( wd_fdc *f );
|
||||
void wd_fdc_set_hlt( wd_fdc *f, int hlt );
|
||||
|
||||
#endif /* #ifndef FUSE_WD_FDC_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,98 @@
|
|||
/* display.h: Routines for printing the Spectrum's screen
|
||||
Copyright (c) 1999-2006 Philip Kendall
|
||||
|
||||
$Id: display.h 2889 2007-05-26 17:45:08Z zubzero $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_DISPLAY_H
|
||||
#define FUSE_DISPLAY_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
/* The width and height of the Speccy's screen */
|
||||
#define DISPLAY_WIDTH_COLS 32
|
||||
#define DISPLAY_HEIGHT_ROWS 24
|
||||
|
||||
/* The width and height of the Speccy's screen */
|
||||
/* Each main screen column can produce 16 pixels in hires mode */
|
||||
#define DISPLAY_WIDTH ( DISPLAY_WIDTH_COLS * 16 )
|
||||
/* Each main screen row can produce only 8 pixels in any mode */
|
||||
#define DISPLAY_HEIGHT ( DISPLAY_HEIGHT_ROWS * 8 )
|
||||
|
||||
/* The width and height of the (emulated) border */
|
||||
#define DISPLAY_BORDER_WIDTH_COLS 4
|
||||
#define DISPLAY_BORDER_HEIGHT_COLS 3
|
||||
|
||||
/* The width and height of the (emulated) border */
|
||||
/* Each main screen column can produce 16 pixels in hires mode */
|
||||
#define DISPLAY_BORDER_WIDTH ( DISPLAY_BORDER_WIDTH_COLS * 16 )
|
||||
/* Aspect corrected border width */
|
||||
#define DISPLAY_BORDER_ASPECT_WIDTH ( DISPLAY_BORDER_WIDTH_COLS * 8 )
|
||||
/* Each main screen row can produce only 8 pixels in any mode */
|
||||
#define DISPLAY_BORDER_HEIGHT ( DISPLAY_BORDER_HEIGHT_COLS * 8 )
|
||||
|
||||
/* The width and height of the window we'll be displaying */
|
||||
#define DISPLAY_SCREEN_WIDTH ( DISPLAY_WIDTH + 2 * DISPLAY_BORDER_WIDTH )
|
||||
#define DISPLAY_SCREEN_HEIGHT ( DISPLAY_HEIGHT + 2 * DISPLAY_BORDER_HEIGHT )
|
||||
|
||||
/* And the width in columns */
|
||||
#define DISPLAY_SCREEN_WIDTH_COLS ( DISPLAY_WIDTH_COLS + 2 * DISPLAY_BORDER_WIDTH_COLS )
|
||||
|
||||
/* The aspect ratio corrected display width */
|
||||
#define DISPLAY_ASPECT_WIDTH ( DISPLAY_SCREEN_WIDTH / 2 )
|
||||
|
||||
extern int display_ui_initialised;
|
||||
|
||||
extern libspectrum_byte display_lores_border;
|
||||
extern libspectrum_byte display_hires_border;
|
||||
|
||||
/* Offsets as to where the data and the attributes for each pixel
|
||||
line start */
|
||||
extern libspectrum_word display_line_start[ DISPLAY_HEIGHT ];
|
||||
extern libspectrum_word display_attr_start[ DISPLAY_HEIGHT ];
|
||||
|
||||
int display_init(int *argc, char ***argv);
|
||||
void display_line(void);
|
||||
|
||||
void display_dirty( libspectrum_word offset );
|
||||
|
||||
void display_parse_attr( libspectrum_byte attr, libspectrum_byte *ink,
|
||||
libspectrum_byte *paper );
|
||||
|
||||
void display_set_lores_border(int colour);
|
||||
void display_set_hires_border(int colour);
|
||||
int display_dirty_border(void);
|
||||
|
||||
int display_frame(void);
|
||||
void display_refresh_main_screen(void);
|
||||
void display_refresh_all(void);
|
||||
|
||||
#define display_get_addr( x, y ) \
|
||||
scld_last_dec.name.altdfile ? display_line_start[(y)]+(x)+ALTDFILE_OFFSET : \
|
||||
display_line_start[(y)]+(x)
|
||||
int display_getpixel( int x, int y );
|
||||
|
||||
void display_update_critical( int x, int y );
|
||||
|
||||
#endif /* #ifndef FUSE_DISPLAY_H */
|
|
@ -0,0 +1,445 @@
|
|||
/* divide.c: DivIDE interface routines
|
||||
Copyright (c) 2005-2008 Matthew Westcott, Philip Kendall
|
||||
|
||||
$Id: divide.c 3703 2008-06-30 20:36:11Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: Philip Kendall <philip-fuse@shadowmagic.org.uk>
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "debugger/debugger.h"
|
||||
#include "ide.h"
|
||||
#include "machine.h"
|
||||
#include "module.h"
|
||||
#include "periph.h"
|
||||
#include "settings.h"
|
||||
#include "ui/ui.h"
|
||||
#include "divide.h"
|
||||
|
||||
/* Private function prototypes */
|
||||
|
||||
static libspectrum_byte divide_ide_read( libspectrum_word port, int *attached );
|
||||
static void divide_ide_write( libspectrum_word port, libspectrum_byte data );
|
||||
static void divide_control_write( libspectrum_word port, libspectrum_byte data );
|
||||
static void divide_control_write_internal( libspectrum_byte data );
|
||||
static void divide_page( void );
|
||||
static void divide_unpage( void );
|
||||
static libspectrum_ide_register port_to_ide_register( libspectrum_byte port );
|
||||
|
||||
/* Data */
|
||||
|
||||
const periph_t divide_peripherals[] = {
|
||||
{ 0x00e3, 0x00a3, divide_ide_read, divide_ide_write },
|
||||
{ 0x00ff, 0x00e3, NULL, divide_control_write },
|
||||
};
|
||||
|
||||
const size_t divide_peripherals_count =
|
||||
sizeof( divide_peripherals ) / sizeof( periph_t );
|
||||
|
||||
static const libspectrum_byte DIVIDE_CONTROL_CONMEM = 0x80;
|
||||
static const libspectrum_byte DIVIDE_CONTROL_MAPRAM = 0x40;
|
||||
|
||||
int divide_automapping_enabled = 0;
|
||||
int divide_active = 0;
|
||||
static libspectrum_byte divide_control;
|
||||
|
||||
/* divide_automap tracks opcode fetches to entry and exit points to determine
|
||||
whether DivIDE memory *would* be paged in at this moment if mapram / wp
|
||||
flags allowed it */
|
||||
static int divide_automap = 0;
|
||||
|
||||
static libspectrum_ide_channel *divide_idechn0;
|
||||
static libspectrum_ide_channel *divide_idechn1;
|
||||
|
||||
#define DIVIDE_PAGES 4
|
||||
#define DIVIDE_PAGE_LENGTH 0x2000
|
||||
static libspectrum_byte divide_ram[ DIVIDE_PAGES ][ DIVIDE_PAGE_LENGTH ];
|
||||
static libspectrum_byte divide_eprom[ DIVIDE_PAGE_LENGTH ];
|
||||
|
||||
static void divide_reset( int hard_reset );
|
||||
static void divide_memory_map( void );
|
||||
static void divide_enabled_snapshot( libspectrum_snap *snap );
|
||||
static void divide_from_snapshot( libspectrum_snap *snap );
|
||||
static void divide_to_snapshot( libspectrum_snap *snap );
|
||||
|
||||
static module_info_t divide_module_info = {
|
||||
|
||||
divide_reset,
|
||||
divide_memory_map,
|
||||
divide_enabled_snapshot,
|
||||
divide_from_snapshot,
|
||||
divide_to_snapshot,
|
||||
|
||||
};
|
||||
|
||||
/* Debugger events */
|
||||
static const char *event_type_string = "divide";
|
||||
static int page_event, unpage_event;
|
||||
|
||||
/* Housekeeping functions */
|
||||
|
||||
int
|
||||
divide_init( void )
|
||||
{
|
||||
int error;
|
||||
|
||||
divide_idechn0 = libspectrum_ide_alloc( LIBSPECTRUM_IDE_DATA16 );
|
||||
divide_idechn1 = libspectrum_ide_alloc( LIBSPECTRUM_IDE_DATA16 );
|
||||
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_IDE_DIVIDE_MASTER_EJECT, 0 );
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_IDE_DIVIDE_SLAVE_EJECT, 0 );
|
||||
|
||||
if( settings_current.divide_master_file ) {
|
||||
error = libspectrum_ide_insert( divide_idechn0, LIBSPECTRUM_IDE_MASTER,
|
||||
settings_current.divide_master_file );
|
||||
if( error ) return error;
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_IDE_DIVIDE_MASTER_EJECT, 1 );
|
||||
}
|
||||
|
||||
if( settings_current.divide_slave_file ) {
|
||||
error = libspectrum_ide_insert( divide_idechn0, LIBSPECTRUM_IDE_SLAVE,
|
||||
settings_current.divide_slave_file );
|
||||
if( error ) return error;
|
||||
ui_menu_activate( UI_MENU_ITEM_MEDIA_IDE_DIVIDE_SLAVE_EJECT, 1 );
|
||||
}
|
||||
|
||||
module_register( ÷_module_info );
|
||||
|
||||
if( periph_register_paging_events( event_type_string, &page_event,
|
||||
&unpage_event ) )
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
divide_end( void )
|
||||
{
|
||||
int error;
|
||||
|
||||
error = libspectrum_ide_free( divide_idechn0 );
|
||||
error = libspectrum_ide_free( divide_idechn1 ) || error;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
/* DivIDE does not page in immediately on a reset condition (we do that by
|
||||
trapping PC instead); however, it needs to perform housekeeping tasks upon
|
||||
reset */
|
||||
static void
|
||||
divide_reset( int hard_reset )
|
||||
{
|
||||
divide_active = 0;
|
||||
|
||||
if( !settings_current.divide_enabled ) return;
|
||||
|
||||
if( hard_reset ) {
|
||||
divide_control = 0;
|
||||
} else {
|
||||
divide_control &= DIVIDE_CONTROL_MAPRAM;
|
||||
}
|
||||
divide_automap = 0;
|
||||
divide_refresh_page_state();
|
||||
|
||||
libspectrum_ide_reset( divide_idechn0 );
|
||||
libspectrum_ide_reset( divide_idechn1 );
|
||||
}
|
||||
|
||||
int
|
||||
divide_insert( const char *filename, libspectrum_ide_unit unit )
|
||||
{
|
||||
char **setting;
|
||||
ui_menu_item item;
|
||||
|
||||
switch( unit ) {
|
||||
case LIBSPECTRUM_IDE_MASTER:
|
||||
setting = &settings_current.divide_master_file;
|
||||
item = UI_MENU_ITEM_MEDIA_IDE_DIVIDE_MASTER_EJECT;
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_IDE_SLAVE:
|
||||
setting = &settings_current.divide_slave_file;
|
||||
item = UI_MENU_ITEM_MEDIA_IDE_DIVIDE_SLAVE_EJECT;
|
||||
break;
|
||||
|
||||
default: return 1;
|
||||
}
|
||||
|
||||
return ide_insert( filename, divide_idechn0, unit, divide_commit, setting,
|
||||
item );
|
||||
}
|
||||
|
||||
int
|
||||
divide_commit( libspectrum_ide_unit unit )
|
||||
{
|
||||
int error;
|
||||
|
||||
error = libspectrum_ide_commit( divide_idechn0, unit );
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
int
|
||||
divide_eject( libspectrum_ide_unit unit )
|
||||
{
|
||||
char **setting;
|
||||
ui_menu_item item;
|
||||
|
||||
switch( unit ) {
|
||||
case LIBSPECTRUM_IDE_MASTER:
|
||||
setting = &settings_current.divide_master_file;
|
||||
item = UI_MENU_ITEM_MEDIA_IDE_DIVIDE_MASTER_EJECT;
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_IDE_SLAVE:
|
||||
setting = &settings_current.divide_slave_file;
|
||||
item = UI_MENU_ITEM_MEDIA_IDE_DIVIDE_SLAVE_EJECT;
|
||||
break;
|
||||
|
||||
default: return 1;
|
||||
}
|
||||
|
||||
return ide_eject( divide_idechn0, unit, divide_commit, setting, item );
|
||||
}
|
||||
|
||||
/* Port read/writes */
|
||||
|
||||
static libspectrum_ide_register
|
||||
port_to_ide_register( libspectrum_byte port )
|
||||
{
|
||||
switch( port & 0xff ) {
|
||||
case 0xa3:
|
||||
return LIBSPECTRUM_IDE_REGISTER_DATA;
|
||||
case 0xa7:
|
||||
return LIBSPECTRUM_IDE_REGISTER_ERROR_FEATURE;
|
||||
case 0xab:
|
||||
return LIBSPECTRUM_IDE_REGISTER_SECTOR_COUNT;
|
||||
case 0xaf:
|
||||
return LIBSPECTRUM_IDE_REGISTER_SECTOR;
|
||||
case 0xb3:
|
||||
return LIBSPECTRUM_IDE_REGISTER_CYLINDER_LOW;
|
||||
case 0xb7:
|
||||
return LIBSPECTRUM_IDE_REGISTER_CYLINDER_HIGH;
|
||||
case 0xbb:
|
||||
return LIBSPECTRUM_IDE_REGISTER_HEAD_DRIVE;
|
||||
default: /* 0xbf */
|
||||
return LIBSPECTRUM_IDE_REGISTER_COMMAND_STATUS;
|
||||
}
|
||||
}
|
||||
|
||||
libspectrum_byte
|
||||
divide_ide_read( libspectrum_word port, int *attached )
|
||||
{
|
||||
int ide_register;
|
||||
if( !settings_current.divide_enabled ) return 0xff;
|
||||
|
||||
*attached = 1;
|
||||
ide_register = port_to_ide_register( port );
|
||||
|
||||
return libspectrum_ide_read( divide_idechn0, ide_register );
|
||||
}
|
||||
|
||||
static void
|
||||
divide_ide_write( libspectrum_word port, libspectrum_byte data )
|
||||
{
|
||||
int ide_register;
|
||||
if( !settings_current.divide_enabled ) return;
|
||||
|
||||
ide_register = port_to_ide_register( port );
|
||||
|
||||
libspectrum_ide_write( divide_idechn0, ide_register, data );
|
||||
}
|
||||
|
||||
static void
|
||||
divide_control_write( libspectrum_word port GCC_UNUSED, libspectrum_byte data )
|
||||
{
|
||||
int old_mapram;
|
||||
|
||||
if( !settings_current.divide_enabled ) return;
|
||||
|
||||
/* MAPRAM bit cannot be reset, only set */
|
||||
old_mapram = divide_control & DIVIDE_CONTROL_MAPRAM;
|
||||
divide_control_write_internal( data | old_mapram );
|
||||
}
|
||||
|
||||
static void
|
||||
divide_control_write_internal( libspectrum_byte data )
|
||||
{
|
||||
divide_control = data;
|
||||
divide_refresh_page_state();
|
||||
}
|
||||
|
||||
void
|
||||
divide_set_automap( int state )
|
||||
{
|
||||
divide_automap = state;
|
||||
divide_refresh_page_state();
|
||||
}
|
||||
|
||||
void
|
||||
divide_refresh_page_state( void )
|
||||
{
|
||||
if( divide_control & DIVIDE_CONTROL_CONMEM ) {
|
||||
/* always paged in if conmem enabled */
|
||||
divide_page();
|
||||
} else if( settings_current.divide_wp
|
||||
|| ( divide_control & DIVIDE_CONTROL_MAPRAM ) ) {
|
||||
/* automap in effect */
|
||||
if( divide_automap ) {
|
||||
divide_page();
|
||||
} else {
|
||||
divide_unpage();
|
||||
}
|
||||
} else {
|
||||
divide_unpage();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
divide_page( void )
|
||||
{
|
||||
divide_active = 1;
|
||||
machine_current->ram.romcs = 1;
|
||||
machine_current->memory_map();
|
||||
|
||||
debugger_event( page_event );
|
||||
}
|
||||
|
||||
static void
|
||||
divide_unpage( void )
|
||||
{
|
||||
divide_active = 0;
|
||||
machine_current->ram.romcs = 0;
|
||||
machine_current->memory_map();
|
||||
|
||||
debugger_event( unpage_event );
|
||||
}
|
||||
|
||||
void
|
||||
divide_memory_map( void )
|
||||
{
|
||||
int upper_ram_page;
|
||||
|
||||
if( !divide_active ) return;
|
||||
|
||||
/* low bits of divide_control register give page number to use in upper
|
||||
bank; only lowest two bits on original 32K model */
|
||||
upper_ram_page = divide_control & (DIVIDE_PAGES - 1);
|
||||
|
||||
if( divide_control & DIVIDE_CONTROL_CONMEM ) {
|
||||
memory_map_romcs[0].page = divide_eprom;
|
||||
memory_map_romcs[0].writable = !settings_current.divide_wp;
|
||||
memory_map_romcs[1].page = divide_ram[ upper_ram_page ];
|
||||
memory_map_romcs[1].writable = 1;
|
||||
} else {
|
||||
if( divide_control & DIVIDE_CONTROL_MAPRAM ) {
|
||||
memory_map_romcs[0].page = divide_ram[3];
|
||||
memory_map_romcs[0].writable = 0;
|
||||
memory_map_romcs[1].page = divide_ram[ upper_ram_page ];
|
||||
memory_map_romcs[1].writable = ( upper_ram_page != 3 );
|
||||
} else {
|
||||
memory_map_romcs[0].page = divide_eprom;
|
||||
memory_map_romcs[0].writable = 0;
|
||||
memory_map_romcs[1].page = divide_ram[ upper_ram_page ];
|
||||
memory_map_romcs[1].writable = 1;
|
||||
}
|
||||
}
|
||||
|
||||
memory_map_read[0] = memory_map_write[0] = memory_map_romcs[0];
|
||||
memory_map_read[1] = memory_map_write[1] = memory_map_romcs[1];
|
||||
}
|
||||
|
||||
static void
|
||||
divide_enabled_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
if( libspectrum_snap_divide_active( snap ) )
|
||||
settings_current.divide_enabled = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
divide_from_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
size_t i;
|
||||
|
||||
if( !libspectrum_snap_divide_active( snap ) ) return;
|
||||
|
||||
settings_current.divide_wp =
|
||||
libspectrum_snap_divide_eprom_writeprotect( snap );
|
||||
divide_control_write_internal( libspectrum_snap_divide_control( snap ) );
|
||||
|
||||
if( libspectrum_snap_divide_eprom( snap, 0 ) ) {
|
||||
memcpy( divide_eprom,
|
||||
libspectrum_snap_divide_eprom( snap, 0 ), DIVIDE_PAGE_LENGTH );
|
||||
}
|
||||
|
||||
for( i = 0; i < libspectrum_snap_divide_pages( snap ); i++ )
|
||||
if( libspectrum_snap_divide_ram( snap, i ) )
|
||||
memcpy( divide_ram[ i ], libspectrum_snap_divide_ram( snap, i ),
|
||||
DIVIDE_PAGE_LENGTH );
|
||||
|
||||
if( libspectrum_snap_divide_paged( snap ) ) {
|
||||
divide_page();
|
||||
} else {
|
||||
divide_unpage();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
divide_to_snapshot( libspectrum_snap *snap )
|
||||
{
|
||||
size_t i;
|
||||
libspectrum_byte *buffer;
|
||||
|
||||
if( !settings_current.divide_enabled ) return;
|
||||
|
||||
libspectrum_snap_set_divide_active( snap, 1 );
|
||||
libspectrum_snap_set_divide_eprom_writeprotect( snap,
|
||||
settings_current.divide_wp );
|
||||
libspectrum_snap_set_divide_paged( snap, divide_active );
|
||||
libspectrum_snap_set_divide_control( snap, divide_control );
|
||||
|
||||
buffer = malloc( DIVIDE_PAGE_LENGTH * sizeof( libspectrum_byte ) );
|
||||
if( !buffer ) {
|
||||
ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy( buffer, divide_eprom, DIVIDE_PAGE_LENGTH );
|
||||
libspectrum_snap_set_divide_eprom( snap, 0, buffer );
|
||||
|
||||
libspectrum_snap_set_divide_pages( snap, DIVIDE_PAGES );
|
||||
|
||||
for( i = 0; i < DIVIDE_PAGES; i++ ) {
|
||||
|
||||
buffer = malloc( DIVIDE_PAGE_LENGTH * sizeof( libspectrum_byte ) );
|
||||
if( !buffer ) {
|
||||
ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy( buffer, divide_ram[ i ], DIVIDE_PAGE_LENGTH );
|
||||
libspectrum_snap_set_divide_ram( snap, i, buffer );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/* divide.h: DivIDE interface routines
|
||||
Copyright (c) 2005 Matthew Westcott
|
||||
|
||||
$Id: divide.h 2993 2007-06-17 13:54:49Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: Philip Kendall <philip-fuse@shadowmagic.org.uk>
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_DIVIDE_H
|
||||
#define FUSE_DIVIDE_H
|
||||
|
||||
#include <libspectrum.h>
|
||||
#include "periph.h"
|
||||
|
||||
extern const periph_t divide_peripherals[];
|
||||
extern const size_t divide_peripherals_count;
|
||||
|
||||
/* Whether DivIDE is currently paged in */
|
||||
extern int divide_active;
|
||||
|
||||
/* Notify DivIDE hardware of an opcode fetch to one of the designated
|
||||
entry / exit points. Depending on configuration, it may or may not
|
||||
result in the DivIDE memory being paged in */
|
||||
void divide_set_automap( int state );
|
||||
|
||||
/* Call this after some state change other than an opcode fetch which could
|
||||
trigger DivIDE paging (such as updating the write-protect flag), to
|
||||
re-evaluate whether paging will actually happen */
|
||||
void divide_refresh_page_state( void );
|
||||
|
||||
int divide_init( void );
|
||||
int divide_end( void );
|
||||
int divide_insert( const char *filename, libspectrum_ide_unit unit );
|
||||
int divide_commit( libspectrum_ide_unit unit );
|
||||
int divide_eject( libspectrum_ide_unit unit );
|
||||
|
||||
#endif /* #ifndef FUSE_DIVIDE_H */
|
|
@ -0,0 +1,286 @@
|
|||
/* event.c: Routines needed for dealing with the event list
|
||||
Copyright (c) 2000-2008 Philip Kendall
|
||||
|
||||
$Id: event.c 3942 2009-01-10 14:18:46Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "event.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
/* A large value to mean `no events due' */
|
||||
static const libspectrum_dword event_no_events = 0xffffffff;
|
||||
|
||||
/* When will the next event happen? */
|
||||
libspectrum_dword event_next_event;
|
||||
|
||||
/* The actual list of events */
|
||||
static GSList *event_list = NULL;
|
||||
|
||||
/* An event ready to be reused */
|
||||
static event_t *event_free = NULL;
|
||||
|
||||
/* A null event */
|
||||
int event_type_null;
|
||||
|
||||
typedef struct event_descriptor_t {
|
||||
event_fn_t fn;
|
||||
char *description;
|
||||
} event_descriptor_t;
|
||||
|
||||
typedef struct event_typeuser_t {
|
||||
int type;
|
||||
gpointer data;
|
||||
} event_typeuser_t;
|
||||
|
||||
static GArray *registered_events;
|
||||
|
||||
int
|
||||
event_init( void )
|
||||
{
|
||||
registered_events = g_array_new( FALSE, FALSE, sizeof( event_descriptor_t ) );
|
||||
if( !registered_events ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d\n", __FILE__, __LINE__ );
|
||||
return 1;
|
||||
}
|
||||
|
||||
event_type_null = event_register( NULL, "[Deleted event]" );
|
||||
if( event_type_null == -1 ) return 1;
|
||||
|
||||
event_next_event = event_no_events;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
event_register( event_fn_t fn, const char *description )
|
||||
{
|
||||
event_descriptor_t descriptor;
|
||||
|
||||
descriptor.fn = fn;
|
||||
descriptor.description = strdup( description );
|
||||
if( !descriptor.description ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d\n", __FILE__, __LINE__ );
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_array_append_val( registered_events, descriptor );
|
||||
|
||||
return registered_events->len - 1;
|
||||
}
|
||||
|
||||
static gint
|
||||
event_add_cmp( gconstpointer a1, gconstpointer b1 )
|
||||
{
|
||||
const event_t *a = a1, *b = b1;
|
||||
|
||||
return a->tstates != b->tstates ? a->tstates - b->tstates
|
||||
: a->type - b->type;
|
||||
}
|
||||
|
||||
/* Add an event at the correct place in the event list */
|
||||
int
|
||||
event_add_with_data( libspectrum_dword event_time, int type, void *user_data )
|
||||
{
|
||||
event_t *ptr;
|
||||
|
||||
if( event_free ) {
|
||||
ptr = event_free;
|
||||
event_free = NULL;
|
||||
} else {
|
||||
ptr = malloc( sizeof( *ptr ) );
|
||||
if( !ptr ) return 1;
|
||||
}
|
||||
|
||||
ptr->tstates = event_time;
|
||||
ptr->type =type;
|
||||
ptr->user_data = user_data;
|
||||
|
||||
if( event_time < event_next_event ) {
|
||||
event_next_event = event_time;
|
||||
event_list = g_slist_prepend( event_list, ptr );
|
||||
} else {
|
||||
event_list = g_slist_insert_sorted( event_list, ptr, event_add_cmp );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Do all events which have passed */
|
||||
int
|
||||
event_do_events( void )
|
||||
{
|
||||
event_t *ptr;
|
||||
|
||||
while(event_next_event <= tstates) {
|
||||
ptr = event_list->data;
|
||||
event_descriptor_t descriptor =
|
||||
g_array_index( registered_events, event_descriptor_t, ptr->type );
|
||||
|
||||
/* Remove the event from the list *before* processing */
|
||||
event_list = g_slist_remove( event_list, ptr );
|
||||
|
||||
if( event_list == NULL ) {
|
||||
event_next_event = event_no_events;
|
||||
} else {
|
||||
event_next_event = ((event_t*)(event_list->data))->tstates;
|
||||
}
|
||||
|
||||
if( descriptor.fn ) descriptor.fn( ptr->tstates, ptr->type, ptr->user_data );
|
||||
|
||||
if( event_free ) {
|
||||
free( ptr );
|
||||
} else {
|
||||
event_free = ptr;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
event_reduce_tstates( gpointer data, gpointer user_data )
|
||||
{
|
||||
event_t *ptr = data;
|
||||
libspectrum_dword *tstates_per_frame = user_data;
|
||||
|
||||
ptr->tstates -= *tstates_per_frame;
|
||||
}
|
||||
|
||||
/* Called at end of frame to reduce T-state count of all entries */
|
||||
int
|
||||
event_frame( libspectrum_dword tstates_per_frame )
|
||||
{
|
||||
g_slist_foreach( event_list, event_reduce_tstates, &tstates_per_frame );
|
||||
|
||||
event_next_event = event_list ?
|
||||
((event_t*)(event_list->data))->tstates : event_no_events;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Do all events that would happen between the current time and when
|
||||
the next interrupt will occur; called only when RZX playback is in
|
||||
effect */
|
||||
int
|
||||
event_force_events( void )
|
||||
{
|
||||
while( event_next_event < machine_current->timings.tstates_per_frame ) {
|
||||
|
||||
/* Jump along to the next event */
|
||||
tstates = event_next_event;
|
||||
|
||||
/* And do that event */
|
||||
event_do_events();
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
set_event_null( gpointer data, gpointer user_data )
|
||||
{
|
||||
event_t *ptr = data;
|
||||
int *type = user_data;
|
||||
|
||||
if( ptr->type == *type ) ptr->type = event_type_null;
|
||||
}
|
||||
|
||||
static void
|
||||
set_event_null_2( gpointer data, gpointer user_data )
|
||||
{
|
||||
event_t *ptr = data;
|
||||
event_typeuser_t *e = user_data;
|
||||
|
||||
if( ptr->type == e->type && ptr->user_data == e->data )
|
||||
ptr->type = event_type_null;
|
||||
}
|
||||
|
||||
/* Remove all events of a specific type from the stack */
|
||||
int
|
||||
event_remove_type( int type )
|
||||
{
|
||||
g_slist_foreach( event_list, set_event_null, &type );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Remove all events of a specific type and user data from the stack */
|
||||
int
|
||||
event_remove_type_user_data( int type, gpointer user_data )
|
||||
{
|
||||
event_typeuser_t e;
|
||||
|
||||
e.type = type;
|
||||
e.data = user_data;
|
||||
g_slist_foreach( event_list, set_event_null_2, &e );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Free the memory used by a specific entry */
|
||||
static void
|
||||
event_free_entry( gpointer data, gpointer user_data GCC_UNUSED )
|
||||
{
|
||||
free( data );
|
||||
}
|
||||
|
||||
/* Clear the event stack */
|
||||
int
|
||||
event_reset( void )
|
||||
{
|
||||
g_slist_foreach( event_list, event_free_entry, NULL );
|
||||
g_slist_free( event_list );
|
||||
event_list = NULL;
|
||||
|
||||
event_next_event = event_no_events;
|
||||
|
||||
free( event_free );
|
||||
event_free = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Call a user-supplied function for every event in the current list */
|
||||
int
|
||||
event_foreach( GFunc function, gpointer user_data )
|
||||
{
|
||||
g_slist_foreach( event_list, function, user_data );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* A textual representation of each event type */
|
||||
const char*
|
||||
event_name( int type )
|
||||
{
|
||||
return g_array_index( registered_events, event_descriptor_t, type ).description;
|
||||
}
|
||||
|
||||
/* Tidy-up function called at end of emulation */
|
||||
int
|
||||
event_end( void )
|
||||
{
|
||||
return event_reset();
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
/* event.h: Routines needed for dealing with the event list
|
||||
Copyright (c) 2000-2004 Philip Kendall
|
||||
|
||||
$Id: event.h 3942 2009-01-10 14:18:46Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_EVENT_H
|
||||
#define FUSE_EVENT_H
|
||||
|
||||
#ifdef HAVE_LIB_GLIB
|
||||
#include <glib.h>
|
||||
#endif /* #ifdef HAVE_LIB_GLIB */
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
/* Information about an event */
|
||||
typedef struct event_t {
|
||||
libspectrum_dword tstates;
|
||||
int type;
|
||||
void *user_data;
|
||||
} event_t;
|
||||
|
||||
/* A null event type */
|
||||
extern int event_type_null;
|
||||
|
||||
/* The function to be called when an event occurs */
|
||||
typedef void (*event_fn_t)( libspectrum_dword tstates, int type, void *user_data );
|
||||
|
||||
/* When will the next event happen? */
|
||||
extern libspectrum_dword event_next_event;
|
||||
|
||||
/* Set up the event list */
|
||||
int event_init(void);
|
||||
|
||||
/* Register a new event type */
|
||||
int event_register( event_fn_t fn, const char *description );
|
||||
|
||||
/* Add an event at the correct place in the event list */
|
||||
int event_add_with_data( libspectrum_dword event_time, int type,
|
||||
void *user_data );
|
||||
|
||||
static inline int
|
||||
event_add( libspectrum_dword event_time, int type )
|
||||
{
|
||||
return event_add_with_data( event_time, type, NULL );
|
||||
}
|
||||
|
||||
/* Do all events which have passed */
|
||||
int event_do_events(void);
|
||||
|
||||
/* Called at end of frame to reduce T-state count of all entries */
|
||||
int event_frame( libspectrum_dword tstates_per_frame );
|
||||
|
||||
/* Force all events between now and the next interrupt to happen */
|
||||
int event_force_events( void );
|
||||
|
||||
/* Remove all events of a specific type from the stack */
|
||||
int event_remove_type( int type );
|
||||
|
||||
/* Remove all events of a specific type and user data from the stack */
|
||||
int event_remove_type_user_data( int type, gpointer user_data );
|
||||
|
||||
/* Clear the event stack */
|
||||
int event_reset(void);
|
||||
|
||||
/* Call a user-supplied function for every event in the current list */
|
||||
int event_foreach( GFunc function, gpointer user_data );
|
||||
|
||||
/* A textual representation of each event type */
|
||||
const char *event_name( int type );
|
||||
|
||||
/* Called on exit to clean up */
|
||||
int event_end(void);
|
||||
|
||||
#endif /* #ifndef FUSE_EVENT_H */
|
|
@ -0,0 +1,823 @@
|
|||
/* fuse.c: The Free Unix Spectrum Emulator
|
||||
Copyright (c) 1999-2009 Philip Kendall
|
||||
|
||||
$Id: fuse.c 3942 2009-01-10 14:18:46Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif /* #ifdef WIN32 */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef UI_SDL
|
||||
#include <SDL.h> /* Needed on MacOS X and Windows */
|
||||
#endif /* #ifdef UI_SDL */
|
||||
|
||||
#include "ay.h"
|
||||
#include "dck.h"
|
||||
#include "debugger/debugger.h"
|
||||
#include "disk/beta.h"
|
||||
#include "disk/fdd.h"
|
||||
#include "display.h"
|
||||
#include "divide.h"
|
||||
#include "event.h"
|
||||
#include "fuse.h"
|
||||
#include "if1.h"
|
||||
#include "if2.h"
|
||||
#include "joystick.h"
|
||||
#include "keyboard.h"
|
||||
#include "kempmouse.h"
|
||||
#include "machine.h"
|
||||
#include "memory.h"
|
||||
#include "pokefinder/pokefinder.h"
|
||||
#include "printer.h"
|
||||
#include "profile.h"
|
||||
#include "psg.h"
|
||||
#include "rzx.h"
|
||||
#include "scld.h"
|
||||
#include "settings.h"
|
||||
#include "simpleide.h"
|
||||
#include "slt.h"
|
||||
#include "snapshot.h"
|
||||
#include "sound.h"
|
||||
#include "spectrum.h"
|
||||
#include "tape.h"
|
||||
#include "timer/timer.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/scaler/scaler.h"
|
||||
#include "ula.h"
|
||||
#include "unittests/unittests.h"
|
||||
#include "utils.h"
|
||||
#include "zxatasp.h"
|
||||
#include "zxcf.h"
|
||||
|
||||
#ifdef USE_WIDGET
|
||||
#include "ui/widget/widget.h"
|
||||
#endif /* #ifdef USE_WIDGET */
|
||||
|
||||
#include "z80/z80.h"
|
||||
|
||||
/* What name were we called under? */
|
||||
char *fuse_progname;
|
||||
|
||||
/* Which directory were we started in? */
|
||||
char fuse_directory[ PATH_MAX ];
|
||||
|
||||
/* A flag to say when we want to exit the emulator */
|
||||
int fuse_exiting;
|
||||
|
||||
/* Is Spectrum emulation currently paused, and if so, how many times? */
|
||||
int fuse_emulation_paused;
|
||||
|
||||
/* The creator information we'll store in file formats that support this */
|
||||
libspectrum_creator *fuse_creator;
|
||||
|
||||
/* The earliest version of libspectrum we need */
|
||||
static const char *LIBSPECTRUM_MIN_VERSION = "0.5.0";
|
||||
|
||||
/* The various types of file we may want to run on startup */
|
||||
typedef struct start_files_t {
|
||||
|
||||
const char *disk_plus3;
|
||||
const char *disk_plusd;
|
||||
const char *disk_beta;
|
||||
const char *dock;
|
||||
const char *if2;
|
||||
const char *playback;
|
||||
const char *recording;
|
||||
const char *snapshot;
|
||||
const char *tape;
|
||||
|
||||
const char *simpleide_master, *simpleide_slave;
|
||||
const char *zxatasp_master, *zxatasp_slave;
|
||||
const char *zxcf;
|
||||
const char *divide_master, *divide_slave;
|
||||
const char *mdr[8];
|
||||
|
||||
} start_files_t;
|
||||
|
||||
#ifdef ANDROID
|
||||
#else
|
||||
static int fuse_init(int argc, char **argv);
|
||||
#endif
|
||||
|
||||
static int creator_init( void );
|
||||
static void fuse_show_copyright(void);
|
||||
static void fuse_show_version( void );
|
||||
static void fuse_show_help( void );
|
||||
|
||||
static int setup_start_files( start_files_t *start_files );
|
||||
static int parse_nonoption_args( int argc, char **argv, int first_arg,
|
||||
start_files_t *start_files );
|
||||
static int do_start_files( start_files_t *start_files );
|
||||
|
||||
#ifdef ANDROID
|
||||
#else
|
||||
static int fuse_end(void);
|
||||
#endif
|
||||
|
||||
#ifdef UI_WIN32
|
||||
int fuse_main(int argc, char **argv)
|
||||
#else
|
||||
int main(int argc, char **argv)
|
||||
#endif
|
||||
{
|
||||
int r;
|
||||
|
||||
#ifdef WIN32
|
||||
SetErrorMode( SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX );
|
||||
#endif
|
||||
|
||||
if(fuse_init(argc,argv)) {
|
||||
fprintf(stderr,"%s: error initialising -- giving up!\n", fuse_progname);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( settings_current.show_help ||
|
||||
settings_current.show_version ) return 0;
|
||||
|
||||
if( settings_current.unittests ) {
|
||||
r = unittests_run();
|
||||
} else {
|
||||
while( !fuse_exiting ) {
|
||||
z80_do_opcodes();
|
||||
event_do_events();
|
||||
}
|
||||
r = 0;
|
||||
}
|
||||
|
||||
fuse_end();
|
||||
|
||||
return r;
|
||||
|
||||
}
|
||||
|
||||
#include "mempool.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
int fuse_init(int argc, char **argv)
|
||||
#else
|
||||
static int fuse_init(int argc, char **argv)
|
||||
#endif
|
||||
{
|
||||
int error, first_arg;
|
||||
char *start_scaler;
|
||||
start_files_t start_files;
|
||||
|
||||
/* Seed the bad but widely-available random number
|
||||
generator with the current time */
|
||||
srand( (unsigned)time( NULL ) );
|
||||
|
||||
fuse_progname=argv[0];
|
||||
libspectrum_error_function = ui_libspectrum_error;
|
||||
|
||||
if( !getcwd( fuse_directory, PATH_MAX - 1 ) ) {
|
||||
ui_error( UI_ERROR_ERROR, "error getting current working directory: %s",
|
||||
strerror( errno ) );
|
||||
return 1;
|
||||
}
|
||||
strcat( fuse_directory, FUSE_DIR_SEP_STR );
|
||||
|
||||
if( settings_init( &first_arg, argc, argv ) ) return 1;
|
||||
|
||||
if( settings_current.show_version ) {
|
||||
fuse_show_version();
|
||||
return 0;
|
||||
} else if( settings_current.show_help ) {
|
||||
fuse_show_help();
|
||||
return 0;
|
||||
}
|
||||
|
||||
start_scaler = strdup( settings_current.start_scaler_mode );
|
||||
if( !start_scaler ) {
|
||||
ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Windows will create a console for our output if there isn't one already,
|
||||
* so we don't display the copyright message on Win32. */
|
||||
#ifndef WIN32
|
||||
fuse_show_copyright();
|
||||
#endif
|
||||
|
||||
/* FIXME: order of these initialisation calls. Work out what depends on
|
||||
what */
|
||||
/* FIXME FIXME 20030407: really do this soon. This is getting *far* too
|
||||
hairy */
|
||||
fuse_joystick_init ();
|
||||
fuse_keyboard_init();
|
||||
|
||||
#ifdef USE_WIDGET
|
||||
if( widget_init() ) return 1;
|
||||
#endif /* #ifdef USE_WIDGET */
|
||||
|
||||
if( event_init() ) return 1;
|
||||
|
||||
if( display_init(&argc,&argv) ) return 1;
|
||||
|
||||
if( libspectrum_check_version( LIBSPECTRUM_MIN_VERSION ) ) {
|
||||
if( libspectrum_init() ) return 1;
|
||||
} else {
|
||||
ui_error( UI_ERROR_ERROR,
|
||||
"libspectrum version %s found, but %s required",
|
||||
libspectrum_version(), LIBSPECTRUM_MIN_VERSION );
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Must be called after libspectrum_init() so we can get the gcrypt
|
||||
version */
|
||||
if( creator_init() ) return 1;
|
||||
|
||||
#ifdef HAVE_GETEUID
|
||||
/* Drop root privs if we have them */
|
||||
if( !geteuid() ) { setuid( getuid() ); }
|
||||
#endif /* #ifdef HAVE_GETEUID */
|
||||
|
||||
if( mempool_init() ) return 1;
|
||||
if( memory_init() ) return 1;
|
||||
|
||||
if( debugger_init() ) return 1;
|
||||
|
||||
if( spectrum_init() ) return 1;
|
||||
if( printer_init() ) return 1;
|
||||
if( rzx_init() ) return 1;
|
||||
if( psg_init() ) return 1;
|
||||
if( beta_init() ) return 1;
|
||||
if( plusd_init() ) return 1;
|
||||
if( fdd_init_events() ) return 1;
|
||||
if( simpleide_init() ) return 1;
|
||||
if( zxatasp_init() ) return 1;
|
||||
if( zxcf_init() ) return 1;
|
||||
if( if1_init() ) return 1;
|
||||
if( if2_init() ) return 1;
|
||||
if( divide_init() ) return 1;
|
||||
if( scld_init() ) return 1;
|
||||
if( ula_init() ) return 1;
|
||||
if( ay_init() ) return 1;
|
||||
if( slt_init() ) return 1;
|
||||
if( profile_init() ) return 1;
|
||||
if( kempmouse_init() ) return 1;
|
||||
|
||||
error = pokefinder_clear(); if( error ) return error;
|
||||
|
||||
if( z80_init() ) return 1;
|
||||
|
||||
if( timer_init() ) return 1;
|
||||
|
||||
error = timer_estimate_reset(); if( error ) return error;
|
||||
|
||||
error = machine_init_machines();
|
||||
if( error ) return error;
|
||||
|
||||
error = machine_select_id( settings_current.start_machine );
|
||||
if( error ) return error;
|
||||
|
||||
error = tape_init(); if( error ) return error;
|
||||
|
||||
error = scaler_select_id( start_scaler ); free( start_scaler );
|
||||
if( error ) return error;
|
||||
|
||||
if( setup_start_files( &start_files ) ) return 1;
|
||||
if( parse_nonoption_args( argc, argv, first_arg, &start_files ) ) return 1;
|
||||
if( do_start_files( &start_files ) ) return 1;
|
||||
|
||||
/* Must do this after all subsytems are initialised */
|
||||
debugger_command_evaluate( settings_current.debugger_command );
|
||||
|
||||
if( ui_mouse_present ) ui_mouse_grabbed = ui_mouse_grab( 1 );
|
||||
|
||||
fuse_emulation_paused = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int creator_init( void )
|
||||
{
|
||||
size_t i;
|
||||
unsigned int version[4] = { 0, 0, 0, 0 };
|
||||
char *custom, osname[ 256 ];
|
||||
static const size_t CUSTOM_SIZE = 256;
|
||||
|
||||
libspectrum_error error; int sys_error;
|
||||
|
||||
const char *gcrypt_version;
|
||||
|
||||
sscanf( VERSION, "%u.%u.%u.%u",
|
||||
&version[0], &version[1], &version[2], &version[3] );
|
||||
|
||||
for( i=0; i<4; i++ ) if( version[i] > 0xff ) version[i] = 0xff;
|
||||
|
||||
sys_error = compat_osname( osname, sizeof( osname ) );
|
||||
if( sys_error ) return 1;
|
||||
|
||||
fuse_creator = libspectrum_creator_alloc();
|
||||
|
||||
error = libspectrum_creator_set_program( fuse_creator, "Fuse" );
|
||||
if( error ) { libspectrum_creator_free( fuse_creator ); return error; }
|
||||
|
||||
error = libspectrum_creator_set_major( fuse_creator,
|
||||
version[0] * 0x100 + version[1] );
|
||||
if( error ) { libspectrum_creator_free( fuse_creator ); return error; }
|
||||
|
||||
error = libspectrum_creator_set_minor( fuse_creator,
|
||||
version[2] * 0x100 + version[3] );
|
||||
if( error ) { libspectrum_creator_free( fuse_creator ); return error; }
|
||||
|
||||
custom = malloc( CUSTOM_SIZE );
|
||||
if( !custom ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
libspectrum_creator_free( fuse_creator );
|
||||
return 1;
|
||||
}
|
||||
|
||||
gcrypt_version = libspectrum_gcrypt_version();
|
||||
if( !gcrypt_version ) gcrypt_version = "not available";
|
||||
|
||||
snprintf( custom, CUSTOM_SIZE,
|
||||
"gcrypt: %s\nlibspectrum: %s\nuname: %s", gcrypt_version,
|
||||
libspectrum_version(), osname );
|
||||
|
||||
error = libspectrum_creator_set_custom(
|
||||
fuse_creator, (libspectrum_byte*)custom, strlen( custom )
|
||||
);
|
||||
if( error ) {
|
||||
free( custom ); libspectrum_creator_free( fuse_creator );
|
||||
return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void fuse_show_copyright(void)
|
||||
{
|
||||
printf( "\n" );
|
||||
fuse_show_version();
|
||||
printf(
|
||||
"Copyright (c) 1999-2009 Philip Kendall and others; see the file\n"
|
||||
"'AUTHORS' for more details.\n"
|
||||
"\n"
|
||||
"For help, please mail <fuse-emulator-devel@lists.sf.net> or use\n"
|
||||
"the forums at <http://sourceforge.net/forum/?group_id=91293>.\n"
|
||||
"\n"
|
||||
"This program is distributed in the hope that it will be useful,\n"
|
||||
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
|
||||
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
|
||||
"GNU General Public License for more details.\n\n");
|
||||
}
|
||||
|
||||
static void fuse_show_version( void )
|
||||
{
|
||||
printf( "The Free Unix Spectrum Emulator (Fuse) version " VERSION ".\n" );
|
||||
}
|
||||
|
||||
static void fuse_show_help( void )
|
||||
{
|
||||
printf( "\n" );
|
||||
fuse_show_version();
|
||||
printf(
|
||||
"\nAvailable command-line options:\n\n"
|
||||
"Boolean options (use `--no-<option>' to turn off):\n\n"
|
||||
"--auto-load Automatically load tape files when opened.\n"
|
||||
"--beeper-stereo Add fake stereo to beeper emulation.\n"
|
||||
"--compress-rzx Write RZX files out compressed.\n"
|
||||
"--double-screen Write screenshots out as double size.\n"
|
||||
"--issue2 Emulate an Issue 2 Spectrum.\n"
|
||||
"--kempston Emulate the Kempston joystick on QAOP<space>.\n"
|
||||
"--loading-sound Emulate the sound of tapes loading.\n"
|
||||
"--separation Use ACB stereo for the AY-3-8912 sound chip.\n"
|
||||
"--sound Produce sound.\n"
|
||||
"--sound-force-8bit Generate 8-bit sound even if 16-bit is available.\n"
|
||||
"--slt Turn SLT traps on.\n"
|
||||
"--traps Turn tape traps on.\n\n"
|
||||
"Other options:\n\n"
|
||||
"--help This information.\n"
|
||||
"--machine <type> Which machine should be emulated?\n"
|
||||
"--playback <filename> Play back RZX file <filename>.\n"
|
||||
"--record <filename> Record to RZX file <filename>.\n"
|
||||
"--snapshot <filename> Load snapshot <filename>.\n"
|
||||
"--speed <percentage> How fast should emulation run?\n"
|
||||
"--svga-mode <mode> Which mode should be used for SVGAlib?\n"
|
||||
"--tape <filename> Open tape file <filename>.\n"
|
||||
"--version Print version number and exit.\n\n" );
|
||||
}
|
||||
|
||||
/* Stop all activities associated with actual Spectrum emulation */
|
||||
int fuse_emulation_pause(void)
|
||||
{
|
||||
int error;
|
||||
|
||||
/* If we were already paused, just return. In any case, increment
|
||||
the pause count */
|
||||
if( fuse_emulation_paused++ ) return 0;
|
||||
|
||||
/* Stop recording any competition mode RZX file */
|
||||
if( rzx_recording && rzx_competition_mode ) {
|
||||
ui_error( UI_ERROR_INFO, "Stopping competition mode RZX recording" );
|
||||
error = rzx_stop_recording(); if( error ) return error;
|
||||
}
|
||||
|
||||
/* If we had sound enabled (and hence doing the speed regulation),
|
||||
turn it off */
|
||||
sound_pause();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Restart emulation activities */
|
||||
int fuse_emulation_unpause(void)
|
||||
{
|
||||
int error;
|
||||
|
||||
/* If this doesn't start us running again, just return. In any case,
|
||||
decrement the pause count */
|
||||
if( --fuse_emulation_paused ) return 0;
|
||||
|
||||
/* If we now want sound, enable it */
|
||||
sound_unpause();
|
||||
|
||||
/* Restart speed estimation with no information */
|
||||
error = timer_estimate_reset(); if( error ) return error;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
setup_start_files( start_files_t *start_files )
|
||||
{
|
||||
start_files->disk_plus3 = settings_current.plus3disk_file;
|
||||
start_files->disk_plusd = settings_current.plusddisk_file;
|
||||
start_files->disk_beta = settings_current.betadisk_file;
|
||||
start_files->dock = settings_current.dck_file;
|
||||
start_files->if2 = settings_current.if2_file;
|
||||
start_files->playback = settings_current.playback_file;
|
||||
start_files->recording = settings_current.record_file;
|
||||
start_files->snapshot = settings_current.snapshot;
|
||||
start_files->tape = settings_current.tape_file;
|
||||
|
||||
start_files->simpleide_master = settings_current.simpleide_master_file;
|
||||
start_files->simpleide_slave = settings_current.simpleide_slave_file;
|
||||
|
||||
start_files->zxatasp_master = settings_current.zxatasp_master_file;
|
||||
start_files->zxatasp_slave = settings_current.zxatasp_slave_file;
|
||||
|
||||
start_files->zxcf = settings_current.zxcf_pri_file;
|
||||
|
||||
start_files->divide_master = settings_current.divide_master_file;
|
||||
start_files->divide_slave = settings_current.divide_slave_file;
|
||||
|
||||
start_files->mdr[0] = settings_current.mdr_file;
|
||||
start_files->mdr[1] = settings_current.mdr_file2;
|
||||
start_files->mdr[2] = settings_current.mdr_file3;
|
||||
start_files->mdr[3] = settings_current.mdr_file4;
|
||||
start_files->mdr[4] = settings_current.mdr_file5;
|
||||
start_files->mdr[5] = settings_current.mdr_file6;
|
||||
start_files->mdr[6] = settings_current.mdr_file7;
|
||||
start_files->mdr[7] = settings_current.mdr_file8;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Make 'best guesses' as to what to do with non-option arguments */
|
||||
static int
|
||||
parse_nonoption_args( int argc, char **argv, int first_arg,
|
||||
start_files_t *start_files )
|
||||
{
|
||||
size_t i, j;
|
||||
const char *filename;
|
||||
utils_file file;
|
||||
libspectrum_id_t type;
|
||||
libspectrum_class_t class;
|
||||
int error;
|
||||
|
||||
for( i = first_arg; i < (size_t)argc; i++ ) {
|
||||
|
||||
filename = argv[i];
|
||||
|
||||
error = utils_read_file( filename, &file );
|
||||
if( error ) return error;
|
||||
|
||||
error = libspectrum_identify_file_with_class( &type, &class, filename,
|
||||
file.buffer, file.length );
|
||||
if( error ) return error;
|
||||
|
||||
switch( class ) {
|
||||
|
||||
case LIBSPECTRUM_CLASS_CARTRIDGE_TIMEX:
|
||||
start_files->dock = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_CARTRIDGE_IF2:
|
||||
start_files->if2 = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_HARDDISK:
|
||||
if( settings_current.zxcf_active ) {
|
||||
start_files->zxcf = filename;
|
||||
} else if( settings_current.zxatasp_active ) {
|
||||
start_files->zxatasp_master = filename;
|
||||
} else if( settings_current.simpleide_active ) {
|
||||
start_files->simpleide_master = filename;
|
||||
} else if( settings_current.divide_enabled ) {
|
||||
start_files->divide_master = filename;
|
||||
} else {
|
||||
/* No IDE interface active, so activate the ZXCF */
|
||||
settings_current.zxcf_active = 1;
|
||||
start_files->zxcf = filename;
|
||||
}
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_DISK_PLUS3:
|
||||
start_files->disk_plus3 = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_DISK_PLUSD:
|
||||
start_files->disk_plusd = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_DISK_TRDOS:
|
||||
start_files->disk_beta = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_DISK_GENERIC:
|
||||
if( machine_current->machine == LIBSPECTRUM_MACHINE_PLUS3 ||
|
||||
machine_current->machine == LIBSPECTRUM_MACHINE_PLUS2A )
|
||||
start_files->disk_plus3 = filename;
|
||||
else if( machine_current->machine == LIBSPECTRUM_MACHINE_PENT ||
|
||||
machine_current->machine == LIBSPECTRUM_MACHINE_PENT512 ||
|
||||
machine_current->machine == LIBSPECTRUM_MACHINE_PENT1024 ||
|
||||
machine_current->machine == LIBSPECTRUM_MACHINE_SCORP )
|
||||
start_files->disk_beta = filename;
|
||||
else {
|
||||
if( periph_beta128_active )
|
||||
start_files->disk_beta = filename;
|
||||
else if( periph_plusd_active )
|
||||
start_files->disk_plusd = filename;
|
||||
}
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_RECORDING:
|
||||
start_files->playback = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_SNAPSHOT:
|
||||
start_files->snapshot = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_MICRODRIVE:
|
||||
for( j = 0; j < 8; j++ ) {
|
||||
if( !start_files->mdr[j] ) {
|
||||
start_files->mdr[j] = filename;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_TAPE:
|
||||
start_files->tape = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_UNKNOWN:
|
||||
ui_error( UI_ERROR_WARNING, "couldn't identify '%s'; ignoring it",
|
||||
filename );
|
||||
break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "parse_nonoption_args: unknown file class %d",
|
||||
class );
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
do_start_files( start_files_t *start_files )
|
||||
{
|
||||
int autoload, error, i;
|
||||
|
||||
/* Can't do both input recording and playback */
|
||||
if( start_files->playback && start_files->recording ) {
|
||||
ui_error(
|
||||
UI_ERROR_WARNING,
|
||||
"can't do both input playback and recording; recording disabled"
|
||||
);
|
||||
start_files->recording = NULL;
|
||||
}
|
||||
|
||||
/* Can't use both +3 and TR-DOS disks simultaneously */
|
||||
if( start_files->disk_plus3 && start_files->disk_beta ) {
|
||||
ui_error(
|
||||
UI_ERROR_WARNING,
|
||||
"can't use +3 and TR-DOS disks simultaneously; +3 disk ignored"
|
||||
);
|
||||
start_files->disk_plus3 = NULL;
|
||||
}
|
||||
|
||||
/* Can't use disks and the dock simultaneously */
|
||||
if( ( start_files->disk_plus3 || start_files->disk_beta ) &&
|
||||
start_files->dock ) {
|
||||
ui_error(
|
||||
UI_ERROR_WARNING,
|
||||
"can't use disks and the dock simultaneously; dock cartridge ignored"
|
||||
);
|
||||
start_files->dock = NULL;
|
||||
}
|
||||
|
||||
/* Can't use disks and the Interface II simultaneously */
|
||||
if( ( start_files->disk_plus3 || start_files->disk_beta ) &&
|
||||
start_files->if2 ) {
|
||||
ui_error(
|
||||
UI_ERROR_WARNING,
|
||||
"can't use disks and the Interface II simultaneously; cartridge ignored"
|
||||
);
|
||||
start_files->if2 = NULL;
|
||||
}
|
||||
|
||||
/* If a snapshot has been specified, don't autoload tape, disks etc */
|
||||
autoload = start_files->snapshot ? 0 : tape_can_autoload();
|
||||
|
||||
/* Load in each of the files. Input recording must be done after
|
||||
snapshot loading such that the right snapshot is embedded into
|
||||
the file; input playback being done after snapshot loading means
|
||||
any embedded snapshot in the input recording will override any
|
||||
specified snapshot */
|
||||
|
||||
if( start_files->disk_plus3 ) {
|
||||
error = utils_open_file( start_files->disk_plus3, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->disk_plusd ) {
|
||||
error = utils_open_file( start_files->disk_plusd, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->disk_beta ) {
|
||||
error = utils_open_file( start_files->disk_beta, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->dock ) {
|
||||
error = utils_open_file( start_files->dock, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->if2 ) {
|
||||
error = utils_open_file( start_files->if2, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->snapshot ) {
|
||||
error = utils_open_file( start_files->snapshot, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->tape ) {
|
||||
error = utils_open_file( start_files->tape, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
/* Microdrive cartridges */
|
||||
|
||||
for( i = 0; i < 8; i++ ) {
|
||||
if( start_files->mdr[i] ) {
|
||||
error = utils_open_file( start_files->mdr[i], autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
}
|
||||
|
||||
/* IDE hard disk images */
|
||||
|
||||
if( start_files->simpleide_master ) {
|
||||
error = simpleide_insert( start_files->simpleide_master,
|
||||
LIBSPECTRUM_IDE_MASTER );
|
||||
simpleide_reset( 0 );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->simpleide_slave ) {
|
||||
error = simpleide_insert( start_files->simpleide_slave,
|
||||
LIBSPECTRUM_IDE_SLAVE );
|
||||
simpleide_reset( 0 );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->zxatasp_master ) {
|
||||
error = zxatasp_insert( start_files->zxatasp_master,
|
||||
LIBSPECTRUM_IDE_MASTER );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->zxatasp_slave ) {
|
||||
error = zxatasp_insert( start_files->zxatasp_slave,
|
||||
LIBSPECTRUM_IDE_SLAVE );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->zxcf ) {
|
||||
error = zxcf_insert( start_files->zxcf ); if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->divide_master ) {
|
||||
error = divide_insert( start_files->divide_master,
|
||||
LIBSPECTRUM_IDE_MASTER );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->divide_slave ) {
|
||||
error = divide_insert( start_files->divide_slave,
|
||||
LIBSPECTRUM_IDE_SLAVE );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
/* Input recordings */
|
||||
|
||||
if( start_files->playback ) {
|
||||
error = utils_open_file( start_files->playback, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->recording ) {
|
||||
error = rzx_start_recording( start_files->recording,
|
||||
settings_current.embed_snapshot );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Tidy-up function called at end of emulation */
|
||||
#ifdef ANDROID
|
||||
fuse_end(void)
|
||||
#else
|
||||
static int fuse_end(void)
|
||||
#endif
|
||||
{
|
||||
/* Must happen before memory is deallocated as we read the character
|
||||
set from memory for the text output */
|
||||
printer_end();
|
||||
|
||||
/* also required before memory is deallocated on Fuse for OS X where
|
||||
settings need to look up machine names etc. */
|
||||
settings_end();
|
||||
|
||||
psg_end();
|
||||
rzx_end();
|
||||
debugger_end();
|
||||
simpleide_end();
|
||||
zxatasp_end();
|
||||
zxcf_end();
|
||||
if1_end();
|
||||
divide_end();
|
||||
plusd_end();
|
||||
|
||||
machine_end();
|
||||
|
||||
timer_end();
|
||||
|
||||
sound_end();
|
||||
event_end();
|
||||
fuse_joystick_end();
|
||||
ui_end();
|
||||
|
||||
#ifdef USE_WIDGET
|
||||
widget_end();
|
||||
#endif /* #ifdef USE_WIDGET */
|
||||
|
||||
libspectrum_creator_free( fuse_creator );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Emergency shutdown */
|
||||
void
|
||||
fuse_abort( void )
|
||||
{
|
||||
fuse_end();
|
||||
abort();
|
||||
}
|
|
@ -0,0 +1,809 @@
|
|||
/* fuse.c: The Free Unix Spectrum Emulator
|
||||
Copyright (c) 1999-2009 Philip Kendall
|
||||
|
||||
$Id: fuse.c 3942 2009-01-10 14:18:46Z pak21 $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif /* #ifdef WIN32 */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef UI_SDL
|
||||
#include <SDL.h> /* Needed on MacOS X and Windows */
|
||||
#endif /* #ifdef UI_SDL */
|
||||
|
||||
#include "ay.h"
|
||||
#include "dck.h"
|
||||
#include "debugger/debugger.h"
|
||||
#include "disk/beta.h"
|
||||
#include "disk/fdd.h"
|
||||
#include "display.h"
|
||||
#include "divide.h"
|
||||
#include "event.h"
|
||||
#include "fuse.h"
|
||||
#include "if1.h"
|
||||
#include "if2.h"
|
||||
#include "joystick.h"
|
||||
#include "keyboard.h"
|
||||
#include "kempmouse.h"
|
||||
#include "machine.h"
|
||||
#include "memory.h"
|
||||
#include "pokefinder/pokefinder.h"
|
||||
#include "printer.h"
|
||||
#include "profile.h"
|
||||
#include "psg.h"
|
||||
#include "rzx.h"
|
||||
#include "scld.h"
|
||||
#include "settings.h"
|
||||
#include "simpleide.h"
|
||||
#include "slt.h"
|
||||
#include "snapshot.h"
|
||||
#include "sound.h"
|
||||
#include "spectrum.h"
|
||||
#include "tape.h"
|
||||
#include "timer/timer.h"
|
||||
#include "ui/ui.h"
|
||||
#include "ui/scaler/scaler.h"
|
||||
#include "ula.h"
|
||||
#include "unittests/unittests.h"
|
||||
#include "utils.h"
|
||||
#include "zxatasp.h"
|
||||
#include "zxcf.h"
|
||||
|
||||
#ifdef USE_WIDGET
|
||||
#include "ui/widget/widget.h"
|
||||
#endif /* #ifdef USE_WIDGET */
|
||||
|
||||
#include "z80/z80.h"
|
||||
|
||||
/* What name were we called under? */
|
||||
char *fuse_progname;
|
||||
|
||||
/* Which directory were we started in? */
|
||||
char fuse_directory[ PATH_MAX ];
|
||||
|
||||
/* A flag to say when we want to exit the emulator */
|
||||
int fuse_exiting;
|
||||
|
||||
/* Is Spectrum emulation currently paused, and if so, how many times? */
|
||||
int fuse_emulation_paused;
|
||||
|
||||
/* The creator information we'll store in file formats that support this */
|
||||
libspectrum_creator *fuse_creator;
|
||||
|
||||
/* The earliest version of libspectrum we need */
|
||||
static const char *LIBSPECTRUM_MIN_VERSION = "0.5.0";
|
||||
|
||||
/* The various types of file we may want to run on startup */
|
||||
typedef struct start_files_t {
|
||||
|
||||
const char *disk_plus3;
|
||||
const char *disk_plusd;
|
||||
const char *disk_beta;
|
||||
const char *dock;
|
||||
const char *if2;
|
||||
const char *playback;
|
||||
const char *recording;
|
||||
const char *snapshot;
|
||||
const char *tape;
|
||||
|
||||
const char *simpleide_master, *simpleide_slave;
|
||||
const char *zxatasp_master, *zxatasp_slave;
|
||||
const char *zxcf;
|
||||
const char *divide_master, *divide_slave;
|
||||
const char *mdr[8];
|
||||
|
||||
} start_files_t;
|
||||
|
||||
static int fuse_init(int argc, char **argv);
|
||||
|
||||
static int creator_init( void );
|
||||
static void fuse_show_copyright(void);
|
||||
static void fuse_show_version( void );
|
||||
static void fuse_show_help( void );
|
||||
|
||||
static int setup_start_files( start_files_t *start_files );
|
||||
static int parse_nonoption_args( int argc, char **argv, int first_arg,
|
||||
start_files_t *start_files );
|
||||
static int do_start_files( start_files_t *start_files );
|
||||
|
||||
static int fuse_end(void);
|
||||
|
||||
#ifdef UI_WIN32
|
||||
int fuse_main(int argc, char **argv)
|
||||
#else
|
||||
int main(int argc, char **argv)
|
||||
#endif
|
||||
{
|
||||
int r;
|
||||
|
||||
#ifdef WIN32
|
||||
SetErrorMode( SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX );
|
||||
#endif
|
||||
|
||||
if(fuse_init(argc,argv)) {
|
||||
fprintf(stderr,"%s: error initialising -- giving up!\n", fuse_progname);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if( settings_current.show_help ||
|
||||
settings_current.show_version ) return 0;
|
||||
|
||||
if( settings_current.unittests ) {
|
||||
r = unittests_run();
|
||||
} else {
|
||||
while( !fuse_exiting ) {
|
||||
z80_do_opcodes();
|
||||
event_do_events();
|
||||
}
|
||||
r = 0;
|
||||
}
|
||||
|
||||
fuse_end();
|
||||
|
||||
return r;
|
||||
|
||||
}
|
||||
|
||||
#include "mempool.h"
|
||||
|
||||
static int fuse_init(int argc, char **argv)
|
||||
{
|
||||
int error, first_arg;
|
||||
char *start_scaler;
|
||||
start_files_t start_files;
|
||||
|
||||
/* Seed the bad but widely-available random number
|
||||
generator with the current time */
|
||||
srand( (unsigned)time( NULL ) );
|
||||
|
||||
fuse_progname=argv[0];
|
||||
libspectrum_error_function = ui_libspectrum_error;
|
||||
|
||||
if( !getcwd( fuse_directory, PATH_MAX - 1 ) ) {
|
||||
ui_error( UI_ERROR_ERROR, "error getting current working directory: %s",
|
||||
strerror( errno ) );
|
||||
return 1;
|
||||
}
|
||||
strcat( fuse_directory, FUSE_DIR_SEP_STR );
|
||||
|
||||
if( settings_init( &first_arg, argc, argv ) ) return 1;
|
||||
|
||||
if( settings_current.show_version ) {
|
||||
fuse_show_version();
|
||||
return 0;
|
||||
} else if( settings_current.show_help ) {
|
||||
fuse_show_help();
|
||||
return 0;
|
||||
}
|
||||
|
||||
start_scaler = strdup( settings_current.start_scaler_mode );
|
||||
if( !start_scaler ) {
|
||||
ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Windows will create a console for our output if there isn't one already,
|
||||
* so we don't display the copyright message on Win32. */
|
||||
#ifndef WIN32
|
||||
fuse_show_copyright();
|
||||
#endif
|
||||
|
||||
/* FIXME: order of these initialisation calls. Work out what depends on
|
||||
what */
|
||||
/* FIXME FIXME 20030407: really do this soon. This is getting *far* too
|
||||
hairy */
|
||||
fuse_joystick_init ();
|
||||
fuse_keyboard_init();
|
||||
|
||||
#ifdef USE_WIDGET
|
||||
if( widget_init() ) return 1;
|
||||
#endif /* #ifdef USE_WIDGET */
|
||||
|
||||
if( event_init() ) return 1;
|
||||
|
||||
if( display_init(&argc,&argv) ) return 1;
|
||||
|
||||
if( libspectrum_check_version( LIBSPECTRUM_MIN_VERSION ) ) {
|
||||
if( libspectrum_init() ) return 1;
|
||||
} else {
|
||||
ui_error( UI_ERROR_ERROR,
|
||||
"libspectrum version %s found, but %s required",
|
||||
libspectrum_version(), LIBSPECTRUM_MIN_VERSION );
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Must be called after libspectrum_init() so we can get the gcrypt
|
||||
version */
|
||||
if( creator_init() ) return 1;
|
||||
|
||||
#ifdef HAVE_GETEUID
|
||||
/* Drop root privs if we have them */
|
||||
if( !geteuid() ) { setuid( getuid() ); }
|
||||
#endif /* #ifdef HAVE_GETEUID */
|
||||
|
||||
if( mempool_init() ) return 1;
|
||||
if( memory_init() ) return 1;
|
||||
|
||||
if( debugger_init() ) return 1;
|
||||
|
||||
if( spectrum_init() ) return 1;
|
||||
if( printer_init() ) return 1;
|
||||
if( rzx_init() ) return 1;
|
||||
if( psg_init() ) return 1;
|
||||
if( beta_init() ) return 1;
|
||||
if( plusd_init() ) return 1;
|
||||
if( fdd_init_events() ) return 1;
|
||||
if( simpleide_init() ) return 1;
|
||||
if( zxatasp_init() ) return 1;
|
||||
if( zxcf_init() ) return 1;
|
||||
if( if1_init() ) return 1;
|
||||
if( if2_init() ) return 1;
|
||||
if( divide_init() ) return 1;
|
||||
if( scld_init() ) return 1;
|
||||
if( ula_init() ) return 1;
|
||||
if( ay_init() ) return 1;
|
||||
if( slt_init() ) return 1;
|
||||
if( profile_init() ) return 1;
|
||||
if( kempmouse_init() ) return 1;
|
||||
|
||||
error = pokefinder_clear(); if( error ) return error;
|
||||
|
||||
if( z80_init() ) return 1;
|
||||
|
||||
if( timer_init() ) return 1;
|
||||
|
||||
error = timer_estimate_reset(); if( error ) return error;
|
||||
|
||||
error = machine_init_machines();
|
||||
if( error ) return error;
|
||||
|
||||
error = machine_select_id( settings_current.start_machine );
|
||||
if( error ) return error;
|
||||
|
||||
error = tape_init(); if( error ) return error;
|
||||
|
||||
error = scaler_select_id( start_scaler ); free( start_scaler );
|
||||
if( error ) return error;
|
||||
|
||||
if( setup_start_files( &start_files ) ) return 1;
|
||||
if( parse_nonoption_args( argc, argv, first_arg, &start_files ) ) return 1;
|
||||
if( do_start_files( &start_files ) ) return 1;
|
||||
|
||||
/* Must do this after all subsytems are initialised */
|
||||
debugger_command_evaluate( settings_current.debugger_command );
|
||||
|
||||
if( ui_mouse_present ) ui_mouse_grabbed = ui_mouse_grab( 1 );
|
||||
|
||||
fuse_emulation_paused = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int creator_init( void )
|
||||
{
|
||||
size_t i;
|
||||
unsigned int version[4] = { 0, 0, 0, 0 };
|
||||
char *custom, osname[ 256 ];
|
||||
static const size_t CUSTOM_SIZE = 256;
|
||||
|
||||
libspectrum_error error; int sys_error;
|
||||
|
||||
const char *gcrypt_version;
|
||||
|
||||
sscanf( VERSION, "%u.%u.%u.%u",
|
||||
&version[0], &version[1], &version[2], &version[3] );
|
||||
|
||||
for( i=0; i<4; i++ ) if( version[i] > 0xff ) version[i] = 0xff;
|
||||
|
||||
sys_error = compat_osname( osname, sizeof( osname ) );
|
||||
if( sys_error ) return 1;
|
||||
|
||||
fuse_creator = libspectrum_creator_alloc();
|
||||
|
||||
error = libspectrum_creator_set_program( fuse_creator, "Fuse" );
|
||||
if( error ) { libspectrum_creator_free( fuse_creator ); return error; }
|
||||
|
||||
error = libspectrum_creator_set_major( fuse_creator,
|
||||
version[0] * 0x100 + version[1] );
|
||||
if( error ) { libspectrum_creator_free( fuse_creator ); return error; }
|
||||
|
||||
error = libspectrum_creator_set_minor( fuse_creator,
|
||||
version[2] * 0x100 + version[3] );
|
||||
if( error ) { libspectrum_creator_free( fuse_creator ); return error; }
|
||||
|
||||
custom = malloc( CUSTOM_SIZE );
|
||||
if( !custom ) {
|
||||
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
|
||||
libspectrum_creator_free( fuse_creator );
|
||||
return 1;
|
||||
}
|
||||
|
||||
gcrypt_version = libspectrum_gcrypt_version();
|
||||
if( !gcrypt_version ) gcrypt_version = "not available";
|
||||
|
||||
snprintf( custom, CUSTOM_SIZE,
|
||||
"gcrypt: %s\nlibspectrum: %s\nuname: %s", gcrypt_version,
|
||||
libspectrum_version(), osname );
|
||||
|
||||
error = libspectrum_creator_set_custom(
|
||||
fuse_creator, (libspectrum_byte*)custom, strlen( custom )
|
||||
);
|
||||
if( error ) {
|
||||
free( custom ); libspectrum_creator_free( fuse_creator );
|
||||
return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void fuse_show_copyright(void)
|
||||
{
|
||||
printf( "\n" );
|
||||
fuse_show_version();
|
||||
printf(
|
||||
"Copyright (c) 1999-2009 Philip Kendall and others; see the file\n"
|
||||
"'AUTHORS' for more details.\n"
|
||||
"\n"
|
||||
"For help, please mail <fuse-emulator-devel@lists.sf.net> or use\n"
|
||||
"the forums at <http://sourceforge.net/forum/?group_id=91293>.\n"
|
||||
"\n"
|
||||
"This program is distributed in the hope that it will be useful,\n"
|
||||
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
|
||||
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
|
||||
"GNU General Public License for more details.\n\n");
|
||||
}
|
||||
|
||||
static void fuse_show_version( void )
|
||||
{
|
||||
printf( "The Free Unix Spectrum Emulator (Fuse) version " VERSION ".\n" );
|
||||
}
|
||||
|
||||
static void fuse_show_help( void )
|
||||
{
|
||||
printf( "\n" );
|
||||
fuse_show_version();
|
||||
printf(
|
||||
"\nAvailable command-line options:\n\n"
|
||||
"Boolean options (use `--no-<option>' to turn off):\n\n"
|
||||
"--auto-load Automatically load tape files when opened.\n"
|
||||
"--beeper-stereo Add fake stereo to beeper emulation.\n"
|
||||
"--compress-rzx Write RZX files out compressed.\n"
|
||||
"--double-screen Write screenshots out as double size.\n"
|
||||
"--issue2 Emulate an Issue 2 Spectrum.\n"
|
||||
"--kempston Emulate the Kempston joystick on QAOP<space>.\n"
|
||||
"--loading-sound Emulate the sound of tapes loading.\n"
|
||||
"--separation Use ACB stereo for the AY-3-8912 sound chip.\n"
|
||||
"--sound Produce sound.\n"
|
||||
"--sound-force-8bit Generate 8-bit sound even if 16-bit is available.\n"
|
||||
"--slt Turn SLT traps on.\n"
|
||||
"--traps Turn tape traps on.\n\n"
|
||||
"Other options:\n\n"
|
||||
"--help This information.\n"
|
||||
"--machine <type> Which machine should be emulated?\n"
|
||||
"--playback <filename> Play back RZX file <filename>.\n"
|
||||
"--record <filename> Record to RZX file <filename>.\n"
|
||||
"--snapshot <filename> Load snapshot <filename>.\n"
|
||||
"--speed <percentage> How fast should emulation run?\n"
|
||||
"--svga-mode <mode> Which mode should be used for SVGAlib?\n"
|
||||
"--tape <filename> Open tape file <filename>.\n"
|
||||
"--version Print version number and exit.\n\n" );
|
||||
}
|
||||
|
||||
/* Stop all activities associated with actual Spectrum emulation */
|
||||
int fuse_emulation_pause(void)
|
||||
{
|
||||
int error;
|
||||
|
||||
/* If we were already paused, just return. In any case, increment
|
||||
the pause count */
|
||||
if( fuse_emulation_paused++ ) return 0;
|
||||
|
||||
/* Stop recording any competition mode RZX file */
|
||||
if( rzx_recording && rzx_competition_mode ) {
|
||||
ui_error( UI_ERROR_INFO, "Stopping competition mode RZX recording" );
|
||||
error = rzx_stop_recording(); if( error ) return error;
|
||||
}
|
||||
|
||||
/* If we had sound enabled (and hence doing the speed regulation),
|
||||
turn it off */
|
||||
sound_pause();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Restart emulation activities */
|
||||
int fuse_emulation_unpause(void)
|
||||
{
|
||||
int error;
|
||||
|
||||
/* If this doesn't start us running again, just return. In any case,
|
||||
decrement the pause count */
|
||||
if( --fuse_emulation_paused ) return 0;
|
||||
|
||||
/* If we now want sound, enable it */
|
||||
sound_unpause();
|
||||
|
||||
/* Restart speed estimation with no information */
|
||||
error = timer_estimate_reset(); if( error ) return error;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
setup_start_files( start_files_t *start_files )
|
||||
{
|
||||
start_files->disk_plus3 = settings_current.plus3disk_file;
|
||||
start_files->disk_plusd = settings_current.plusddisk_file;
|
||||
start_files->disk_beta = settings_current.betadisk_file;
|
||||
start_files->dock = settings_current.dck_file;
|
||||
start_files->if2 = settings_current.if2_file;
|
||||
start_files->playback = settings_current.playback_file;
|
||||
start_files->recording = settings_current.record_file;
|
||||
start_files->snapshot = settings_current.snapshot;
|
||||
start_files->tape = settings_current.tape_file;
|
||||
|
||||
start_files->simpleide_master = settings_current.simpleide_master_file;
|
||||
start_files->simpleide_slave = settings_current.simpleide_slave_file;
|
||||
|
||||
start_files->zxatasp_master = settings_current.zxatasp_master_file;
|
||||
start_files->zxatasp_slave = settings_current.zxatasp_slave_file;
|
||||
|
||||
start_files->zxcf = settings_current.zxcf_pri_file;
|
||||
|
||||
start_files->divide_master = settings_current.divide_master_file;
|
||||
start_files->divide_slave = settings_current.divide_slave_file;
|
||||
|
||||
start_files->mdr[0] = settings_current.mdr_file;
|
||||
start_files->mdr[1] = settings_current.mdr_file2;
|
||||
start_files->mdr[2] = settings_current.mdr_file3;
|
||||
start_files->mdr[3] = settings_current.mdr_file4;
|
||||
start_files->mdr[4] = settings_current.mdr_file5;
|
||||
start_files->mdr[5] = settings_current.mdr_file6;
|
||||
start_files->mdr[6] = settings_current.mdr_file7;
|
||||
start_files->mdr[7] = settings_current.mdr_file8;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Make 'best guesses' as to what to do with non-option arguments */
|
||||
static int
|
||||
parse_nonoption_args( int argc, char **argv, int first_arg,
|
||||
start_files_t *start_files )
|
||||
{
|
||||
size_t i, j;
|
||||
const char *filename;
|
||||
utils_file file;
|
||||
libspectrum_id_t type;
|
||||
libspectrum_class_t class;
|
||||
int error;
|
||||
|
||||
for( i = first_arg; i < (size_t)argc; i++ ) {
|
||||
|
||||
filename = argv[i];
|
||||
|
||||
error = utils_read_file( filename, &file );
|
||||
if( error ) return error;
|
||||
|
||||
error = libspectrum_identify_file_with_class( &type, &class, filename,
|
||||
file.buffer, file.length );
|
||||
if( error ) return error;
|
||||
|
||||
switch( class ) {
|
||||
|
||||
case LIBSPECTRUM_CLASS_CARTRIDGE_TIMEX:
|
||||
start_files->dock = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_CARTRIDGE_IF2:
|
||||
start_files->if2 = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_HARDDISK:
|
||||
if( settings_current.zxcf_active ) {
|
||||
start_files->zxcf = filename;
|
||||
} else if( settings_current.zxatasp_active ) {
|
||||
start_files->zxatasp_master = filename;
|
||||
} else if( settings_current.simpleide_active ) {
|
||||
start_files->simpleide_master = filename;
|
||||
} else if( settings_current.divide_enabled ) {
|
||||
start_files->divide_master = filename;
|
||||
} else {
|
||||
/* No IDE interface active, so activate the ZXCF */
|
||||
settings_current.zxcf_active = 1;
|
||||
start_files->zxcf = filename;
|
||||
}
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_DISK_PLUS3:
|
||||
start_files->disk_plus3 = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_DISK_PLUSD:
|
||||
start_files->disk_plusd = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_DISK_TRDOS:
|
||||
start_files->disk_beta = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_DISK_GENERIC:
|
||||
if( machine_current->machine == LIBSPECTRUM_MACHINE_PLUS3 ||
|
||||
machine_current->machine == LIBSPECTRUM_MACHINE_PLUS2A )
|
||||
start_files->disk_plus3 = filename;
|
||||
else if( machine_current->machine == LIBSPECTRUM_MACHINE_PENT ||
|
||||
machine_current->machine == LIBSPECTRUM_MACHINE_PENT512 ||
|
||||
machine_current->machine == LIBSPECTRUM_MACHINE_PENT1024 ||
|
||||
machine_current->machine == LIBSPECTRUM_MACHINE_SCORP )
|
||||
start_files->disk_beta = filename;
|
||||
else {
|
||||
if( periph_beta128_active )
|
||||
start_files->disk_beta = filename;
|
||||
else if( periph_plusd_active )
|
||||
start_files->disk_plusd = filename;
|
||||
}
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_RECORDING:
|
||||
start_files->playback = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_SNAPSHOT:
|
||||
start_files->snapshot = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_MICRODRIVE:
|
||||
for( j = 0; j < 8; j++ ) {
|
||||
if( !start_files->mdr[j] ) {
|
||||
start_files->mdr[j] = filename;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_TAPE:
|
||||
start_files->tape = filename; break;
|
||||
|
||||
case LIBSPECTRUM_CLASS_UNKNOWN:
|
||||
ui_error( UI_ERROR_WARNING, "couldn't identify '%s'; ignoring it",
|
||||
filename );
|
||||
break;
|
||||
|
||||
default:
|
||||
ui_error( UI_ERROR_ERROR, "parse_nonoption_args: unknown file class %d",
|
||||
class );
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
do_start_files( start_files_t *start_files )
|
||||
{
|
||||
int autoload, error, i;
|
||||
|
||||
/* Can't do both input recording and playback */
|
||||
if( start_files->playback && start_files->recording ) {
|
||||
ui_error(
|
||||
UI_ERROR_WARNING,
|
||||
"can't do both input playback and recording; recording disabled"
|
||||
);
|
||||
start_files->recording = NULL;
|
||||
}
|
||||
|
||||
/* Can't use both +3 and TR-DOS disks simultaneously */
|
||||
if( start_files->disk_plus3 && start_files->disk_beta ) {
|
||||
ui_error(
|
||||
UI_ERROR_WARNING,
|
||||
"can't use +3 and TR-DOS disks simultaneously; +3 disk ignored"
|
||||
);
|
||||
start_files->disk_plus3 = NULL;
|
||||
}
|
||||
|
||||
/* Can't use disks and the dock simultaneously */
|
||||
if( ( start_files->disk_plus3 || start_files->disk_beta ) &&
|
||||
start_files->dock ) {
|
||||
ui_error(
|
||||
UI_ERROR_WARNING,
|
||||
"can't use disks and the dock simultaneously; dock cartridge ignored"
|
||||
);
|
||||
start_files->dock = NULL;
|
||||
}
|
||||
|
||||
/* Can't use disks and the Interface II simultaneously */
|
||||
if( ( start_files->disk_plus3 || start_files->disk_beta ) &&
|
||||
start_files->if2 ) {
|
||||
ui_error(
|
||||
UI_ERROR_WARNING,
|
||||
"can't use disks and the Interface II simultaneously; cartridge ignored"
|
||||
);
|
||||
start_files->if2 = NULL;
|
||||
}
|
||||
|
||||
/* If a snapshot has been specified, don't autoload tape, disks etc */
|
||||
autoload = start_files->snapshot ? 0 : tape_can_autoload();
|
||||
|
||||
/* Load in each of the files. Input recording must be done after
|
||||
snapshot loading such that the right snapshot is embedded into
|
||||
the file; input playback being done after snapshot loading means
|
||||
any embedded snapshot in the input recording will override any
|
||||
specified snapshot */
|
||||
|
||||
if( start_files->disk_plus3 ) {
|
||||
error = utils_open_file( start_files->disk_plus3, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->disk_plusd ) {
|
||||
error = utils_open_file( start_files->disk_plusd, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->disk_beta ) {
|
||||
error = utils_open_file( start_files->disk_beta, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->dock ) {
|
||||
error = utils_open_file( start_files->dock, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->if2 ) {
|
||||
error = utils_open_file( start_files->if2, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->snapshot ) {
|
||||
error = utils_open_file( start_files->snapshot, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->tape ) {
|
||||
error = utils_open_file( start_files->tape, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
/* Microdrive cartridges */
|
||||
|
||||
for( i = 0; i < 8; i++ ) {
|
||||
if( start_files->mdr[i] ) {
|
||||
error = utils_open_file( start_files->mdr[i], autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
}
|
||||
|
||||
/* IDE hard disk images */
|
||||
|
||||
if( start_files->simpleide_master ) {
|
||||
error = simpleide_insert( start_files->simpleide_master,
|
||||
LIBSPECTRUM_IDE_MASTER );
|
||||
simpleide_reset( 0 );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->simpleide_slave ) {
|
||||
error = simpleide_insert( start_files->simpleide_slave,
|
||||
LIBSPECTRUM_IDE_SLAVE );
|
||||
simpleide_reset( 0 );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->zxatasp_master ) {
|
||||
error = zxatasp_insert( start_files->zxatasp_master,
|
||||
LIBSPECTRUM_IDE_MASTER );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->zxatasp_slave ) {
|
||||
error = zxatasp_insert( start_files->zxatasp_slave,
|
||||
LIBSPECTRUM_IDE_SLAVE );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->zxcf ) {
|
||||
error = zxcf_insert( start_files->zxcf ); if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->divide_master ) {
|
||||
error = divide_insert( start_files->divide_master,
|
||||
LIBSPECTRUM_IDE_MASTER );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->divide_slave ) {
|
||||
error = divide_insert( start_files->divide_slave,
|
||||
LIBSPECTRUM_IDE_SLAVE );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
/* Input recordings */
|
||||
|
||||
if( start_files->playback ) {
|
||||
error = utils_open_file( start_files->playback, autoload, NULL );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
if( start_files->recording ) {
|
||||
error = rzx_start_recording( start_files->recording,
|
||||
settings_current.embed_snapshot );
|
||||
if( error ) return error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Tidy-up function called at end of emulation */
|
||||
static int fuse_end(void)
|
||||
{
|
||||
/* Must happen before memory is deallocated as we read the character
|
||||
set from memory for the text output */
|
||||
printer_end();
|
||||
|
||||
/* also required before memory is deallocated on Fuse for OS X where
|
||||
settings need to look up machine names etc. */
|
||||
settings_end();
|
||||
|
||||
psg_end();
|
||||
rzx_end();
|
||||
debugger_end();
|
||||
simpleide_end();
|
||||
zxatasp_end();
|
||||
zxcf_end();
|
||||
if1_end();
|
||||
divide_end();
|
||||
plusd_end();
|
||||
|
||||
machine_end();
|
||||
|
||||
timer_end();
|
||||
|
||||
sound_end();
|
||||
event_end();
|
||||
fuse_joystick_end();
|
||||
ui_end();
|
||||
|
||||
#ifdef USE_WIDGET
|
||||
widget_end();
|
||||
#endif /* #ifdef USE_WIDGET */
|
||||
|
||||
libspectrum_creator_free( fuse_creator );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Emergency shutdown */
|
||||
void
|
||||
fuse_abort( void )
|
||||
{
|
||||
fuse_end();
|
||||
abort();
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/* fuse.h: Variables exported from the main file
|
||||
Copyright (c) 2000-2003 Philip Kendall
|
||||
|
||||
$Id: fuse.h 2889 2007-05-26 17:45:08Z zubzero $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Author contact information:
|
||||
|
||||
E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
*/
|
||||
|
||||
#ifndef FUSE_FUSE_H
|
||||
#define FUSE_FUSE_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include <libspectrum.h>
|
||||
|
||||
#include "compat.h"
|
||||
|
||||
extern char *fuse_progname; /* argv[0] */
|
||||
extern char fuse_directory[ PATH_MAX ]; /* The directory we started in */
|
||||
|
||||
extern int fuse_exiting; /* Shall we exit now? */
|
||||
|
||||
extern int fuse_emulation_paused; /* Is Spectrum emulation paused? */
|
||||
int fuse_emulation_pause(void); /* Stop and start emulation */
|
||||
int fuse_emulation_unpause(void);
|
||||
|
||||
#ifdef UI_WIN32
|
||||
int fuse_main(int argc, char **argv);
|
||||
#endif
|
||||
|
||||
void fuse_abort( void ) GCC_NORETURN; /* Emergency shutdown */
|
||||
|
||||
extern libspectrum_creator *fuse_creator; /* Creator information for file
|
||||
formats which support this */
|
||||
|
||||
#endif /* #ifndef FUSE_FUSE_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,27 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## Copyright (c) 2002-2008 Philip Kendall
|
||||
|
||||
## $Id: Makefile.am 3818 2008-11-15 13:28:08Z pak21 $
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation; either version 2 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License along
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
##
|
||||
## Author contact information:
|
||||
##
|
||||
## E-mail: philip-fuse@shadowmagic.org.uk
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
EXTRA_DIST = coding_style.txt cvs-tags implementation_notes.txt \
|
||||
tc2048_tech_notes.txt ui.txt
|
|
@ -0,0 +1,374 @@
|
|||
# Makefile.in generated by automake 1.10.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = hacking
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOLOAD_SNAPS = @AUTOLOAD_SNAPS@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPAT_OSNAME = @COMPAT_OSNAME@
|
||||
COMPAT_SUBDIR = @COMPAT_SUBDIR@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_CONFIG = @GLIB_CONFIG@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
GREP = @GREP@
|
||||
GTK_CFLAGS = @GTK_CFLAGS@
|
||||
GTK_LIBS = @GTK_LIBS@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LEX = @LEX@
|
||||
LEXLIB = @LEXLIB@
|
||||
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSPEC_CFLAGS = @LIBSPEC_CFLAGS@
|
||||
LIBSPEC_LIBS = @LIBSPEC_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PNG_LIBS = @PNG_LIBS@
|
||||
RANLIB = @RANLIB@
|
||||
SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@
|
||||
SAMPLERATE_LIBS = @SAMPLERATE_LIBS@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_CONFIG = @SDL_CONFIG@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SOUND_LIBADD = @SOUND_LIBADD@
|
||||
SOUND_LIBS = @SOUND_LIBS@
|
||||
STRIP = @STRIP@
|
||||
TIMER_LIBADD = @TIMER_LIBADD@
|
||||
UI = @UI@
|
||||
UI_LIBS = @UI_LIBS@
|
||||
VERSION = @VERSION@
|
||||
WIDGET = @WIDGET@
|
||||
WINDRES = @WINDRES@
|
||||
WINDRES_OBJ = @WINDRES_OBJ@
|
||||
XMKMF = @XMKMF@
|
||||
XML2_CONFIG = @XML2_CONFIG@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
X_EXTRA_LIBS = @X_EXTRA_LIBS@
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
YACC = @YACC@
|
||||
YFLAGS = @YFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
EXTRA_DIST = coding_style.txt cvs-tags implementation_notes.txt \
|
||||
tc2048_tech_notes.txt ui.txt
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hacking/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign hacking/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
ctags: CTAGS
|
||||
CTAGS:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
distclean distclean-generic distclean-libtool distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-html install-html-am \
|
||||
install-info install-info-am install-man install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,40 @@
|
|||
Coding style for Fuse
|
||||
|
||||
$Id: coding_style.txt 427 2002-03-23 11:59:05Z pak21 $
|
||||
|
||||
In general, please stick to the following guidelines when writing code
|
||||
for Fuse. There are plenty of places which don't follow this style
|
||||
exactly, and certain source files which ignore it completely. If
|
||||
you're modifying these bits, don't reformat the existing code, and use
|
||||
your judgement as to whether patches should match the existing style
|
||||
or use this `official' style; new source files should always follow
|
||||
these guidelines.
|
||||
|
||||
* Indents are two spaces
|
||||
|
||||
* Variable names should be all_lowercase_and_separated_with_underscores,
|
||||
except for #define and enum constants which should be
|
||||
IN_UPPERCASE_AND_SEPARATED_WITH_UNDERSCORES.
|
||||
|
||||
* There should be a space after the opening parenthesis of function
|
||||
calls (unless there are no arguments), after operators (apart from
|
||||
increments and decrements) and before the closing parenthesis of
|
||||
function calls. Array subscripts should also have spaces around them
|
||||
unless they're very short (eg `array[i]' ). Don't be afraid to add
|
||||
extra spaces to line things up vertically where this helps
|
||||
readability.
|
||||
|
||||
* Despite the above, don't be afraid to leave out spaces around
|
||||
operators if it helps group a complex expression more clearly.
|
||||
|
||||
* Opening braces should be on the same line as their control construct
|
||||
(except for function definitions), and closing braces should be on a
|
||||
line of their own, except that cuddled elses ( ie `} else {' ) are
|
||||
OK.
|
||||
|
||||
* Function return types should be on a separate line to the name,
|
||||
which should start in column 1 (this isn't used very much at all
|
||||
yet, but I'd like to encourage it).
|
||||
|
||||
* No C++ style `//' comments. Yes, I know most compilers now support
|
||||
these in C, but some don't.
|
|
@ -0,0 +1,173 @@
|
|||
CVS tags for Fuse
|
||||
|
||||
$Id: cvs-tags 3897 2008-12-10 18:42:11Z pak21 $
|
||||
|
||||
| Release-0_3_1
|
||||
| Release-0_3_2pre1
|
||||
| Release-0_3_2pre2
|
||||
| Release-0_3_2pre3
|
||||
| Release-0_3_2
|
||||
| Release-0_3_2_1 Bugfix release from 0.3.2
|
||||
| Release-0_4_0pre1
|
||||
| Release-0_4_0pre2
|
||||
| Release-0_4_0pre3
|
||||
| Release-0_4_0pre4
|
||||
| Release-0_4_0pre5
|
||||
| Release-0_4_0pre6
|
||||
| Release-0_4_0
|
||||
| Release-0_4_1pre1
|
||||
|
|
||||
+-\ Dave Ball's Sharp PDA port (dead?)
|
||||
| | Release-0_4_1pre1-qtopia-branch
|
||||
|
|
||||
| Release-0_4_1pre2
|
||||
| Release-0_4_1pre3
|
||||
| Release-0_4_1pre4
|
||||
| Release-0_4_1
|
||||
| Release-0_4_2pre1
|
||||
| Release-0_4_2pre2
|
||||
| Release-0_4_2pre3
|
||||
|
|
||||
+-\ Fred's TC2048 stuff
|
||||
| | Release-0_4_2pre3-tc2048-branch-1 Changes merged to trunk
|
||||
| | at Release-0_4_2-merge-1
|
||||
| | Release-0_4_2pre3-tc2048-branch
|
||||
|
|
||||
| Release-0_4_2pre4
|
||||
| Release-0_4_2
|
||||
|
|
||||
+-\ Experiment with recording all
|
||||
| | port reads
|
||||
| | Release-0_4_2-rzx2-branch-1 Z80 core fixes; merged
|
||||
| | to trunk at Release-0_4_2-merge-2
|
||||
| | Release-0_4_2-rzx2-branch-2 RZX2 working. Merged to trunk
|
||||
| | at Release-0_5_0pre1-merge-1
|
||||
| | Release-0_4_2-rzx2-branch
|
||||
|
|
||||
| Release-0_4_2-merge-1 Merged from
|
||||
| Release-0_4_2pre3-tc2048-branch-1
|
||||
| Release-0_4_2-merge-2 Merged from
|
||||
| Release-0_4_2-rzx2-branch-1
|
||||
| Release-0_5_0pre1
|
||||
| Release-0_5_0pre1-merge-1 Merged from
|
||||
| Release-0_4_2-rzx2-branch-2
|
||||
| Release-0_5_0pre2
|
||||
| Release-0_5_0-trunk
|
||||
|
|
||||
+-\ Branch for the 0.5.0 release
|
||||
| | Release-0_5_0pre3
|
||||
| | Release-0_5_0
|
||||
| | Release-0_5_0-branch-1 Changes merged to trunk at
|
||||
| | Release-0_5_0-merge-1
|
||||
| | Release-0_5_0-branch
|
||||
|
|
||||
| Release-0_5_0-merge-1 Merged from
|
||||
| Release-0_5_0-branch-1
|
||||
| Release-0_5_1pre1
|
||||
|
|
||||
+-\ Branch for digitial signatures
|
||||
| |
|
||||
| | Release-0_5_1pre1-crypto-branch-1 Sync with HEAD as of 2003/07/22
|
||||
| | (post Release-0_6_1pre1-merge-1)
|
||||
| | Release-0_5_1pre1-crypto-branch-2 Merge to head at
|
||||
| | Release-0_6_1pre1-merge-2
|
||||
| |
|
||||
| | Release-0_5_1pre1-crypto-branch
|
||||
|
|
||||
| Release-0_5_1pre2
|
||||
|
|
||||
+-\ First bits of debugger
|
||||
| | Release-0_5_1pre2-debugger-branch-1 Merged to trunk at
|
||||
| | Release-0_5_1-merge-1
|
||||
| | Release-0_5_1pre2-debugger-branch
|
||||
|
|
||||
| Release-0_5_1pre3
|
||||
| Release-0_5_1
|
||||
| Release-0_5_1-merge-1 Merged from
|
||||
| Release-0_5_1pre2-debugger-branch-1
|
||||
| Release-0_5_2pre1
|
||||
| Release-0_5_2pre1-trunk
|
||||
|
|
||||
+-\ Fred's UI scaling patches
|
||||
| | Release-0_5_2pre1-scaler-branch-1 Merged to trunk at
|
||||
| | Release-0_5_2pre1-merge-1
|
||||
| | Release-0_5_2pre1-scaler-branch
|
||||
|
|
||||
| Release-0_5_2pre1-merge-1 Merged from
|
||||
| Release-0_5_2pre1-scaler-branch-1
|
||||
| Release-0_5_2pre2
|
||||
| Release-0_6_0pre1
|
||||
| Release-0_6_0pre2
|
||||
| Release-0_6_0
|
||||
|
|
||||
+-\ Bugfix branch for 0.6.0
|
||||
| | Release-0_6_0_1 Merged to trunk at
|
||||
| | Release-0_6_1pre1-merge-1
|
||||
| | Release-0_6_0-bugfix-branch
|
||||
|
|
||||
| Release-0_6_1pre1
|
||||
| Release-0_6_1pre1-merge-1 Merged from
|
||||
| Release-0_6_0_1
|
||||
| Release-0_6_1pre1-merge-2 Merged from
|
||||
| Release-0_5_1pre1-crypto-branch-2
|
||||
|
|
||||
+-\ Branch for the 0.6.1 release
|
||||
| | Release-0_6_1
|
||||
| | Release-0_6_1_1
|
||||
| |
|
||||
| | Release-0_6_1-branch
|
||||
|
|
||||
| Release-0_6_2-trunk
|
||||
|
|
||||
+-\ Branch for the 0.6.2 release
|
||||
| | Release-0_6_2pre1
|
||||
| | Release-0_6_2
|
||||
| | Release-0_6_2_1 Merged to HEAD at Release-0_6_2-merge-1
|
||||
| |
|
||||
| | Release-0_6_2-branch
|
||||
|
|
||||
| Release-0_6_2-merge-1
|
||||
| Release-0_7_0pre1
|
||||
| Release-0_7_0
|
||||
| Release-0_7_0-trunk
|
||||
|
|
||||
+-\ Branch for Fred's renderer changes
|
||||
| |
|
||||
| | Release-0_7_0-render-branch
|
||||
|
|
||||
| Release-0_7_0-trunk-1
|
||||
|
|
||||
+-\ Branch for Disciple support
|
||||
| |
|
||||
| | Release-0_7_0-disciple-branch
|
||||
|
|
||||
| Release-0_8_0-trunk
|
||||
|
|
||||
+-\
|
||||
| | Release-0_8_0-pre1
|
||||
| | Release-0_8_0-pre2
|
||||
| | Release-0_8_0
|
||||
| | Release-0_8_0_1 Merged to HEAD at Release-0_8_0-merge-1
|
||||
| |
|
||||
| | Release-0_8_0-branch
|
||||
|
|
||||
| Release-0_8_0-merge-1
|
||||
|
|
||||
+-\ Branch for XVideo integration
|
||||
| |
|
||||
| | xvideo-2007-08-31
|
||||
|
|
||||
+-\
|
||||
| | Release-0_9_0-pre1
|
||||
| | Release-0_9_0
|
||||
| |
|
||||
| | Release-0_9_0-branch
|
||||
|
|
||||
+-\
|
||||
| | Release_0_10_0-pre1
|
||||
| | Release_0_10_0
|
||||
| | Release_0_10_0_1
|
||||
| |
|
||||
| | Release_0_10_0-branch
|
||||
|
|
||||
HEAD
|
|
@ -0,0 +1,123 @@
|
|||
Implementation notes for some of Fuse's systems
|
||||
===============================================
|
||||
|
||||
Contents:
|
||||
|
||||
1. The main emulation loop
|
||||
2. The display code
|
||||
2.1. Building an image of the Spectrum's screen
|
||||
|
||||
1. The main emulation loop
|
||||
==========================
|
||||
|
||||
The main emulation loop (the while loop in fuse.c:main) is essentially
|
||||
fairly simple: it just runs Z80 opcodes until something `interesting'
|
||||
happens, at which point it deals with the `interesting' thing.
|
||||
|
||||
The question here is how do we know when something `interesting' has
|
||||
occurred: the simple answer is that something interesting occurs when
|
||||
the `tstates' global variable (which counts tstates since the last
|
||||
interrupt occurred) reaches `event_next_event'. It should be noted here
|
||||
that these events are purely a Fuse concept, and not related to any OS
|
||||
feature.
|
||||
|
||||
Perhaps the most obvious type of event which can occur is an
|
||||
interrupt, which (on the 48K machine anyway) will occur 69888 tstates
|
||||
after the last interrupt. When each interrupt occurs, the code sets
|
||||
another interrupt to occur one frame later (the event_add() call in
|
||||
spectrum.c:spectrum_interrupt). `event_next_event' will then be set by
|
||||
the code in event.c.
|
||||
|
||||
TZX playback is handled in much the same way: an event (of type
|
||||
EVENT_TYPE_EDGE) is scheduled to occur whenever the signal from the
|
||||
(emulated) tape changes. That event then toggles the input to the
|
||||
ULA's EAR bit, and schedules another event to occur whenever the next
|
||||
edge is due from the tape.
|
||||
|
||||
RZX playback cannot be handled in the same way, as it is not known
|
||||
after how many tstates the interrupt will occur. In this case, the
|
||||
interrupt is forced when it is due to occur by scheduling an event
|
||||
from the main Z80 emulation loop (z80/z80_ops.c:z80_do_opcodes) and
|
||||
then breaking out of the loop.
|
||||
|
||||
2. The display code
|
||||
===================
|
||||
|
||||
There are two stages to producing the Spectrum's screen on the
|
||||
emulating machine's screen: firstly, building an image of the
|
||||
Spectrum's screen in memory, and then translating that image onto the
|
||||
emulating machine's screen.
|
||||
|
||||
The first of these functions is accomplished by the code in display.c,
|
||||
whilst the second is fulfilled by each user interface separately,
|
||||
although generally in ui/<name>/<name>display.c.
|
||||
|
||||
2.1. Building an image of the Spectrum's screen
|
||||
-----------------------------------------------
|
||||
|
||||
The function of almost all the code in display.c is to build an image
|
||||
of the Spectrum's screen in the display.c:display_image array. For the
|
||||
`normal' (non-Timex) machines, this array has a size 320x240 and each
|
||||
pixel represents one pixel on the Spectrum's screen (including 32
|
||||
pixels of left and right border, and 24 pixels of top and bottom
|
||||
border). For the Timex machines, this array is sized 640x480 to
|
||||
accommodate the hires modes and each Spectrum pixel is represented by
|
||||
two vertically adjacent pixels in the array (as the hires modes double
|
||||
only the horizontal resolution, not the vertical resolution). In both
|
||||
cases, the values in this array are the Spectrum colours (0 to 15).
|
||||
|
||||
Every time the screen memory is written to (and actually changed, as
|
||||
opposed to the data already there being written back again), three
|
||||
things occur:
|
||||
|
||||
* Fuse works out if it needs to update the display. It does this by
|
||||
looking at the region between the current position of the electron
|
||||
beam and the position it was in the last time it updated the
|
||||
display. If the write affects this 'critical' region, then the
|
||||
display_image array is updated with any 'dirty' chunks (see below)
|
||||
in the critical region.
|
||||
|
||||
Each run of dirty pixels is noted, and a list of rectangles of such
|
||||
pixels is built up by display.c:add_rectangle() and
|
||||
display.c:end_line(). At the end of the frame, each of these
|
||||
rectangles is passed off to the user-interface specific rendering
|
||||
code to be drawn onto the emulating machine's screen.
|
||||
|
||||
* The new data is now written to RAM.
|
||||
|
||||
* Fuse marks any pixels affected by the write as 'dirty' in the
|
||||
display.c:display_is_dirty array. Each bit in each entry represents
|
||||
an 8 (non-Timex) or 16 (Timex) pixel chunk of the screen plus border
|
||||
which must be updated. The least significant bit represents the
|
||||
left-most 8 (16) pixels, the second bit the next 8 (16) and so
|
||||
on. (For the rest of this section, I'll take the doubling in pixel
|
||||
numbers for Timex machines as read).
|
||||
|
||||
If the `data' area of memory is written to, one 8 pixel chunk is
|
||||
marked as `dirty', whilst 64 pixels (in an 8x8 square) are marked as
|
||||
dirty if the attributes area is written to. `FLASH'ing characters
|
||||
will also cause 8x8 pixel chunks to be marked as dirty every 16
|
||||
frames (display.c:display_dirty_flashing()). The arrays
|
||||
display_dirty_xtable and display_dirty_ytable store the address to
|
||||
coordinate mappings for the data area of the Spectrum's screen,
|
||||
whilst display_dirty_xtable2 and display_dirty_ytable2 serves the
|
||||
same function for the attributes area.
|
||||
|
||||
2.2. From display_image to the emulating machine's screen
|
||||
---------------------------------------------------------
|
||||
|
||||
At the end of every frame, Fuse calls uidisplay_area repeatedly to get
|
||||
the user interface to update the emulating machine's screen.
|
||||
|
||||
If a user interface is outputting the same number of pixels as in
|
||||
display_image (320x240 for non-Timex, 640x480 for Timex), this can be
|
||||
very simple, but user interfaces which implement scaling (either
|
||||
upwards, or downwards as is necessary for displaying the Timex modes
|
||||
in a 320x240 mode) may wish to make use of the 'scalers' defined in
|
||||
ui/scaler: a generalised set of routines for accomplishing this, as
|
||||
well as various smoothing options and the like (for example,
|
||||
scanlines). See `scalers.txt' for more information on these.
|
||||
|
||||
(FIXME: write scalers.txt)
|
||||
|
||||
$Id: implementation_notes.txt 3032 2007-06-28 22:48:54Z zubzero $
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue