[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx: [475] vendor/fuse-emulator/current
Brought to you by:
fredm
|
From: <fr...@us...> - 2008-02-14 12:06:51
|
Revision: 475
http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=475&view=rev
Author: fredm
Date: 2008-02-14 04:06:55 -0800 (Thu, 14 Feb 2008)
Log Message:
-----------
Import vendor libspectrum-0.4.0 and fuse-0.9.0.
Modified Paths:
--------------
vendor/fuse-emulator/current/fuse/ChangeLog
vendor/fuse-emulator/current/fuse/Makefile.am
vendor/fuse-emulator/current/fuse/README
vendor/fuse-emulator/current/fuse/ay.c
vendor/fuse-emulator/current/fuse/compat/Makefile.am
vendor/fuse-emulator/current/fuse/compat/win32/osname.c
vendor/fuse-emulator/current/fuse/configure.in
vendor/fuse-emulator/current/fuse/disk/beta.c
vendor/fuse-emulator/current/fuse/disk/beta.h
vendor/fuse-emulator/current/fuse/disk/disk.c
vendor/fuse-emulator/current/fuse/disk/disk.h
vendor/fuse-emulator/current/fuse/disk/fdd.c
vendor/fuse-emulator/current/fuse/disk/fdd.h
vendor/fuse-emulator/current/fuse/disk/plusd.c
vendor/fuse-emulator/current/fuse/disk/plusd.h
vendor/fuse-emulator/current/fuse/disk/wd_fdc.c
vendor/fuse-emulator/current/fuse/disk/wd_fdc.h
vendor/fuse-emulator/current/fuse/display.c
vendor/fuse-emulator/current/fuse/divide.c
vendor/fuse-emulator/current/fuse/fuse.c
vendor/fuse-emulator/current/fuse/hacking/ChangeLog
vendor/fuse-emulator/current/fuse/hacking/cvs-tags
vendor/fuse-emulator/current/fuse/hacking/tc2048_tech_notes.txt
vendor/fuse-emulator/current/fuse/if1.c
vendor/fuse-emulator/current/fuse/if1.h
vendor/fuse-emulator/current/fuse/if2.c
vendor/fuse-emulator/current/fuse/input.c
vendor/fuse-emulator/current/fuse/joystick.c
vendor/fuse-emulator/current/fuse/kempmouse.c
vendor/fuse-emulator/current/fuse/keyboard.c
vendor/fuse-emulator/current/fuse/machine.c
vendor/fuse-emulator/current/fuse/machines/Makefile.am
vendor/fuse-emulator/current/fuse/machines/machines.h
vendor/fuse-emulator/current/fuse/machines/pentagon.c
vendor/fuse-emulator/current/fuse/machines/pentagon1024.c
vendor/fuse-emulator/current/fuse/machines/scorpion.c
vendor/fuse-emulator/current/fuse/machines/spec128.c
vendor/fuse-emulator/current/fuse/machines/spec16.c
vendor/fuse-emulator/current/fuse/machines/spec48.c
vendor/fuse-emulator/current/fuse/machines/spec48.h
vendor/fuse-emulator/current/fuse/machines/spec_se.c
vendor/fuse-emulator/current/fuse/machines/specplus2.c
vendor/fuse-emulator/current/fuse/machines/specplus2a.c
vendor/fuse-emulator/current/fuse/machines/specplus3.c
vendor/fuse-emulator/current/fuse/machines/specplus3.h
vendor/fuse-emulator/current/fuse/machines/specplus3e.c
vendor/fuse-emulator/current/fuse/machines/tc2048.c
vendor/fuse-emulator/current/fuse/machines/tc2068.c
vendor/fuse-emulator/current/fuse/machines/ts2068.c
vendor/fuse-emulator/current/fuse/man/fuse.1
vendor/fuse-emulator/current/fuse/memory.c
vendor/fuse-emulator/current/fuse/menu.c
vendor/fuse-emulator/current/fuse/menu.h
vendor/fuse-emulator/current/fuse/menu_data.dat
vendor/fuse-emulator/current/fuse/menu_data.pl
vendor/fuse-emulator/current/fuse/module.c
vendor/fuse-emulator/current/fuse/module.h
vendor/fuse-emulator/current/fuse/periph.c
vendor/fuse-emulator/current/fuse/periph.h
vendor/fuse-emulator/current/fuse/printer.c
vendor/fuse-emulator/current/fuse/profile.c
vendor/fuse-emulator/current/fuse/scld.c
vendor/fuse-emulator/current/fuse/settings.dat
vendor/fuse-emulator/current/fuse/settings.pl
vendor/fuse-emulator/current/fuse/simpleide.c
vendor/fuse-emulator/current/fuse/slt.c
vendor/fuse-emulator/current/fuse/snapshot.c
vendor/fuse-emulator/current/fuse/sound/alsasound.c
vendor/fuse-emulator/current/fuse/sound/sdlsound.c
vendor/fuse-emulator/current/fuse/spectrum.c
vendor/fuse-emulator/current/fuse/spectrum.h
vendor/fuse-emulator/current/fuse/tape.c
vendor/fuse-emulator/current/fuse/tape.h
vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c
vendor/fuse-emulator/current/fuse/ui/fb/fbmouse.c
vendor/fuse-emulator/current/fuse/ui/gtk/binary.c
vendor/fuse-emulator/current/fuse/ui/gtk/confirm.c
vendor/fuse-emulator/current/fuse/ui/gtk/fileselector.c
vendor/fuse-emulator/current/fuse/ui/gtk/gtkjoystick.c
vendor/fuse-emulator/current/fuse/ui/gtk/gtkui.c
vendor/fuse-emulator/current/fuse/ui/gtk/pokefinder.c
vendor/fuse-emulator/current/fuse/ui/gtk/rollback.c
vendor/fuse-emulator/current/fuse/ui/gtk/roms.c
vendor/fuse-emulator/current/fuse/ui/options.dat
vendor/fuse-emulator/current/fuse/ui/sdl/sdlui.c
vendor/fuse-emulator/current/fuse/ui/ui.h
vendor/fuse-emulator/current/fuse/ui/win32/Makefile.am
vendor/fuse-emulator/current/fuse/ui/win32/error.c
vendor/fuse-emulator/current/fuse/ui/win32/win32internals.h
vendor/fuse-emulator/current/fuse/ui/win32/win32ui.c
vendor/fuse-emulator/current/fuse/ui.c
vendor/fuse-emulator/current/fuse/ula.c
vendor/fuse-emulator/current/fuse/utils.c
vendor/fuse-emulator/current/fuse/widget/browse.c
vendor/fuse-emulator/current/fuse/widget/filesel.c
vendor/fuse-emulator/current/fuse/widget/menu.c
vendor/fuse-emulator/current/fuse/widget/options.pl
vendor/fuse-emulator/current/fuse/widget/roms.c
vendor/fuse-emulator/current/fuse/widget/widget.c
vendor/fuse-emulator/current/fuse/widget/widget.h
vendor/fuse-emulator/current/fuse/widget/widget_internals.h
vendor/fuse-emulator/current/fuse/z80/coretest.c
vendor/fuse-emulator/current/fuse/z80/tests/Makefile.am
vendor/fuse-emulator/current/fuse/z80/z80.c
vendor/fuse-emulator/current/fuse/z80/z80.pl
vendor/fuse-emulator/current/fuse/z80/z80_macros.h
vendor/fuse-emulator/current/fuse/z80/z80_ops.c
vendor/fuse-emulator/current/fuse/zxatasp.c
vendor/fuse-emulator/current/fuse/zxcf.c
vendor/fuse-emulator/current/libspectrum/COPYING
vendor/fuse-emulator/current/libspectrum/ChangeLog
vendor/fuse-emulator/current/libspectrum/Makefile.am
vendor/fuse-emulator/current/libspectrum/README
vendor/fuse-emulator/current/libspectrum/accessor.pl
vendor/fuse-emulator/current/libspectrum/configure.in
vendor/fuse-emulator/current/libspectrum/csw.c
vendor/fuse-emulator/current/libspectrum/dll.c
vendor/fuse-emulator/current/libspectrum/doc/cvs-tags
vendor/fuse-emulator/current/libspectrum/doc/libspectrum.3
vendor/fuse-emulator/current/libspectrum/doc/libspectrum.txt
vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog
vendor/fuse-emulator/current/libspectrum/internals.h
vendor/fuse-emulator/current/libspectrum/libspectrum.c
vendor/fuse-emulator/current/libspectrum/libspectrum.h.in
vendor/fuse-emulator/current/libspectrum/plusd.c
vendor/fuse-emulator/current/libspectrum/sna.c
vendor/fuse-emulator/current/libspectrum/snap_accessors.txt
vendor/fuse-emulator/current/libspectrum/snapshot.c
vendor/fuse-emulator/current/libspectrum/szx.c
vendor/fuse-emulator/current/libspectrum/tap.c
vendor/fuse-emulator/current/libspectrum/tape.c
vendor/fuse-emulator/current/libspectrum/tape_block.c
vendor/fuse-emulator/current/libspectrum/test/Makefile.am
vendor/fuse-emulator/current/libspectrum/test/test.c
vendor/fuse-emulator/current/libspectrum/timings.c
vendor/fuse-emulator/current/libspectrum/z80.c
Added Paths:
-----------
vendor/fuse-emulator/current/fuse/machines/pentagon.h
vendor/fuse-emulator/current/fuse/machines/pentagon512.c
vendor/fuse-emulator/current/libspectrum/test/empty.csw
vendor/fuse-emulator/current/libspectrum/test/sp-2000.sna.gz
vendor/fuse-emulator/current/libspectrum/test/sp-ffff.sna.gz
Modified: vendor/fuse-emulator/current/fuse/ChangeLog
===================================================================
--- vendor/fuse-emulator/current/fuse/ChangeLog 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/ChangeLog 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,6 +1,6 @@
-2007-xx-xx Philip Kendall <phi...@sh...>
+2008-01-05 Philip Kendall <phi...@sh...>
- * Fuse 0.x.x released
+ * Fuse 0.9.0 released
* New features:
* Add +D disk interface support (Stuart Brady).
@@ -26,14 +26,43 @@
* Fix undocumented flags after BIT n,(IX+d) instructions (Philip
Kendall).
* Fix undocumented behaviour of DAA (Stuart Brady).
- * Separate out contention when MREQ isn't active, as the +2A/+3 ULA
- applies contention only when MREQ is active (Philip Kendall).
+ * 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:
- * Removed the GTK 1.x UI (please note that GTK 2.x will remain
+ * 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).
@@ -69,7 +98,7 @@
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).
+ * Interface I and Microdrive emulation (Gergely Szasz).
* TS2068 support (Fredrick Meunier).
* Kempston mouse emulation (Darren Salt).
* TZX generalized data block (0x19) support (Philip Kendall).
@@ -218,7 +247,7 @@
+ 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 <pak...@sr...>
* Fuse 0.6.2.1 released.
@@ -261,7 +290,7 @@
printer emulation (Philip Kendall).
* Z80 core improvements:
- + Improved memory handling. Should be both quicker and more
+ + Improved memory handling. Should be both quicker and more
flexible.
+ Support for retriggered interrupts.
+ Don't allow interrupts after an EI instruction.
@@ -312,7 +341,7 @@
+ 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
+ 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).
@@ -715,7 +744,7 @@
* Changed the default install location to `/usr/local' (Philip
Kendall).
- * Generate keysyms.c from keysyms.dat; allows me automatically
+ * Generate keysyms.c from keysyms.dat; allows me automatically
keep the Xlib/GTK+ and svgalib key tables in sync (Philip
Kendall).
@@ -849,4 +878,4 @@
* Version 0.1.0 released.
-$Id: ChangeLog 3253 2007-10-26 02:02:17Z zubzero $
+$Id: ChangeLog 3462 2008-01-04 09:34:40Z pak21 $
Modified: vendor/fuse-emulator/current/fuse/Makefile.am
===================================================================
--- vendor/fuse-emulator/current/fuse/Makefile.am 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/Makefile.am 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
# Process this file with automake to produce Makefile.in
## Copyright (c) 1999-2004 Philip Kendall
-## $Id: Makefile.am 3218 2007-10-21 23:25:23Z zubzero $
+## $Id: Makefile.am 3318 2007-11-21 19:25:31Z 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
@@ -25,7 +25,7 @@
bin_PROGRAMS = fuse
-SUBDIRS = compat \
+SUBDIRS = @COMPAT_SUBDIR@ \
debugger \
disk \
hacking \
@@ -41,8 +41,7 @@
@WIDGET@ \
z80
-DIST_SUBDIRS = compat \
- debugger \
+DIST_SUBDIRS = debugger \
disk \
hacking \
lib \
@@ -97,6 +96,18 @@
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 \
@@ -117,7 +128,6 @@
@SAMPLERATE_LIBS@ \
@X_LIBS@ \
@XML_LIBS@ \
-compat/libcompat.a \
compat/@COMPAT_OSNAME@/libcompatos.a \
@WINDRES_OBJ@
@@ -195,3 +205,7 @@
CLEANFILES = settings.c \
settings.h
+
+AM_CPPFLAGS =
+
+include compat/Makefile.am
Modified: vendor/fuse-emulator/current/fuse/README
===================================================================
--- vendor/fuse-emulator/current/fuse/README 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/README 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,5 +1,5 @@
-The Free Unix Spectrum Emulator (Fuse) 0.8.0.1
-==============================================
+The Free Unix Spectrum Emulator (Fuse) 0.9.0
+============================================
Fuse (the Free Unix Spectrum Emulator) was originally, and somewhat
unsurprisingly, an emulator of the ZX Spectrum (a popular 1980s home
@@ -10,10 +10,11 @@
What Fuse does have:
-* Working Spectrum 16K/48K/128K/+2/+2A/+3/+3e/SE, Timex TC2048,
- TC2068 and TS2068, Pentagon 128 and Scorpion ZS 256 emulation,
- running at true Speccy speed on any computer you're likely to try it
- on.
+* 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.
* Sound (on systems supporting the Open Sound System, SDL, or OpenBSD/
Solaris's /dev/audio).
@@ -23,7 +24,7 @@
* Support for the RZX input recording file format, including
rollback and 'competition mode'.
* Emulation of the DivIDE, Interface I, Kempston mouse, Spectrum +3e,
- ZXATASP and ZXCF interfaces.
+ ZXATASP, ZXCF, Beta 128 and +D interfaces.
What you'll need to run Fuse
----------------------------
@@ -62,6 +63,11 @@
* 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
-------------
@@ -141,6 +147,6 @@
( http://www.worldofspectrum.org/faq/index.html ) first!
Philip Kendall <phi...@sh...>
-11 May 2007
+5 January 2008
-$Id: README 2835 2007-05-13 10:01:36Z fredm $
+$Id: README 3462 2008-01-04 09:34:40Z pak21 $
Modified: vendor/fuse-emulator/current/fuse/ay.c
===================================================================
--- vendor/fuse-emulator/current/fuse/ay.c 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/ay.c 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
/* ay.c: AY-8-3912 routines
Copyright (c) 1999-2004 Philip Kendall
- $Id: ay.c 3213 2007-10-21 16:37:52Z pak21 $
+ $Id: ay.c 3390 2007-12-03 12:59:54Z 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
@@ -25,6 +25,8 @@
#include <config.h>
+#include <string.h>
+
#include "compat.h"
#include "machine.h"
#include "module.h"
@@ -49,6 +51,7 @@
ay_reset,
NULL,
+ NULL,
ay_from_snapshot,
ay_to_snapshot,
Modified: vendor/fuse-emulator/current/fuse/compat/Makefile.am
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/Makefile.am 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/compat/Makefile.am 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
## Copyright (c) 2003-2007 Philip Kendall
-## $Id: Makefile.am 3115 2007-08-19 02:49:14Z fredm $
+## $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
@@ -21,29 +21,16 @@
##
## E-mail: phi...@sh...
-AUTOMAKE_OPTIONS = foreign
+AM_CPPFLAGS += -I$(srcdir)/compat
-AM_CPPFLAGS = -I$(srcdir)/..
+DIST_SUBDIRS += compat/amiga \
+ compat/morphos \
+ compat/unix \
+ compat/win32
-SUBDIRS = @COMPAT_OSNAME@
+EXTRA_fuse_SOURCES += compat/dirname.c \
+ compat/getopt.c \
+ compat/getopt1.c \
+ compat/mkstemp.c
-DIST_SUBDIRS = amiga \
- morphos \
- unix \
- win32
-
-noinst_LIBRARIES = libcompat.a
-
-libcompat_a_SOURCES =
-
-EXTRA_libcompat_a_SOURCES = dirname.c \
- getopt.c \
- getopt1.c \
- mkstemp.c
-
-libcompat_a_LIBADD = $(COMPAT_LIBADD)
-libcompat_a_DEPENDENCIES = $(COMPAT_LIBADD)
-
-INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
-
-noinst_HEADERS = getopt.h
+noinst_HEADERS += compat/getopt.h
Modified: vendor/fuse-emulator/current/fuse/compat/win32/osname.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/win32/osname.c 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/compat/win32/osname.c 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
/* osname.c: Get a representation of the OS we're running on
Copyright (c) 1999-2007 Philip Kendall
- $Id: osname.c 3163 2007-09-06 21:41:45Z zubzero $
+ $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
@@ -49,9 +49,10 @@
default: windows_name = "unknown"; break;
}
- snprintf( osname, length, "Windows %s %ld.%ld build %ld %s",
- windows_name, buf.dwMajorVersion, buf.dwMinorVersion,
- buf.dwBuildNumber, buf.szCSDVersion );
+ /* 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;
}
Modified: vendor/fuse-emulator/current/fuse/configure.in
===================================================================
--- vendor/fuse-emulator/current/fuse/configure.in 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/configure.in 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $Id: configure.in 3253 2007-10-26 02:02:17Z zubzero $
+dnl $Id: configure.in 3429 2007-12-18 20:02:35Z zubzero $
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
@@ -24,7 +24,7 @@
AC_CANONICAL_SYSTEM
dnl Use automake to produce `Makefile.in'
-AM_INIT_AUTOMAKE(fuse, 0.8.0.1)
+AM_INIT_AUTOMAKE(fuse, 0.9.0)
dnl Checks for programs.
AC_PROG_CC
@@ -580,32 +580,31 @@
dnl Work out which standard routines we're missing
AC_MSG_CHECKING(which standard routines we're missing)
-COMPAT_LIBADD=''
missing_routines=''
if test "$ac_cv_func_dirname" = no; then
- COMPAT_LIBADD="$COMPAT_LIBADD"'dirname.$(OBJEXT) '
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_LIBADD="$COMPAT_LIBADD"'getopt.$(OBJEXT) getopt1.$(OBJEXT) '
+ 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
- COMPAT_LIBADD="$COMPAT_LIBADD"'mkstemp.$(OBJEXT) '
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)
-AC_SUBST(COMPAT_LIBADD)
dnl Work out which compatibility routines to use
AC_MSG_CHECKING(which compatibility routines to use)
@@ -624,6 +623,8 @@
;;
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?
@@ -663,7 +664,6 @@
fi
AC_OUTPUT(Makefile \
-compat/Makefile \
compat/amiga/Makefile \
compat/morphos/Makefile \
compat/unix/Makefile \
@@ -687,6 +687,7 @@
ui/sdl/Makefile \
ui/scaler/Makefile \
ui/win32/Makefile \
+ui/win32/icons/Makefile \
ui/xlib/Makefile \
widget/Makefile \
z80/Makefile \
Modified: vendor/fuse-emulator/current/fuse/disk/beta.c
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/beta.c 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/beta.c 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
/* beta.c: Routines for handling the Beta disk interface
Copyright (c) 2004-2007 Stuart Brady
- $Id: beta.c 3227 2007-10-23 14:11:20Z zubzero $
+ $Id: beta.c 3400 2007-12-04 18:24:31Z 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
@@ -56,32 +56,41 @@
int beta_available = 0;
int beta_active = 0;
+int beta_builtin = 0;
static int beta_index_pulse = 0;
#define BETA_NUM_DRIVES 4
-static int beta_datarq;
-static int beta_intrq;
-
static wd_fdc *beta_fdc;
static wd_fdc_drive beta_drives[ BETA_NUM_DRIVES ];
-void beta_reset( void );
+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_from_snapshot( libspectrum_snap *snap );
static void beta_to_snapshot( libspectrum_snap *snap );
static module_info_t beta_module_info = {
- NULL,
+ beta_reset,
beta_memory_map,
+ NULL, /* XXX: beta_enabled_snapshot */
beta_from_snapshot,
beta_to_snapshot,
};
-
void
beta_page( void )
{
@@ -107,24 +116,6 @@
memory_map_read[1] = memory_map_write[1] = memory_map_romcs[ 1 ];
}
-static void
-beta_set_intrq( wd_fdc *f )
-{
- beta_intrq = 1;
-}
-
-static void
-beta_set_datarq( wd_fdc *f )
-{
- beta_datarq = 1;
-}
-
-static void
-beta_reset_datarq( wd_fdc *f )
-{
- beta_datarq = 0;
-}
-
int
beta_init( void )
{
@@ -140,26 +131,32 @@
}
beta_fdc->dden = 1;
- beta_fdc->set_intrq = beta_set_intrq;
+ beta_fdc->set_intrq = NULL;
beta_fdc->reset_intrq = NULL;
- beta_fdc->set_datarq = beta_set_datarq;
- beta_fdc->reset_datarq = beta_reset_datarq;
+ beta_fdc->set_datarq = NULL;
+ beta_fdc->reset_datarq = NULL;
module_register( &beta_module_info );
return 0;
}
-void
-beta_reset( void )
+static void
+beta_reset( int hard_reset )
{
int i;
wd_fdc_drive *d;
- beta_active = 0;
-
event_remove_type( EVENT_TYPE_BETA_INDEX );
+ 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++ ) {
@@ -169,15 +166,37 @@
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_fdc->current_drive = &beta_drives[ 0 ];
machine_current->memory_map();
@@ -195,7 +214,7 @@
libspectrum_byte
beta_sr_read( libspectrum_word port GCC_UNUSED, int *attached )
{
- if( !beta_active ) return 0;
+ if( !beta_active ) return 0xff;
*attached = 1;
return wd_fdc_sr_read( beta_fdc );
@@ -212,7 +231,7 @@
libspectrum_byte
beta_tr_read( libspectrum_word port GCC_UNUSED, int *attached )
{
- if( !beta_active ) return 0;
+ if( !beta_active ) return 0xff;
*attached = 1;
return wd_fdc_tr_read( beta_fdc );
@@ -229,7 +248,7 @@
libspectrum_byte
beta_sec_read( libspectrum_word port GCC_UNUSED, int *attached )
{
- if( !beta_active ) return 0;
+ if( !beta_active ) return 0xff;
*attached = 1;
return wd_fdc_sec_read( beta_fdc );
@@ -246,7 +265,7 @@
libspectrum_byte
beta_dr_read( libspectrum_word port GCC_UNUSED, int *attached )
{
- if( !beta_active ) return 0;
+ if( !beta_active ) return 0xff;
*attached = 1;
return wd_fdc_dr_read( beta_fdc );
@@ -278,21 +297,19 @@
{
libspectrum_byte b;
- if( !beta_active ) return 0;
+ if( !beta_active ) return 0xff;
*attached = 1;
b = 0;
- if( beta_intrq )
+ if( beta_fdc->intrq )
b |= 0x80;
- if( beta_datarq )
+ if( beta_fdc->datarq )
b |= 0x40;
- beta_intrq = 0;
/* we should reset beta_datarq, but we first need to raise it for each byte
* transferred in wd_fdc.c */
-/* beta_datarq = 0; */
return b;
}
@@ -317,30 +334,50 @@
/* Abort the insert if we want to keep the current disk */
if( beta_disk_eject( which, 0 ) ) return 0;
}
- if( ( error = disk_open( &d->disk, filename, 0 ) != DISK_OK ) ) {
- ui_error( UI_ERROR_ERROR, "Failed to open disk image: %s",
- disk_strerror( d->disk.status ) );
- return 1;
+
+ 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( autoload ) {
+ if( filename && autoload ) {
PC = 0;
machine_current->ram.last_byte |= 0x10; /* Select ROM 1 */
beta_page();
@@ -350,16 +387,47 @@
}
int
-beta_disk_insert_default_autoload( beta_drive_number which,
- const char *filename )
+beta_disk_writeprotect( beta_drive_number which, int wrprot )
{
- return beta_disk_insert( which, filename, settings_current.auto_load );
+ 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;
@@ -377,8 +445,18 @@
if( d->disk.dirty ) {
+ 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;
+ }
+
ui_confirm_save_t confirm = ui_confirm_save(
- "Disk has been modified.\nDo you want to save it?"
+ "Disk in Beta drive %c: has been modified.\n"
+ "Do you want to save it?",
+ drive
);
switch( confirm ) {
@@ -434,13 +512,6 @@
}
int
-beta_event_cmd_done( libspectrum_dword last_tstates )
-{
- beta_fdc->status_register &= ~WD_FDC_SR_BUSY;
- return 0;
-}
-
-int
beta_event_index( libspectrum_dword last_tstates )
{
int error;
@@ -496,6 +567,7 @@
int attached;
wd_fdc *f = beta_fdc;
+ libspectrum_snap_set_beta_active( 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 ) );
Modified: vendor/fuse-emulator/current/fuse/disk/beta.h
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/beta.h 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/beta.h 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
/* beta.h: Routines for handling the Beta disk interface
Copyright (c) 2003-2004 Fredrick Meunier, Philip Kendall
- $Id: beta.h 3207 2007-10-19 20:04:47Z zubzero $
+ $Id: beta.h 3400 2007-12-04 18:24:31Z 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
@@ -30,9 +30,15 @@
#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 );
@@ -63,15 +69,11 @@
BETA_DRIVE_D,
} beta_drive_number;
-void beta_reset( void );
-
int beta_disk_insert( beta_drive_number which, const char *filename,
int autoload );
-int beta_disk_insert_default_autoload( beta_drive_number which,
- const char *filename );
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 );
-int beta_event_cmd_done( libspectrum_dword last_tstates );
int beta_event_index( libspectrum_dword last_tstates );
#endif /* #ifndef FUSE_BETA_H */
Modified: vendor/fuse-emulator/current/fuse/disk/disk.c
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/disk.c 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/disk.c 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
/* disk.c: Routines for handling disk images
Copyright (c) 2007 Gergely Szasz
- $Id: disk.c 3226 2007-10-23 14:01:20Z zubzero $
+ $Id: disk.c 3471 2008-01-05 18:14:15Z 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
@@ -25,6 +25,7 @@
#include <config.h>
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -458,7 +459,7 @@
}
static int
-calc_sectorlen( disk_t *d, int sector_length, int gap )
+calc_sectorlen( int mfm, int sector_length, int gap )
{
int len = 0;
disk_gap_t *g = &gaps[ gap ];
@@ -467,7 +468,7 @@
len += 7;
/*------------------------------ GAP II ------------------------------*/
len += g->len[2] + g->sync_len;
- if( d->density != DISK_SD )
+ if( mfm )
len += 3;
/*--------------------------------- data ---------------------------------*/
len += 1; /* DAM */
@@ -475,7 +476,7 @@
len += 2; /* CRC */
/*------------------------------ GAP III ------------------------------*/
len += g->len[3] + g->sync_len;
- if( d->density != DISK_SD )
+ if( mfm )
len += 3;
return len;
}
@@ -486,12 +487,13 @@
#define PREINDEX 1
static int
-trackgen( disk_t *d, FILE *file, int head, int track, int sector_base,
- int sectors, int sector_length, int preindex, int gap, int interleave,
- int autofill )
+trackgen( disk_t *d, FILE *file, int head, int track,
+ int sector_base, int sectors, int sector_length, int preindex,
+ int gap, int interleave, int autofill )
{
int i, s, pos;
- int slen = calc_sectorlen( d, sector_length, gap );
+ int slen = calc_sectorlen( ( d->density != DISK_SD && d->density != DISK_8_SD ),
+ sector_length, gap );
int idx;
d->i = 0;
@@ -524,10 +526,6 @@
void
disk_close( disk_t *d )
{
- if( d->filename != NULL ) {
- free( d->filename );
- d->filename = NULL;
- }
if( d->data != NULL ) {
free( d->data );
d->data = NULL;
@@ -548,17 +546,27 @@
if( d->density != DISK_DENS_AUTO ) {
d->bpt = disk_bpt[ d->density ];
- } else if( d->bpt > 12000 ) {
+ } else if( d->bpt > 13000 ) {
return d->status = DISK_UNSUP;
- } else if( d->bpt > 6000 ) {
+ } else if( d->bpt > 10600 ) {
+ d->density = DISK_HD;
d->bpt = disk_bpt[ DISK_HD ];
- } else if( d->bpt > 3000 ) {
+ } else if( d->bpt > 6500 ) {
+ d->density = DISK_8_DD;
+ d->bpt = disk_bpt[ DISK_8_DD ];
+ } else if( d->bpt > 5300 ) {
+ d->density = DISK_DD;
d->bpt = disk_bpt[ DISK_DD ];
+ } else if( d->bpt > 3250 ) {
+ d->density = DISK_8_SD;
+ d->bpt = disk_bpt[ DISK_8_SD ];
} else if( d->bpt > 0 ) {
+ d->density = DISK_SD;
d->bpt = disk_bpt[ DISK_SD ];
}
- d->tlen = d->bpt + d->bpt / 8 + ( d->bpt % 8 ? 1 : 0 );
+ if( d->bpt > 0 )
+ d->tlen = d->bpt + d->bpt / 8 + ( d->bpt % 8 ? 1 : 0 );
dlen = d->sides * d->cylinders * d->tlen; /* track len with clock marks */
if( ( d->data = calloc( 1, dlen ) ) == NULL )
@@ -586,8 +594,8 @@
if( disk_alloc( d ) != DISK_OK )
return d->status;
- d->filename = NULL;
-
+ d->wrprot = 0;
+ d->dirty = 0;
return d->status = DISK_OK;
}
@@ -611,7 +619,7 @@
static int
open_udi( FILE *file, disk_t *d )
{
- int i, bpt;
+ int i, j, bpt;
d->sides = head[10] + 1;
d->cylinders = head[9] + 1;
@@ -632,8 +640,15 @@
return d->status = DISK_OPEN;
}
+ if( d->bpt == 0 )
+ return d->status = DISK_GEOM;
+
+ bpt = d->bpt; /* save the maximal value */
+ d->tlen = bpt + bpt / 8 + ( bpt % 8 ? 1 : 0 );
+ d->bpt = 0; /* we know exactly the track len... */
if( disk_alloc( d ) != DISK_OK )
return d->status;
+ d->bpt = bpt; /* restore the maximal byte per track */
fseek( file, 16, SEEK_SET );
d->track = d->data;
@@ -644,8 +659,22 @@
if( head[0] != 0x00 )
return d->status = DISK_UNSUP;
/* read track + clocks */
- if( fread( d->track, bpt + bpt / 8 + ( bpt % 8 ? 1 : 0 ), 1, file ) != 1 )
- return d->status = DISK_OPEN;
+ if( d->bpt == bpt ) { /* if udi track length equal with the maximal track length */
+ if( fread( d->track, bpt + bpt / 8 + ( bpt % 8 ? 1 : 0 ), 1, file ) != 1 )
+ return d->status = DISK_OPEN;
+ } else {
+ if( fread( d->track, bpt , 1, file ) != 1 ) /* first the data */
+ return d->status = DISK_OPEN;
+ d->track += bpt;
+ for( j = d->bpt - bpt; j > 0; j--, d->track++ )
+ *d->track = 0x4e; /* fill track data with 0x4e */
+ if( fread( d->track, bpt / 8 + ( bpt % 8 ? 1 : 0 ), 1, file ) != 1 )
+ return d->status = DISK_OPEN; /* next the clock marks */
+ d->track += bpt / 8 + ( bpt % 8 ? 1 : 0 );
+ for( j = ( d->bpt / 8 + ( d->bpt % 8 ? 1 : 0 ) ) -
+ ( bpt / 8 + ( bpt % 8 ? 1 : 0 ) ); j > 0; j--, d->track++ )
+ *d->track = 0x00; /* fill the clocks with 0x00 */
+ }
d->track += d->tlen;
}
@@ -760,7 +789,8 @@
static int
open_fdi( FILE *file, disk_t *d, int preindex )
{
- int i, j, h, bpt, gap;
+ int i, j, h, gap;
+ int bpt, bpt_fm, max_bpt = 0, max_bpt_fm = 0;
int data_offset, track_offset, head_offset, sector_offset;
d->wrprot = head[0x03] == 1 ? 1 : 0;
@@ -776,29 +806,41 @@
fseek( file, head_offset, SEEK_SET );
if( fread( head, 7, 1, file ) != 1 ) /* 7 := track head */
return d->status = DISK_OPEN;
- bpt = 0;
+ bpt = bpt_fm = 0;
for( j = 0; j < head[0x06]; j++ ) { /* calculate track len */
if( j % 35 == 0 ) { /* 35-sector header */
if( fread( head + 7, 245, 1, file ) != 1 ) /* 7*35 := max 35 sector head */
return d->status = DISK_OPEN;
}
- if( ( head[ 0x0b + 7 * ( j % 35 ) ] & 0x3f ) != 0 )
- bpt += 0x80 << head[ 0x0a + 7 * ( j % 35 ) ];
+ if( ( head[ 0x0b + 7 * ( j % 35 ) ] & 0x3f ) != 0 ) {
+ bpt += calc_sectorlen( 1, 0x80 << head[ 0x0a + 7 * ( j % 35 ) ], GAP_MINIMAL_MFM );
+ bpt_fm += calc_sectorlen( 0, 0x80 << head[ 0x0a + 7 * ( j % 35 ) ], GAP_MINIMAL_FM );
+ }
}
+ if( bpt > max_bpt )
+ max_bpt = bpt;
+ if( bpt_fm > max_bpt_fm )
+ max_bpt_fm = bpt_fm;
- if( bpt > d->bpt )
- d->bpt = bpt;
-
head_offset += 7 + 7 * head[ 0x06 ];
}
+
+ if( max_bpt == 0 || max_bpt_fm == 0 )
+ return d->status = DISK_GEOM;
d->density = DISK_DENS_AUTO; /* disk_alloc use d->bpt */
+ if( max_bpt_fm < 3000 ) { /* we choose an SD disk with FM */
+ d->bpt = max_bpt_fm;
+ gap = GAP_MINIMAL_FM;
+ } else {
+ d->bpt = max_bpt;
+ gap = GAP_MINIMAL_MFM;
+ }
if( disk_alloc( d ) != DISK_OK )
return d->status;
/* start reading the tracks */
- gap = d->bpt <= 3000 ? GAP_MINIMAL_FM : GAP_MINIMAL_MFM;
-
+
head_offset = h; /* restore head start */
for( i = 0; i < d->cylinders * d->sides; i++ ) { /* ALT */
fseek( file, head_offset, SEEK_SET );
@@ -841,21 +883,33 @@
open_cpc( FILE *file, disk_t *d, disk_type_t type, int preindex )
{
int i, j, seclen, gap;
+ int bpt, max_bpt = 0, max_bpt_fm = 0;
d->sides = head[0x31];
d->cylinders = head[0x30];
if( type == DISK_CPC ) {
- d->bpt = head[0x32] + 256 * head[0x33] - 0x100;
+ max_bpt = calc_sectorlen( 1, head[0x32] + 256 * head[0x33] - 0x100, GAP_MINIMAL_MFM );
+ max_bpt_fm = calc_sectorlen( 0, head[0x32] + 256 * head[0x33] - 0x100, GAP_MINIMAL_FM );
} else {
d->bpt = 0;
- for( i = 0; i < d->sides * d->cylinders; i++ )
- if( head[ 0x34 + i ] > d->bpt )
- d->bpt = head[ 0x34 + i ];
- d->bpt <<= 8;
- d->bpt -= 0x100;
+ for( i = 0; i < d->sides * d->cylinders; i++ ) {
+ bpt = calc_sectorlen( 1, ( head[ 0x34 + i ] << 8 ) - 0x100, GAP_MINIMAL_MFM );
+ if( bpt > max_bpt )
+ max_bpt = bpt;
+ bpt = calc_sectorlen( 0, ( head[ 0x34 + i ] << 8 ) - 0x100, GAP_MINIMAL_FM );
+ if( bpt > max_bpt_fm )
+ max_bpt_fm = bpt;
+ }
}
+ if( max_bpt == 0 || max_bpt_fm == 0 )
+ return d->status = DISK_GEOM;
d->density = DISK_DENS_AUTO; /* disk_alloc use d->bpt */
+ if( max_bpt_fm < 3000 ) { /* we choose an SD disk with FM */
+ d->bpt = max_bpt_fm;
+ } else {
+ d->bpt = max_bpt;
+ }
if( disk_alloc( d ) != DISK_OK )
return d->status;
@@ -924,7 +978,7 @@
TR-DOS directory */
j = 0; /* index for head[] */
memset( head, 0, 256 );
- seclen = calc_sectorlen( d, 256, GAP_TRDOS ); /* one sector raw length */
+ seclen = calc_sectorlen( 1, 256, GAP_TRDOS ); /* one sector raw length */
for( i = 0; i < scl_files; i++ ) { /* read all entry and build TR-DOS dir */
if( fread( head + j, 14, 1, file ) != 1 )
return d->status = DISK_OPEN;
@@ -990,7 +1044,7 @@
static int
open_td0( FILE *file, disk_t *d, int preindex )
{
- int i, j, s, sectors, seclen, bpt, gap, mfm;
+ int i, j, s, sectors, seclen, bpt, gap, mfm, mfm_old;
int data_offset, track_offset, sector_offset;
unsigned char *buff;
@@ -998,7 +1052,7 @@
return d->status = DISK_IMPL; /* not implemented */
buff = NULL; /* we may use this buffer */
- mfm = head[5] & 0x80 ? 0 : 1; /* td0notes say: may older teledisk
+ mfm_old = head[5] & 0x80 ? 0 : 1; /* td0notes say: may older teledisk
indicate the SD on high bit of
data rate */
d->sides = head[9]; /* 1 or 2 */
@@ -1011,6 +1065,7 @@
/* determine the greatest track length */
d->bpt = 0;
d->cylinders = 0;
+ seclen = 0;
while( 1 ) {
fseek( file, track_offset, SEEK_SET );
if( fread( head, 1, 1, file ) != 1 )
@@ -1023,6 +1078,7 @@
d->cylinders = head[1] + 1;
bpt = 0;
sector_offset = track_offset + 4;
+ mfm = head[2] & 0x80 ? 0 : 1; /* 0x80 == 1 => SD track */
for( s = 0; s < sectors; s++ ) {
fseek( file, sector_offset, SEEK_SET );
if( fread( head, 6, 1, file ) != 1 )
@@ -1031,7 +1087,8 @@
if( fread( head + 6, 3, 1, file ) != 1 ) /* read data header */
return d->status = DISK_OPEN;
- bpt += 0x80 << head[3];
+ bpt += calc_sectorlen( mfm_old || mfm, 0x80 << head[3],
+ mfm_old || mfm ? GAP_MINIMAL_FM : GAP_MINIMAL_MFM );
if( head[3] > seclen )
seclen = head[3]; /* biggest sector */
sector_offset += head[6] + 256 * head[7] - 1;
@@ -1043,6 +1100,9 @@
track_offset = sector_offset;
}
+ if( d->bpt == 0 )
+ return d->status = DISK_GEOM;
+
d->density = DISK_DENS_AUTO;
if( disk_alloc( d ) != DISK_OK )
return d->status;
@@ -1066,7 +1126,7 @@
d->clocks = d->track + d->bpt;
d->i = 0;
/* later teledisk -> if head[2] & 0x80 -> FM track */
- gap = mfm == 0 || head[2] & 0x80 ? GAP_MINIMAL_FM : GAP_MINIMAL_MFM;
+ gap = mfm_old || head[2] & 0x80 ? GAP_MINIMAL_FM : GAP_MINIMAL_MFM;
postindex_add( d, gap );
for( s = 0; s < sectors; s++ ) {
@@ -1249,6 +1309,8 @@
if( access( filename, W_OK ) == -1 ) /* file read only */
d->wrprot = 1;
+ else
+ d->wrprot = 0;
switch ( type ) {
case DISK_UDI:
@@ -1287,14 +1349,9 @@
fclose( file );
return d->status;
}
- if( ( d->filename = malloc( strlen( filename ) + 1 ) ) == NULL ) {
- free( d->data );
- fclose( file );
- return d->status = DISK_MEM;
- }
fclose( file );
- strcpy( d->filename, filename );
d->type = type;
+ d->dirty = 0;
return d->status = DISK_OK;
}
Modified: vendor/fuse-emulator/current/fuse/disk/disk.h
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/disk.h 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/disk.h 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
/* fdd.h: Header for handling raw disk images
Copyright (c) 2007 Gergely Szasz
- $Id: disk.h 3207 2007-10-19 20:04:47Z zubzero $
+ $Id: disk.h 3459 2008-01-02 16:40: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
@@ -74,16 +74,14 @@
typedef enum disk_dens_t {
DISK_DENS_AUTO = 0,
- DISK_8_SD, /* 8" SD floppy 5208 */
+ DISK_8_SD, /* 8" SD floppy 5208 MF */
DISK_8_DD, /* 8" DD floppy 10416 */
- DISK_SD, /* 3125 bpt */
+ DISK_SD, /* 3125 bpt MF */
DISK_DD, /* 6250 bpt */
DISK_HD, /* 12500 bpt*/
} disk_dens_t;
typedef struct disk_t {
- char *filename;
-
int sides; /* 1 or 2 */
int cylinders; /* tracks per side */
int bpt; /* bytes per track */
Modified: vendor/fuse-emulator/current/fuse/disk/fdd.c
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/fdd.c 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/fdd.c 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
/* fdd.c: Routines for emulating floppy disk drives
Copyright (c) 2007 Gergely Szasz
- $Id: fdd.c 3218 2007-10-21 23:25:23Z zubzero $
+ $Id: fdd.c 3312 2007-11-19 22:02:14Z 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
@@ -203,6 +203,15 @@
}
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->loaded )
Modified: vendor/fuse-emulator/current/fuse/disk/fdd.h
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/fdd.h 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/fdd.h 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
/* fdd.h: Header for handling raw disk images
Copyright (c) 2007 Gergely Szasz
- $Id: fdd.h 3204 2007-10-19 15:52:05Z zubzero $
+ $Id: fdd.h 3312 2007-11-19 22:02:14Z 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
@@ -103,6 +103,8 @@
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 );
Modified: vendor/fuse-emulator/current/fuse/disk/plusd.c
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/plusd.c 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/plusd.c 2008-02-14 12:06:55 UTC (rev 475)
@@ -2,7 +2,7 @@
Copyright (c) 1999-2007 Stuart Brady, Fredrick Meunier, Philip Kendall,
Dmitry Sanarin, Darren Salt
- $Id: plusd.c 3222 2007-10-22 22:08:50Z zubzero $
+ $Id: plusd.c 3398 2007-12-04 12:53:15Z 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
@@ -30,6 +30,8 @@
#include <libspectrum.h>
+#include <string.h>
+
#include "compat.h"
#include "machine.h"
#include "module.h"
@@ -53,6 +55,7 @@
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 );
@@ -60,11 +63,14 @@
plusd_reset,
plusd_memory_map,
+ plusd_enabled_snapshot,
plusd_from_snapshot,
plusd_to_snapshot,
};
+static libspectrum_byte plusd_control_register;
+
void
plusd_page( void )
{
@@ -166,6 +172,7 @@
memory_map_romcs[ 1 ].writable = 1;
plusd_available = 1;
+ plusd_active = 1;
plusd_index_pulse = 0;
if( hard_reset )
@@ -183,8 +190,12 @@
/* 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 ];
machine_current->memory_map();
@@ -275,6 +286,8 @@
if( !plusd_available ) return;
+ plusd_control_register = b;
+
drive = ( b & 0x03 ) == 2 ? 1 : 0;
side = ( b & 0x80 ) ? 1 : 0;
@@ -331,13 +344,6 @@
}
int
-plusd_disk_insert_default_autoload( plusd_drive_number which,
- const char *filename )
-{
- return plusd_disk_insert( which, filename, settings_current.auto_load );
-}
-
-int
plusd_disk_insert( plusd_drive_number which, const char *filename,
int autoload )
{
@@ -357,24 +363,40 @@
/* Abort the insert if we want to keep the current disk */
if( plusd_disk_eject( which, 0 ) ) return 0;
}
- if( ( error = disk_open( &d->disk, filename, 0 ) != DISK_OK ) ) {
- ui_error( UI_ERROR_ERROR, "Failed to open disk image: %s",
- disk_strerror( error ) );
- return 1;
+
+ 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( autoload ) {
+ if( filename && autoload ) {
/* XXX */
}
@@ -403,7 +425,9 @@
if( d->disk.dirty ) {
ui_confirm_save_t confirm = ui_confirm_save(
- "Disk has been modified.\nDo you want to save it?"
+ "Disk in +D drive %c has been modified.\n"
+ "Do you want to save it?",
+ which == PLUSD_DRIVE_1 ? '1' : '2'
);
switch( confirm ) {
@@ -435,6 +459,35 @@
}
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 ];
@@ -477,14 +530,93 @@
return 0;
}
+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_from_snapshot( libspectrum_snap *snap GCC_UNUSED )
+plusd_enabled_snapshot( libspectrum_snap *snap )
{
- /* XXX */
+ 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 ) ) {
+ memory_map_romcs[0].offset = 0;
+ memory_map_romcs[0].page_num = 0;
+ memory_map_romcs[0].page =
+ memory_pool_allocate( MEMORY_PAGE_SIZE * sizeof( libspectrum_byte ) );
+ if( !memory_map_romcs[0].page ) {
+ ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ );
+ return;
+ }
+ memory_map_romcs[0].source = MEMORY_SOURCE_CUSTOMROM;
+
+ memcpy( memory_map_romcs[0].page, libspectrum_snap_plusd_rom( snap, 0 ),
+ MEMORY_PAGE_SIZE );
+ }
+
+ 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 )
{
- /* XXX */
+ 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 );
}
Modified: vendor/fuse-emulator/current/fuse/disk/plusd.h
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/plusd.h 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/plusd.h 2008-02-14 12:06:55 UTC (rev 475)
@@ -1,7 +1,7 @@
/* plusd.h: Routines for handling the +D interface
Copyright (c) 2005-2007 Stuart Brady
- $Id: plusd.h 3205 2007-10-19 16:37:27Z zubzero $
+ $Id: plusd.h 3313 2007-11-19 23:35:38Z 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
@@ -74,10 +74,9 @@
int plusd_disk_insert( plusd_drive_number which, const char *filename,
int autoload );
-int plusd_disk_insert_default_autoload( plusd_drive_number which,
- const char *filename );
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 );
int plusd_event_index( libspectrum_dword last_tstates );
#endif /* #ifndef FUSE_PLUSD_H */
Modified: vendor/fuse-emulator/current/fuse/disk/wd_fdc.c
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/wd_fdc.c 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/wd_fdc.c 2008-02-14 12:06:55 UTC (rev 475)
@@ -2,7 +2,7 @@
Copyright (c) 2002-2007 Stuart Brady, Fredrick Meunier, Philip Kendall,
Dmitry Sanarin, Gergely Szasz
- $Id: wd_fdc.c 3228 2007-10-23 14:40:05Z zubzero $
+ $Id: wd_fdc.c 3389 2007-12-03 12:54:17Z 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
@@ -56,6 +56,7 @@
f->direction = 0;
f->head_load = 0;
f->intrq = 0;
+ f->datarq = 0;
f->state = WD_FDC_STATE_NONE;
f->status_type = WD_FDC_STATUS_TYPE1;
@@ -144,8 +145,9 @@
void
wd_fdc_set_datarq( wd_fdc *f )
{
- if( !( f->status_register & WD_FDC_SR_IDX_DRQ ) ) {
+ if( f->datarq != 1 ) {
f->status_register |= WD_FDC_SR_IDX_DRQ;
+ f->datarq = 1;
if( f->set_datarq ) f->set_datarq( f );
}
}
@@ -153,8 +155,9 @@
void
wd_fdc_reset_datarq( wd_fdc *f )
{
- if( f->status_register & WD_FDC_SR_IDX_DRQ ) {
+ if( f->datarq == 1 ) {
f->status_register &= ~WD_FDC_SR_IDX_DRQ;
+ f->datarq = 0;
if( f->reset_datarq ) f->reset_datarq( f );
}
}
@@ -572,7 +575,9 @@
f->rev = 5;
read_id( f );
if( f->id_mark == WD_FDC_AM_NONE ) {
+ f->state = WD_FDC_STATE_NONE;
f->status_register |= WD_FDC_SR_RNF;
+ f->status_register &= ~WD_FDC_SR_BUSY;
wd_fdc_set_intrq( f );
return;
}
Modified: vendor/fuse-emulator/current/fuse/disk/wd_fdc.h
===================================================================
--- vendor/fuse-emulator/current/fuse/disk/wd_fdc.h 2008-02-14 11:33:39 UTC (rev 474)
+++ vendor/fuse-emulator/current/fuse/disk/wd_fdc.h 2008-02-14 12:06:55 UTC (rev 475)
@@ -2,7 +2,7 @@
Copyright (c) 2003-2007 Stuart Brady, Fredrick Meunier, Philip Kendall,
Gergely Szasz
- $Id: wd_fdc.h 3222 2007-10-22 22:08:50Z zubzero $
+ $Id: wd_fdc.h 3306 2007-11-19 17:53:10Z 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
@@ -72,6 +72,7 @@
fdd_dir_t directi...
[truncated message content] |