fuse-for-macosx-commits Mailing List for Fuse for macOS (Page 7)
Brought to you by:
fredm
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(9) |
Dec
(31) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(24) |
Feb
(11) |
Mar
(6) |
Apr
(48) |
May
(9) |
Jun
(38) |
Jul
(33) |
Aug
(15) |
Sep
|
Oct
(3) |
Nov
(6) |
Dec
(3) |
2008 |
Jan
|
Feb
(24) |
Mar
(11) |
Apr
(22) |
May
(7) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(3) |
Nov
(18) |
Dec
(23) |
2009 |
Jan
(16) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
(7) |
Jul
(4) |
Aug
(11) |
Sep
(9) |
Oct
|
Nov
(3) |
Dec
(2) |
2010 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(2) |
May
(8) |
Jun
|
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(9) |
Nov
|
Dec
(8) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(2) |
Dec
|
2012 |
Jan
(4) |
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(10) |
Nov
(13) |
Dec
(11) |
2013 |
Jan
(4) |
Feb
(1) |
Mar
(8) |
Apr
(8) |
May
(16) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2014 |
Jan
|
Feb
(6) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2015 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(10) |
Jun
(9) |
Jul
(6) |
Aug
(5) |
Sep
(3) |
Oct
(6) |
Nov
(5) |
Dec
|
From: <fr...@us...> - 2012-02-26 12:10:47
|
Revision: 688 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=688&view=rev Author: fredm Date: 2012-02-26 12:10:41 +0000 (Sun, 26 Feb 2012) Log Message: ----------- Correct file name. Added Paths: ----------- trunk/fuse/fusepb/resources/Fuse Help/html/disciple.html Removed Paths: ------------- trunk/fuse/fusepb/resources/Fuse Help/html/discovery.html Copied: trunk/fuse/fusepb/resources/Fuse Help/html/disciple.html (from rev 687, trunk/fuse/fusepb/resources/Fuse Help/html/discovery.html) =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/disciple.html (rev 0) +++ trunk/fuse/fusepb/resources/Fuse Help/html/disciple.html 2012-02-26 12:10:41 UTC (rev 688) @@ -0,0 +1,57 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> + <meta http-equiv="content-type" + content="text/html; charset=ISO-8859-1"> +<!-- AppleSegStart="DISCiPLE Emulation" --> + <title>DISCiPLE Emulation</title> +</head> +<body> +<font face="Lucida Grande,Helvetica,Arial"><a name="+D EMULATION"></a><!-- AppleSegDescription="This section describes the +D interface emulation in Fuse." --></font> +<div class="refsect1" xml:lang="en" lang="en"> +<h2><font face="Lucida Grande,Helvetica,Arial">DISCiPLE Emulation</font></h2> +</div> +<p> +<font face="Lucida Grande,Helvetica,Arial">Fuse supports emulating the +DISCiPLE disk and printer interface, although it does not currently +support emulation of the Sinclair Network, or support emulation of a +DISCiPLE attached to a 128K machine. See the <font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>DISK +FILE FORMATS</em></span></font> +section for more details on supported disk file formats, which are the +same as for +D emulation.</font><font + face="Lucida Grande,Helvetica,Arial"> The DISCiPLE's printer port is +emulated. (See the +</font><font face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>PRINTER +EMULATION</em></span></font><font face="Lucida Grande,Helvetica,Arial"> +section for more details.) The DISCiPLE may only be used with 48K +emulation at present. To access disks, you will first need to +load GDOS, by inserting a disk containing the DOS file (SYS) and +entering "RUN". Once DOS is +loaded, you can load to/from DISCiPLE disks by prefixing filenames with +<span style="font-style: italic;">`d n</span>' where <span + style="font-style: italic;">` n '</span> is the number of the drive in +use. For example, `LOAD d1;"myfile"' would load the file named +`myfile' from the emulated drive 1. Microdrive syntax may also be used.</font></p> +<p><font face="Lucida Grande,Helvetica,Arial">To save a snapshot, +choose the `Machine, NMI' menu option, and then +press `4' to save a 48K snapshot, or `5' to save a 128K snapshot.</font></p> +<p><font face="Lucida Grande,Helvetica,Arial">When saving a 128K +snapshot, you must then press Y or N to indicate +whether the screen changed while saving the snapshot, to finish +saving. You can also choose `3' to save a screenshot to disk.</font></p> +<p><font face="Lucida Grande,Helvetica,Arial">Options `1' and `2' allow +screenshots to be printed (in monochrome) if +printer emulation is enabled.<br> +</font></p> +<p><font face="Lucida Grande,Helvetica,Arial">Note that GDOS on the +DISCiPLE contains a bug which causes corruption in any saved snapshots, +and incorrect restoration of saved snapshots, even if saved on a ++D. This bug is not present in G+DOS on the +D. (Note: this +was caused by saving/restoring the AF register twice in the NMI +handler, where both AF and the AF' shadow register should have been +saved/restored.)<br> +</font></p> +<!-- AppleSegEnd --> +</body> +</html> Deleted: trunk/fuse/fusepb/resources/Fuse Help/html/discovery.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/discovery.html 2012-02-26 12:08:34 UTC (rev 687) +++ trunk/fuse/fusepb/resources/Fuse Help/html/discovery.html 2012-02-26 12:10:41 UTC (rev 688) @@ -1,57 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <meta http-equiv="content-type" - content="text/html; charset=ISO-8859-1"> -<!-- AppleSegStart="DISCiPLE Emulation" --> - <title>DISCiPLE Emulation</title> -</head> -<body> -<font face="Lucida Grande,Helvetica,Arial"><a name="+D EMULATION"></a><!-- AppleSegDescription="This section describes the +D interface emulation in Fuse." --></font> -<div class="refsect1" xml:lang="en" lang="en"> -<h2><font face="Lucida Grande,Helvetica,Arial">DISCiPLE Emulation</font></h2> -</div> -<p> -<font face="Lucida Grande,Helvetica,Arial">Fuse supports emulating the -DISCiPLE disk and printer interface, although it does not currently -support emulation of the Sinclair Network, or support emulation of a -DISCiPLE attached to a 128K machine. See the <font - face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>DISK -FILE FORMATS</em></span></font> -section for more details on supported disk file formats, which are the -same as for +D emulation.</font><font - face="Lucida Grande,Helvetica,Arial"> The DISCiPLE's printer port is -emulated. (See the -</font><font face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>PRINTER -EMULATION</em></span></font><font face="Lucida Grande,Helvetica,Arial"> -section for more details.) The DISCiPLE may only be used with 48K -emulation at present. To access disks, you will first need to -load GDOS, by inserting a disk containing the DOS file (SYS) and -entering "RUN". Once DOS is -loaded, you can load to/from DISCiPLE disks by prefixing filenames with -<span style="font-style: italic;">`d n</span>' where <span - style="font-style: italic;">` n '</span> is the number of the drive in -use. For example, `LOAD d1;"myfile"' would load the file named -`myfile' from the emulated drive 1. Microdrive syntax may also be used.</font></p> -<p><font face="Lucida Grande,Helvetica,Arial">To save a snapshot, -choose the `Machine, NMI' menu option, and then -press `4' to save a 48K snapshot, or `5' to save a 128K snapshot.</font></p> -<p><font face="Lucida Grande,Helvetica,Arial">When saving a 128K -snapshot, you must then press Y or N to indicate -whether the screen changed while saving the snapshot, to finish -saving. You can also choose `3' to save a screenshot to disk.</font></p> -<p><font face="Lucida Grande,Helvetica,Arial">Options `1' and `2' allow -screenshots to be printed (in monochrome) if -printer emulation is enabled.<br> -</font></p> -<p><font face="Lucida Grande,Helvetica,Arial">Note that GDOS on the -DISCiPLE contains a bug which causes corruption in any saved snapshots, -and incorrect restoration of saved snapshots, even if saved on a -+D. This bug is not present in G+DOS on the +D. (Note: this -was caused by saving/restoring the AF register twice in the NMI -handler, where both AF and the AF' shadow register should have been -saved/restored.)<br> -</font></p> -<!-- AppleSegEnd --> -</body> -</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-02-26 12:08:44
|
Revision: 687 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=687&view=rev Author: fredm Date: 2012-02-26 12:08:34 +0000 (Sun, 26 Feb 2012) Log Message: ----------- Merge up to vendor revision 4620. TODO: pokemem dialog. Revision Links: -------------- http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=4620&view=rev Modified Paths: -------------- trunk/FuseGenerator/FuseGenerator.xcodeproj/project.pbxproj trunk/FuseGenerator/libspectrum.h trunk/FuseImporter/FuseImporter.xcodeproj/project.pbxproj trunk/FuseImporter/libspectrum.h trunk/audiofile/audiofile.xcodeproj/project.pbxproj trunk/fuse/AUTHORS trunk/fuse/ChangeLog trunk/fuse/Makefile.am trunk/fuse/README trunk/fuse/bitmap.h trunk/fuse/compat/amiga/Makefile.am trunk/fuse/compat/morphos/Makefile.am trunk/fuse/compat/unix/Makefile.am trunk/fuse/compat/unix/file.c trunk/fuse/compat/wii/Makefile.am trunk/fuse/compat/win32/Makefile.am trunk/fuse/compat/win32/timer.c trunk/fuse/compat.h trunk/fuse/configure.in trunk/fuse/debugger/breakpoint.c trunk/fuse/debugger/breakpoint.h trunk/fuse/debugger/commandl.l trunk/fuse/debugger/commandy.y trunk/fuse/debugger/debugger.c trunk/fuse/debugger/debugger_internals.h trunk/fuse/debugger/disassemble.c trunk/fuse/debugger/event.c trunk/fuse/display.c trunk/fuse/event.c trunk/fuse/fuse.c trunk/fuse/fusepb/Credits.html trunk/fuse/fusepb/English.lproj/InfoPlist.strings trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj trunk/fuse/fusepb/FuseMenus.m trunk/fuse/fusepb/Info-Fuse.plist trunk/fuse/fusepb/config.h trunk/fuse/fusepb/controllers/DebuggerController.m trunk/fuse/fusepb/controllers/FuseController.h trunk/fuse/fusepb/controllers/FuseController.m trunk/fuse/fusepb/controllers/PokeFinderController.m trunk/fuse/fusepb/controllers/PreferencesController.h trunk/fuse/fusepb/controllers/PreferencesController.m trunk/fuse/fusepb/libspectrum.h trunk/fuse/fusepb/models/Emulator.h trunk/fuse/fusepb/models/Emulator.m trunk/fuse/fusepb/resources/Fuse Help/html/about.html trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html trunk/fuse/fusepb/resources/Fuse Help/html/formats.html trunk/fuse/fusepb/resources/Fuse Help/html/machine.html trunk/fuse/fusepb/resources/Fuse Help/html/menus.html trunk/fuse/fusepb/resources/Fuse Help/html/monitor.html trunk/fuse/fusepb/resources/Fuse Help/html/peripherals.html trunk/fuse/fusepb/resources/Fuse Help/html/printer.html trunk/fuse/fusepb/resources/Fuse Help/html/tocstart.html trunk/fuse/fusepb/views/DisplayOpenGLView.h trunk/fuse/fusepb/views/DisplayOpenGLView.m trunk/fuse/fusepb/xibs/PokeFinder.xib trunk/fuse/fusepb/xibs/Preferences.xib trunk/fuse/hacking/ChangeLog trunk/fuse/hacking/tc2048_tech_notes.txt trunk/fuse/input.c trunk/fuse/keyboard.c trunk/fuse/keysyms.pl trunk/fuse/machine.c trunk/fuse/machine.h trunk/fuse/machines/Makefile.am trunk/fuse/machines/pentagon.c trunk/fuse/machines/pentagon.h trunk/fuse/machines/pentagon1024.c trunk/fuse/machines/pentagon512.c trunk/fuse/machines/scorpion.c trunk/fuse/machines/spec128.c trunk/fuse/machines/spec128.h trunk/fuse/machines/spec16.c trunk/fuse/machines/spec48.c trunk/fuse/machines/spec48.h trunk/fuse/machines/spec48_ntsc.c trunk/fuse/machines/spec_se.c trunk/fuse/machines/specplus2.c trunk/fuse/machines/specplus2a.c trunk/fuse/machines/specplus3.c trunk/fuse/machines/specplus3.h trunk/fuse/machines/specplus3e.c trunk/fuse/machines/tc2048.c trunk/fuse/machines/tc2068.c trunk/fuse/machines/tc2068.h trunk/fuse/machines/ts2068.c trunk/fuse/man/fuse.1 trunk/fuse/memory.c trunk/fuse/memory.h trunk/fuse/mempool.c trunk/fuse/mempool.h trunk/fuse/menu.c trunk/fuse/menu.h trunk/fuse/menu_data.dat trunk/fuse/periph.c trunk/fuse/periph.h trunk/fuse/pokefinder/Makefile.am trunk/fuse/roms/Makefile.am trunk/fuse/roms/README.copyright trunk/fuse/rzx.c trunk/fuse/screenshot.c trunk/fuse/screenshot.h trunk/fuse/settings.dat trunk/fuse/settings.pl trunk/fuse/snapshot.c trunk/fuse/sound/blipbuffer.c trunk/fuse/sound.c trunk/fuse/sound.h trunk/fuse/spectrum.c trunk/fuse/tape.c trunk/fuse/ui/cocoa/cocoaui.m trunk/fuse/ui/cocoa/options-header.pl trunk/fuse/ui/cocoa/options.pl trunk/fuse/ui/fb/fbdisplay.c trunk/fuse/ui/fb/fbjoystick.c trunk/fuse/ui/fb/fbui.c trunk/fuse/ui/gtk/Makefile.am trunk/fuse/ui/gtk/debugger.c trunk/fuse/ui/gtk/fileselector.c trunk/fuse/ui/gtk/gtkdisplay.c trunk/fuse/ui/gtk/gtkinternals.h trunk/fuse/ui/gtk/gtkjoystick.c trunk/fuse/ui/gtk/gtkui.c trunk/fuse/ui/gtk/options-header.pl trunk/fuse/ui/gtk/options.pl trunk/fuse/ui/gtk/picture.c trunk/fuse/ui/gtk/pokefinder.c trunk/fuse/ui/gtk/statusbar.c trunk/fuse/ui/options.dat trunk/fuse/ui/sdl/sdldisplay.c trunk/fuse/ui/sdl/sdljoystick.c trunk/fuse/ui/sdl/sdlui.c trunk/fuse/ui/svga/svgajoystick.c trunk/fuse/ui/svga/svgaui.c trunk/fuse/ui/ui.h trunk/fuse/ui/uijoystick.c trunk/fuse/ui/widget/Makefile.am trunk/fuse/ui/widget/debugger.c trunk/fuse/ui/widget/filesel.c trunk/fuse/ui/widget/menu.c trunk/fuse/ui/widget/options-header.pl trunk/fuse/ui/widget/options.pl trunk/fuse/ui/widget/pokefinder.c trunk/fuse/ui/widget/widget.c trunk/fuse/ui/widget/widget.h trunk/fuse/ui/widget/widget_internals.h trunk/fuse/ui/win32/Makefile.am trunk/fuse/ui/win32/debugger.c trunk/fuse/ui/win32/debugger.rc trunk/fuse/ui/win32/installer/fuse.nsi trunk/fuse/ui/win32/options-header.pl trunk/fuse/ui/win32/options-resource.pl trunk/fuse/ui/win32/options.pl trunk/fuse/ui/win32/picture.c trunk/fuse/ui/win32/pokefinder.c trunk/fuse/ui/win32/pokefinder.rc trunk/fuse/ui/win32/statusbar.c trunk/fuse/ui/win32/win32display.c trunk/fuse/ui/win32/win32internals.h trunk/fuse/ui/win32/win32joystick.c trunk/fuse/ui/win32/win32joystick.rc trunk/fuse/ui/win32/win32ui.c trunk/fuse/ui/xlib/xdisplay.c trunk/fuse/ui/xlib/xjoystick.c trunk/fuse/ui.c trunk/fuse/unittests/unittests.c trunk/fuse/unittests/unittests.h trunk/fuse/utils.c trunk/fuse/utils.h trunk/fuse/windres.rc trunk/fuse/z80/coretest.c trunk/fuse/z80/z80.c trunk/fuse/z80/z80_checks.h trunk/fuse/z80/z80_ops.c trunk/libspectrum/config.h trunk/libspectrum/libspectrum/ChangeLog trunk/libspectrum/libspectrum/Makefile.am trunk/libspectrum/libspectrum/README trunk/libspectrum/libspectrum/accessor.pl trunk/libspectrum/libspectrum/configure.in trunk/libspectrum/libspectrum/doc/libspectrum.3 trunk/libspectrum/libspectrum/doc/libspectrum.txt trunk/libspectrum/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum/internals.h trunk/libspectrum/libspectrum/libspectrum.c trunk/libspectrum/libspectrum/libspectrum.h.in trunk/libspectrum/libspectrum/make-perl.c trunk/libspectrum/libspectrum/myglib/garray.c trunk/libspectrum/libspectrum/myglib/ghash.c trunk/libspectrum/libspectrum/rzx.c trunk/libspectrum/libspectrum/sna.c trunk/libspectrum/libspectrum/snap_accessors.txt trunk/libspectrum/libspectrum/snapshot.c trunk/libspectrum/libspectrum/szx.c trunk/libspectrum/libspectrum/tap.c trunk/libspectrum/libspectrum/tape.c trunk/libspectrum/libspectrum/tape_accessors.txt trunk/libspectrum/libspectrum/tape_block.c trunk/libspectrum/libspectrum/tape_block.h trunk/libspectrum/libspectrum/test/Makefile.am trunk/libspectrum/libspectrum/test/test.c trunk/libspectrum/libspectrum/test/test15.c trunk/libspectrum/libspectrum/tzx_read.c trunk/libspectrum/libspectrum/tzx_write.c trunk/libspectrum/libspectrum/warajevo_read.c trunk/libspectrum/libspectrum/wav.c trunk/libspectrum/libspectrum/z80.c trunk/libspectrum/libspectrum.h trunk/libspectrum/libspectrum.xcodeproj/project.pbxproj Added Paths: ----------- trunk/fuse/compat/unix/tuntap.c trunk/fuse/fusepb/resources/Fuse Help/html/discovery.html trunk/fuse/machines/machines_periph.c trunk/fuse/machines/machines_periph.h trunk/fuse/peripherals/ trunk/fuse/pokefinder/pokemem.c trunk/fuse/pokefinder/pokemem.h trunk/fuse/roms/speccyboot-1.4.rom trunk/fuse/ui/gtk/pokemem.c trunk/fuse/ui/widget/pokemem.c trunk/fuse/ui/win32/about.c trunk/fuse/ui/win32/about.h trunk/fuse/ui/win32/about.rc trunk/fuse/ui/win32/fuse.manifest.in trunk/fuse/ui/win32/hyperlinks.c trunk/fuse/ui/win32/hyperlinks.h trunk/fuse/ui/win32/pokemem.c trunk/fuse/ui/win32/pokemem.h trunk/fuse/ui/win32/pokemem.rc trunk/libspectrum/libspectrum/pzx_read.c trunk/libspectrum/libspectrum/utilities.c Removed Paths: ------------- trunk/fuse/ay.c trunk/fuse/ay.h trunk/fuse/dck.c trunk/fuse/dck.h trunk/fuse/disk/ trunk/fuse/fuller.c trunk/fuse/fuller.h trunk/fuse/ide/ trunk/fuse/if1.c trunk/fuse/if1.h trunk/fuse/if2.c trunk/fuse/if2.h trunk/fuse/joystick.c trunk/fuse/joystick.h trunk/fuse/kempmouse.c trunk/fuse/kempmouse.h trunk/fuse/melodik.c trunk/fuse/melodik.h trunk/fuse/printer.c trunk/fuse/printer.h trunk/fuse/scld.c trunk/fuse/scld.h trunk/fuse/ula.c trunk/fuse/ula.h Property Changed: ---------------- trunk/fuse/ trunk/libspectrum/libspectrum/ Modified: trunk/FuseGenerator/FuseGenerator.xcodeproj/project.pbxproj =================================================================== --- trunk/FuseGenerator/FuseGenerator.xcodeproj/project.pbxproj 2012-02-15 12:43:47 UTC (rev 686) +++ trunk/FuseGenerator/FuseGenerator.xcodeproj/project.pbxproj 2012-02-26 12:08:34 UTC (rev 687) @@ -55,6 +55,8 @@ B6D30B480D16533C0036CC54 /* AttributeManager.c in Sources */ = {isa = PBXBuildFile; fileRef = B6D30B3E0D16533C0036CC54 /* AttributeManager.c */; }; B6D30B4C0D1653510036CC54 /* ColourMacros.c in Sources */ = {isa = PBXBuildFile; fileRef = B6D30B4A0D1653510036CC54 /* ColourMacros.c */; }; B6D30B510D1653730036CC54 /* JWSpectrumScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = B6D30B4F0D1653730036CC54 /* JWSpectrumScreen.m */; }; + B6E1F13B14F511DA00600EB0 /* pzx_read.c in Sources */ = {isa = PBXBuildFile; fileRef = B6E1F13A14F511DA00600EB0 /* pzx_read.c */; }; + B6E1F13D14F511F000600EB0 /* utilities.c in Sources */ = {isa = PBXBuildFile; fileRef = B6E1F13C14F511F000600EB0 /* utilities.c */; }; C86B05270671AA6E00DD9006 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C86B05260671AA6E00DD9006 /* CoreServices.framework */; }; F28CFBFD0A3EC0AF000ABFF5 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28CFBFC0A3EC0AF000ABFF5 /* ApplicationServices.framework */; }; F28CFC030A3EC0C6000ABFF5 /* QuickLook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F28CFC020A3EC0C6000ABFF5 /* QuickLook.framework */; }; @@ -163,6 +165,8 @@ B6D30B4F0D1653730036CC54 /* JWSpectrumScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JWSpectrumScreen.m; path = JWSpectrumScreen/JWSpectrumScreen.m; sourceTree = "<group>"; }; B6D30B520D1653920036CC54 /* JWSpectrumScreenConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JWSpectrumScreenConstants.h; path = JWSpectrumScreen/JWSpectrumScreenConstants.h; sourceTree = "<group>"; }; B6D30B530D1653920036CC54 /* PixelData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PixelData.h; path = JWSpectrumScreen/PixelData.h; sourceTree = "<group>"; }; + B6E1F13A14F511DA00600EB0 /* pzx_read.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pzx_read.c; path = ../../libspectrum/libspectrum/pzx_read.c; sourceTree = "<group>"; }; + B6E1F13C14F511F000600EB0 /* utilities.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = utilities.c; path = ../../libspectrum/libspectrum/utilities.c; sourceTree = "<group>"; }; C86B05260671AA6E00DD9006 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = "<absolute>"; }; F28CFBFC0A3EC0AF000ABFF5 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; }; F28CFC020A3EC0C6000ABFF5 /* QuickLook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickLook.framework; path = /System/Library/Frameworks/QuickLook.framework; sourceTree = "<absolute>"; }; @@ -258,6 +262,7 @@ B67F1E7A0E93A3AF00246616 /* memory.c */, B6D30AF70D16288A0036CC54 /* microdrive.c */, B6D30AF90D1628A10036CC54 /* plusd.c */, + B6E1F13A14F511DA00600EB0 /* pzx_read.c */, B6D30AFB0D1628DB0036CC54 /* rzx.c */, B6D30AFC0D1628DB0036CC54 /* sna.c */, B6D30AFF0D1628F20036CC54 /* snapshot.c */, @@ -272,6 +277,7 @@ B6D30B110D16298C0036CC54 /* timings.c */, B6D30B130D1629C20036CC54 /* tzx_read.c */, B6D30B140D1629C20036CC54 /* tzx_write.c */, + B6E1F13C14F511F000600EB0 /* utilities.c */, B6D30B150D1629C20036CC54 /* warajevo_read.c */, B6D30B160D1629C20036CC54 /* wav.c */, B6D30B170D1629C20036CC54 /* z80.c */, @@ -358,7 +364,14 @@ isa = PBXProject; buildConfigurationList = 2CA326220896AD4900168862 /* Build configuration list for PBXProject "FuseGenerator" */; compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); mainGroup = 089C166AFE841209C02AAC07 /* FuseGenerator */; projectDirPath = ""; projectRoot = ""; @@ -439,6 +452,8 @@ B63944AB0D18B0430059DAA5 /* LibspectrumSCRExtractor.m in Sources */, B67F1E790E93A39800246616 /* garray.c in Sources */, B67F1E7B0E93A3AF00246616 /* memory.c in Sources */, + B6E1F13B14F511DA00600EB0 /* pzx_read.c in Sources */, + B6E1F13D14F511F000600EB0 /* utilities.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; Modified: trunk/FuseGenerator/libspectrum.h =================================================================== --- trunk/FuseGenerator/libspectrum.h 2012-02-15 12:43:47 UTC (rev 686) +++ trunk/FuseGenerator/libspectrum.h 2012-02-26 12:08:34 UTC (rev 687) @@ -1,7 +1,7 @@ /* libspectrum.h: the library for dealing with ZX Spectrum emulator files Copyright (c) 2001-2007 Philip Kendall, Darren Salt, Fredrick Meunier - $Id: libspectrum.h.in 4148 2010-08-25 21:20:50Z pak21 $ + $Id: libspectrum.h.in 4534 2011-08-11 12:59:47Z 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 @@ -84,11 +84,12 @@ #define TRUE (!FALSE) #endif -typedef char gchar; +typedef char gchar; typedef int gint; typedef long glong; typedef gint gboolean; typedef unsigned int guint; +typedef unsigned long gulong; typedef const void * gconstpointer; typedef void * gpointer; @@ -106,80 +107,89 @@ gconstpointer b); -GSList WIN32_DLL *g_slist_insert_sorted (GSList *list, +WIN32_DLL GSList *g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func); -GSList WIN32_DLL *g_slist_insert (GSList *list, +WIN32_DLL GSList *g_slist_insert (GSList *list, gpointer data, gint position); -GSList WIN32_DLL *g_slist_append (GSList *list, +WIN32_DLL GSList *g_slist_append (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_prepend (GSList *list, +WIN32_DLL GSList *g_slist_prepend (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_remove (GSList *list, +WIN32_DLL GSList *g_slist_remove (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_delete_link (GSList *list, +WIN32_DLL GSList *g_slist_last (GSList *list); + +WIN32_DLL GSList *g_slist_reverse (GSList *list); + +WIN32_DLL GSList *g_slist_delete_link (GSList *list, GSList *link); -guint WIN32_DLL g_slist_length (GSList *list); +WIN32_DLL guint g_slist_length (GSList *list); -void WIN32_DLL g_slist_foreach (GSList *list, +WIN32_DLL void g_slist_foreach (GSList *list, GFunc func, gpointer user_data); -void WIN32_DLL g_slist_free (GSList *list); +WIN32_DLL void g_slist_free (GSList *list); -GSList WIN32_DLL *g_slist_last (GSList *list); - -GSList WIN32_DLL *g_slist_reverse (GSList *list); - -GSList WIN32_DLL *g_slist_nth (GSList *list, +WIN32_DLL GSList *g_slist_nth (GSList *list, guint n); -GSList WIN32_DLL * g_slist_find_custom (GSList *list, +WIN32_DLL GSList *g_slist_find_custom (GSList *list, gpointer data, GCompareFunc func ); -gint WIN32_DLL g_slist_position (GSList *list, +WIN32_DLL gint g_slist_position (GSList *list, GSList *llink); typedef struct _GHashTable GHashTable; typedef guint (*GHashFunc) (gconstpointer key); +typedef void (*GHFunc) (gpointer key, + gpointer value, + gpointer user_data); + typedef gboolean (*GHRFunc) (gpointer key, gpointer value, gpointer user_data); -gint WIN32_DLL g_int_equal (gconstpointer v, +WIN32_DLL gint g_int_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_int_hash (gconstpointer v); -gint WIN32_DLL g_str_equal (gconstpointer v, +WIN32_DLL guint g_int_hash (gconstpointer v); + +WIN32_DLL gint g_str_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_str_hash (gconstpointer v); +WIN32_DLL guint g_str_hash (gconstpointer v); -GHashTable WIN32_DLL *g_hash_table_new (GHashFunc hash_func, +WIN32_DLL GHashTable *g_hash_table_new (GHashFunc hash_func, GCompareFunc key_compare_func); -void WIN32_DLL g_hash_table_destroy (GHashTable *hash_table); +WIN32_DLL void g_hash_table_destroy (GHashTable *hash_table); -void WIN32_DLL g_hash_table_insert (GHashTable *hash_table, +WIN32_DLL void g_hash_table_insert (GHashTable *hash_table, gpointer key, gpointer value); -gpointer WIN32_DLL g_hash_table_lookup (GHashTable *hash_table, +WIN32_DLL gpointer g_hash_table_lookup (GHashTable *hash_table, gconstpointer key); -guint WIN32_DLL g_hash_table_foreach_remove (GHashTable *hash_table, +WIN32_DLL void g_hash_table_foreach (GHashTable *hash_table, + GHFunc func, + gpointer user_data); + +WIN32_DLL guint g_hash_table_foreach_remove (GHashTable *hash_table, GHRFunc func, gpointer user_data); -guint WIN32_DLL g_hash_table_size (GHashTable *hash_table); +WIN32_DLL guint g_hash_table_size (GHashTable *hash_table); typedef struct _GArray GArray; @@ -193,21 +203,24 @@ size_t allocated; }; -GArray* WIN32_DLL g_array_new( gboolean zero_terminated, gboolean clear, - guint element_size ); +WIN32_DLL GArray* g_array_new( gboolean zero_terminated, gboolean clear, + guint element_size ); #define g_array_append_val(a,v) g_array_append_vals( a, &(v), 1 ); -GArray* WIN32_DLL g_array_append_vals( GArray *array, gconstpointer data, guint len ); +WIN32_DLL GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len ); #define g_array_index(a,t,i) (*(((t*)a->data)+i)) -GArray* WIN32_DLL g_array_set_size( GArray *array, guint length ); +WIN32_DLL GArray* g_array_set_size( GArray *array, guint length ); +WIN32_DLL gchar* g_array_free( GArray *array, gboolean free_segment ); #include <TargetConditionals.h> #ifdef TARGET_RT_64_BIT #define GINT_TO_POINTER(i) ((gpointer) (glong)(i)) #define GPOINTER_TO_INT(p) ((gint) (glong)(p)) +#define GPOINTER_TO_UINT(p) ((guint) (gulong)(p)) #else #define GINT_TO_POINTER(i) ((gpointer) (i)) #define GPOINTER_TO_INT(p) ((gint) (p)) +#define GPOINTER_TO_UINT(p) ((guint) (p)) #endif /* @@ -243,13 +256,21 @@ WIN32_DLL libspectrum_error libspectrum_zlib_inflate( const libspectrum_byte *gzptr, size_t gzlength, - libspectrum_byte **outptr, size_t *outlength ); + libspectrum_byte **outptr, size_t *outlength ); WIN32_DLL libspectrum_error libspectrum_zlib_compress( const libspectrum_byte *data, size_t length, - libspectrum_byte **gzptr, size_t *gzlength ); + libspectrum_byte **gzptr, size_t *gzlength ); +/* we support files compressed with bz2 */ +#define LIBSPECTRUM_SUPPORTS_BZ2_COMPRESSION (1) + + +/* we support files wav files */ +#define LIBSPECTRUM_SUPPORTS_AUDIOFILE (1) + + /* Initialisation */ WIN32_DLL libspectrum_error libspectrum_init( void ); @@ -363,6 +384,10 @@ LIBSPECTRUM_ID_DISK_OPD, /* .opu/.opd Opus Discovery disk image */ + LIBSPECTRUM_ID_TAPE_PZX, /* PZX tape image */ + + LIBSPECTRUM_ID_AUX_POK, /* POKE file */ + LIBSPECTRUM_ID_SCREEN_SCR, /* .scr screen file */ } libspectrum_id_t; @@ -401,6 +426,8 @@ LIBSPECTRUM_CLASS_DISK_GENERIC, /* generic disk image */ + LIBSPECTRUM_CLASS_AUXILIARY, /* auxiliary supported file */ + LIBSPECTRUM_CLASS_SCREENSHOT, /* Screenshot */ } libspectrum_class_t; @@ -626,250 +653,284 @@ extern WIN32_DLL const int LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_2; /* Accessor functions */ -libspectrum_machine WIN32_DLL libspectrum_snap_machine( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_machine( libspectrum_snap *snap, libspectrum_machine machine ); -libspectrum_byte WIN32_DLL libspectrum_snap_a( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_a( libspectrum_snap *snap, libspectrum_byte a ); -libspectrum_byte WIN32_DLL libspectrum_snap_f( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_f( libspectrum_snap *snap, libspectrum_byte f ); -libspectrum_word WIN32_DLL libspectrum_snap_bc( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_bc( libspectrum_snap *snap, libspectrum_word bc ); -libspectrum_word WIN32_DLL libspectrum_snap_de( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_de( libspectrum_snap *snap, libspectrum_word de ); -libspectrum_word WIN32_DLL libspectrum_snap_hl( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_hl( libspectrum_snap *snap, libspectrum_word hl ); -libspectrum_byte WIN32_DLL libspectrum_snap_a_( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_a_( libspectrum_snap *snap, libspectrum_byte a_ ); -libspectrum_byte WIN32_DLL libspectrum_snap_f_( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_f_( libspectrum_snap *snap, libspectrum_byte f_ ); -libspectrum_word WIN32_DLL libspectrum_snap_bc_( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_bc_( libspectrum_snap *snap, libspectrum_word bc_ ); -libspectrum_word WIN32_DLL libspectrum_snap_de_( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_de_( libspectrum_snap *snap, libspectrum_word de_ ); -libspectrum_word WIN32_DLL libspectrum_snap_hl_( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_hl_( libspectrum_snap *snap, libspectrum_word hl_ ); -libspectrum_word WIN32_DLL libspectrum_snap_ix( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_ix( libspectrum_snap *snap, libspectrum_word ix ); -libspectrum_word WIN32_DLL libspectrum_snap_iy( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_iy( libspectrum_snap *snap, libspectrum_word iy ); -libspectrum_byte WIN32_DLL libspectrum_snap_i( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_i( libspectrum_snap *snap, libspectrum_byte i ); -libspectrum_byte WIN32_DLL libspectrum_snap_r( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_r( libspectrum_snap *snap, libspectrum_byte r ); -libspectrum_word WIN32_DLL libspectrum_snap_sp( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_sp( libspectrum_snap *snap, libspectrum_word sp ); -libspectrum_word WIN32_DLL libspectrum_snap_pc( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_pc( libspectrum_snap *snap, libspectrum_word pc ); -libspectrum_byte WIN32_DLL libspectrum_snap_iff1( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_iff1( libspectrum_snap *snap, libspectrum_byte iff1 ); -libspectrum_byte WIN32_DLL libspectrum_snap_iff2( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_iff2( libspectrum_snap *snap, libspectrum_byte iff2 ); -libspectrum_byte WIN32_DLL libspectrum_snap_im( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_im( libspectrum_snap *snap, libspectrum_byte im ); -libspectrum_dword WIN32_DLL libspectrum_snap_tstates( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_tstates( libspectrum_snap *snap, libspectrum_dword tstates ); -int WIN32_DLL libspectrum_snap_halted( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_halted( libspectrum_snap *snap, int halted ); -int WIN32_DLL libspectrum_snap_last_instruction_ei( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_last_instruction_ei( libspectrum_snap *snap, int last_instruction_ei ); -libspectrum_byte WIN32_DLL libspectrum_snap_out_ula( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_out_ula( libspectrum_snap *snap, libspectrum_byte out_ula ); -libspectrum_byte WIN32_DLL libspectrum_snap_out_128_memoryport( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_out_128_memoryport( libspectrum_snap *snap, libspectrum_byte out_128_memoryport ); -libspectrum_byte WIN32_DLL libspectrum_snap_out_plus3_memoryport( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_out_plus3_memoryport( libspectrum_snap *snap, libspectrum_byte out_plus3_memoryport ); -libspectrum_byte WIN32_DLL libspectrum_snap_out_ay_registerport( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_out_ay_registerport( libspectrum_snap *snap, libspectrum_byte out_ay_registerport ); -libspectrum_byte WIN32_DLL libspectrum_snap_ay_registers( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_ay_registers( libspectrum_snap *snap, int idx, libspectrum_byte ay_registers ); -libspectrum_byte WIN32_DLL libspectrum_snap_out_scld_hsr( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_out_scld_hsr( libspectrum_snap *snap, libspectrum_byte out_scld_hsr ); -libspectrum_byte WIN32_DLL libspectrum_snap_out_scld_dec( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_out_scld_dec( libspectrum_snap *snap, libspectrum_byte out_scld_dec ); -int WIN32_DLL libspectrum_snap_interface1_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_interface1_active( libspectrum_snap *snap, int interface1_active ); -int WIN32_DLL libspectrum_snap_interface1_paged( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_interface1_paged( libspectrum_snap *snap, int interface1_paged ); -int WIN32_DLL libspectrum_snap_interface1_drive_count( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_interface1_drive_count( libspectrum_snap *snap, int interface1_drive_count ); -int WIN32_DLL libspectrum_snap_interface1_custom_rom( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_interface1_custom_rom( libspectrum_snap *snap, int interface1_custom_rom ); -libspectrum_byte WIN32_DLL * libspectrum_snap_interface1_rom( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_interface1_rom( libspectrum_snap *snap, int idx, libspectrum_byte* interface1_rom ); -size_t WIN32_DLL libspectrum_snap_interface1_rom_length( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_interface1_rom_length( libspectrum_snap *snap, int idx, size_t interface1_rom_length ); -int WIN32_DLL libspectrum_snap_beta_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_active( libspectrum_snap *snap, int beta_active ); -int WIN32_DLL libspectrum_snap_beta_paged( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_paged( libspectrum_snap *snap, int beta_paged ); -int WIN32_DLL libspectrum_snap_beta_drive_count( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_drive_count( libspectrum_snap *snap, int beta_drive_count ); -int WIN32_DLL libspectrum_snap_beta_custom_rom( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_custom_rom( libspectrum_snap *snap, int beta_custom_rom ); -int WIN32_DLL libspectrum_snap_beta_direction( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_direction( libspectrum_snap *snap, int beta_direction ); -libspectrum_byte WIN32_DLL libspectrum_snap_beta_system( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_system( libspectrum_snap *snap, libspectrum_byte beta_system ); -libspectrum_byte WIN32_DLL libspectrum_snap_beta_track( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_track( libspectrum_snap *snap, libspectrum_byte beta_track ); -libspectrum_byte WIN32_DLL libspectrum_snap_beta_sector( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_sector( libspectrum_snap *snap, libspectrum_byte beta_sector ); -libspectrum_byte WIN32_DLL libspectrum_snap_beta_data( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_data( libspectrum_snap *snap, libspectrum_byte beta_data ); -libspectrum_byte WIN32_DLL libspectrum_snap_beta_status( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_beta_status( libspectrum_snap *snap, libspectrum_byte beta_status ); -libspectrum_byte WIN32_DLL * libspectrum_snap_beta_rom( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_beta_rom( libspectrum_snap *snap, int idx, libspectrum_byte* beta_rom ); -int WIN32_DLL libspectrum_snap_plusd_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_active( libspectrum_snap *snap, int plusd_active ); -int WIN32_DLL libspectrum_snap_plusd_paged( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_paged( libspectrum_snap *snap, int plusd_paged ); -int WIN32_DLL libspectrum_snap_plusd_drive_count( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_drive_count( libspectrum_snap *snap, int plusd_drive_count ); -int WIN32_DLL libspectrum_snap_plusd_custom_rom( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_custom_rom( libspectrum_snap *snap, int plusd_custom_rom ); -int WIN32_DLL libspectrum_snap_plusd_direction( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_direction( libspectrum_snap *snap, int plusd_direction ); -libspectrum_byte WIN32_DLL libspectrum_snap_plusd_control( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_control( libspectrum_snap *snap, libspectrum_byte plusd_control ); -libspectrum_byte WIN32_DLL libspectrum_snap_plusd_track( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_track( libspectrum_snap *snap, libspectrum_byte plusd_track ); -libspectrum_byte WIN32_DLL libspectrum_snap_plusd_sector( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_sector( libspectrum_snap *snap, libspectrum_byte plusd_sector ); -libspectrum_byte WIN32_DLL libspectrum_snap_plusd_data( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_data( libspectrum_snap *snap, libspectrum_byte plusd_data ); -libspectrum_byte WIN32_DLL libspectrum_snap_plusd_status( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_plusd_status( libspectrum_snap *snap, libspectrum_byte plusd_status ); -libspectrum_byte WIN32_DLL * libspectrum_snap_plusd_rom( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_plusd_rom( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_rom ); -libspectrum_byte WIN32_DLL * libspectrum_snap_plusd_ram( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_plusd_ram( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_ram ); -int WIN32_DLL libspectrum_snap_opus_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_active( libspectrum_snap *snap, int opus_active ); -int WIN32_DLL libspectrum_snap_opus_paged( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_paged( libspectrum_snap *snap, int opus_paged ); -int WIN32_DLL libspectrum_snap_opus_drive_count( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_drive_count( libspectrum_snap *snap, int opus_drive_count ); -int WIN32_DLL libspectrum_snap_opus_custom_rom( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_custom_rom( libspectrum_snap *snap, int opus_custom_rom ); -int WIN32_DLL libspectrum_snap_opus_direction( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_direction( libspectrum_snap *snap, int opus_direction ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_track( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_track( libspectrum_snap *snap, libspectrum_byte opus_track ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_sector( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_sector( libspectrum_snap *snap, libspectrum_byte opus_sector ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_data( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_data( libspectrum_snap *snap, libspectrum_byte opus_data ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_status( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_status( libspectrum_snap *snap, libspectrum_byte opus_status ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_data_reg_a( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_data_reg_a( libspectrum_snap *snap, libspectrum_byte opus_data_reg_a ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_data_dir_a( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_data_dir_a( libspectrum_snap *snap, libspectrum_byte opus_data_dir_a ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_control_a( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_control_a( libspectrum_snap *snap, libspectrum_byte opus_control_a ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_data_reg_b( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_data_reg_b( libspectrum_snap *snap, libspectrum_byte opus_data_reg_b ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_data_dir_b( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_data_dir_b( libspectrum_snap *snap, libspectrum_byte opus_data_dir_b ); -libspectrum_byte WIN32_DLL libspectrum_snap_opus_control_b( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_opus_control_b( libspectrum_snap *snap, libspectrum_byte opus_control_b ); -libspectrum_byte WIN32_DLL * libspectrum_snap_opus_rom( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_opus_rom( libspectrum_snap *snap, int idx, libspectrum_byte* opus_rom ); -libspectrum_byte WIN32_DLL * libspectrum_snap_opus_ram( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_opus_ram( libspectrum_snap *snap, int idx, libspectrum_byte* opus_ram ); -int WIN32_DLL libspectrum_snap_custom_rom( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_custom_rom( libspectrum_snap *snap, int custom_rom ); -size_t WIN32_DLL libspectrum_snap_custom_rom_pages( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_custom_rom_pages( libspectrum_snap *snap, size_t custom_rom_pages ); -libspectrum_byte WIN32_DLL * libspectrum_snap_roms( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_roms( libspectrum_snap *snap, int idx, libspectrum_byte* roms ); -size_t WIN32_DLL libspectrum_snap_rom_length( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_rom_length( libspectrum_snap *snap, int idx, size_t rom_length ); -libspectrum_byte WIN32_DLL * libspectrum_snap_pages( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_pages( libspectrum_snap *snap, int idx, libspectrum_byte* pages ); -libspectrum_byte WIN32_DLL * libspectrum_snap_slt( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_slt( libspectrum_snap *snap, int idx, libspectrum_byte* slt ); -size_t WIN32_DLL libspectrum_snap_slt_length( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_slt_length( libspectrum_snap *snap, int idx, size_t slt_length ); -libspectrum_byte WIN32_DLL * libspectrum_snap_slt_screen( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_slt_screen( libspectrum_snap *snap, libspectrum_byte* slt_screen ); -int WIN32_DLL libspectrum_snap_slt_screen_level( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_slt_screen_level( libspectrum_snap *snap, int slt_screen_level ); -int WIN32_DLL libspectrum_snap_zxatasp_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxatasp_active( libspectrum_snap *snap, int zxatasp_active ); -int WIN32_DLL libspectrum_snap_zxatasp_upload( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxatasp_upload( libspectrum_snap *snap, int zxatasp_upload ); -int WIN32_DLL libspectrum_snap_zxatasp_writeprotect( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxatasp_writeprotect( libspectrum_snap *snap, int zxatasp_writeprotect ); -libspectrum_byte WIN32_DLL libspectrum_snap_zxatasp_port_a( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxatasp_port_a( libspectrum_snap *snap, libspectrum_byte zxatasp_port_a ); -libspectrum_byte WIN32_DLL libspectrum_snap_zxatasp_port_b( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxatasp_port_b( libspectrum_snap *snap, libspectrum_byte zxatasp_port_b ); -libspectrum_byte WIN32_DLL libspectrum_snap_zxatasp_port_c( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxatasp_port_c( libspectrum_snap *snap, libspectrum_byte zxatasp_port_c ); -libspectrum_byte WIN32_DLL libspectrum_snap_zxatasp_control( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxatasp_control( libspectrum_snap *snap, libspectrum_byte zxatasp_control ); -size_t WIN32_DLL libspectrum_snap_zxatasp_pages( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxatasp_pages( libspectrum_snap *snap, size_t zxatasp_pages ); -size_t WIN32_DLL libspectrum_snap_zxatasp_current_page( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxatasp_current_page( libspectrum_snap *snap, size_t zxatasp_current_page ); -libspectrum_byte WIN32_DLL * libspectrum_snap_zxatasp_ram( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_zxatasp_ram( libspectrum_snap *snap, int idx, libspectrum_byte* zxatasp_ram ); -int WIN32_DLL libspectrum_snap_zxcf_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxcf_active( libspectrum_snap *snap, int zxcf_active ); -int WIN32_DLL libspectrum_snap_zxcf_upload( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxcf_upload( libspectrum_snap *snap, int zxcf_upload ); -libspectrum_byte WIN32_DLL libspectrum_snap_zxcf_memctl( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxcf_memctl( libspectrum_snap *snap, libspectrum_byte zxcf_memctl ); -size_t WIN32_DLL libspectrum_snap_zxcf_pages( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_zxcf_pages( libspectrum_snap *snap, size_t zxcf_pages ); -libspectrum_byte WIN32_DLL * libspectrum_snap_zxcf_ram( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_zxcf_ram( libspectrum_snap *snap, int idx, libspectrum_byte* zxcf_ram ); -int WIN32_DLL libspectrum_snap_interface2_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_interface2_active( libspectrum_snap *snap, int interface2_active ); -libspectrum_byte WIN32_DLL * libspectrum_snap_interface2_rom( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_interface2_rom( libspectrum_snap *snap, int idx, libspectrum_byte* interface2_rom ); -int WIN32_DLL libspectrum_snap_dock_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_dock_active( libspectrum_snap *snap, int dock_active ); -libspectrum_byte WIN32_DLL libspectrum_snap_exrom_ram( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_exrom_ram( libspectrum_snap *snap, int idx, libspectrum_byte exrom_ram ); -libspectrum_byte WIN32_DLL * libspectrum_snap_exrom_cart( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_exrom_cart( libspectrum_snap *snap, int idx, libspectrum_byte* exrom_cart ); -libspectrum_byte WIN32_DLL libspectrum_snap_dock_ram( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_dock_ram( libspectrum_snap *snap, int idx, libspectrum_byte dock_ram ); -libspectrum_byte WIN32_DLL * libspectrum_snap_dock_cart( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_dock_cart( libspectrum_snap *snap, int idx, libspectrum_byte* dock_cart ); -int WIN32_DLL libspectrum_snap_issue2( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_issue2( libspectrum_snap *snap, int issue2 ); -size_t WIN32_DLL libspectrum_snap_joystick_active_count( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_joystick_active_count( libspectrum_snap *snap, size_t joystick_active_count ); -libspectrum_joystick WIN32_DLL libspectrum_snap_joystick_list( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_joystick_list( libspectrum_snap *snap, int idx, libspectrum_joystick joystick_list ); -int WIN32_DLL libspectrum_snap_joystick_inputs( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_joystick_inputs( libspectrum_snap *snap, int idx, int joystick_inputs ); -int WIN32_DLL libspectrum_snap_kempston_mouse_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_kempston_mouse_active( libspectrum_snap *snap, int kempston_mouse_active ); -int WIN32_DLL libspectrum_snap_simpleide_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_simpleide_active( libspectrum_snap *snap, int simpleide_active ); -int WIN32_DLL libspectrum_snap_divide_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_divide_active( libspectrum_snap *snap, int divide_active ); -int WIN32_DLL libspectrum_snap_divide_eprom_writeprotect( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_divide_eprom_writeprotect( libspectrum_snap *snap, int divide_eprom_writeprotect ); -int WIN32_DLL libspectrum_snap_divide_paged( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_divide_paged( libspectrum_snap *snap, int divide_paged ); -libspectrum_byte WIN32_DLL libspectrum_snap_divide_control( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_divide_control( libspectrum_snap *snap, libspectrum_byte divide_control ); -size_t WIN32_DLL libspectrum_snap_divide_pages( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_divide_pages( libspectrum_snap *snap, size_t divide_pages ); -libspectrum_byte WIN32_DLL * libspectrum_snap_divide_eprom( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_divide_eprom( libspectrum_snap *snap, int idx, libspectrum_byte* divide_eprom ); -libspectrum_byte WIN32_DLL * libspectrum_snap_divide_ram( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_divide_ram( libspectrum_snap *snap, int idx, libspectrum_byte* divide_ram ); -int WIN32_DLL libspectrum_snap_fuller_box_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_fuller_box_active( libspectrum_snap *snap, int fuller_box_active ); -int WIN32_DLL libspectrum_snap_melodik_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_melodik_active( libspectrum_snap *snap, int melodik_active ); +WIN32_DLL libspectrum_machine libspectrum_snap_machine( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_machine( libspectrum_snap *snap, libspectrum_machine machine ); +WIN32_DLL libspectrum_byte libspectrum_snap_a( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_a( libspectrum_snap *snap, libspectrum_byte a ); +WIN32_DLL libspectrum_byte libspectrum_snap_f( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_f( libspectrum_snap *snap, libspectrum_byte f ); +WIN32_DLL libspectrum_word libspectrum_snap_bc( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_bc( libspectrum_snap *snap, libspectrum_word bc ); +WIN32_DLL libspectrum_word libspectrum_snap_de( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_de( libspectrum_snap *snap, libspectrum_word de ); +WIN32_DLL libspectrum_word libspectrum_snap_hl( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_hl( libspectrum_snap *snap, libspectrum_word hl ); +WIN32_DLL libspectrum_byte libspectrum_snap_a_( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_a_( libspectrum_snap *snap, libspectrum_byte a_ ); +WIN32_DLL libspectrum_byte libspectrum_snap_f_( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_f_( libspectrum_snap *snap, libspectrum_byte f_ ); +WIN32_DLL libspectrum_word libspectrum_snap_bc_( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_bc_( libspectrum_snap *snap, libspectrum_word bc_ ); +WIN32_DLL libspectrum_word libspectrum_snap_de_( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_de_( libspectrum_snap *snap, libspectrum_word de_ ); +WIN32_DLL libspectrum_word libspectrum_snap_hl_( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_hl_( libspectrum_snap *snap, libspectrum_word hl_ ); +WIN32_DLL libspectrum_word libspectrum_snap_ix( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_ix( libspectrum_snap *snap, libspectrum_word ix ); +WIN32_DLL libspectrum_word libspectrum_snap_iy( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_iy( libspectrum_snap *snap, libspectrum_word iy ); +WIN32_DLL libspectrum_byte libspectrum_snap_i( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_i( libspectrum_snap *snap, libspectrum_byte i ); +WIN32_DLL libspectrum_byte libspectrum_snap_r( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_r( libspectrum_snap *snap, libspectrum_byte r ); +WIN32_DLL libspectrum_word libspectrum_snap_sp( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_sp( libspectrum_snap *snap, libspectrum_word sp ); +WIN32_DLL libspectrum_word libspectrum_snap_pc( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_pc( libspectrum_snap *snap, libspectrum_word pc ); +WIN32_DLL libspectrum_byte libspectrum_snap_iff1( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_iff1( libspectrum_snap *snap, libspectrum_byte iff1 ); +WIN32_DLL libspectrum_byte libspectrum_snap_iff2( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_iff2( libspectrum_snap *snap, libspectrum_byte iff2 ); +WIN32_DLL libspectrum_byte libspectrum_snap_im( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_im( libspectrum_snap *snap, libspectrum_byte im ); +WIN32_DLL libspectrum_dword libspectrum_snap_tstates( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_tstates( libspectrum_snap *snap, libspectrum_dword tstates ); +WIN32_DLL int libspectrum_snap_halted( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_halted( libspectrum_snap *snap, int halted ); +WIN32_DLL int libspectrum_snap_last_instruction_ei( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_last_instruction_ei( libspectrum_snap *snap, int last_instruction_ei ); +WIN32_DLL libspectrum_byte libspectrum_snap_out_ula( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_out_ula( libspectrum_snap *snap, libspectrum_byte out_ula ); +WIN32_DLL libspectrum_byte libspectrum_snap_out_128_memoryport( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_out_128_memoryport( libspectrum_snap *snap, libspectrum_byte out_128_memoryport ); +WIN32_DLL libspectrum_byte libspectrum_snap_out_plus3_memoryport( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_out_plus3_memoryport( libspectrum_snap *snap, libspectrum_byte out_plus3_memoryport ); +WIN32_DLL libspectrum_byte libspectrum_snap_out_ay_registerport( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_out_ay_registerport( libspectrum_snap *snap, libspectrum_byte out_ay_registerport ); +WIN32_DLL libspectrum_byte libspectrum_snap_ay_registers( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_ay_registers( libspectrum_snap *snap, int idx, libspectrum_byte ay_registers ); +WIN32_DLL libspectrum_byte libspectrum_snap_out_scld_hsr( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_out_scld_hsr( libspectrum_snap *snap, libspectrum_byte out_scld_hsr ); +WIN32_DLL libspectrum_byte libspectrum_snap_out_scld_dec( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_out_scld_dec( libspectrum_snap *snap, libspectrum_byte out_scld_dec ); +WIN32_DLL int libspectrum_snap_interface1_active( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_interface1_active( libspectrum_snap *snap, int interface1_active ); +WIN32_DLL int libspectrum_snap_interface1_paged( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_interface1_paged( libspectrum_snap *snap, int interface1_paged ); +WIN32_DLL int libspectrum_snap_interface1_drive_count( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_interface1_drive_count( libspectrum_snap *snap, int interface1_drive_count ); +WIN32_DLL int libspectrum_snap_interface1_custom_rom( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_interface1_custom_rom( libspectrum_snap *snap, int interface1_custom_rom ); +WIN32_DLL libspectrum_byte * libspectrum_snap_interface1_rom( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_interface1_rom( libspectrum_snap *snap, int idx, libspectrum_byte* interface1_rom ); +WIN32_DLL size_t libspectrum_snap_interface1_rom_length( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_interface1_rom_length( libspectrum_snap *snap, int idx, size_t interface1_rom_length ); +WIN32_DLL int libspectrum_snap_beta_active( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_active( libspectrum_snap *snap, int beta_active ); +WIN32_DLL int libspectrum_snap_beta_paged( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_paged( libspectrum_snap *snap, int beta_paged ); +WIN32_DLL int libspectrum_snap_beta_autoboot( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_autoboot( libspectrum_snap *snap, int beta_autoboot ); +WIN32_DLL int libspectrum_snap_beta_drive_count( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_drive_count( libspectrum_snap *snap, int beta_drive_count ); +WIN32_DLL int libspectrum_snap_beta_custom_rom( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_custom_rom( libspectrum_snap *snap, int beta_custom_rom ); +WIN32_DLL int libspectrum_snap_beta_direction( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_direction( libspectrum_snap *snap, int beta_direction ); +WIN32_DLL libspectrum_byte libspectrum_snap_beta_system( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_system( libspectrum_snap *snap, libspectrum_byte beta_system ); +WIN32_DLL libspectrum_byte libspectrum_snap_beta_track( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_track( libspectrum_snap *snap, libspectrum_byte beta_track ); +WIN32_DLL libspectrum_byte libspectrum_snap_beta_sector( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_sector( libspectrum_snap *snap, libspectrum_byte beta_sector ); +WIN32_DLL libspectrum_byte libspectrum_snap_beta_data( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_data( libspectrum_snap *snap, libspectrum_byte beta_data ); +WIN32_DLL libspectrum_byte libspectrum_snap_beta_status( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_beta_status( libspectrum_snap *snap, libspectrum_byte beta_status ); +WIN32_DLL libspectrum_byte * libspectrum_snap_beta_rom( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_beta_rom( libspectrum_snap *snap, int idx, libspectrum_byte* beta_rom ); +WIN32_DLL int libspectrum_snap_plusd_active( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_active( libspectrum_snap *snap, int plusd_active ); +WIN32_DLL int libspectrum_snap_plusd_paged( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_paged( libspectrum_snap *snap, int plusd_paged ); +WIN32_DLL int libspectrum_snap_plusd_drive_count( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_drive_count( libspectrum_snap *snap, int plusd_drive_count ); +WIN32_DLL int libspectrum_snap_plusd_custom_rom( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_custom_rom( libspectrum_snap *snap, int plusd_custom_rom ); +WIN32_DLL int libspectrum_snap_plusd_direction( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_direction( libspectrum_snap *snap, int plusd_direction ); +WIN32_DLL libspectrum_byte libspectrum_snap_plusd_control( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_control( libspectrum_snap *snap, libspectrum_byte plusd_control ); +WIN32_DLL libspectrum_byte libspectrum_snap_plusd_track( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_track( libspectrum_snap *snap, libspectrum_byte plusd_track ); +WIN32_DLL libspectrum_byte libspectrum_snap_plusd_sector( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_sector( libspectrum_snap *snap, libspectrum_byte plusd_sector ); +WIN32_DLL libspectrum_byte libspectrum_snap_plusd_data( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_data( libspectrum_snap *snap, libspectrum_byte plusd_data ); +WIN32_DLL libspectrum_byte libspectrum_snap_plusd_status( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_plusd_status( libspectrum_snap *snap, libspectrum_byte plusd_status ); +WIN32_DLL libspectrum_byte * libspectrum_snap_plusd_rom( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_plusd_rom( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_rom ); +WIN32_DLL libspectrum_byte * libspectrum_snap_plusd_ram( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_plusd_ram( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_ram ); +WIN32_DLL int libspectrum_snap_opus_active( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_active( libspectrum_snap *snap, int opus_active ); +WIN32_DLL int libspectrum_snap_opus_paged( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_paged( libspectrum_snap *snap, int opus_paged ); +WIN32_DLL int libspectrum_snap_opus_drive_count( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_drive_count( libspectrum_snap *snap, int opus_drive_count ); +WIN32_DLL int libspectrum_snap_opus_custom_rom( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_custom_rom( libspectrum_snap *snap, int opus_custom_rom ); +WIN32_DLL int libspectrum_snap_opus_direction( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_direction( libspectrum_snap *snap, int opus_direction ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_track( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_track( libspectrum_snap *snap, libspectrum_byte opus_track ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_sector( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_sector( libspectrum_snap *snap, libspectrum_byte opus_sector ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_data( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_data( libspectrum_snap *snap, libspectrum_byte opus_data ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_status( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_status( libspectrum_snap *snap, libspectrum_byte opus_status ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_data_reg_a( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_data_reg_a( libspectrum_snap *snap, libspectrum_byte opus_data_reg_a ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_data_dir_a( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_data_dir_a( libspectrum_snap *snap, libspectrum_byte opus_data_dir_a ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_control_a( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_control_a( libspectrum_snap *snap, libspectrum_byte opus_control_a ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_data_reg_b( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_data_reg_b( libspectrum_snap *snap, libspectrum_byte opus_data_reg_b ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_data_dir_b( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_data_dir_b( libspectrum_snap *snap, libspectrum_byte opus_data_dir_b ); +WIN32_DLL libspectrum_byte libspectrum_snap_opus_control_b( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_opus_control_b( libspectrum_snap *snap, libspectrum_byte opus_control_b ); +WIN32_DLL libspectrum_byte * libspectrum_snap_opus_rom( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_opus_rom( libspectrum_snap *snap, int idx, libspectrum_byte* opus_rom ); +WIN32_DLL libspectrum_byte * libspectrum_snap_opus_ram( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_opus_ram( libspectrum_snap *snap, int idx, libspectrum_byte* opus_ram ); +WIN32_DLL int libspectrum_snap_custom_rom( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_custom_rom( libspectrum_snap *snap, int custom_rom ); +WIN32_DLL size_t libspectrum_snap_custom_rom_pages( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_custom_rom_pages( libspectrum_snap *snap, size_t custom_rom_pages ); +WIN32_DLL libspectrum_byte * libspectrum_snap_roms( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_roms( libspectrum_snap *snap, int idx, libspectrum_byte* roms ); +WIN32_DLL size_t libspectrum_snap_rom_length( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_rom_length( libspectrum_snap *snap, int idx, size_t rom_length ); +WIN32_DLL libspectrum_byte * libspectrum_snap_pages( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_pages( libspectrum_snap *snap, int idx, libspectrum_byte* pages ); +WIN32_DLL libspectrum_byte * libspectrum_snap_slt( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_slt( libspectrum_snap *snap, int idx, libspectrum_byte* slt ); +WIN32_DLL size_t libspectrum_snap_slt_length( libspectrum_snap *snap, int idx ); +WIN32_DLL void libspectrum_snap_set_slt_length( libspectrum_snap *snap, int idx, size_t slt_length ); +WIN32_DLL libspectrum_byte * libspectrum_snap_slt_screen( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_slt_screen( libspectrum_snap *snap, libspectrum_byte* slt_screen ); +WIN32_DLL int libspectrum_snap_slt_screen_level( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_slt_screen_level( libspectrum_snap *snap, int slt_screen_level ); +WIN32_DLL int libspectrum_snap_zxatasp_active( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_zxatasp_active( libspectrum_snap *snap, int zxatasp_active ); +WIN32_DLL int libspectrum_snap_zxatasp_upload( libspectrum_snap *snap ); +WIN32_DLL void libspectrum_snap_set_zxatasp_upload( libspectrum_snap *snap, int zxatasp_upload ); +WIN32_DLL int libspectrum_snap_zxatasp_writeprotect(... [truncated message content] |
From: <fr...@us...> - 2012-02-15 12:43:53
|
Revision: 686 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=686&view=rev Author: fredm Date: 2012-02-15 12:43:47 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Tag vendor/fuse-emulator/current as vendor/fuse-emulator/fuse-r4617. Revision Links: -------------- http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=4617&view=rev Added Paths: ----------- vendor/fuse-emulator/fuse-r4617/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2012-02-15 12:43:25
|
Revision: 685 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=685&view=rev Author: fredm Date: 2012-02-15 12:43:10 +0000 (Wed, 15 Feb 2012) Log Message: ----------- Load . into vendor/fuse-emulator/current. Modified Paths: -------------- vendor/fuse-emulator/current/fuse/AUTHORS vendor/fuse-emulator/current/fuse/ChangeLog vendor/fuse-emulator/current/fuse/Makefile.am vendor/fuse-emulator/current/fuse/README vendor/fuse-emulator/current/fuse/bitmap.h vendor/fuse-emulator/current/fuse/compat/amiga/Makefile.am vendor/fuse-emulator/current/fuse/compat/morphos/Makefile.am vendor/fuse-emulator/current/fuse/compat/unix/Makefile.am vendor/fuse-emulator/current/fuse/compat/unix/file.c vendor/fuse-emulator/current/fuse/compat/wii/Makefile.am vendor/fuse-emulator/current/fuse/compat/win32/Makefile.am vendor/fuse-emulator/current/fuse/compat/win32/timer.c vendor/fuse-emulator/current/fuse/compat.h vendor/fuse-emulator/current/fuse/configure.in vendor/fuse-emulator/current/fuse/debugger/breakpoint.c vendor/fuse-emulator/current/fuse/debugger/breakpoint.h vendor/fuse-emulator/current/fuse/debugger/commandl.l vendor/fuse-emulator/current/fuse/debugger/commandy.y vendor/fuse-emulator/current/fuse/debugger/debugger.c vendor/fuse-emulator/current/fuse/debugger/debugger_internals.h vendor/fuse-emulator/current/fuse/debugger/disassemble.c vendor/fuse-emulator/current/fuse/debugger/event.c vendor/fuse-emulator/current/fuse/display.c vendor/fuse-emulator/current/fuse/event.c vendor/fuse-emulator/current/fuse/fuse.c vendor/fuse-emulator/current/fuse/hacking/ChangeLog vendor/fuse-emulator/current/fuse/hacking/tc2048_tech_notes.txt vendor/fuse-emulator/current/fuse/input.c vendor/fuse-emulator/current/fuse/keyboard.c vendor/fuse-emulator/current/fuse/keysyms.pl vendor/fuse-emulator/current/fuse/machine.c vendor/fuse-emulator/current/fuse/machine.h vendor/fuse-emulator/current/fuse/machines/Makefile.am vendor/fuse-emulator/current/fuse/machines/pentagon.c vendor/fuse-emulator/current/fuse/machines/pentagon.h vendor/fuse-emulator/current/fuse/machines/pentagon1024.c vendor/fuse-emulator/current/fuse/machines/pentagon512.c vendor/fuse-emulator/current/fuse/machines/scorpion.c vendor/fuse-emulator/current/fuse/machines/spec128.c vendor/fuse-emulator/current/fuse/machines/spec128.h 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/spec48_ntsc.c 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/tc2068.h 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/memory.h vendor/fuse-emulator/current/fuse/mempool.c vendor/fuse-emulator/current/fuse/mempool.h 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/periph.c vendor/fuse-emulator/current/fuse/periph.h vendor/fuse-emulator/current/fuse/peripherals/ay.c vendor/fuse-emulator/current/fuse/peripherals/ay.h vendor/fuse-emulator/current/fuse/peripherals/dck.c vendor/fuse-emulator/current/fuse/peripherals/dck.h vendor/fuse-emulator/current/fuse/peripherals/disk/Makefile.am vendor/fuse-emulator/current/fuse/peripherals/disk/beta.c vendor/fuse-emulator/current/fuse/peripherals/disk/beta.h vendor/fuse-emulator/current/fuse/peripherals/disk/crc.c vendor/fuse-emulator/current/fuse/peripherals/disk/disk.c vendor/fuse-emulator/current/fuse/peripherals/disk/fdd.c vendor/fuse-emulator/current/fuse/peripherals/disk/opus.c vendor/fuse-emulator/current/fuse/peripherals/disk/opus.h vendor/fuse-emulator/current/fuse/peripherals/disk/plusd.c vendor/fuse-emulator/current/fuse/peripherals/disk/plusd.h vendor/fuse-emulator/current/fuse/peripherals/disk/upd_fdc.c vendor/fuse-emulator/current/fuse/peripherals/disk/upd_fdc.h vendor/fuse-emulator/current/fuse/peripherals/disk/wd_fdc.c vendor/fuse-emulator/current/fuse/peripherals/disk/wd_fdc.h vendor/fuse-emulator/current/fuse/peripherals/fuller.c vendor/fuse-emulator/current/fuse/peripherals/fuller.h vendor/fuse-emulator/current/fuse/peripherals/ide/Makefile.am vendor/fuse-emulator/current/fuse/peripherals/ide/divide.c vendor/fuse-emulator/current/fuse/peripherals/ide/divide.h vendor/fuse-emulator/current/fuse/peripherals/ide/ide.c vendor/fuse-emulator/current/fuse/peripherals/ide/ide.h vendor/fuse-emulator/current/fuse/peripherals/ide/simpleide.c vendor/fuse-emulator/current/fuse/peripherals/ide/simpleide.h vendor/fuse-emulator/current/fuse/peripherals/ide/zxatasp.c vendor/fuse-emulator/current/fuse/peripherals/ide/zxatasp.h vendor/fuse-emulator/current/fuse/peripherals/ide/zxcf.c vendor/fuse-emulator/current/fuse/peripherals/ide/zxcf.h vendor/fuse-emulator/current/fuse/peripherals/if1.c vendor/fuse-emulator/current/fuse/peripherals/if1.h vendor/fuse-emulator/current/fuse/peripherals/if2.c vendor/fuse-emulator/current/fuse/peripherals/if2.h vendor/fuse-emulator/current/fuse/peripherals/joystick.c vendor/fuse-emulator/current/fuse/peripherals/joystick.h vendor/fuse-emulator/current/fuse/peripherals/kempmouse.c vendor/fuse-emulator/current/fuse/peripherals/kempmouse.h vendor/fuse-emulator/current/fuse/peripherals/melodik.c vendor/fuse-emulator/current/fuse/peripherals/melodik.h vendor/fuse-emulator/current/fuse/peripherals/printer.c vendor/fuse-emulator/current/fuse/peripherals/printer.h vendor/fuse-emulator/current/fuse/peripherals/scld.c vendor/fuse-emulator/current/fuse/peripherals/scld.h vendor/fuse-emulator/current/fuse/peripherals/ula.c vendor/fuse-emulator/current/fuse/peripherals/ula.h vendor/fuse-emulator/current/fuse/pokefinder/Makefile.am vendor/fuse-emulator/current/fuse/roms/Makefile.am vendor/fuse-emulator/current/fuse/roms/README.copyright vendor/fuse-emulator/current/fuse/rzx.c vendor/fuse-emulator/current/fuse/screenshot.c vendor/fuse-emulator/current/fuse/screenshot.h vendor/fuse-emulator/current/fuse/settings.dat vendor/fuse-emulator/current/fuse/settings.pl vendor/fuse-emulator/current/fuse/snapshot.c vendor/fuse-emulator/current/fuse/sound/blipbuffer.c vendor/fuse-emulator/current/fuse/sound.c vendor/fuse-emulator/current/fuse/sound.h vendor/fuse-emulator/current/fuse/spectrum.c vendor/fuse-emulator/current/fuse/tape.c vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c vendor/fuse-emulator/current/fuse/ui/fb/fbjoystick.c vendor/fuse-emulator/current/fuse/ui/fb/fbui.c vendor/fuse-emulator/current/fuse/ui/gtk/Makefile.am vendor/fuse-emulator/current/fuse/ui/gtk/debugger.c vendor/fuse-emulator/current/fuse/ui/gtk/fileselector.c vendor/fuse-emulator/current/fuse/ui/gtk/gtkdisplay.c vendor/fuse-emulator/current/fuse/ui/gtk/gtkinternals.h 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/options-header.pl vendor/fuse-emulator/current/fuse/ui/gtk/options.pl vendor/fuse-emulator/current/fuse/ui/gtk/picture.c vendor/fuse-emulator/current/fuse/ui/gtk/pokefinder.c vendor/fuse-emulator/current/fuse/ui/gtk/statusbar.c vendor/fuse-emulator/current/fuse/ui/options.dat vendor/fuse-emulator/current/fuse/ui/sdl/sdldisplay.c vendor/fuse-emulator/current/fuse/ui/sdl/sdljoystick.c vendor/fuse-emulator/current/fuse/ui/sdl/sdlui.c vendor/fuse-emulator/current/fuse/ui/svga/svgajoystick.c vendor/fuse-emulator/current/fuse/ui/svga/svgaui.c vendor/fuse-emulator/current/fuse/ui/ui.h vendor/fuse-emulator/current/fuse/ui/uijoystick.c vendor/fuse-emulator/current/fuse/ui/widget/Makefile.am vendor/fuse-emulator/current/fuse/ui/widget/debugger.c vendor/fuse-emulator/current/fuse/ui/widget/filesel.c vendor/fuse-emulator/current/fuse/ui/widget/menu.c vendor/fuse-emulator/current/fuse/ui/widget/options-header.pl vendor/fuse-emulator/current/fuse/ui/widget/options.pl vendor/fuse-emulator/current/fuse/ui/widget/pokefinder.c vendor/fuse-emulator/current/fuse/ui/widget/widget.c vendor/fuse-emulator/current/fuse/ui/widget/widget.h vendor/fuse-emulator/current/fuse/ui/widget/widget_internals.h vendor/fuse-emulator/current/fuse/ui/win32/Makefile.am vendor/fuse-emulator/current/fuse/ui/win32/debugger.c vendor/fuse-emulator/current/fuse/ui/win32/debugger.rc vendor/fuse-emulator/current/fuse/ui/win32/installer/fuse.nsi vendor/fuse-emulator/current/fuse/ui/win32/options-header.pl vendor/fuse-emulator/current/fuse/ui/win32/options-resource.pl vendor/fuse-emulator/current/fuse/ui/win32/options.pl vendor/fuse-emulator/current/fuse/ui/win32/picture.c vendor/fuse-emulator/current/fuse/ui/win32/pokefinder.c vendor/fuse-emulator/current/fuse/ui/win32/pokefinder.rc vendor/fuse-emulator/current/fuse/ui/win32/statusbar.c vendor/fuse-emulator/current/fuse/ui/win32/win32display.c vendor/fuse-emulator/current/fuse/ui/win32/win32internals.h vendor/fuse-emulator/current/fuse/ui/win32/win32joystick.c vendor/fuse-emulator/current/fuse/ui/win32/win32joystick.rc vendor/fuse-emulator/current/fuse/ui/win32/win32ui.c vendor/fuse-emulator/current/fuse/ui/xlib/xdisplay.c vendor/fuse-emulator/current/fuse/ui/xlib/xjoystick.c vendor/fuse-emulator/current/fuse/ui.c vendor/fuse-emulator/current/fuse/unittests/unittests.c vendor/fuse-emulator/current/fuse/unittests/unittests.h vendor/fuse-emulator/current/fuse/utils.c vendor/fuse-emulator/current/fuse/utils.h vendor/fuse-emulator/current/fuse/windres.rc vendor/fuse-emulator/current/fuse/z80/coretest.c vendor/fuse-emulator/current/fuse/z80/z80.c vendor/fuse-emulator/current/fuse/z80/z80_checks.h vendor/fuse-emulator/current/fuse/z80/z80_ops.c vendor/fuse-emulator/current/fuse-utils/audio2tape.h vendor/fuse-emulator/current/fuse-utils/compat.h vendor/fuse-emulator/current/fuse-utils/configure.in vendor/fuse-emulator/current/fuse-utils/hacking/ChangeLog vendor/fuse-emulator/current/fuse-utils/man/profile2map.1 vendor/fuse-emulator/current/fuse-utils/man/tape2wav.1 vendor/fuse-emulator/current/fuse-utils/man/tzxlist.1 vendor/fuse-emulator/current/fuse-utils/snap2tzx.c vendor/fuse-emulator/current/fuse-utils/tape2wav.c vendor/fuse-emulator/current/fuse-utils/tzxlist.c 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/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/make-perl.c vendor/fuse-emulator/current/libspectrum/myglib/garray.c vendor/fuse-emulator/current/libspectrum/myglib/ghash.c vendor/fuse-emulator/current/libspectrum/rzx.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_accessors.txt vendor/fuse-emulator/current/libspectrum/tape_block.c vendor/fuse-emulator/current/libspectrum/tape_block.h vendor/fuse-emulator/current/libspectrum/test/Makefile.am vendor/fuse-emulator/current/libspectrum/test/test.c vendor/fuse-emulator/current/libspectrum/test/test15.c vendor/fuse-emulator/current/libspectrum/tzx_read.c vendor/fuse-emulator/current/libspectrum/tzx_write.c vendor/fuse-emulator/current/libspectrum/warajevo_read.c vendor/fuse-emulator/current/libspectrum/wav.c vendor/fuse-emulator/current/libspectrum/z80.c vendor/fuse-emulator/current/website/fuse.php vendor/fuse-emulator/current/website/libspectrum.php vendor/fuse-emulator/current/website/screens/f-nongtk.png Added Paths: ----------- vendor/fuse-emulator/current/fuse/compat/unix/tuntap.c vendor/fuse-emulator/current/fuse/machines/machines_periph.c vendor/fuse-emulator/current/fuse/machines/machines_periph.h vendor/fuse-emulator/current/fuse/peripherals/Makefile.am vendor/fuse-emulator/current/fuse/peripherals/disk/disciple.c vendor/fuse-emulator/current/fuse/peripherals/disk/disciple.h vendor/fuse-emulator/current/fuse/peripherals/nic/ vendor/fuse-emulator/current/fuse/peripherals/nic/Makefile.am vendor/fuse-emulator/current/fuse/peripherals/nic/enc28j60.c vendor/fuse-emulator/current/fuse/peripherals/nic/enc28j60.h vendor/fuse-emulator/current/fuse/peripherals/speccyboot.c vendor/fuse-emulator/current/fuse/peripherals/speccyboot.h vendor/fuse-emulator/current/fuse/peripherals/specdrum.c vendor/fuse-emulator/current/fuse/peripherals/specdrum.h vendor/fuse-emulator/current/fuse/pokefinder/pokemem.c vendor/fuse-emulator/current/fuse/pokefinder/pokemem.h vendor/fuse-emulator/current/fuse/roms/speccyboot-1.4.rom vendor/fuse-emulator/current/fuse/ui/gtk/pokemem.c vendor/fuse-emulator/current/fuse/ui/widget/pokemem.c vendor/fuse-emulator/current/fuse/ui/win32/about.c vendor/fuse-emulator/current/fuse/ui/win32/about.h vendor/fuse-emulator/current/fuse/ui/win32/about.rc vendor/fuse-emulator/current/fuse/ui/win32/fuse.manifest.in vendor/fuse-emulator/current/fuse/ui/win32/hyperlinks.c vendor/fuse-emulator/current/fuse/ui/win32/hyperlinks.h vendor/fuse-emulator/current/fuse/ui/win32/pokemem.c vendor/fuse-emulator/current/fuse/ui/win32/pokemem.h vendor/fuse-emulator/current/fuse/ui/win32/pokemem.rc vendor/fuse-emulator/current/fuse-utils/compat/win32/ vendor/fuse-emulator/current/fuse-utils/compat/win32/Makefile.am vendor/fuse-emulator/current/fuse-utils/compat/win32/osname.c vendor/fuse-emulator/current/libspectrum/pzx_read.c vendor/fuse-emulator/current/libspectrum/utilities.c Modified: vendor/fuse-emulator/current/fuse/AUTHORS =================================================================== --- vendor/fuse-emulator/current/fuse/AUTHORS 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/AUTHORS 2012-02-15 12:43:10 UTC (rev 685) @@ -48,6 +48,8 @@ * Michael D Wynne: the Opus Discovery emulation (for EightyOne). +* Patrik Persson: the SpeccyBoot Ethernet emulation. + * Philip Kendall: everything else. -$Id: AUTHORS 4060 2009-07-30 13:21:38Z fredm $ +$Id: AUTHORS 4237 2010-12-31 19:31:26Z pak21 $ Modified: vendor/fuse-emulator/current/fuse/ChangeLog =================================================================== --- vendor/fuse-emulator/current/fuse/ChangeLog 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/ChangeLog 2012-02-15 12:43:10 UTC (rev 685) @@ -1,19 +1,3 @@ -2011-04-01 Philip Kendall <phi...@sh...> - - * Fuse 1.0.0.1a released. - - * Remove all ROMs for which there isn't explicit permission to - distribute (Philip Kendall). - -2011-01-12 Philip Kendall <phi...@sh...> - - * Fuse 1.0.0.1 released. - - * Fix temporary breakpoints on platforms using replacement Glib - (Fredrick Meunier, Sergio Baldovi; thanks, Chris Cowley) - * Ensure Amiga port can load files (Chris Young) - * Fix SVGAlib compilation (rkd77) - 2010-12-16 Philip Kendall <phi...@sh...> * Fuse 1.0.0 released. @@ -602,7 +586,7 @@ * 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 all sorts of other possibilities (mostly Fredrick Meunier and Philip Kendall; based on the same feature in ScummVM). * Transparent monitor/debugger (Philip Kendall). @@ -701,7 +685,7 @@ * Put the keyboard help in a separate window when using the GTK+ UI (Philip Kendall). - * Changable emulation speed (Philip Kendall). + * Changeable emulation speed (Philip Kendall). * Change to lib765 0.3.0 for Mac OS X compatibility (Frederick Meunier). @@ -1051,4 +1035,4 @@ * Version 0.1.0 released. -$Id: ChangeLog 4331 2011-04-01 07:47:06Z pak21 $ +$Id: ChangeLog 4409 2011-05-01 10:47:07Z zubzero $ Modified: vendor/fuse-emulator/current/fuse/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse/Makefile.am 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/Makefile.am 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ # Process this file with automake to produce Makefile.in ## Copyright (c) 1999-2009 Philip Kendall -## $Id: Makefile.am 4112 2010-01-08 11:03:43Z fredm $ +## $Id: Makefile.am 4288 2011-02-03 21:06: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 @@ -27,12 +27,11 @@ SUBDIRS = @COMPAT_SUBDIR@ \ debugger \ - disk \ hacking \ - ide \ lib \ machines \ man \ + peripherals \ perl \ pokefinder \ roms \ @@ -43,12 +42,11 @@ z80 DIST_SUBDIRS = debugger \ - disk \ hacking \ - ide \ lib \ machines \ man \ + peripherals \ perl \ pokefinder \ roms \ @@ -58,32 +56,22 @@ unittests \ z80 -fuse_SOURCES = ay.c \ - dck.c \ - display.c \ +fuse_SOURCES = display.c \ event.c \ - fuller.c \ fuse.c \ - if1.c \ - if2.c \ input.c \ - joystick.c \ - kempmouse.c \ keyboard.c \ loader.c \ machine.c \ - melodik.c \ memory.c \ mempool.c \ menu.c \ module.c \ periph.c \ - printer.c \ profile.c \ psg.c \ rectangle.c \ rzx.c \ - scld.c \ screenshot.c \ settings.c \ slt.c \ @@ -93,7 +81,6 @@ tape.c \ ui.c \ uidisplay.c \ - ula.c \ utils.c \ windres.rc @@ -114,9 +101,11 @@ fuse_LDADD = debugger/libdebugger.a \ @UI_LIBS@ \ debugger/libdebugger.a \ -disk/libdisk.a \ -ide/libide.a \ machines/libmachines.a \ +peripherals/libperipherals.a \ +peripherals/disk/libdisk.a \ +peripherals/ide/libide.a \ +peripherals/nic/libnic.a \ pokefinder/libpokefinder.a \ sound/libsound.a \ timer/libtimer.a \ @@ -136,9 +125,11 @@ fuse_DEPENDENCIES = debugger/libdebugger.a \ @UI_LIBS@ \ debugger/libdebugger.a \ -disk/libdisk.a \ -ide/libide.a \ machines/libmachines.a \ +peripherals/libperipherals.a \ +peripherals/disk/libdisk.a \ +peripherals/ide/libide.a \ +peripherals/nic/libnic.a \ pokefinder/libpokefinder.a \ sound/libsound.a \ timer/libtimer.a \ @@ -170,22 +161,15 @@ INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ \ @XML_CFLAGS@ -DFUSEDATADIR="\"${pkgdatadir}\"" @SDL_CFLAGS@ -noinst_HEADERS = ay.h \ - bitmap.h \ +noinst_HEADERS = bitmap.h \ compat.h \ - dck.h \ display.h \ event.h \ - fuller.h \ fuse.h \ - if1.h \ - if2.h \ input.h \ keyboard.h \ - kempmouse.h \ loader.h \ machine.h \ - melodik.h \ memory.h \ mempool.h \ menu.h \ @@ -202,12 +186,8 @@ spectrum.h \ tape.h \ utils.h \ - joystick.h \ options.h \ - printer.h \ - profile.h \ - scld.h \ - ula.h + profile.h EXTRA_DIST = AUTHORS \ README \ Modified: vendor/fuse-emulator/current/fuse/README =================================================================== --- vendor/fuse-emulator/current/fuse/README 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/README 2012-02-15 12:43:10 UTC (rev 685) @@ -1,5 +1,5 @@ -The Free Unix Spectrum Emulator (Fuse) 1.0.0.1a -=============================================== +The Free Unix Spectrum Emulator (Fuse) 1.0.0 +============================================ Fuse (the Free Unix Spectrum Emulator) was originally, and somewhat unsurprisingly, an emulator of the ZX Spectrum (a popular 1980s home @@ -90,7 +90,7 @@ 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 +you to specify that you have some of 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 @@ -214,6 +214,6 @@ <http://www.worldofspectrum.org/forums/>. Philip Kendall <phi...@sh...> -28 March 2011 +16 December 2010 -$Id: README 4329 2011-03-27 22:26:07Z pak21 $ +$Id: README 4410 2011-05-01 10:51:21Z zubzero $ Modified: vendor/fuse-emulator/current/fuse/bitmap.h =================================================================== --- vendor/fuse-emulator/current/fuse/bitmap.h 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/bitmap.h 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* bitmap.h: Bitmap routines Copyright (c) 2007 Stuart Brady - $Id: bitmap.h 3218 2007-10-21 23:25:23Z zubzero $ + $Id: bitmap.h 4343 2011-04-04 19:32: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 @@ -21,7 +21,7 @@ Philip: phi...@sh... - Stuart: sd...@nt... + Stuart: stu...@gm... */ Modified: vendor/fuse-emulator/current/fuse/compat/amiga/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse/compat/amiga/Makefile.am 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/compat/amiga/Makefile.am 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2007-2008 Philip Kendall -## $Id: Makefile.am 3935 2009-01-07 12:55:13Z pak21 $ +## $Id: Makefile.am 4237 2010-12-31 19:31:26Z 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 @@ -31,6 +31,7 @@ ../unix/file.c \ osname.c \ paths.c \ - ../unix/timer.c + ../unix/timer.c \ + ../unix/tuntap.c INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ Modified: vendor/fuse-emulator/current/fuse/compat/morphos/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse/compat/morphos/Makefile.am 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/compat/morphos/Makefile.am 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2007-2008 Philip Kendall -## $Id: Makefile.am 3935 2009-01-07 12:55:13Z pak21 $ +## $Id: Makefile.am 4237 2010-12-31 19:31:26Z 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 @@ -31,6 +31,7 @@ ../unix/file.c \ osname.c \ ../amiga/paths.c \ - ../unix/timer.c + ../unix/timer.c \ + ../unix/tuntap.c INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ Modified: vendor/fuse-emulator/current/fuse/compat/unix/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse/compat/unix/Makefile.am 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/compat/unix/Makefile.am 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2007-2008 Philip Kendall -## $Id: Makefile.am 3935 2009-01-07 12:55:13Z pak21 $ +## $Id: Makefile.am 4237 2010-12-31 19:31:26Z 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 @@ -31,6 +31,7 @@ file.c \ osname.c \ paths.c \ - timer.c + timer.c \ + tuntap.c INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ Modified: vendor/fuse-emulator/current/fuse/compat/unix/file.c =================================================================== --- vendor/fuse-emulator/current/fuse/compat/unix/file.c 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/compat/unix/file.c 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* file.c: File-related compatibility routines Copyright (c) 2008 Philip Kendall - $Id: file.c 4072 2009-08-31 15:42:26Z specu $ + $Id: file.c 4534 2011-08-11 12:59:47Z 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 @@ -90,3 +90,9 @@ { return fclose( fd ); } + +int +compat_file_exists( const char *path ) +{ + return ( access( path, R_OK ) != -1 ); +} Added: vendor/fuse-emulator/current/fuse/compat/unix/tuntap.c =================================================================== --- vendor/fuse-emulator/current/fuse/compat/unix/tuntap.c (rev 0) +++ vendor/fuse-emulator/current/fuse/compat/unix/tuntap.c 2012-02-15 12:43:10 UTC (rev 685) @@ -0,0 +1,70 @@ +/* tuntap.c: TUN/TAP compatability layer + Copyright (c) 2009-2010 Patrik Persson, Philip Kendall + + $Id: tuntap.c 4432 2011-05-11 14:08: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: phi...@sh... + +*/ + +#include "config.h" + +#include <fcntl.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> + +#ifdef LINUX_TAP +#include <linux/if_tun.h> +#include <net/if.h> +#include <sys/ioctl.h> +#endif /* #ifdef LINUX_TAP */ + +#include "ui/ui.h" + +int +compat_get_tap( const char *interface_name ) +{ + int fd = -1; + +#ifdef LINUX_TAP + + if ( (fd = open( "/dev/net/tun", O_RDWR | O_NONBLOCK )) < 0 ) + ui_error( UI_ERROR_ERROR, "couldn't open TUN/TAP device '/dev/net/tun'" ); + else { + struct ifreq ifr; + memset( &ifr, 0, sizeof( ifr ) ); + ifr.ifr_flags = IFF_TAP | IFF_NO_PI; + strncpy( ifr.ifr_name, interface_name, IFNAMSIZ ); + + if ( ioctl( fd, TUNSETIFF, (void *) &ifr ) < 0 ) { + ui_error( UI_ERROR_ERROR, "couldn't select TAP interface '%s'", + ifr.ifr_name ); + } + } + +#else + + ui_error( UI_ERROR_ERROR, + "TUN/TAP not yet supported for this operating system" ); + +#endif /* #ifdef LINUX_TAP */ + + return fd; +} Modified: vendor/fuse-emulator/current/fuse/compat/wii/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse/compat/wii/Makefile.am 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/compat/wii/Makefile.am 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2007-2008 Philip Kendall -## $Id: Makefile.am 4040 2009-06-27 09:32:42Z fredm $ +## $Id: Makefile.am 4237 2010-12-31 19:31:26Z 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 @@ -31,6 +31,7 @@ ../unix/file.c \ osname.c \ paths.c \ - timer.c + timer.c \ + ../unix/tuntap.c INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ Modified: vendor/fuse-emulator/current/fuse/compat/win32/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse/compat/win32/Makefile.am 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/compat/win32/Makefile.am 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2007-2008 Philip Kendall -## $Id: Makefile.am 3935 2009-01-07 12:55:13Z pak21 $ +## $Id: Makefile.am 4237 2010-12-31 19:31:26Z 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 @@ -31,6 +31,7 @@ ../unix/file.c \ osname.c \ paths.c \ - timer.c + timer.c \ + ../unix/tuntap.c INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@ Modified: vendor/fuse-emulator/current/fuse/compat/win32/timer.c =================================================================== --- vendor/fuse-emulator/current/fuse/compat/win32/timer.c 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/compat/win32/timer.c 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* timer.c: Win32 speed routines for Fuse Copyright (c) 1999-2008 Philip Kendall, Marek Januszewski, Fredrick Meunier - $Id: timer.c 3951 2009-01-12 18:09:42Z specu $ + $Id: timer.c 4365 2011-04-14 00:38: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 Modified: vendor/fuse-emulator/current/fuse/compat.h =================================================================== --- vendor/fuse-emulator/current/fuse/compat.h 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/compat.h 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* compat.h: various compatibility bits Copyright (c) 2003-2008 Philip Kendall - $Id: compat.h 4068 2009-08-30 19:30:19Z specu $ + $Id: compat.h 4534 2011-08-11 12:59:47Z 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 @@ -96,6 +96,7 @@ int compat_file_write( compat_fd fd, const unsigned char *buffer, size_t length ); int compat_file_close( compat_fd fd ); +int compat_file_exists( const char *path ); /* Directory handling */ @@ -115,4 +116,8 @@ double compat_timer_get_time( void ); void compat_timer_sleep( int ms ); +/* TUN/TAP handling */ + +int compat_get_tap( const char *interface_name ); + #endif /* #ifndef FUSE_COMPAT_H */ Modified: vendor/fuse-emulator/current/fuse/configure.in =================================================================== --- vendor/fuse-emulator/current/fuse/configure.in 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/configure.in 2012-02-15 12:43:10 UTC (rev 685) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Id: configure.in 4329 2011-03-27 22:26:07Z pak21 $ +dnl $Id: configure.in 4617 2012-01-03 11:47:27Z fredm $ 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 @@ -23,7 +23,7 @@ AM_CONFIG_HEADER(config.h) AC_CANONICAL_SYSTEM -define(FUSE_VERSION, [1.0.0.1a]) +define(FUSE_VERSION, [1.0.0]) dnl Use automake to produce `Makefile.in' AM_INIT_AUTOMAKE(fuse, FUSE_VERSION) @@ -38,18 +38,27 @@ 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" - define(FUSE_FULL_VERSION, - [ifelse(translit(FUSE_VERSION, [0-9]), [.], [FUSE_VERSION[.0.0]], - translit(FUSE_VERSION, [0-9]), [..], [FUSE_VERSION[.0]], - [FUSE_VERSION])])dnl - AC_DEFINE([VERSION_WIN32], [translit(FUSE_FULL_VERSION, [.], [,])], [Define version information for win32 executable]) +AC_MSG_CHECKING(whether to use windres) +AC_ARG_WITH(windres, +[ --without-windres don't use windres], +if test "$withval" = no; then windres=no; else windres=yes; fi, +windres=yes) +AC_MSG_RESULT($windres) +if test "$windres" = yes; then + AC_CHECK_TOOL(WINDRES, windres, no) + AC_SUBST(WINDRES) + if test "$WINDRES" != no; then + WINDRES_OBJ="windres.o" + define(FUSE_FULL_VERSION, + [ifelse(translit(FUSE_VERSION, [0-9]), [.], [FUSE_VERSION[.0.0]], + translit(FUSE_VERSION, [0-9]), [..], [FUSE_VERSION[.0]], + [FUSE_VERSION])])dnl + AC_DEFINE([VERSION_WIN32], [translit(FUSE_FULL_VERSION, [.], [,])], [Define version information for win32 executable]) + FUSE_FULL[]_VERSION=FUSE_FULL_VERSION + AC_SUBST(FUSE_FULL[]_VERSION) + fi fi AC_SUBST(WINDRES_OBJ) -AM_SUBST_NOTMAKE(WINDRES_OBJ) dnl Generate commandy.h YFLAGS="$YFLAGS -d" @@ -66,7 +75,8 @@ strings.h \ sys/soundcard.h \ sys/audio.h \ - sys/audioio.h + sys/audioio.h \ + zlib.h ) dnl Checks for typedefs, structures, and compiler characteristics. @@ -217,9 +227,9 @@ gtk=yes) AC_MSG_RESULT($gtk) if test "$gtk" = yes; then - AM_PATH_GTK_2_0(2.0.0, + AM_PATH_GTK_2_0(2.18.0, AC_DEFINE([UI_GTK], 1, - [Defined if GTK+ UI (either 1.2 or 2.x) is in use]) + [Defined if GTK+ UI 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])) @@ -283,21 +293,12 @@ glib=yes) AC_MSG_RESULT($glib) if test "$glib" = yes; then - glib2=no AM_PATH_GLIB_2_0( - 2.0.0, - glib2=yes + 2.20.0, AC_DEFINE([HAVE_LIB_GLIB], 1, [Defined if we've got glib]) LIBS="$LIBS `pkg-config --libs glib-2.0`", + AC_MSG_WARN(glib not found - using libspectrum's replacement) ) - 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 @@ -367,33 +368,35 @@ if test -n "$LIBPNG_CONFIG"; then PNG_CFLAGS=`libpng-config --cflags` PNG_LIBS=`libpng-config --ldflags` - PNG_LIBS=`echo " $PNG_LIBS" | sed 's/ -l[[^ ]][[^ ]]*//g'` + AC_DEFINE([USE_LIBPNG], 1, [Defined if we're going to be using the installed libpng]) + else + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $PNG_CFLAGS" + ac_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$PNG_LIBS $LDFLAGS" + + 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_CHECK_HEADERS(libpng/png.h, + [CPPFLAGS="$ac_save_CPPFLAGS $PNG_CFLAGS/libpng" + 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) + PNG_LIBS=''] + )], + )], + [AC_MSG_WARN(png_write_png not found - saving screenshots disabled) + PNG_LIBS=''] + ) + + CPPFLAGS="$ac_save_CPPFLAGS" + LDFLAGS="$ac_save_LDFLAGS" fi - ac_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $PNG_CFLAGS" - ac_save_LDFLAGS="$LDFLAGS" - LDFLAGS="$PNG_LIBS $LDFLAGS" - - 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_CHECK_HEADERS(libpng/png.h, - [CPPFLAGS="$ac_save_CPPFLAGS $PNG_CFLAGS/libpng" - 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) - PNG_LIBS=''] - )], - )], - [AC_MSG_WARN(png_write_png not found - saving screenshots disabled) - PNG_LIBS=''] - ) AC_SUBST(PNG_LIBS) fi -LDFLAGS="$ac_save_LDFLAGS" - dnl Check if a version of libasound which supplies pcm is available AC_MSG_CHECKING(whether ALSA requested) AC_ARG_WITH(alsa, @@ -535,16 +538,40 @@ 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)], + AS_HELP_STRING([--disable-ui-joystick], [use libjsw 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]) + AC_MSG_RESULT([no, use libjsw]) else - AC_MSG_RESULT(yes) - AC_DEFINE([USE_JOYSTICK], 1, [Defined if we're using hardware joysticks]) + AC_MSG_RESULT(yes) + AC_DEFINE([USE_JOYSTICK], 1, [Defined if we're using hardware joysticks]) fi ;; + gtk|xlib) + dnl These UIs could use SDL library for handling joysticks + AC_MSG_CHECKING([whether to use $UI's joystick support]) + AC_ARG_ENABLE(ui-joystick, + AS_HELP_STRING([--disable-ui-joystick], [use libjsw 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) + SDL_VERSION=1.2.4 + AM_PATH_SDL($SDL_VERSION, + LIBS="$LIBS `sdl-config --libs`" + CPPFLAGS="$CPPFLAGS `sdl-config --cflags`" + AC_DEFINE([USE_JOYSTICK], 1, [Defined if we're using hardware joysticks]), + AC_MSG_WARN([SDL version $SDL_VERSION not found - joystick support disabled])) + fi + ;; + wii) + dnl Wii UI check this elsewhere + AC_MSG_RESULT(yes) + libjsw=no + ;; *) dnl Our only option is libjsw. libjsw=yes @@ -584,6 +611,24 @@ fi AC_SUBST(TIMER_LIBADD) +dnl See if Linux TAP devices are supported +AC_MSG_CHECKING(whether Linux TAP devices are supported) +ac_save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $LIBSPEC_CFLAGS" +AC_TRY_COMPILE([ + #include <linux/if_tun.h> + #include <net/if.h> + #include <sys/ioctl.h> + ],[ + int test1 = IFF_TAP | IFF_NO_PI; + int test2 = TUNSETIFF; + ], + AC_DEFINE([LINUX_TAP], 1, [Define to 1 if Linux TAP devices are supported.]) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) + +CPPFLAGS="$ac_save_CPPFLAGS" + dnl Work out which standard routines we're missing AC_MSG_CHECKING(which standard routines we're missing) missing_routines='' @@ -679,12 +724,14 @@ compat/wii/Makefile \ compat/win32/Makefile \ debugger/Makefile \ -disk/Makefile \ hacking/Makefile \ -ide/Makefile \ lib/Makefile \ machines/Makefile \ man/Makefile \ +peripherals/Makefile \ +peripherals/disk/Makefile \ +peripherals/ide/Makefile \ +peripherals/nic/Makefile \ perl/Makefile \ perl/Fuse/Makefile \ pokefinder/Makefile \ @@ -699,6 +746,7 @@ ui/sdl/Makefile \ ui/scaler/Makefile \ ui/widget/Makefile \ +ui/win32/fuse.manifest \ ui/win32/Makefile \ ui/win32/icons/Makefile \ ui/win32/installer/Makefile \ Modified: vendor/fuse-emulator/current/fuse/debugger/breakpoint.c =================================================================== --- vendor/fuse-emulator/current/fuse/debugger/breakpoint.c 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/debugger/breakpoint.c 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* breakpoint.c: a debugger breakpoint - Copyright (c) 2002-2008 Philip Kendall + Copyright (c) 2002-2011 Philip Kendall - $Id: breakpoint.c 4239 2011-01-01 15:41:13Z pak21 $ + $Id: breakpoint.c 4415 2011-05-01 22:51:43Z 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 @@ -79,9 +79,9 @@ /* 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_breakpoint_add_address( debugger_breakpoint_type type, int source, + int page, libspectrum_word offset, + size_t ignore, debugger_breakpoint_life life, debugger_expression *condition ) { debugger_breakpoint_value value; @@ -98,6 +98,7 @@ fuse_abort(); } + value.address.source = source; value.address.page = page; value.address.offset = offset; @@ -270,87 +271,30 @@ return ( debugger_mode == DEBUGGER_MODE_HALTED ); } -static int -encode_bank_and_page( debugger_breakpoint_type type, libspectrum_word address ) +static memory_page* +get_page( debugger_breakpoint_type type, libspectrum_word address ) { - memory_page *read_write, *page; - breakpoint_page_offset offset; + memory_page *page; switch( type ) { case DEBUGGER_BREAKPOINT_TYPE_EXECUTE: case DEBUGGER_BREAKPOINT_TYPE_READ: - read_write = memory_map_read; + page = memory_map_read; break; case DEBUGGER_BREAKPOINT_TYPE_WRITE: - read_write = memory_map_write; + page = 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] ); + "%s:get_page: unexpected breakpoint type %d", __FILE__, type ); fuse_abort(); } - offset += atoi( &text[1] ); - - return offset; + return page; } -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 ) { @@ -371,8 +315,6 @@ breakpoint_check( debugger_breakpoint *bp, debugger_breakpoint_type type, libspectrum_dword value ) { - int page; - if( bp->type != type ) return 0; switch( type ) { @@ -381,15 +323,15 @@ 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 source == memory_source_any, value must match exactly; otherwise, + the source, page and offset must match */ + if( bp->value.address.source == memory_source_any ) { 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; + memory_page *page = get_page( type, value ); + if( bp->value.address.source != page->source || + bp->value.address.page != page->page_num || + bp->value.address.offset != ( value & 0x3fff ) ) return 0; } break; @@ -536,7 +478,7 @@ return 1; /* Ignore all page-specific breakpoints */ - if( bp->value.address.page != -1 ) return 1; + if( bp->value.address.source != memory_source_any ) return 1; return bp->value.address.offset - address; } Modified: vendor/fuse-emulator/current/fuse/debugger/breakpoint.h =================================================================== --- vendor/fuse-emulator/current/fuse/debugger/breakpoint.h 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/debugger/breakpoint.h 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* breakpoint.h: a debugger breakpoint - Copyright (c) 2002-2008 Philip Kendall + Copyright (c) 2002-2011 Philip Kendall - $Id: breakpoint.h 3662 2008-06-09 11:19:29Z pak21 $ + $Id: breakpoint.h 4415 2011-05-01 22:51:43Z 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 @@ -26,6 +26,8 @@ #ifndef FUSE_DEBUGGER_BREAKPOINT_H #define FUSE_DEBUGGER_BREAKPOINT_H +#include "memory.h" + /* Types of breakpoint */ typedef enum debugger_breakpoint_type { DEBUGGER_BREAKPOINT_TYPE_EXECUTE, @@ -51,20 +53,20 @@ typedef struct debugger_breakpoint_address { + /* Which memory device we are interested in. memory_source_any for an + absolute address */ + int source; + + /* The page number from the source we are interested in. Not used for + MEMORY_SOURCE_ANY */ int page; + + /* The offset within the page, or the absolute address for + MEMORY_SOURCE_ANY */ 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; @@ -117,7 +119,7 @@ /* Add a new breakpoint */ int debugger_breakpoint_add_address( - debugger_breakpoint_type type, int page, libspectrum_word offset, + debugger_breakpoint_type type, int source, int page, libspectrum_word offset, size_t ignore, debugger_breakpoint_life life, debugger_expression *condition ); @@ -143,7 +145,4 @@ 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 */ Modified: vendor/fuse-emulator/current/fuse/debugger/commandl.l =================================================================== --- vendor/fuse-emulator/current/fuse/debugger/commandl.l 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/debugger/commandl.l 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* commandl.l: Debugger command lexical scanner Copyright (c) 2002-2008 Philip Kendall - $Id: commandl.l 4130 2010-05-18 12:06:19Z fredm $ + $Id: commandl.l 4415 2011-05-01 22:51:43Z 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 @@ -139,8 +139,6 @@ 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; } Modified: vendor/fuse-emulator/current/fuse/debugger/commandy.y =================================================================== --- vendor/fuse-emulator/current/fuse/debugger/commandy.y 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/debugger/commandy.y 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* commandy.y: Parse a debugger command - Copyright (c) 2002-2008 Philip Kendall + Copyright (c) 2002-2011 Philip Kendall - $Id: commandy.y 3657 2008-06-08 15:04:37Z pak21 $ + $Id: commandy.y 4415 2011-05-01 22:51:43Z 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 @@ -53,7 +53,8 @@ debugger_breakpoint_type bptype; debugger_breakpoint_life bplife; - struct { int value1; libspectrum_word value2; } pair; + struct { libspectrum_word mask, value; } port; + struct { int source; int page; int offset; } location; debugger_expression* exp; @@ -97,7 +98,6 @@ %token TIME %token WRITE -%token <integer> PAGE %token <reg> DEBUGGER_REGISTER %token <integer> NUMBER @@ -111,8 +111,8 @@ %type <bplife> breakpointlife %type <bptype> breakpointtype -%type <integer> pageornumber -%type <pair> breakpointpair +%type <port> breakpointport +%type <location> breakpointlocation %type <bptype> portbreakpointtype %type <integer> numberorpc %type <integer> number @@ -151,15 +151,14 @@ ; command: BASE number { debugger_output_base = $2; } - | breakpointlife breakpointtype breakpointpair optionalcondition { - debugger_breakpoint_add_address( $2, $3.value1, $3.value2, 0, $1, - $4 ); + | breakpointlife breakpointtype breakpointlocation optionalcondition { + debugger_breakpoint_add_address( $2, $3.source, $3.page, $3.offset, + 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 PORT portbreakpointtype breakpointport optionalcondition { + int mask = $4.mask; + if( mask == 0 ) mask = ( $4.value < 0x100 ? 0x00ff : 0xffff ); + debugger_breakpoint_add_port( $3, $4.value, mask, 0, $1, $5 ); } | breakpointlife TIME number optionalcondition { debugger_breakpoint_add_time( DEBUGGER_BREAKPOINT_TYPE_TIME, @@ -201,12 +200,22 @@ | WRITE { $$ = DEBUGGER_BREAKPOINT_TYPE_WRITE; } ; -breakpointpair: numberorpc { $$.value1 = -1; $$.value2 = $1; } - | pageornumber ':' number { $$.value1 = $1; $$.value2 = $3; } +breakpointport: number { $$.mask = 0; $$.value = $1; } + | number ':' number { $$.mask = $1; $$.value = $3; } ; -pageornumber: PAGE { $$ = $1; } - | number { $$ = $1; } +breakpointlocation: numberorpc { $$.source = memory_source_any; $$.offset = $1; } + | STRING ':' number ':' number { + $$.source = memory_source_find( $1 ); + if( $$.source == -1 ) { + char buffer[80]; + snprintf( buffer, 80, "unknown memory source \"%s\"", $1 ); + yyerror( buffer ); + YYERROR; + } + $$.page = $3; + $$.offset = $5; + } portbreakpointtype: READ { $$ = DEBUGGER_BREAKPOINT_TYPE_PORT_READ; } | WRITE { $$ = DEBUGGER_BREAKPOINT_TYPE_PORT_WRITE; } Modified: vendor/fuse-emulator/current/fuse/debugger/debugger.c =================================================================== --- vendor/fuse-emulator/current/fuse/debugger/debugger.c 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/debugger/debugger.c 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* debugger.c: Fuse's monitor/debugger - Copyright (c) 2002-2008 Philip Kendall + Copyright (c) 2002-2011 Philip Kendall - $Id: debugger.c 3686 2008-06-21 14:33:22Z pak21 $ + $Id: debugger.c 4540 2011-09-05 12:31:18Z 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 @@ -87,6 +87,8 @@ debugger_end( void ) { debugger_breakpoint_remove_all(); + debugger_event_end(); + return 0; } @@ -116,9 +118,10 @@ 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_breakpoint_add_address( + DEBUGGER_BREAKPOINT_TYPE_EXECUTE, memory_source_any, 0, PC + length, 0, + DEBUGGER_BREAKPOINT_LIFE_ONESHOT, NULL + ); debugger_run(); @@ -146,7 +149,7 @@ target = readbyte_internal( SP ) + 0x100 * readbyte_internal( SP+1 ); if( debugger_breakpoint_add_address( - DEBUGGER_BREAKPOINT_TYPE_EXECUTE, -1, target, 0, + DEBUGGER_BREAKPOINT_TYPE_EXECUTE, memory_source_any, 0, target, 0, DEBUGGER_BREAKPOINT_LIFE_ONESHOT, NULL ) ) Modified: vendor/fuse-emulator/current/fuse/debugger/debugger_internals.h =================================================================== --- vendor/fuse-emulator/current/fuse/debugger/debugger_internals.h 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/debugger/debugger_internals.h 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* debugger_internals.h: The internals of Fuse's monitor/debugger - Copyright (c) 2002-2008 Philip Kendall + Copyright (c) 2002-2011 Philip Kendall - $Id: debugger_internals.h 4125 2010-05-06 22:18:50Z pak21 $ + $Id: debugger_internals.h 4540 2011-09-05 12:31:18Z 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 @@ -59,7 +59,6 @@ /* 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 ); @@ -102,6 +101,7 @@ int debugger_event_init( void ); int debugger_event_is_registered( const char *type, const char *detail ); +void debugger_event_end( void ); /* Variables handling */ Modified: vendor/fuse-emulator/current/fuse/debugger/disassemble.c =================================================================== --- vendor/fuse-emulator/current/fuse/debugger/disassemble.c 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/debugger/disassemble.c 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* disassemble.c: Fuse's disassembler Copyright (c) 2002-2003 Darren Salt, Philip Kendall - $Id: disassemble.c 4087 2009-09-02 13:42:00Z fredm $ + $Id: disassemble.c 4547 2011-09-27 11:50: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 @@ -531,7 +531,11 @@ break; case 0x05: case 0x0d: - snprintf( buffer, buflen, "RETN" ); *length = 1; + if( b == 0x4d ) { + snprintf( buffer, buflen, "RETI" ); *length = 1; + } else { + snprintf( buffer, buflen, "RETN" ); *length = 1; + } break; case 0x06: case 0x0e: Modified: vendor/fuse-emulator/current/fuse/debugger/event.c =================================================================== --- vendor/fuse-emulator/current/fuse/debugger/event.c 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/debugger/event.c 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* event.c: Debugger events Copyright (c) 2008 Philip Kendall - $Id: event.c 3922 2008-12-31 19:01:31Z zubzero $ + $Id: event.c 4540 2011-09-05 12:31:18Z 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 @@ -116,3 +116,22 @@ } } } + +/* Tidy-up function called at end of emulation */ +void +debugger_event_end( void ) +{ + int i; + debugger_event_t event; + + if( !registered_events ) return; + + for( i = 0; i < registered_events->len; i++ ) { + event = g_array_index( registered_events, debugger_event_t, i ); + free( event.detail ); + free( event.type ); + } + + g_array_free( registered_events, TRUE ); + registered_events = NULL; +} Modified: vendor/fuse-emulator/current/fuse/display.c =================================================================== --- vendor/fuse-emulator/current/fuse/display.c 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/display.c 2012-02-15 12:43:10 UTC (rev 685) @@ -2,7 +2,7 @@ Copyright (c) 1999-2006 Philip Kendall, Thomas Harte, Witold Filipczyk and Fredrick Meunier - $Id: display.c 4105 2009-12-15 10:15:43Z fredm $ + $Id: display.c 4288 2011-02-03 21:06: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 @@ -35,13 +35,13 @@ #include "event.h" #include "fuse.h" #include "machine.h" +#include "peripherals/scld.h" #include "rectangle.h" #include "screenshot.h" #include "settings.h" #include "spectrum.h" #include "ui/ui.h" #include "ui/uidisplay.h" -#include "scld.h" /* Set once we have initialised the UI */ int display_ui_initialised = 0; Modified: vendor/fuse-emulator/current/fuse/event.c =================================================================== --- vendor/fuse-emulator/current/fuse/event.c 2012-02-15 12:32:32 UTC (rev 684) +++ vendor/fuse-emulator/current/fuse/event.c 2012-02-15 12:43:10 UTC (rev 685) @@ -1,7 +1,7 @@ /* event.c: Routines needed for dealing with the event list Copyright (c) 2000-2008 Philip Kendall - $Id: event.c 3912 2008-12-15 05:10:21Z pak21 $ + $Id: event.c 4540 2011-09-05 12:31:18Z 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 @@ -264,9 +264,27 @@ return g_array_index( registered_events, event_descriptor_t, type ).description; } +void +registered_events_free( void ) +{ + int i; + event_descriptor_t descriptor; + + if( !registered_events ) return; + + for( i = 0; i < registered_events->len; i++ ) { + descriptor = g_array_index( registered_events, event_... [truncated message content] |
From: <fr...@us...> - 2012-02-15 12:32:44
|
Revision: 684 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=684&view=rev Author: fredm Date: 2012-02-15 12:32:32 +0000 (Wed, 15 Feb 2012) Log Message: ----------- To prepare to load . into vendor/fuse-emulator/current, perform 24 renames. Added Paths: ----------- vendor/fuse-emulator/current/fuse/peripherals/ vendor/fuse-emulator/current/fuse/peripherals/ay.c vendor/fuse-emulator/current/fuse/peripherals/ay.h vendor/fuse-emulator/current/fuse/peripherals/dck.c vendor/fuse-emulator/current/fuse/peripherals/dck.h vendor/fuse-emulator/current/fuse/peripherals/disk/ vendor/fuse-emulator/current/fuse/peripherals/fuller.c vendor/fuse-emulator/current/fuse/peripherals/fuller.h vendor/fuse-emulator/current/fuse/peripherals/ide/ vendor/fuse-emulator/current/fuse/peripherals/if1.c vendor/fuse-emulator/current/fuse/peripherals/if1.h vendor/fuse-emulator/current/fuse/peripherals/if2.c vendor/fuse-emulator/current/fuse/peripherals/if2.h vendor/fuse-emulator/current/fuse/peripherals/joystick.c vendor/fuse-emulator/current/fuse/peripherals/joystick.h vendor/fuse-emulator/current/fuse/peripherals/kempmouse.c vendor/fuse-emulator/current/fuse/peripherals/kempmouse.h vendor/fuse-emulator/current/fuse/peripherals/melodik.c vendor/fuse-emulator/current/fuse/peripherals/melodik.h vendor/fuse-emulator/current/fuse/peripherals/printer.c vendor/fuse-emulator/current/fuse/peripherals/printer.h vendor/fuse-emulator/current/fuse/peripherals/scld.c vendor/fuse-emulator/current/fuse/peripherals/scld.h vendor/fuse-emulator/current/fuse/peripherals/ula.c vendor/fuse-emulator/current/fuse/peripherals/ula.h Removed Paths: ------------- vendor/fuse-emulator/current/fuse/ay.c vendor/fuse-emulator/current/fuse/ay.h vendor/fuse-emulator/current/fuse/dck.c vendor/fuse-emulator/current/fuse/dck.h vendor/fuse-emulator/current/fuse/disk/ vendor/fuse-emulator/current/fuse/fuller.c vendor/fuse-emulator/current/fuse/fuller.h vendor/fuse-emulator/current/fuse/ide/ 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/if2.h vendor/fuse-emulator/current/fuse/joystick.c vendor/fuse-emulator/current/fuse/joystick.h vendor/fuse-emulator/current/fuse/kempmouse.c vendor/fuse-emulator/current/fuse/kempmouse.h vendor/fuse-emulator/current/fuse/melodik.c vendor/fuse-emulator/current/fuse/melodik.h vendor/fuse-emulator/current/fuse/printer.c vendor/fuse-emulator/current/fuse/printer.h vendor/fuse-emulator/current/fuse/scld.c vendor/fuse-emulator/current/fuse/scld.h vendor/fuse-emulator/current/fuse/ula.c vendor/fuse-emulator/current/fuse/ula.h Deleted: vendor/fuse-emulator/current/fuse/ay.c =================================================================== --- vendor/fuse-emulator/current/fuse/ay.c 2012-01-14 13:01:10 UTC (rev 683) +++ vendor/fuse-emulator/current/fuse/ay.c 2012-02-15 12:32:32 UTC (rev 684) @@ -1,169 +0,0 @@ -/* ay.c: AY-8-3912 routines - Copyright (c) 1999-2009 Philip Kendall - - $Id: ay.c 4030 2009-06-07 14:38:38Z 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: phi...@sh... - -*/ - -#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 ); -} - -void -ay_state_from_snapshot( libspectrum_snap *snap ) -{ - size_t i; - - 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_from_snapshot( libspectrum_snap *snap ) -{ - if( machine_current->capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_AY ) { - ay_state_from_snapshot( snap ); - } -} - -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] ); -} Deleted: vendor/fuse-emulator/current/fuse/ay.h =================================================================== --- vendor/fuse-emulator/current/fuse/ay.h 2012-01-14 13:01:10 UTC (rev 683) +++ vendor/fuse-emulator/current/fuse/ay.h 2012-02-15 12:32:32 UTC (rev 684) @@ -1,47 +0,0 @@ -/* ay.h: AY-8-3912 routines - Copyright (c) 1999-2009 Philip Kendall - - $Id: ay.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... - -*/ - -#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 ); - -void ay_state_from_snapshot( libspectrum_snap *snap ); - -#endif /* #ifndef FUSE_AY_H */ Deleted: vendor/fuse-emulator/current/fuse/dck.c =================================================================== --- vendor/fuse-emulator/current/fuse/dck.c 2012-01-14 13:01:10 UTC (rev 683) +++ vendor/fuse-emulator/current/fuse/dck.c 2012-02-15 12:32:32 UTC (rev 684) @@ -1,184 +0,0 @@ -/* 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: phi...@sh... - - Darren: li...@yo... - Fred: fr...@sp... - -*/ - -#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 ); -} Deleted: vendor/fuse-emulator/current/fuse/dck.h =================================================================== --- vendor/fuse-emulator/current/fuse/dck.h 2012-01-14 13:01:10 UTC (rev 683) +++ vendor/fuse-emulator/current/fuse/dck.h 2012-02-15 12:32:32 UTC (rev 684) @@ -1,39 +0,0 @@ -/* 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: phi...@sh... - - Darren: li...@yo... - Fred: fr...@sp... - -*/ - -#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 Deleted: vendor/fuse-emulator/current/fuse/fuller.c =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.c 2012-01-14 13:01:10 UTC (rev 683) +++ vendor/fuse-emulator/current/fuse/fuller.c 2012-02-15 12:32:32 UTC (rev 684) @@ -1,90 +0,0 @@ -/* fuller.c: Routines for handling the Fuller Box - Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier - - $Id: fuller.c 4032 2009-06-10 11:09:44Z 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: phi...@sh... - - Stuart: sd...@nt... - -*/ - -#include <config.h> - -#include <libspectrum.h> - -#include "ay.h" -#include "compat.h" -#include "fuller.h" -#include "joystick.h" -#include "module.h" -#include "periph.h" -#include "settings.h" - -static void fuller_enabled_snapshot( libspectrum_snap *snap ); -static void fuller_from_snapshot( libspectrum_snap *snap ); -static void fuller_to_snapshot( libspectrum_snap *snap ); - -static module_info_t fuller_module_info = { - - NULL, - NULL, - fuller_enabled_snapshot, - fuller_from_snapshot, - fuller_to_snapshot, - -}; - -const periph_t fuller_peripherals[] = { - { 0x00ff, 0x003f, ay_registerport_read, ay_registerport_write }, - { 0x00ff, 0x005f, NULL, ay_dataport_write }, - { 0x00ff, 0x007f, joystick_fuller_read, NULL }, -}; - -const size_t fuller_peripherals_count = - sizeof( fuller_peripherals ) / sizeof( periph_t ); - -static void -fuller_enabled_snapshot( libspectrum_snap *snap ) -{ - if( libspectrum_snap_fuller_box_active( snap ) ) - settings_current.fuller = 1; -} - -static void -fuller_from_snapshot( libspectrum_snap *snap ) -{ - if( periph_fuller_active ) { - ay_state_from_snapshot( snap ); - } -} - -static void -fuller_to_snapshot( libspectrum_snap *snap ) -{ - libspectrum_snap_set_fuller_box_active( snap, periph_fuller_active ); -} - -int -fuller_init( void ) -{ - module_register( &fuller_module_info ); - - return 0; -} Deleted: vendor/fuse-emulator/current/fuse/fuller.h =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.h 2012-01-14 13:01:10 UTC (rev 683) +++ vendor/fuse-emulator/current/fuse/fuller.h 2012-02-15 12:32:32 UTC (rev 684) @@ -1,40 +0,0 @@ -/* fuller.h: Routines for handling the Fuller Box - Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier - - $Id: fuller.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... - - Stuart: sd...@nt... - -*/ - -#ifndef FUSE_FULLER_H -#define FUSE_FULLER_H - -#include <libspectrum.h> - -#include "periph.h" - -extern const periph_t fuller_peripherals[]; -extern const size_t fuller_peripherals_count; - -int fuller_init( void ); - -#endif /* #ifndef FUSE_FULLER_H */ Deleted: vendor/fuse-emulator/current/fuse/if1.c =================================================================== --- vendor/fuse-emulator/current/fuse/if1.c 2012-01-14 13:01:10 UTC (rev 683) +++ vendor/fuse-emulator/current/fuse/if1.c 2012-02-15 12:32:32 UTC (rev 684) @@ -1,1304 +0,0 @@ -/* if1.c: Interface I handling routines - Copyright (c) 2004-2008 Gergely Szasz, Philip Kendall - - $Id: if1.c 4180 2010-10-09 12:59:37Z 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: - - Gergely: sz...@hu... - -*/ - -#include <config.h> - -#include <string.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> - -#include <unistd.h> - -#include "compat.h" -#include "debugger/debugger.h" -#include "if1.h" -#include "machine.h" -#include "memory.h" -#include "module.h" -#include "periph.h" -#include "settings.h" -#include "utils.h" -#include "ui/ui.h" - -#undef IF1_DEBUG_MDR -#undef IF1_DEBUG_NET -#undef IF1_DEBUG_NET_1 - -#define BUFF_EMPTY 0x100 - -enum { - SYNC_NO = 0, - SYNC_OK = 0xff -}; - -/* - Microdrive cartridge - GAP PREAMBLE 15 byte GAP PREAMBLE 15 byte 512 1 - [-----][00 00 ... ff ff][BLOCK HEAD][-----][00 00 ... ff ff][REC HEAD][ DATA ][CHK] - Preamble = 10 * 0x00 + 2 * 0xff (12 byte) -*/ - -typedef struct microdrive_t { - utils_file file; - char *filename; /* old filename */ - int inserted; - int modified; - int motor_on; - int head_pos; - int transfered; - int max_bytes; - libspectrum_byte pream[512]; /* preamble/sync area written */ - libspectrum_byte last; - libspectrum_byte gap; - libspectrum_byte sync; - - libspectrum_microdrive *cartridge; /* write protect, len, blocks */ - -} microdrive_t; - -typedef struct if1_ula_t { - int fd_r; /* file descriptor for reading bytes or bits RS232 */ - int fd_t; /* file descriptor for writing bytes or bits RS232 */ - int fd_net; /* file descriptor for rw bytes or bits SinclairNET */ - int rs232_buffer; /* read buffer */ - int s_net_mode; - int status; /* if1_ula/SinclairNET */ - int comms_data; /* the previous data comms state */ - int comms_clk; /* the previous data comms state */ - int cts; /* CTS of peripheral */ - int dtr; /* DTR of peripheral */ - int tx; /* TxD the name is very kind, because this is the read end of - the TxD wire of DATA machine (really RxD the view of - spectrum */ - int rx; /* RxD the name is very kind, because this is the write end of - the RxD wire of DATA machine (really TxD the view of - spectrum */ - int data_in; /* interpreted incoming data */ - int count_in; - int data_out; /* interpreted outgoing data */ - int count_out; - int esc_in; /* if we compose an escape seq */ - - int net; /* Network in/out (really 1 wire bus :-) */ - int net_data; /* Interpreted network data */ - int net_state; /* Interpreted network data */ - int wait; /* Wait state */ - int busy; /* Indicate busy; if1 software never poll it ... */ -} if1_ula_t; - -/* - 7 6 5 4 3 2 1 0 - STATUS RO $EF(239) --- --- --- BSY DTR GAP SYN WPR - - CONTRO WO $EF(239) --- --- WAT CTS ERA R/w CLK DTA - - MDR DT RW $E7(231) D7 D6 D5 D4 D3 D2 D1 D0 - - COMM I RO $F7(247) TX --- --- --- --- --- --- NET - - COMM O WO $F7(247) --- --- --- --- --- --- --- NET/RX - -RS232: - DTR -> Data Terminal Ready (DTE -> DCE) - CTS -> Clear To Send (DCE -> DTE) - TX -> Transmitted Data (DTE -> DCE) - RX -> Received Data (DCE -> DTE) - - The IF1 serial behaves not as a DTE (Data Terminal Equipment, e.g. - a computer) but as a DCE (Data Communications Equipment, e.g. a modem) - - If we were to consider the ZX Spectrum a DTE, we would rename the lines: - DTR := DSR (Data Set Ready) - CTS := RTS (Request To Send) - TX := RX - RX := TX - - On the communication channels: - Bytes interpreted as is, except: - 0x00 0x00 --> DTR ~~\__ - 0x00 0x01 --> DTR __/~~ - 0x00 0x02 --> CTS ~~\__ - 0x00 0x03 --> CTS __/~~ - 0x00 ? --> lost - 0x00 * --> 0x00 - Additionally: - if fuse read 0x00 0x00 => DTR = 0 ~~\__ - if fuse read 0x00 0x01 => DTR = 1 __/~~ - if CTS = ~~\__ fuse send 0x00 0x02 - if CTS = __/~~ fuse send 0x00 0x03 - if fuse lost send 0x00 + 0x3f (?) - every other 0x00 + 0x## are discarded -*/ - -/* Two 8Kb memory chunks accessible by the Z80 when /ROMCS is low */ -static memory_page if1_memory_map_romcs[2]; - -/* IF1 paged out ROM activated? */ -int if1_active = 0; -int if1_available = 0; -static int if1_mdr_status = 0; - -int rnd_factor = ( ( RAND_MAX >> 2 ) << 2 ) / 19 + 1; - -static microdrive_t microdrive[8]; /* We have 8 microdrive */ -static if1_ula_t if1_ula; - -static void microdrives_reset( void ); -static void microdrives_restart( void ); -static void increment_head( int m ); - -#define MDR_IN(m) microdrive[m - 1].inserted -#define MDR_WP(m) libspectrum_microdrive_write_protect( microdrive[m - 1].cartridge ) - -enum if1_menu_item { - - UMENU_ALL = 0, - UMENU_MDRV1, - UMENU_MDRV2, - UMENU_MDRV3, - UMENU_MDRV4, - UMENU_MDRV5, - UMENU_MDRV6, - UMENU_MDRV7, - UMENU_MDRV8, - UMENU_RS232, -}; - -enum if1_port { - PORT_MDR, - PORT_CTR, - PORT_NET, - PORT_UNKNOWN, -}; - -static void if1_reset( int hard_reset ); -static void if1_enabled_snapshot( libspectrum_snap *snap ); -static void if1_from_snapshot( libspectrum_snap *snap ); -static void if1_to_snapshot( libspectrum_snap *snap ); - -static module_info_t if1_module_info = { - - if1_reset, - if1_memory_map, - if1_enabled_snapshot, - if1_from_snapshot, - if1_to_snapshot, - -}; - -const periph_t if1_peripherals[] = { - { 0x0018, 0x0010, if1_port_in, if1_port_out }, - { 0x0018, 0x0008, if1_port_in, if1_port_out }, - { 0x0018, 0x0000, if1_port_in, if1_port_out }, -}; - -const size_t if1_peripherals_count = - sizeof( if1_peripherals ) / sizeof( periph_t ); - -/* Debugger events */ -static const char *event_type_string = "if1"; -static int page_event, unpage_event; - -static void -update_menu( enum if1_menu_item what ) -{ - if( what == UMENU_ALL || what == UMENU_MDRV1 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_EJECT, MDR_IN( 1 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_WP_SET, - !MDR_IN( 1 ) ? 0 : !MDR_WP( 1 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV2 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_EJECT, MDR_IN( 2 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_WP_SET, - !MDR_IN( 2 ) ? 0 : !MDR_WP( 2 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV3 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_EJECT, MDR_IN( 3 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_WP_SET, - !MDR_IN( 3 ) ? 0 : !MDR_WP( 3 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV4 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_EJECT, MDR_IN( 4 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_WP_SET, - !MDR_IN( 4 ) ? 0 : !MDR_WP( 4 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV5 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_EJECT, MDR_IN( 5 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_WP_SET, - !MDR_IN( 5 ) ? 0 : !MDR_WP( 5 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV6 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_EJECT, MDR_IN( 6 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_WP_SET, - !MDR_IN( 6 ) ? 0 : !MDR_WP( 6 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV7 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_EJECT, MDR_IN( 7 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_WP_SET, - !MDR_IN( 7 ) ? 0 : !MDR_WP( 7 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV8 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_EJECT, MDR_IN( 8 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_WP_SET, - !MDR_IN( 8 ) ? 0 : !MDR_WP( 8 ) ); - } - - if( what == UMENU_ALL || what == UMENU_RS232 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_R, - ( if1_ula.fd_r > -1 ) ? 1 : 0 ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_T, - ( if1_ula.fd_t > -1 ) ? 1 : 0 ); -#ifdef BUILD_WITH_SNET - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_SNET_UNPLUG, - ( if1_ula.fd_net > -1 ) ? 1 : 0 ); -#endif - } -} - -int -if1_init( void ) -{ - int m, i; - - if1_ula.fd_r = -1; - if1_ula.fd_t = -1; - if1_ula.dtr = 0; /* No data terminal yet */ - if1_ula.cts = 2; /* force to emit first cts status */ - if1_ula.comms_clk = 0; - if1_ula.comms_data = 0; /* really? */ - if1_ula.fd_net = -1; - if1_ula.s_net_mode = 1; - if1_ula.net = 0; - if1_ula.esc_in = 0; /* empty */ - - for( m = 0; m < 8; m++ ) { - microdrive[m].cartridge = libspectrum_microdrive_alloc(); - microdrive[m].inserted = 0; - microdrive[m].modified = 0; - } - - if( settings_current.rs232_rx ) { - if1_plug( settings_current.rs232_rx, 1 ); - free( settings_current.rs232_rx ); - settings_current.rs232_rx = NULL; - } - - if( settings_current.rs232_tx ) { - if1_plug( settings_current.rs232_tx, 2 ); - free( settings_current.rs232_tx ); - settings_current.rs232_tx = NULL; - } - - if( settings_current.snet ) { - if1_plug( settings_current.snet, 3 ); - free( settings_current.snet ); - settings_current.snet = NULL; - } - - module_register( &if1_module_info ); - for( i = 0; i < 2; i++ ) if1_memory_map_romcs[i].bank = MEMORY_BANK_ROMCS; - - if( periph_register_paging_events( event_type_string, &page_event, - &unpage_event ) ) - return 1; - - return 0; -} - -libspectrum_error -if1_end( void ) -{ - int m; - - for( m = 0; m < 8; m++ ) { - libspectrum_error error = - libspectrum_microdrive_free( microdrive[m].cartridge ); - if( error ) return error; - } - - return LIBSPECTRUM_ERROR_NONE; -} - -void -if1_update_menu( void ) -{ - update_menu( UMENU_ALL ); -} - -static void -if1_reset( int hard_reset GCC_UNUSED ) -{ - if1_active = 0; - if1_available = 0; - - if( !periph_interface1_active ) return; - - machine_load_rom_bank( if1_memory_map_romcs, 0, 0, - settings_current.rom_interface_i, - settings_default.rom_interface_i, - MEMORY_PAGE_SIZE ); - - if1_memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL; - - machine_current->ram.romcs = 0; - - if1_ula.cts = 2; /* force to emit first out if raw */ - if1_ula.comms_clk = 0; - if1_ula.comms_data = 0; - if1_ula.net = 0; - if1_ula.esc_in = 0; - - microdrives_reset(); - - update_menu( UMENU_ALL ); - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_INACTIVE ); - - if1_mdr_status = 0; - - if1_available = 1; -} - -void -if1_page( void ) -{ - if1_active = 1; - machine_current->ram.romcs = 1; - machine_current->memory_map(); - - debugger_event( page_event ); -} - -void -if1_unpage( void ) -{ - if1_active = 0; - machine_current->ram.romcs = 0; - machine_current->memory_map(); - - debugger_event( unpage_event ); -} - -void -if1_memory_map( void ) -{ - if( !if1_active ) return; - - memory_map_read[0] = memory_map_write[0] = if1_memory_map_romcs[0]; -} - -static void -if1_enabled_snapshot( libspectrum_snap *snap ) -{ - if( libspectrum_snap_interface1_active( snap ) ) - settings_current.interface1 = 1; -} - -static void -if1_from_snapshot( libspectrum_snap *snap ) -{ - if( !libspectrum_snap_interface1_active( snap ) ) return; - - if( libspectrum_snap_interface1_custom_rom( snap ) && - libspectrum_snap_interface1_rom( snap, 0 ) && - machine_load_rom_bank_from_buffer( - if1_memory_map_romcs, 0, 0, - libspectrum_snap_interface1_rom( snap, 0 ), - libspectrum_snap_interface1_rom_length( snap, 0 ), - 1 ) ) - return; - - if( libspectrum_snap_interface1_paged( snap ) ) { - if1_page(); - } else { - if1_unpage(); - } -} - -static void -if1_to_snapshot( libspectrum_snap *snap ) -{ - libspectrum_byte *buffer; - - if( !periph_interface1_active ) return; - - libspectrum_snap_set_interface1_active( snap, 1 ); - libspectrum_snap_set_interface1_paged ( snap, if1_active ); - libspectrum_snap_set_interface1_drive_count( snap, 8 ); - - if( if1_memory_map_romcs[0].source == MEMORY_SOURCE_CUSTOMROM ) { - size_t rom_length = MEMORY_PAGE_SIZE; - - if( if1_memory_map_romcs[1].source == MEMORY_SOURCE_CUSTOMROM ) { - rom_length <<= 1; - } - - libspectrum_snap_set_interface1_custom_rom( snap, 1 ); - libspectrum_snap_set_interface1_rom_length( snap, 0, rom_length ); - - buffer = malloc( rom_length ); - if( !buffer ) { - ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ ); - return; - } - - memcpy( buffer, if1_memory_map_romcs[0].page, MEMORY_PAGE_SIZE ); - - if( rom_length == MEMORY_PAGE_SIZE*2 ) { - memcpy( buffer + MEMORY_PAGE_SIZE, if1_memory_map_romcs[1].page, - MEMORY_PAGE_SIZE ); - } - - libspectrum_snap_set_interface1_rom( snap, 0, buffer ); - } -} - -static void -microdrives_reset( void ) -{ - int m; - - for( m = 0; m < 8; m++ ) { - microdrive[m].head_pos = 0; - microdrive[m].motor_on = 0; /* motor off */ - microdrive[m].gap = 15; - microdrive[m].sync = 15; - microdrive[m].transfered = 0; - } - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_INACTIVE ); - if1_mdr_status = 0; -/* - if1_ula.comms_data = 0; - if1_ula.count_in = 0; - if1_ula.count_out = 0; - if1_ula.cts = 0; - if1_ula.dtr = 0; - if1_ula.wait = 0; - if1_ula.busy = 0; - if1_ula.net = 0; - if1_ula.net_state = 0; -*/ -} - -static enum if1_port -decode_port( libspectrum_word port ) -{ - switch( port & 0x0018 ) { - case 0x0000: return PORT_MDR; - case 0x0008: return PORT_CTR; - case 0x0010: return PORT_NET; - default: return PORT_UNKNOWN; - } -} - -static libspectrum_byte -port_mdr_in( void ) -{ - libspectrum_byte ret = 0xff; - int m; - - for( m = 0; m < 8; m++ ) { - - microdrive_t *mdr = µdrive[ m ]; - - if( mdr->motor_on && mdr->inserted ) { - - if( mdr->transfered < mdr->max_bytes ) { - mdr->last = libspectrum_microdrive_data( mdr->cartridge, - mdr->head_pos ); - increment_head( m ); - } - - mdr->transfered++; - ret &= mdr->last; /* I assume negative logic, but how know? */ - } - - } - - return ret; -} - -static libspectrum_byte -port_ctr_in( void ) -{ - libspectrum_byte ret = 0xff; - int m, block; - - for( m = 0; m < 8; m++ ) { - - microdrive_t *mdr = µdrive[ m ]; - - if( mdr->motor_on && mdr->inserted ) { - block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); - if( mdr->pream[block] == SYNC_OK ) { /* if formatted */ - if( mdr->gap ) { - /* ret &= 0xff; GAP and SYNC high ? */ - mdr->gap--; - } else { - ret &= 0xf9; /* GAP and SYNC low */ - if( mdr->sync ) { - mdr->sync--; - } else { - mdr->gap = 15; - mdr->sync = 15; - } - } - } - /* if write protected */ - if( libspectrum_microdrive_write_protect( mdr->cartridge) ) - ret &= 0xfe; /* active bit */ - } - } - /* Here we have to poll, the if1_ula DTR 'line' */ - if( if1_ula.rs232_buffer > 0xff ) { /* buffer empty */ - unsigned char byte; - int yes = 1; - - while( yes && read( if1_ula.fd_r, &byte, 1 ) == 1 ) { - if( if1_ula.esc_in == 1 ) { - if1_ula.esc_in = 0; - if( byte == '*' ) { - if1_ula.rs232_buffer = 0x00; - yes = 0; - } else if( byte == 0x00 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 0; - } else if( byte == 0x01 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 1; - } - } else if( byte == 0x00 ) { - if1_ula.esc_in = 1; - } else { - if1_ula.rs232_buffer = byte; - yes = 0; - break; - } - } - } - - if( if1_ula.dtr == 0 ) - ret &= 0xf7; /* %11110111 */ - - /* Here we have to poll, the 'SinclairNet' busy flag but never used by - software in Interface 1 */ - if( if1_ula.busy == 0 ) - ret &= 0xef; /* %11101111 */ - /* fprintf( stderr, "Read CTR ( %%%d%d%d%d%d%d%d%d ).\n", - !!(ret & 128), !!(ret & 64), !!(ret & 32), !!(ret & 16), - !!(ret & 8), !!(ret & 4), !!(ret & 2), !!(ret & 1)); */ - microdrives_restart(); - - return ret; -} - -/* - return 1 if read a byte - 0 if nothing interesting... -*/ - -static int -read_rs232() -{ - if( if1_ula.rs232_buffer <= 0xff ) { /* we read from the buffer */ - if1_ula.data_in = if1_ula.rs232_buffer; - if1_ula.rs232_buffer = 0x0100; - return 1; - } - while( read( if1_ula.fd_r, &if1_ula.data_in, 1 ) == 1 ) { - if( if1_ula.esc_in == 1 ) { - if1_ula.esc_in = 0; - if( if1_ula.data_in == '*' ) { - if1_ula.data_in = 0x00; - return 1; - } else if( if1_ula.data_in == 0x00 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 0; - } else if( if1_ula.data_in == 0x01 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 1; - } - } else if( if1_ula.data_in == 0x00 ) { - if1_ula.esc_in = 1; - } else { - return 1; - } - } - return 0; -} - -static libspectrum_byte -port_net_in( void ) -{ - libspectrum_byte ret = 0xff; - - if( if1_ula.fd_r == -1 ) - goto no_rs232_in; - - /* Here is the RS232 input routine */ - if( if1_ula.cts ) { /* If CTS == 1 */ - if( if1_ula.count_in == 0 ) { - if( if1_ula.fd_r >= 0 && read_rs232() == 1 ) { - if1_ula.count_in++; /* Ok, if read a byte, we begin */ - } - if1_ula.tx = 0; /* now send __ to if1 - later we raise :-) */ - } else if( if1_ula.count_in >= 1 && if1_ula.count_in < 5 ) { - if1_ula.tx = 1; /* send ~~ (start bit :-) */ - if1_ula.count_in++; - } else if( if1_ula.count_in >= 5 && if1_ula.count_in < 13 ) { - if1_ula.tx = ( if1_ula.data_in & 0x01 ) ? 0 : 1; - /* send .. (data bits :-) */ - if1_ula.data_in >>= 1; /* prepare next bit :-) */ - if1_ula.count_in++; - } else - if1_ula.count_in = 0; - } else { /* if( if1_ula.cts ) */ - if1_ula.count_in = 0; /* reset serial in */ - if1_ula.tx = 0; /* send __ stop bits or s.e. :-) */ - } - -no_rs232_in: - if( if1_ula.fd_net == -1 ) - goto no_snet_in; - - if( if1_ula.s_net_mode == 0 ) { /* if we do raw */ - /* Here is the input routine */ - read( if1_ula.fd_net, &if1_ula.net, 1 ); /* Ok, if no byte, we send last*/ - } else {/* if( if1_ula.s_net_mode == 1 ) if we do interpreted */ -/* Here is the input routine. There are several stage in input - and output. So first for output. if1 first do SEND-SC - (http://www.wearmouth.demon.co.uk/if1_2.htm#L101E) to send - a Sync-Out signal and SEND-SC do first a NET-STATE - (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FBC) to see - the line activity: - 11xxxxxx times (192-255) have to get a zero (bit for network) - plus 1 times more from SEND-SC. Next SEND-SC send a 0 which is - a 1 on the net wire (negated output, straight input!!!) - - OK. In input first if1 call WT-SC-E to check Network activity - (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FD3). Now check - 128 times the net wire (we do two round, because to differentiate - net out routines...) -*/ - - if( if1_ula.net_state < 0x0100 ) { /* if1 may in NET-STATE */ - if1_ula.net_state++; - if1_ula.net = 0; -#ifdef IF1_DEBUG_NET - fprintf( stderr, "NET-STAT(%03d)? We send 0!\n", if1_ula.net_state ); -#endif - } else if( if1_ula.net_state == 0x0100 ) { /* probably waiting for input */ - if( read( if1_ula.fd_net, &if1_ula.net_data, 1 ) == 1 ) { - if1_ula.net_state++; - if1_ula.net = 1; /* Start with __/~~ */ - } /* Ok, if have a byte, we send it! */ - } else if( if1_ula.net_state == 0x0101 ) { - if1_ula.net_state++; - if1_ula.net = 1; /* one more ~~ */ - } else if( if1_ula.net_state > 0x0101 && - if1_ula.net_state < 0x010a ) { /* we send the data bits... */ - if1_ula.net_state++; - if1_ula.net = if1_ula.net_data & 1; - if1_ula.net_data >>= 1; - } else if( if1_ula.net_state == 0x010a ) { - if1_ula.net = 0; - if1_ula.net_state = 0; /* OK, we starting a new byte... */ -#ifdef IF1_DEBUG_NET - fprintf( stderr, "NET-STAT(%03d)? Get a byte!\n", if1_ula.net_state ); -#endif - } - } -no_snet_in: - if( !if1_ula.tx ) - ret &= 0x7f; - if( !if1_ula.net ) - ret &= 0xfe; - microdrives_restart(); - - return ret; -} - -libspectrum_byte -if1_port_in( libspectrum_word port GCC_UNUSED, int *attached ) -{ - libspectrum_byte ret = 0xff; - - if( !if1_active ) return ret; - - *attached = 1; - - switch( decode_port( port ) ) - { - case PORT_MDR: ret &= port_mdr_in(); break; - case PORT_CTR: ret &= port_ctr_in(); break; - case PORT_NET: ret &= port_net_in(); break; - case PORT_UNKNOWN: break; - } - - return ret; -} - -static void -port_mdr_out( libspectrum_byte val ) -{ - int m, block; - - /* allow access to the port only if motor 1 is ON and there's a file open */ - for( m = 0; m < 8; m++ ) { - - microdrive_t *mdr = µdrive[ m ]; - - if( mdr->motor_on && mdr->inserted ) { -#ifdef IF1_DEBUG_MDR - fprintf(stderr, "#%05d %03d(%03d): 0x%02x\n", - mdr->head_pos, mdr->transfered, mdr->max_bytes, val ); -#endif - block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); - if( mdr->transfered == 0 && val == 0x00 ) { /* start pream */ - mdr->pream[block] = 1; - } else if( mdr->transfered > 0 && mdr->transfered < 10 && val == 0x00 ) { - mdr->pream[block]++; - } else if( mdr->transfered > 9 && mdr->transfered < 12 && val == 0xff ) { - mdr->pream[block]++; - } else if( mdr->transfered == 12 && mdr->pream[block] == 12 ) { - mdr->pream[block] = SYNC_OK; - } - if( mdr->transfered > 11 && - mdr->transfered < mdr->max_bytes + 12 ) { - - libspectrum_microdrive_set_data( mdr->cartridge, mdr->head_pos, - val ); - increment_head( m ); - mdr->modified = 1; - } - mdr->transfered++; - } - } -} - -static void -port_ctr_out( libspectrum_byte val ) -{ - int m; - - if( !( val & 0x02 ) && ( if1_ula.comms_clk ) ) { /* ~~\__ */ - - for( m = 7; m > 0; m-- ) { - /* Rotate one drive */ - microdrive[m].motor_on = microdrive[m - 1].motor_on; - } - microdrive[0].motor_on = (val & 0x01) ? 0 : 1; - - if( microdrive[0].motor_on || microdrive[1].motor_on || - microdrive[2].motor_on || microdrive[3].motor_on || - microdrive[4].motor_on || microdrive[5].motor_on || - microdrive[6].motor_on || microdrive[7].motor_on ) { - if( !if1_mdr_status ) { - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_ACTIVE ); - if1_mdr_status = 1; - } - } else if ( if1_mdr_status ) { - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_INACTIVE ); - if1_mdr_status = 0; - } - } - if( val & 0x01 ) { /* comms_data == 1 */ - /* Interface 1 service manual p.:1.4 par.: 1.5.1 - The same pin on IC1 (if1 ULA), pin 33, is used for the network - transmit data and for the RS232 transmit data. In order to select - the required function IC1 uses its COMMS_OUT (pin 30) signal, - borrowed from the microdrive control when the microdrive is not - being used (I do not know what it is exactly meaning. It is a - hardware not being used, or a software should not use..?) This signal - is routed from pin 30 to the emitter of transistor Q3 (RX DATA) and - via resistor R4, to the base of transistor Q1 (NET). When COMMS_OUT - is high Q3 is enabled this selecting RS232, and when it is low - Q1 is enabled selecting the network. - - OK, the schematics offer a different interpretation, because if - COMMS_OUT pin level high (>+3V) then Q3 is off (the basis cannot - be more higher potential then emitter (NPN transistor), so whatever - is on the IC1 RX DATA (pin 33) the basis of Q4 is always on +12V, - so the collector of Q4 (PNP transistor) always on -12V. - If COMMS_OUT pin level goes low (~0V), then Q3 basis (connected - to IC1 RX DATA pin) can be higher level (>+3V) than emitter, so - the basis potential of Q4 depend on IC1 RX DATA. - - OK, Summa summarum I assume that, the COMMS OUT pin is a - negated output of the if1 ULA CTR register's COMMS DATA bit. - */ - /* C_DATA = 1 */ - if( if1_ula.comms_data == 0 ) { - if1_ula.count_out = 0; - if1_ula.data_out = 0; - if1_ula.count_in = 0; - if1_ula.data_in = 0; - } - } - if1_ula.wait = ( val & 0x20 ) ? 1 : 0; - if1_ula.comms_data = ( val & 0x01 ) ? 1 : 0; - if1_ula.comms_clk = ( val & 0x02 ) ? 1 : 0; - val = ( val & 0x10 ) ? 1 : 0; - if( settings_current.rs232_handshake && - if1_ula.fd_t != -1 && if1_ula.cts != val ) { - char data = val ? 0x03 : 0x02; - do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); - do ; while( write( if1_ula.fd_t, &data, 1 ) != 1 ); - } - if1_ula.cts = val; - -#ifdef IF1_DEBUG_NET - fprintf( stderr, "Set CTS to %d, set WAIT to %d and COMMS_DATA to %d\n", - if1_ula.cts, if1_ula.wait, if1_ula.comms_data ); -#endif - - microdrives_restart(); -} - -static void -port_net_out( libspectrum_byte val ) -{ - if( if1_ula.fd_t == -1 ) - return; /* nothing to write */ - - if( if1_ula.comms_data == 1 ) { /* OK, RS232 */ - val &= 0x01; - if( if1_ula.count_out == 0 && !val ) { /* waiting for ~~\__ */ - if1_ula.count_out++; - } else if( if1_ula.count_out == 1 ) { - if( if1_ula.cts != 0 || !val ) - if1_ula.count_out = -1; - else - if1_ula.count_out++; /* else get the start bit __/~~ */ - } else if( if1_ula.count_out >= 2 && if1_ula.count_out <= 9 ) { - if1_ula.data_out >>= 1; - if1_ula.data_out |= val & 0x01 ? 0 : 128; - if1_ula.count_out++; /* waiting for next data bit */ - } else if( if1_ula.count_out >= 10 && if1_ula.count_out <= 11 ) { - if( val ) - if1_ula.count_out = -1; - else - if1_ula.count_out++; - } else if( if1_ula.count_out == 12 ) { - if( !val ) - if1_ula.count_out = -1; - else - if1_ula.count_out++; - } else if( if1_ula.count_out == 13 ) { - if( val ) - if1_ula.count_out = -1; - } - - if( if1_ula.count_out == -1 ) { - if1_ula.count_out = 13; - if1_ula.data_out = '?'; - do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); - } - if( if1_ula.count_out == 13 ) { - /* Here is the output routine */ - if( if1_ula.data_out == 0x00 ) { - if1_ula.data_out = '*'; - do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); - } - do ; while( write( if1_ula.fd_t, &if1_ula.data_out, 1 ) != 1 ); - if1_ula.count_out = 0; - } - if1_ula.rx = val & 0x01; /* set rx */ - } else { /* if( if1_ula.comms_data == 1 ) SinclairNET :-)*/ - if( if1_ula.s_net_mode == 0 ) { /* if we out bit by bit, do it */ - /* Here is the output routine */ - -/* OK, examining the schematics of if1 and the disassembly of if1 ROM, I - see that the Q1 and Q2 transistors negate the RX DATA signal, and the - floating state of the net wire is the ~0V level, the forced is the ~3V. - The if1 software send complemented data and read straight data. -*/ - if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set rx */ - lseek( if1_ula.fd_net, 0, SEEK_SET ); /* we save only the state of the wire*/ - do ; while( write( if1_ula.fd_net, &if1_ula.net, 1 ) == -1 ); -#ifdef HAVE_FSYNC - fsync( if1_ula.fd_net ); -#endif /* #ifdef HAVE_FSYNC */ -#ifdef IF1_DEBUG_NET - fprintf( stderr, "Send SinclairNET: %d\n", if1_ula.net ); -#endif - } else { /* if( if1_ula.s_net_mode == 0 ) if we out byte by byte, do it */ - if( if1_ula.net_state >= 0x0200 && if1_ula.net_state < 0x0208 ) { - if1_ula.net_state++; - if1_ula.net_data <<= 1; - if1_ula.net_data |= ( val & 0x01 ) ? 0 : 1; - } else if( if1_ula.net_state == 0x0208 ) { - if1_ula.net_data &= 0xff; - if1_ula.net_state++; /* OK, now we get data bytes... */ - -/* lseek( if1_ula.fd_net, 0, SEEK_SET ); start a packet */ - /* first we send the station number */ - do ; while( write( if1_ula.fd_net, &if1_ula.net_data, 1 ) == -1 ); -#ifdef HAVE_FSYNC - fsync( if1_ula.fd_net ); -#endif /* #ifdef HAVE_FSYNC */ -#ifdef IF1_DEBUG_NET - fprintf( stderr, "SC-OUT send network number: %d\n", - if1_ula.net_data ^ 0xff ); -#endif - } else if( if1_ula.net_state > 192 && if1_ula.net_state < 0x0200 && - ( ( val & 0x01 ) == 0 ) ) { - /* NET-STATE ask as many times.... and now send a 0 */ -/* if1_ula.net = 1; */ - if1_ula.net_state = 0x0200; /* Send the station number */ - } - if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set net wire? */ - } - } - microdrives_restart(); -} - -void -if1_port_out( libspectrum_word port GCC_UNUSED, libspectrum_byte val ) -{ - if( !if1_active ) return; - -#ifdef IF1_DEBUG_NET_1 - fprintf( stderr, "In if1_port_out( %%%d%d%d%d%d%d%d%d => 0x%04x ).\n", - !!(val & 128), !!(val & 64), !!(val & 32), !!(val & 16), - !!(val & 8), !!(val & 4), !!(val & 2), !!(val & 1), port); -#endif - - switch( decode_port( port ) ) { - case PORT_MDR: port_mdr_out( val ); break; - case PORT_CTR: port_ctr_out( val ); break; - case PORT_NET: port_net_out( val ); break; - case PORT_UNKNOWN: break; - } -} - -static void -increment_head( int m ) -{ - microdrive[m].head_pos++; - if( microdrive[m].head_pos >= - libspectrum_microdrive_cartridge_len( microdrive[m].cartridge ) * - LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) - microdrive[m].head_pos = 0; -} - -static void -microdrives_restart( void ) -{ - int m; - - for( m = 0; m < 8; m++ ) { - while( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != 0 && - ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != LIBSPECTRUM_MICRODRIVE_HEAD_LEN ) - increment_head( m ); /* put head in the start of a block */ - - microdrive[m].transfered = 0; /* reset current number of bytes written */ - - if( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) == 0 ) { - microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN; /* up to 15 bytes for header blocks */ - } else { - microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN + LIBSPECTRUM_MICRODRIVE_DATA_LEN + 1; /* up to 528 bytes for data blocks */ - } - } -} - -void -if1_mdr_writeprotect( int drive, int wrprot ) -{ - libspectrum_microdrive_set_write_protect( microdrive[drive].cartridge, - wrprot ? 1 : 0 ); - microdrive[drive].modified = 1; - - update_menu( UMENU_MDRV1 + drive ); -} - -static void -if1_mdr_new( microdrive_t *mdr ) -{ - libspectrum_byte len; - long int i; - - mdr->filename = NULL; - if( settings_current.mdr_random_len ) { /* Random length */ - len = 171 + ( ( rand() >> 2 ) + ( rand() >> 2 ) + - ( rand() >> 2 ) + ( rand() >> 2 ) ) - / rnd_factor; - } else - len = settings_current.mdr_len = settings_current.mdr_len < 10 ? 10 : - settings_current.mdr_len > LIBSPECTRUM_MICRODRIVE_BLOCK_MAX ? LIBSPECTRUM_MICRODRIVE_BLOCK_MAX : settings_current.mdr_len; - - /* Erase the entire cartridge */ - libspectrum_microdrive_set_cartridge_len( mdr->cartridge, len ); - - for( i = 0; i < len * LIBSPECTRUM_MICRODRIVE_BLOCK_LEN; i++ ) - libspectrum_microdrive_set_data( mdr->cartridge, i, 0xff ); - - for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); - i > 0; i-- ) - mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_NO; - - /* but don't write-protect */ - libspectrum_microdrive_set_write_protect( mdr->cartridge, 0 ); - - mdr->inserted = 1; - mdr->modified = 1; - -} - -int -if1_mdr_insert( int which, const char *filename ) -{ - microdrive_t *mdr; - int m, i; - - if( which == -1 ) { /* find an empty one */ - for( m = 0; m < 8; m++ ) { - if( !microdrive[m].inserted ) { - which = m; - break; - } - } - } - - if( which == -1 ) { - ui_error( UI_ERROR_ERROR, - "Cannot insert cartridge '%s', all Microdrives in use", - filename ); - return 1; - } - - if( which >= 8 ) { - ui_error( UI_ERROR_ERROR, "if1_mdr_insert: unknown drive %d", which ); - return 1; - } - - mdr = µdrive[ which ]; - - /* Eject any cartridge already in the drive */ - if( mdr->inserted ) { - /* Abort the insert if we want to keep the current cartridge */ - if( if1_mdr_eject( which, 0 ) ) return 0; - } - - if( filename == NULL ) { /* insert new unformatted cartridge */ - if1_mdr_new( mdr ); - update_menu( UMENU_MDRV1 + which ); - return 0; - } - - if( utils_read_file( filename, &mdr->file ) ) { - ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); - return 1; - } - - if( libspectrum_microdrive_mdr_read( mdr->cartridge, mdr->file.buffer, - mdr->file.length ) ) { - utils_close_file( &mdr->file ); - ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); - return 1; - } - - if( utils_close_file( &mdr->file ) ) return 1; - - mdr->inserted = 1; - mdr->modified = 0; - mdr->filename = strdup( filename ); - /* we assume formatted cartridges */ - for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); - i > 0; i-- ) - mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_OK; - - update_menu( UMENU_MDRV1 + which ); - - return 0; -} - -int -if1_mdr_eject( int which, int saveas ) -{ - microdrive_t *mdr; - - if( which >= 8 ) - return 1; - - mdr = µdrive[ which ]; - - if( !mdr->inserted ) - return 0; - - if( saveas ) { /* 1 -> save as.., 2 -> save */ - - if( mdr->filename == NULL ) saveas = 1; - if( ui_mdr_write( which, 2 - saveas ) ) return 1; - mdr->modified = 0; - return 0; - - } else { - - if( mdr->modified ) { - - ui_confirm_save_t confirm = ui_confirm_save( - "Cartridge in Microdrive %i has been modified.\n" - "Do you want to save it?", - which + 1 - ); - - switch( confirm ) { - - case UI_CONFIRM_SAVE_SAVE: - if( if1_mdr_eject( which, 2 ) ) return 1; /* first save */ - break; - - case UI_CONFIRM_SAVE_DONTSAVE: break; - case UI_CONFIRM_SAVE_CANCEL: return 1; - - } - } - } - - mdr->inserted = 0; - if( mdr->filename != NULL ) { - free( mdr->filename ); - mdr->filename = NULL; - } - - update_menu( UMENU_MDRV1 + which ); - return 0; -} - -int -if1_mdr_write( int which, const char *filename ) -{ - microdrive_t *mdr = µdrive[which]; - - libspectrum_microdrive_mdr_write( mdr->cartridge, &mdr->file.buffer, - &mdr->file.length ); - - if( filename == NULL ) filename = mdr->filename; /* Write over the original file */ - - if( utils_write_file( filename, mdr->file.buffer, mdr->file.length ) ) - return 1; - - if( mdr->filename && strcmp( filename, mdr->filename ) ) { - free( mdr->filename ); - mdr->filename = strdup( filename ); - } - return 0; -} - -#ifndef O_NONBLOCK -#define O_NONBLOCK FNDELAY -#endif - -void -if1_plug( const char *filename, int what ) -{ -#ifdef WIN32 - ui_error( UI_ERROR_ERROR, "Not yet implemented on Win32" ); - return; -#else - int fd = -1; - - switch( what ) { - case 1: - if( if1_ula.fd_r >= 0 ) - close( if1_ula.fd_r ); - fd = if1_ula.fd_r = open( filename, O_RDWR | O_NONBLOCK ); - if( fcntl( fd, F_SETFL, O_RDONLY | O_NONBLOCK ) ) - ui_error( UI_ERROR_ERROR, "Cannot set O_RDONLY on '%s': %s", - filename, strerror( errno ) ); - if1_ula.rs232_buffer = 0x100; /* buffer is empty */ - break; - case 2: - if( if1_ula.fd_t >= 0 ) - close( if1_ula.fd_t ); - fd = if1_ula.fd_t = open( filename, O_RDWR | O_NONBLOCK ); - if( fcntl( fd, F_SETFL, O_WRONLY | O_NONBLOCK ) ) - ui_error( UI_ERROR_ERROR, "Cannot set O_WRONLY on '%s': %s", - filename, strerror( errno ) ); - break; - case 3: - if( if1_ula.fd_net >= 0 ) - close( if1_ula.fd_net ); - fd = if1_ula.fd_net = open( filename, O_RDWR | O_NONBLOCK ); - break; - } - - /* rs232_handshake == 0 -> we assume DTR(DSR) always 1 if tx and rx plugged */ - if( !settings_current.rs232_handshake && - if1_ula.fd_t != -1 && if1_ula.fd_r != -1 ) - if1_ula.dtr = 1; - - if( fd < 0 ) { - ui_error( UI_ERROR_ERROR, "Error opening '%s': %s", - filename, strerror( errno ) ); - return; - } - - if1_ula.s_net_mode = settings_current.raw_s_net ? 0 : 1; - update_menu( UMENU_RS232 ); -#endif -} - -void -if1_unplug( int what ) -{ - switch( what ) { - case 1: - if( if1_ula.fd_r >= 0 ) - close( if1_ula.fd_r ); - if1_ula.fd_r = -1; - break; - case 2: - if( if1_ula.fd_t >= 0 ) - close( if1_ula.fd_t ); - if1_ula.fd_t = -1; - if1_ula.dtr = 0; - break; - case 3: - if( if1_ula.fd_net >= 0 ) - close( if1_ula.fd_net ); - if1_ula.fd_net = -1; - break; - } - /* rs232_handshake == 0 -> we assume DTR(DSR) always 1 if tx and rx plugged */ - if( !settings_current.rs232_handshake && - ( if1_ula.fd_t == -1 || if1_ula.fd_r == -1 ) ) - if1_ula.dtr = 0; - update_menu( UMENU_RS232 ); -} Deleted: vendor/fuse-emulator/current/fuse/if1.h =================================================================== --- vendor/fuse-emulator/current/fuse/if1.h 2012-01-14 13:01:10 UTC (rev 683) +++ vendor/fuse-emulator/current/fuse/if1.h 2012-02-15 12:32:32 UTC (rev 684) @@ -1,59 +0,0 @@ -/* if1.h: Interface I handling routines - Copyright (c) 2004-2005 Gergely Szasz, Philip Kendall - - $Id: if1.h 3327 2007-11-22 23:06:47Z 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: - - Gergely: sz...@hu... - -*/ - -#ifndef FUSE_IF1_H -#define FUSE_IF1_H - -#include <libspectrum.h> - -#include "periph.h" - -/* IF1 */ -extern int if1_active; -extern int if1_available; - -extern const periph_t if1_peripherals[]; -extern const size_t if1_peripherals_count; - -int if1_init( void ); -libspectrum_error if1_end( void ); - -void if1_page( void ); -void if1_unpage( void ); -void if1_memory_map( void ); - -void if1_port_out( libspectrum_word port, libspectrum_byte val ); -libspectrum_byte if1_port_in( lib... [truncated message content] |
From: <fr...@us...> - 2012-01-14 13:01:19
|
Revision: 683 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=683&view=rev Author: fredm Date: 2012-01-14 13:01:10 +0000 (Sat, 14 Jan 2012) Log Message: ----------- Reverse another set of half imported code. Added Paths: ----------- vendor/fuse-emulator/current/fuse/ay.c vendor/fuse-emulator/current/fuse/ay.h vendor/fuse-emulator/current/fuse/dck.c vendor/fuse-emulator/current/fuse/dck.h vendor/fuse-emulator/current/fuse/disk/ vendor/fuse-emulator/current/fuse/fuller.c vendor/fuse-emulator/current/fuse/fuller.h vendor/fuse-emulator/current/fuse/ide/ 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/if2.h vendor/fuse-emulator/current/fuse/joystick.c vendor/fuse-emulator/current/fuse/joystick.h vendor/fuse-emulator/current/fuse/kempmouse.c vendor/fuse-emulator/current/fuse/kempmouse.h vendor/fuse-emulator/current/fuse/melodik.c vendor/fuse-emulator/current/fuse/melodik.h vendor/fuse-emulator/current/fuse/printer.c vendor/fuse-emulator/current/fuse/printer.h vendor/fuse-emulator/current/fuse/scld.c vendor/fuse-emulator/current/fuse/scld.h vendor/fuse-emulator/current/fuse/ula.c vendor/fuse-emulator/current/fuse/ula.h Removed Paths: ------------- vendor/fuse-emulator/current/fuse/peripherals/ Copied: vendor/fuse-emulator/current/fuse/ay.c (from rev 681, vendor/fuse-emulator/current/fuse/ay.c) =================================================================== --- vendor/fuse-emulator/current/fuse/ay.c (rev 0) +++ vendor/fuse-emulator/current/fuse/ay.c 2012-01-14 13:01:10 UTC (rev 683) @@ -0,0 +1,169 @@ +/* ay.c: AY-8-3912 routines + Copyright (c) 1999-2009 Philip Kendall + + $Id: ay.c 4030 2009-06-07 14:38:38Z 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: phi...@sh... + +*/ + +#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 ); +} + +void +ay_state_from_snapshot( libspectrum_snap *snap ) +{ + size_t i; + + 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_from_snapshot( libspectrum_snap *snap ) +{ + if( machine_current->capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_AY ) { + ay_state_from_snapshot( snap ); + } +} + +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] ); +} Copied: vendor/fuse-emulator/current/fuse/ay.h (from rev 681, vendor/fuse-emulator/current/fuse/ay.h) =================================================================== --- vendor/fuse-emulator/current/fuse/ay.h (rev 0) +++ vendor/fuse-emulator/current/fuse/ay.h 2012-01-14 13:01:10 UTC (rev 683) @@ -0,0 +1,47 @@ +/* ay.h: AY-8-3912 routines + Copyright (c) 1999-2009 Philip Kendall + + $Id: ay.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... + +*/ + +#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 ); + +void ay_state_from_snapshot( libspectrum_snap *snap ); + +#endif /* #ifndef FUSE_AY_H */ Copied: vendor/fuse-emulator/current/fuse/dck.c (from rev 681, vendor/fuse-emulator/current/fuse/dck.c) =================================================================== --- vendor/fuse-emulator/current/fuse/dck.c (rev 0) +++ vendor/fuse-emulator/current/fuse/dck.c 2012-01-14 13:01:10 UTC (rev 683) @@ -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: phi...@sh... + + Darren: li...@yo... + Fred: fr...@sp... + +*/ + +#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 ); +} Copied: vendor/fuse-emulator/current/fuse/dck.h (from rev 681, vendor/fuse-emulator/current/fuse/dck.h) =================================================================== --- vendor/fuse-emulator/current/fuse/dck.h (rev 0) +++ vendor/fuse-emulator/current/fuse/dck.h 2012-01-14 13:01:10 UTC (rev 683) @@ -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: phi...@sh... + + Darren: li...@yo... + Fred: fr...@sp... + +*/ + +#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 Copied: vendor/fuse-emulator/current/fuse/fuller.c (from rev 681, vendor/fuse-emulator/current/fuse/fuller.c) =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.c (rev 0) +++ vendor/fuse-emulator/current/fuse/fuller.c 2012-01-14 13:01:10 UTC (rev 683) @@ -0,0 +1,90 @@ +/* fuller.c: Routines for handling the Fuller Box + Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier + + $Id: fuller.c 4032 2009-06-10 11:09:44Z 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: phi...@sh... + + Stuart: sd...@nt... + +*/ + +#include <config.h> + +#include <libspectrum.h> + +#include "ay.h" +#include "compat.h" +#include "fuller.h" +#include "joystick.h" +#include "module.h" +#include "periph.h" +#include "settings.h" + +static void fuller_enabled_snapshot( libspectrum_snap *snap ); +static void fuller_from_snapshot( libspectrum_snap *snap ); +static void fuller_to_snapshot( libspectrum_snap *snap ); + +static module_info_t fuller_module_info = { + + NULL, + NULL, + fuller_enabled_snapshot, + fuller_from_snapshot, + fuller_to_snapshot, + +}; + +const periph_t fuller_peripherals[] = { + { 0x00ff, 0x003f, ay_registerport_read, ay_registerport_write }, + { 0x00ff, 0x005f, NULL, ay_dataport_write }, + { 0x00ff, 0x007f, joystick_fuller_read, NULL }, +}; + +const size_t fuller_peripherals_count = + sizeof( fuller_peripherals ) / sizeof( periph_t ); + +static void +fuller_enabled_snapshot( libspectrum_snap *snap ) +{ + if( libspectrum_snap_fuller_box_active( snap ) ) + settings_current.fuller = 1; +} + +static void +fuller_from_snapshot( libspectrum_snap *snap ) +{ + if( periph_fuller_active ) { + ay_state_from_snapshot( snap ); + } +} + +static void +fuller_to_snapshot( libspectrum_snap *snap ) +{ + libspectrum_snap_set_fuller_box_active( snap, periph_fuller_active ); +} + +int +fuller_init( void ) +{ + module_register( &fuller_module_info ); + + return 0; +} Copied: vendor/fuse-emulator/current/fuse/fuller.h (from rev 681, vendor/fuse-emulator/current/fuse/fuller.h) =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.h (rev 0) +++ vendor/fuse-emulator/current/fuse/fuller.h 2012-01-14 13:01:10 UTC (rev 683) @@ -0,0 +1,40 @@ +/* fuller.h: Routines for handling the Fuller Box + Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier + + $Id: fuller.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... + + Stuart: sd...@nt... + +*/ + +#ifndef FUSE_FULLER_H +#define FUSE_FULLER_H + +#include <libspectrum.h> + +#include "periph.h" + +extern const periph_t fuller_peripherals[]; +extern const size_t fuller_peripherals_count; + +int fuller_init( void ); + +#endif /* #ifndef FUSE_FULLER_H */ Copied: vendor/fuse-emulator/current/fuse/if1.c (from rev 681, vendor/fuse-emulator/current/fuse/if1.c) =================================================================== --- vendor/fuse-emulator/current/fuse/if1.c (rev 0) +++ vendor/fuse-emulator/current/fuse/if1.c 2012-01-14 13:01:10 UTC (rev 683) @@ -0,0 +1,1304 @@ +/* if1.c: Interface I handling routines + Copyright (c) 2004-2008 Gergely Szasz, Philip Kendall + + $Id: if1.c 4180 2010-10-09 12:59:37Z 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: + + Gergely: sz...@hu... + +*/ + +#include <config.h> + +#include <string.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include <unistd.h> + +#include "compat.h" +#include "debugger/debugger.h" +#include "if1.h" +#include "machine.h" +#include "memory.h" +#include "module.h" +#include "periph.h" +#include "settings.h" +#include "utils.h" +#include "ui/ui.h" + +#undef IF1_DEBUG_MDR +#undef IF1_DEBUG_NET +#undef IF1_DEBUG_NET_1 + +#define BUFF_EMPTY 0x100 + +enum { + SYNC_NO = 0, + SYNC_OK = 0xff +}; + +/* + Microdrive cartridge + GAP PREAMBLE 15 byte GAP PREAMBLE 15 byte 512 1 + [-----][00 00 ... ff ff][BLOCK HEAD][-----][00 00 ... ff ff][REC HEAD][ DATA ][CHK] + Preamble = 10 * 0x00 + 2 * 0xff (12 byte) +*/ + +typedef struct microdrive_t { + utils_file file; + char *filename; /* old filename */ + int inserted; + int modified; + int motor_on; + int head_pos; + int transfered; + int max_bytes; + libspectrum_byte pream[512]; /* preamble/sync area written */ + libspectrum_byte last; + libspectrum_byte gap; + libspectrum_byte sync; + + libspectrum_microdrive *cartridge; /* write protect, len, blocks */ + +} microdrive_t; + +typedef struct if1_ula_t { + int fd_r; /* file descriptor for reading bytes or bits RS232 */ + int fd_t; /* file descriptor for writing bytes or bits RS232 */ + int fd_net; /* file descriptor for rw bytes or bits SinclairNET */ + int rs232_buffer; /* read buffer */ + int s_net_mode; + int status; /* if1_ula/SinclairNET */ + int comms_data; /* the previous data comms state */ + int comms_clk; /* the previous data comms state */ + int cts; /* CTS of peripheral */ + int dtr; /* DTR of peripheral */ + int tx; /* TxD the name is very kind, because this is the read end of + the TxD wire of DATA machine (really RxD the view of + spectrum */ + int rx; /* RxD the name is very kind, because this is the write end of + the RxD wire of DATA machine (really TxD the view of + spectrum */ + int data_in; /* interpreted incoming data */ + int count_in; + int data_out; /* interpreted outgoing data */ + int count_out; + int esc_in; /* if we compose an escape seq */ + + int net; /* Network in/out (really 1 wire bus :-) */ + int net_data; /* Interpreted network data */ + int net_state; /* Interpreted network data */ + int wait; /* Wait state */ + int busy; /* Indicate busy; if1 software never poll it ... */ +} if1_ula_t; + +/* + 7 6 5 4 3 2 1 0 + STATUS RO $EF(239) --- --- --- BSY DTR GAP SYN WPR + + CONTRO WO $EF(239) --- --- WAT CTS ERA R/w CLK DTA + + MDR DT RW $E7(231) D7 D6 D5 D4 D3 D2 D1 D0 + + COMM I RO $F7(247) TX --- --- --- --- --- --- NET + + COMM O WO $F7(247) --- --- --- --- --- --- --- NET/RX + +RS232: + DTR -> Data Terminal Ready (DTE -> DCE) + CTS -> Clear To Send (DCE -> DTE) + TX -> Transmitted Data (DTE -> DCE) + RX -> Received Data (DCE -> DTE) + + The IF1 serial behaves not as a DTE (Data Terminal Equipment, e.g. + a computer) but as a DCE (Data Communications Equipment, e.g. a modem) + + If we were to consider the ZX Spectrum a DTE, we would rename the lines: + DTR := DSR (Data Set Ready) + CTS := RTS (Request To Send) + TX := RX + RX := TX + + On the communication channels: + Bytes interpreted as is, except: + 0x00 0x00 --> DTR ~~\__ + 0x00 0x01 --> DTR __/~~ + 0x00 0x02 --> CTS ~~\__ + 0x00 0x03 --> CTS __/~~ + 0x00 ? --> lost + 0x00 * --> 0x00 + Additionally: + if fuse read 0x00 0x00 => DTR = 0 ~~\__ + if fuse read 0x00 0x01 => DTR = 1 __/~~ + if CTS = ~~\__ fuse send 0x00 0x02 + if CTS = __/~~ fuse send 0x00 0x03 + if fuse lost send 0x00 + 0x3f (?) + every other 0x00 + 0x## are discarded +*/ + +/* Two 8Kb memory chunks accessible by the Z80 when /ROMCS is low */ +static memory_page if1_memory_map_romcs[2]; + +/* IF1 paged out ROM activated? */ +int if1_active = 0; +int if1_available = 0; +static int if1_mdr_status = 0; + +int rnd_factor = ( ( RAND_MAX >> 2 ) << 2 ) / 19 + 1; + +static microdrive_t microdrive[8]; /* We have 8 microdrive */ +static if1_ula_t if1_ula; + +static void microdrives_reset( void ); +static void microdrives_restart( void ); +static void increment_head( int m ); + +#define MDR_IN(m) microdrive[m - 1].inserted +#define MDR_WP(m) libspectrum_microdrive_write_protect( microdrive[m - 1].cartridge ) + +enum if1_menu_item { + + UMENU_ALL = 0, + UMENU_MDRV1, + UMENU_MDRV2, + UMENU_MDRV3, + UMENU_MDRV4, + UMENU_MDRV5, + UMENU_MDRV6, + UMENU_MDRV7, + UMENU_MDRV8, + UMENU_RS232, +}; + +enum if1_port { + PORT_MDR, + PORT_CTR, + PORT_NET, + PORT_UNKNOWN, +}; + +static void if1_reset( int hard_reset ); +static void if1_enabled_snapshot( libspectrum_snap *snap ); +static void if1_from_snapshot( libspectrum_snap *snap ); +static void if1_to_snapshot( libspectrum_snap *snap ); + +static module_info_t if1_module_info = { + + if1_reset, + if1_memory_map, + if1_enabled_snapshot, + if1_from_snapshot, + if1_to_snapshot, + +}; + +const periph_t if1_peripherals[] = { + { 0x0018, 0x0010, if1_port_in, if1_port_out }, + { 0x0018, 0x0008, if1_port_in, if1_port_out }, + { 0x0018, 0x0000, if1_port_in, if1_port_out }, +}; + +const size_t if1_peripherals_count = + sizeof( if1_peripherals ) / sizeof( periph_t ); + +/* Debugger events */ +static const char *event_type_string = "if1"; +static int page_event, unpage_event; + +static void +update_menu( enum if1_menu_item what ) +{ + if( what == UMENU_ALL || what == UMENU_MDRV1 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_EJECT, MDR_IN( 1 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_WP_SET, + !MDR_IN( 1 ) ? 0 : !MDR_WP( 1 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV2 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_EJECT, MDR_IN( 2 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_WP_SET, + !MDR_IN( 2 ) ? 0 : !MDR_WP( 2 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV3 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_EJECT, MDR_IN( 3 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_WP_SET, + !MDR_IN( 3 ) ? 0 : !MDR_WP( 3 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV4 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_EJECT, MDR_IN( 4 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_WP_SET, + !MDR_IN( 4 ) ? 0 : !MDR_WP( 4 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV5 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_EJECT, MDR_IN( 5 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_WP_SET, + !MDR_IN( 5 ) ? 0 : !MDR_WP( 5 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV6 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_EJECT, MDR_IN( 6 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_WP_SET, + !MDR_IN( 6 ) ? 0 : !MDR_WP( 6 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV7 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_EJECT, MDR_IN( 7 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_WP_SET, + !MDR_IN( 7 ) ? 0 : !MDR_WP( 7 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV8 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_EJECT, MDR_IN( 8 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_WP_SET, + !MDR_IN( 8 ) ? 0 : !MDR_WP( 8 ) ); + } + + if( what == UMENU_ALL || what == UMENU_RS232 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_R, + ( if1_ula.fd_r > -1 ) ? 1 : 0 ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_T, + ( if1_ula.fd_t > -1 ) ? 1 : 0 ); +#ifdef BUILD_WITH_SNET + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_SNET_UNPLUG, + ( if1_ula.fd_net > -1 ) ? 1 : 0 ); +#endif + } +} + +int +if1_init( void ) +{ + int m, i; + + if1_ula.fd_r = -1; + if1_ula.fd_t = -1; + if1_ula.dtr = 0; /* No data terminal yet */ + if1_ula.cts = 2; /* force to emit first cts status */ + if1_ula.comms_clk = 0; + if1_ula.comms_data = 0; /* really? */ + if1_ula.fd_net = -1; + if1_ula.s_net_mode = 1; + if1_ula.net = 0; + if1_ula.esc_in = 0; /* empty */ + + for( m = 0; m < 8; m++ ) { + microdrive[m].cartridge = libspectrum_microdrive_alloc(); + microdrive[m].inserted = 0; + microdrive[m].modified = 0; + } + + if( settings_current.rs232_rx ) { + if1_plug( settings_current.rs232_rx, 1 ); + free( settings_current.rs232_rx ); + settings_current.rs232_rx = NULL; + } + + if( settings_current.rs232_tx ) { + if1_plug( settings_current.rs232_tx, 2 ); + free( settings_current.rs232_tx ); + settings_current.rs232_tx = NULL; + } + + if( settings_current.snet ) { + if1_plug( settings_current.snet, 3 ); + free( settings_current.snet ); + settings_current.snet = NULL; + } + + module_register( &if1_module_info ); + for( i = 0; i < 2; i++ ) if1_memory_map_romcs[i].bank = MEMORY_BANK_ROMCS; + + if( periph_register_paging_events( event_type_string, &page_event, + &unpage_event ) ) + return 1; + + return 0; +} + +libspectrum_error +if1_end( void ) +{ + int m; + + for( m = 0; m < 8; m++ ) { + libspectrum_error error = + libspectrum_microdrive_free( microdrive[m].cartridge ); + if( error ) return error; + } + + return LIBSPECTRUM_ERROR_NONE; +} + +void +if1_update_menu( void ) +{ + update_menu( UMENU_ALL ); +} + +static void +if1_reset( int hard_reset GCC_UNUSED ) +{ + if1_active = 0; + if1_available = 0; + + if( !periph_interface1_active ) return; + + machine_load_rom_bank( if1_memory_map_romcs, 0, 0, + settings_current.rom_interface_i, + settings_default.rom_interface_i, + MEMORY_PAGE_SIZE ); + + if1_memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL; + + machine_current->ram.romcs = 0; + + if1_ula.cts = 2; /* force to emit first out if raw */ + if1_ula.comms_clk = 0; + if1_ula.comms_data = 0; + if1_ula.net = 0; + if1_ula.esc_in = 0; + + microdrives_reset(); + + update_menu( UMENU_ALL ); + ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, + UI_STATUSBAR_STATE_INACTIVE ); + + if1_mdr_status = 0; + + if1_available = 1; +} + +void +if1_page( void ) +{ + if1_active = 1; + machine_current->ram.romcs = 1; + machine_current->memory_map(); + + debugger_event( page_event ); +} + +void +if1_unpage( void ) +{ + if1_active = 0; + machine_current->ram.romcs = 0; + machine_current->memory_map(); + + debugger_event( unpage_event ); +} + +void +if1_memory_map( void ) +{ + if( !if1_active ) return; + + memory_map_read[0] = memory_map_write[0] = if1_memory_map_romcs[0]; +} + +static void +if1_enabled_snapshot( libspectrum_snap *snap ) +{ + if( libspectrum_snap_interface1_active( snap ) ) + settings_current.interface1 = 1; +} + +static void +if1_from_snapshot( libspectrum_snap *snap ) +{ + if( !libspectrum_snap_interface1_active( snap ) ) return; + + if( libspectrum_snap_interface1_custom_rom( snap ) && + libspectrum_snap_interface1_rom( snap, 0 ) && + machine_load_rom_bank_from_buffer( + if1_memory_map_romcs, 0, 0, + libspectrum_snap_interface1_rom( snap, 0 ), + libspectrum_snap_interface1_rom_length( snap, 0 ), + 1 ) ) + return; + + if( libspectrum_snap_interface1_paged( snap ) ) { + if1_page(); + } else { + if1_unpage(); + } +} + +static void +if1_to_snapshot( libspectrum_snap *snap ) +{ + libspectrum_byte *buffer; + + if( !periph_interface1_active ) return; + + libspectrum_snap_set_interface1_active( snap, 1 ); + libspectrum_snap_set_interface1_paged ( snap, if1_active ); + libspectrum_snap_set_interface1_drive_count( snap, 8 ); + + if( if1_memory_map_romcs[0].source == MEMORY_SOURCE_CUSTOMROM ) { + size_t rom_length = MEMORY_PAGE_SIZE; + + if( if1_memory_map_romcs[1].source == MEMORY_SOURCE_CUSTOMROM ) { + rom_length <<= 1; + } + + libspectrum_snap_set_interface1_custom_rom( snap, 1 ); + libspectrum_snap_set_interface1_rom_length( snap, 0, rom_length ); + + buffer = malloc( rom_length ); + if( !buffer ) { + ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ ); + return; + } + + memcpy( buffer, if1_memory_map_romcs[0].page, MEMORY_PAGE_SIZE ); + + if( rom_length == MEMORY_PAGE_SIZE*2 ) { + memcpy( buffer + MEMORY_PAGE_SIZE, if1_memory_map_romcs[1].page, + MEMORY_PAGE_SIZE ); + } + + libspectrum_snap_set_interface1_rom( snap, 0, buffer ); + } +} + +static void +microdrives_reset( void ) +{ + int m; + + for( m = 0; m < 8; m++ ) { + microdrive[m].head_pos = 0; + microdrive[m].motor_on = 0; /* motor off */ + microdrive[m].gap = 15; + microdrive[m].sync = 15; + microdrive[m].transfered = 0; + } + ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, + UI_STATUSBAR_STATE_INACTIVE ); + if1_mdr_status = 0; +/* + if1_ula.comms_data = 0; + if1_ula.count_in = 0; + if1_ula.count_out = 0; + if1_ula.cts = 0; + if1_ula.dtr = 0; + if1_ula.wait = 0; + if1_ula.busy = 0; + if1_ula.net = 0; + if1_ula.net_state = 0; +*/ +} + +static enum if1_port +decode_port( libspectrum_word port ) +{ + switch( port & 0x0018 ) { + case 0x0000: return PORT_MDR; + case 0x0008: return PORT_CTR; + case 0x0010: return PORT_NET; + default: return PORT_UNKNOWN; + } +} + +static libspectrum_byte +port_mdr_in( void ) +{ + libspectrum_byte ret = 0xff; + int m; + + for( m = 0; m < 8; m++ ) { + + microdrive_t *mdr = µdrive[ m ]; + + if( mdr->motor_on && mdr->inserted ) { + + if( mdr->transfered < mdr->max_bytes ) { + mdr->last = libspectrum_microdrive_data( mdr->cartridge, + mdr->head_pos ); + increment_head( m ); + } + + mdr->transfered++; + ret &= mdr->last; /* I assume negative logic, but how know? */ + } + + } + + return ret; +} + +static libspectrum_byte +port_ctr_in( void ) +{ + libspectrum_byte ret = 0xff; + int m, block; + + for( m = 0; m < 8; m++ ) { + + microdrive_t *mdr = µdrive[ m ]; + + if( mdr->motor_on && mdr->inserted ) { + block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); + if( mdr->pream[block] == SYNC_OK ) { /* if formatted */ + if( mdr->gap ) { + /* ret &= 0xff; GAP and SYNC high ? */ + mdr->gap--; + } else { + ret &= 0xf9; /* GAP and SYNC low */ + if( mdr->sync ) { + mdr->sync--; + } else { + mdr->gap = 15; + mdr->sync = 15; + } + } + } + /* if write protected */ + if( libspectrum_microdrive_write_protect( mdr->cartridge) ) + ret &= 0xfe; /* active bit */ + } + } + /* Here we have to poll, the if1_ula DTR 'line' */ + if( if1_ula.rs232_buffer > 0xff ) { /* buffer empty */ + unsigned char byte; + int yes = 1; + + while( yes && read( if1_ula.fd_r, &byte, 1 ) == 1 ) { + if( if1_ula.esc_in == 1 ) { + if1_ula.esc_in = 0; + if( byte == '*' ) { + if1_ula.rs232_buffer = 0x00; + yes = 0; + } else if( byte == 0x00 ) { + if( settings_current.rs232_handshake ) + if1_ula.dtr = 0; + } else if( byte == 0x01 ) { + if( settings_current.rs232_handshake ) + if1_ula.dtr = 1; + } + } else if( byte == 0x00 ) { + if1_ula.esc_in = 1; + } else { + if1_ula.rs232_buffer = byte; + yes = 0; + break; + } + } + } + + if( if1_ula.dtr == 0 ) + ret &= 0xf7; /* %11110111 */ + + /* Here we have to poll, the 'SinclairNet' busy flag but never used by + software in Interface 1 */ + if( if1_ula.busy == 0 ) + ret &= 0xef; /* %11101111 */ + /* fprintf( stderr, "Read CTR ( %%%d%d%d%d%d%d%d%d ).\n", + !!(ret & 128), !!(ret & 64), !!(ret & 32), !!(ret & 16), + !!(ret & 8), !!(ret & 4), !!(ret & 2), !!(ret & 1)); */ + microdrives_restart(); + + return ret; +} + +/* + return 1 if read a byte + 0 if nothing interesting... +*/ + +static int +read_rs232() +{ + if( if1_ula.rs232_buffer <= 0xff ) { /* we read from the buffer */ + if1_ula.data_in = if1_ula.rs232_buffer; + if1_ula.rs232_buffer = 0x0100; + return 1; + } + while( read( if1_ula.fd_r, &if1_ula.data_in, 1 ) == 1 ) { + if( if1_ula.esc_in == 1 ) { + if1_ula.esc_in = 0; + if( if1_ula.data_in == '*' ) { + if1_ula.data_in = 0x00; + return 1; + } else if( if1_ula.data_in == 0x00 ) { + if( settings_current.rs232_handshake ) + if1_ula.dtr = 0; + } else if( if1_ula.data_in == 0x01 ) { + if( settings_current.rs232_handshake ) + if1_ula.dtr = 1; + } + } else if( if1_ula.data_in == 0x00 ) { + if1_ula.esc_in = 1; + } else { + return 1; + } + } + return 0; +} + +static libspectrum_byte +port_net_in( void ) +{ + libspectrum_byte ret = 0xff; + + if( if1_ula.fd_r == -1 ) + goto no_rs232_in; + + /* Here is the RS232 input routine */ + if( if1_ula.cts ) { /* If CTS == 1 */ + if( if1_ula.count_in == 0 ) { + if( if1_ula.fd_r >= 0 && read_rs232() == 1 ) { + if1_ula.count_in++; /* Ok, if read a byte, we begin */ + } + if1_ula.tx = 0; /* now send __ to if1 + later we raise :-) */ + } else if( if1_ula.count_in >= 1 && if1_ula.count_in < 5 ) { + if1_ula.tx = 1; /* send ~~ (start bit :-) */ + if1_ula.count_in++; + } else if( if1_ula.count_in >= 5 && if1_ula.count_in < 13 ) { + if1_ula.tx = ( if1_ula.data_in & 0x01 ) ? 0 : 1; + /* send .. (data bits :-) */ + if1_ula.data_in >>= 1; /* prepare next bit :-) */ + if1_ula.count_in++; + } else + if1_ula.count_in = 0; + } else { /* if( if1_ula.cts ) */ + if1_ula.count_in = 0; /* reset serial in */ + if1_ula.tx = 0; /* send __ stop bits or s.e. :-) */ + } + +no_rs232_in: + if( if1_ula.fd_net == -1 ) + goto no_snet_in; + + if( if1_ula.s_net_mode == 0 ) { /* if we do raw */ + /* Here is the input routine */ + read( if1_ula.fd_net, &if1_ula.net, 1 ); /* Ok, if no byte, we send last*/ + } else {/* if( if1_ula.s_net_mode == 1 ) if we do interpreted */ +/* Here is the input routine. There are several stage in input + and output. So first for output. if1 first do SEND-SC + (http://www.wearmouth.demon.co.uk/if1_2.htm#L101E) to send + a Sync-Out signal and SEND-SC do first a NET-STATE + (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FBC) to see + the line activity: + 11xxxxxx times (192-255) have to get a zero (bit for network) + plus 1 times more from SEND-SC. Next SEND-SC send a 0 which is + a 1 on the net wire (negated output, straight input!!!) + + OK. In input first if1 call WT-SC-E to check Network activity + (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FD3). Now check + 128 times the net wire (we do two round, because to differentiate + net out routines...) +*/ + + if( if1_ula.net_state < 0x0100 ) { /* if1 may in NET-STATE */ + if1_ula.net_state++; + if1_ula.net = 0; +#ifdef IF1_DEBUG_NET + fprintf( stderr, "NET-STAT(%03d)? We send 0!\n", if1_ula.net_state ); +#endif + } else if( if1_ula.net_state == 0x0100 ) { /* probably waiting for input */ + if( read( if1_ula.fd_net, &if1_ula.net_data, 1 ) == 1 ) { + if1_ula.net_state++; + if1_ula.net = 1; /* Start with __/~~ */ + } /* Ok, if have a byte, we send it! */ + } else if( if1_ula.net_state == 0x0101 ) { + if1_ula.net_state++; + if1_ula.net = 1; /* one more ~~ */ + } else if( if1_ula.net_state > 0x0101 && + if1_ula.net_state < 0x010a ) { /* we send the data bits... */ + if1_ula.net_state++; + if1_ula.net = if1_ula.net_data & 1; + if1_ula.net_data >>= 1; + } else if( if1_ula.net_state == 0x010a ) { + if1_ula.net = 0; + if1_ula.net_state = 0; /* OK, we starting a new byte... */ +#ifdef IF1_DEBUG_NET + fprintf( stderr, "NET-STAT(%03d)? Get a byte!\n", if1_ula.net_state ); +#endif + } + } +no_snet_in: + if( !if1_ula.tx ) + ret &= 0x7f; + if( !if1_ula.net ) + ret &= 0xfe; + microdrives_restart(); + + return ret; +} + +libspectrum_byte +if1_port_in( libspectrum_word port GCC_UNUSED, int *attached ) +{ + libspectrum_byte ret = 0xff; + + if( !if1_active ) return ret; + + *attached = 1; + + switch( decode_port( port ) ) + { + case PORT_MDR: ret &= port_mdr_in(); break; + case PORT_CTR: ret &= port_ctr_in(); break; + case PORT_NET: ret &= port_net_in(); break; + case PORT_UNKNOWN: break; + } + + return ret; +} + +static void +port_mdr_out( libspectrum_byte val ) +{ + int m, block; + + /* allow access to the port only if motor 1 is ON and there's a file open */ + for( m = 0; m < 8; m++ ) { + + microdrive_t *mdr = µdrive[ m ]; + + if( mdr->motor_on && mdr->inserted ) { +#ifdef IF1_DEBUG_MDR + fprintf(stderr, "#%05d %03d(%03d): 0x%02x\n", + mdr->head_pos, mdr->transfered, mdr->max_bytes, val ); +#endif + block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); + if( mdr->transfered == 0 && val == 0x00 ) { /* start pream */ + mdr->pream[block] = 1; + } else if( mdr->transfered > 0 && mdr->transfered < 10 && val == 0x00 ) { + mdr->pream[block]++; + } else if( mdr->transfered > 9 && mdr->transfered < 12 && val == 0xff ) { + mdr->pream[block]++; + } else if( mdr->transfered == 12 && mdr->pream[block] == 12 ) { + mdr->pream[block] = SYNC_OK; + } + if( mdr->transfered > 11 && + mdr->transfered < mdr->max_bytes + 12 ) { + + libspectrum_microdrive_set_data( mdr->cartridge, mdr->head_pos, + val ); + increment_head( m ); + mdr->modified = 1; + } + mdr->transfered++; + } + } +} + +static void +port_ctr_out( libspectrum_byte val ) +{ + int m; + + if( !( val & 0x02 ) && ( if1_ula.comms_clk ) ) { /* ~~\__ */ + + for( m = 7; m > 0; m-- ) { + /* Rotate one drive */ + microdrive[m].motor_on = microdrive[m - 1].motor_on; + } + microdrive[0].motor_on = (val & 0x01) ? 0 : 1; + + if( microdrive[0].motor_on || microdrive[1].motor_on || + microdrive[2].motor_on || microdrive[3].motor_on || + microdrive[4].motor_on || microdrive[5].motor_on || + microdrive[6].motor_on || microdrive[7].motor_on ) { + if( !if1_mdr_status ) { + ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, + UI_STATUSBAR_STATE_ACTIVE ); + if1_mdr_status = 1; + } + } else if ( if1_mdr_status ) { + ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, + UI_STATUSBAR_STATE_INACTIVE ); + if1_mdr_status = 0; + } + } + if( val & 0x01 ) { /* comms_data == 1 */ + /* Interface 1 service manual p.:1.4 par.: 1.5.1 + The same pin on IC1 (if1 ULA), pin 33, is used for the network + transmit data and for the RS232 transmit data. In order to select + the required function IC1 uses its COMMS_OUT (pin 30) signal, + borrowed from the microdrive control when the microdrive is not + being used (I do not know what it is exactly meaning. It is a + hardware not being used, or a software should not use..?) This signal + is routed from pin 30 to the emitter of transistor Q3 (RX DATA) and + via resistor R4, to the base of transistor Q1 (NET). When COMMS_OUT + is high Q3 is enabled this selecting RS232, and when it is low + Q1 is enabled selecting the network. + + OK, the schematics offer a different interpretation, because if + COMMS_OUT pin level high (>+3V) then Q3 is off (the basis cannot + be more higher potential then emitter (NPN transistor), so whatever + is on the IC1 RX DATA (pin 33) the basis of Q4 is always on +12V, + so the collector of Q4 (PNP transistor) always on -12V. + If COMMS_OUT pin level goes low (~0V), then Q3 basis (connected + to IC1 RX DATA pin) can be higher level (>+3V) than emitter, so + the basis potential of Q4 depend on IC1 RX DATA. + + OK, Summa summarum I assume that, the COMMS OUT pin is a + negated output of the if1 ULA CTR register's COMMS DATA bit. + */ + /* C_DATA = 1 */ + if( if1_ula.comms_data == 0 ) { + if1_ula.count_out = 0; + if1_ula.data_out = 0; + if1_ula.count_in = 0; + if1_ula.data_in = 0; + } + } + if1_ula.wait = ( val & 0x20 ) ? 1 : 0; + if1_ula.comms_data = ( val & 0x01 ) ? 1 : 0; + if1_ula.comms_clk = ( val & 0x02 ) ? 1 : 0; + val = ( val & 0x10 ) ? 1 : 0; + if( settings_current.rs232_handshake && + if1_ula.fd_t != -1 && if1_ula.cts != val ) { + char data = val ? 0x03 : 0x02; + do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); + do ; while( write( if1_ula.fd_t, &data, 1 ) != 1 ); + } + if1_ula.cts = val; + +#ifdef IF1_DEBUG_NET + fprintf( stderr, "Set CTS to %d, set WAIT to %d and COMMS_DATA to %d\n", + if1_ula.cts, if1_ula.wait, if1_ula.comms_data ); +#endif + + microdrives_restart(); +} + +static void +port_net_out( libspectrum_byte val ) +{ + if( if1_ula.fd_t == -1 ) + return; /* nothing to write */ + + if( if1_ula.comms_data == 1 ) { /* OK, RS232 */ + val &= 0x01; + if( if1_ula.count_out == 0 && !val ) { /* waiting for ~~\__ */ + if1_ula.count_out++; + } else if( if1_ula.count_out == 1 ) { + if( if1_ula.cts != 0 || !val ) + if1_ula.count_out = -1; + else + if1_ula.count_out++; /* else get the start bit __/~~ */ + } else if( if1_ula.count_out >= 2 && if1_ula.count_out <= 9 ) { + if1_ula.data_out >>= 1; + if1_ula.data_out |= val & 0x01 ? 0 : 128; + if1_ula.count_out++; /* waiting for next data bit */ + } else if( if1_ula.count_out >= 10 && if1_ula.count_out <= 11 ) { + if( val ) + if1_ula.count_out = -1; + else + if1_ula.count_out++; + } else if( if1_ula.count_out == 12 ) { + if( !val ) + if1_ula.count_out = -1; + else + if1_ula.count_out++; + } else if( if1_ula.count_out == 13 ) { + if( val ) + if1_ula.count_out = -1; + } + + if( if1_ula.count_out == -1 ) { + if1_ula.count_out = 13; + if1_ula.data_out = '?'; + do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); + } + if( if1_ula.count_out == 13 ) { + /* Here is the output routine */ + if( if1_ula.data_out == 0x00 ) { + if1_ula.data_out = '*'; + do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); + } + do ; while( write( if1_ula.fd_t, &if1_ula.data_out, 1 ) != 1 ); + if1_ula.count_out = 0; + } + if1_ula.rx = val & 0x01; /* set rx */ + } else { /* if( if1_ula.comms_data == 1 ) SinclairNET :-)*/ + if( if1_ula.s_net_mode == 0 ) { /* if we out bit by bit, do it */ + /* Here is the output routine */ + +/* OK, examining the schematics of if1 and the disassembly of if1 ROM, I + see that the Q1 and Q2 transistors negate the RX DATA signal, and the + floating state of the net wire is the ~0V level, the forced is the ~3V. + The if1 software send complemented data and read straight data. +*/ + if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set rx */ + lseek( if1_ula.fd_net, 0, SEEK_SET ); /* we save only the state of the wire*/ + do ; while( write( if1_ula.fd_net, &if1_ula.net, 1 ) == -1 ); +#ifdef HAVE_FSYNC + fsync( if1_ula.fd_net ); +#endif /* #ifdef HAVE_FSYNC */ +#ifdef IF1_DEBUG_NET + fprintf( stderr, "Send SinclairNET: %d\n", if1_ula.net ); +#endif + } else { /* if( if1_ula.s_net_mode == 0 ) if we out byte by byte, do it */ + if( if1_ula.net_state >= 0x0200 && if1_ula.net_state < 0x0208 ) { + if1_ula.net_state++; + if1_ula.net_data <<= 1; + if1_ula.net_data |= ( val & 0x01 ) ? 0 : 1; + } else if( if1_ula.net_state == 0x0208 ) { + if1_ula.net_data &= 0xff; + if1_ula.net_state++; /* OK, now we get data bytes... */ + +/* lseek( if1_ula.fd_net, 0, SEEK_SET ); start a packet */ + /* first we send the station number */ + do ; while( write( if1_ula.fd_net, &if1_ula.net_data, 1 ) == -1 ); +#ifdef HAVE_FSYNC + fsync( if1_ula.fd_net ); +#endif /* #ifdef HAVE_FSYNC */ +#ifdef IF1_DEBUG_NET + fprintf( stderr, "SC-OUT send network number: %d\n", + if1_ula.net_data ^ 0xff ); +#endif + } else if( if1_ula.net_state > 192 && if1_ula.net_state < 0x0200 && + ( ( val & 0x01 ) == 0 ) ) { + /* NET-STATE ask as many times.... and now send a 0 */ +/* if1_ula.net = 1; */ + if1_ula.net_state = 0x0200; /* Send the station number */ + } + if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set net wire? */ + } + } + microdrives_restart(); +} + +void +if1_port_out( libspectrum_word port GCC_UNUSED, libspectrum_byte val ) +{ + if( !if1_active ) return; + +#ifdef IF1_DEBUG_NET_1 + fprintf( stderr, "In if1_port_out( %%%d%d%d%d%d%d%d%d => 0x%04x ).\n", + !!(val & 128), !!(val & 64), !!(val & 32), !!(val & 16), + !!(val & 8), !!(val & 4), !!(val & 2), !!(val & 1), port); +#endif + + switch( decode_port( port ) ) { + case PORT_MDR: port_mdr_out( val ); break; + case PORT_CTR: port_ctr_out( val ); break; + case PORT_NET: port_net_out( val ); break; + case PORT_UNKNOWN: break; + } +} + +static void +increment_head( int m ) +{ + microdrive[m].head_pos++; + if( microdrive[m].head_pos >= + libspectrum_microdrive_cartridge_len( microdrive[m].cartridge ) * + LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) + microdrive[m].head_pos = 0; +} + +static void +microdrives_restart( void ) +{ + int m; + + for( m = 0; m < 8; m++ ) { + while( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != 0 && + ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != LIBSPECTRUM_MICRODRIVE_HEAD_LEN ) + increment_head( m ); /* put head in the start of a block */ + + microdrive[m].transfered = 0; /* reset current number of bytes written */ + + if( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) == 0 ) { + microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN; /* up to 15 bytes for header blocks */ + } else { + microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN + LIBSPECTRUM_MICRODRIVE_DATA_LEN + 1; /* up to 528 bytes for data blocks */ + } + } +} + +void +if1_mdr_writeprotect( int drive, int wrprot ) +{ + libspectrum_microdrive_set_write_protect( microdrive[drive].cartridge, + wrprot ? 1 : 0 ); + microdrive[drive].modified = 1; + + update_menu( UMENU_MDRV1 + drive ); +} + +static void +if1_mdr_new( microdrive_t *mdr ) +{ + libspectrum_byte len; + long int i; + + mdr->filename = NULL; + if( settings_current.mdr_random_len ) { /* Random length */ + len = 171 + ( ( rand() >> 2 ) + ( rand() >> 2 ) + + ( rand() >> 2 ) + ( rand() >> 2 ) ) + / rnd_factor; + } else + len = settings_current.mdr_len = settings_current.mdr_len < 10 ? 10 : + settings_current.mdr_len > LIBSPECTRUM_MICRODRIVE_BLOCK_MAX ? LIBSPECTRUM_MICRODRIVE_BLOCK_MAX : settings_current.mdr_len; + + /* Erase the entire cartridge */ + libspectrum_microdrive_set_cartridge_len( mdr->cartridge, len ); + + for( i = 0; i < len * LIBSPECTRUM_MICRODRIVE_BLOCK_LEN; i++ ) + libspectrum_microdrive_set_data( mdr->cartridge, i, 0xff ); + + for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); + i > 0; i-- ) + mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_NO; + + /* but don't write-protect */ + libspectrum_microdrive_set_write_protect( mdr->cartridge, 0 ); + + mdr->inserted = 1; + mdr->modified = 1; + +} + +int +if1_mdr_insert( int which, const char *filename ) +{ + microdrive_t *mdr; + int m, i; + + if( which == -1 ) { /* find an empty one */ + for( m = 0; m < 8; m++ ) { + if( !microdrive[m].inserted ) { + which = m; + break; + } + } + } + + if( which == -1 ) { + ui_error( UI_ERROR_ERROR, + "Cannot insert cartridge '%s', all Microdrives in use", + filename ); + return 1; + } + + if( which >= 8 ) { + ui_error( UI_ERROR_ERROR, "if1_mdr_insert: unknown drive %d", which ); + return 1; + } + + mdr = µdrive[ which ]; + + /* Eject any cartridge already in the drive */ + if( mdr->inserted ) { + /* Abort the insert if we want to keep the current cartridge */ + if( if1_mdr_eject( which, 0 ) ) return 0; + } + + if( filename == NULL ) { /* insert new unformatted cartridge */ + if1_mdr_new( mdr ); + update_menu( UMENU_MDRV1 + which ); + return 0; + } + + if( utils_read_file( filename, &mdr->file ) ) { + ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); + return 1; + } + + if( libspectrum_microdrive_mdr_read( mdr->cartridge, mdr->file.buffer, + mdr->file.length ) ) { + utils_close_file( &mdr->file ); + ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); + return 1; + } + + if( utils_close_file( &mdr->file ) ) return 1; + + mdr->inserted = 1; + mdr->modified = 0; + mdr->filename = strdup( filename ); + /* we assume formatted cartridges */ + for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); + i > 0; i-- ) + mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_OK; + + update_menu( UMENU_MDRV1 + which ); + + return 0; +} + +int +if1_mdr_eject( int which, int saveas ) +{ + microdrive_t *mdr; + + if( which >= 8 ) + return 1; + + mdr = µdrive[ which ]; + + if( !mdr->inserted ) + return 0; + + if( saveas ) { /* 1 -> save as.., 2 -> save */ + + if( mdr->filename == NULL ) saveas = 1; + if( ui_mdr_write( which, 2 - saveas ) ) return 1; + mdr->modified = 0; + return 0; + + } else { + + if( mdr->modified ) { + + ui_confirm_save_t confirm = ui_confirm_save( + "Cartridge in Microdrive %i has been modified.\n" + "Do you want to save it?", + which + 1 + ); + + switch( confirm ) { + + case UI_CONFIRM_SAVE_SAVE: + if( if1_mdr_eject( which, 2 ) ) return 1; /* first save */ + break; + + case UI_CONFIRM_SAVE_DONTSAVE: break; + case UI_CONFIRM_SAVE_CANCEL: return 1; + + } + } + } + + mdr->inserted = 0; + if( mdr->filename != NULL ) { + free( mdr->filename ); + mdr->filename = NULL; + } + + update_menu( UMENU_MDRV1 + which ); + return 0; +} + +int +if1_mdr_write( int which, const char *filename ) +{ + microdrive_t *mdr = µdrive[which]; + + libspectrum_microdrive_mdr_write( mdr->cartridge, &mdr->file.buffer, + &mdr->file.length ); + + if( filename == NULL ) filename = mdr->filename; /* Write over the original file */ + + if( utils_write_file( filename, mdr->file.buffer, mdr->file.length ) ) + return 1; + + if( mdr->filename && strcmp( filename, mdr->filename ) ) { + free( mdr->filename ); + mdr->filename = strdup( filename ); + } + return 0; +} + +#ifndef O_NONBLOCK +#define O_NONBLOCK FNDELAY +#endif + +void +if1_plug( const char *filename, int what ) +{ +#ifdef WIN32 + ui_error( UI_ERROR_ERROR, "Not yet implemented on Win32" ); + return; +#else + int fd = -1; + + switch( what ) { + case 1: + if( if1_ula.fd_r >= 0 ) + close( if1_ula.fd_r ); + fd = if1_ula.fd_r = open( filename, O_RDWR | O_NONBLOCK ); + if( fcntl( fd, F_SETFL, O_RDONLY | O_NONBLOCK ) ) + ui_error( UI_ERROR_ERROR, "Cannot set O_RDONLY on '%s': %s", + filename, strerror( errno ) ); + if1_ula.rs232_buffer = 0x100; /* buffer is empty */ + break; + case 2: + if( if1_ula.fd_t >= 0 ) + close( if1_ula.fd_t ); + fd = if1_ula.fd_t = open( filename, O_RDWR | O_NONBLOCK ); + if( fcntl( fd, F_SETFL, O_WRONLY | O_NONBLOCK ) ) + ui_error( UI_ERROR_ERROR, "Cannot set O_WRONLY on '%s': %s", + filename, strerror( errno ) ); + break; + case 3: + if( if1_ula.fd_net >= 0 ) + close( if1_ula.fd_net ); + fd = if1_ula.fd_net = open( filename, O_RDWR | O_NONBLOCK ); + break; + } + + /* rs232_handshake == 0 -> we assume DTR(DSR) always 1 if tx and rx plugged */ + if( !settings_current.rs232_handshake && + if1_ula.fd_t != -1 && if1_ula.fd_r != -1 ) + if1_ula.dtr = 1; + + if( fd < 0 ) { + ui_error( UI_ERROR_ERROR, "Error opening '%s': %s", + filename, strerror( errno ) ); + return; + } + + if1_ula.s_net_mode = settings_current.raw_s_net ? 0 : 1; + update_menu( UMENU_RS232 ); +#endif +} + +void +if1_unplug( int what ) +{ + switch( what ) { + case 1: + if( if1_ula.fd_r >= 0 ) + close( if1_ula.fd_r ); + if1_ula.fd_r = -1; + break; + case 2: + if( if1_ula.fd_t >= 0 ) + close( if1_ula.fd_t ); + if1_ula.fd_t = -1; + if1_ula.dtr = 0; + break; + case 3: + if( if1_ula.fd_net >= 0 ) + close( if1_ula.fd_net ); + if1_ula.fd_net = -1; + break; + } + /* rs232_handshake == 0 -> we assume DTR(DSR) always 1 if tx and rx plugged */ + if( !settings_current.rs232_handshake && + ( if1_ula.fd_t == -1 || if1_ula.fd_r == -1 ) ) + if1_ula.dtr = 0; + update_menu( UMENU_RS232 ); +} Copied: vendor/fuse-emulator/current/fuse/if1.h (from rev 681, vendor/fuse-emulator/current/fuse/if1.h) =================================================================== --- vendor/fuse-emulator/current/fuse/if1.h (rev 0) +++ vendor/fuse-emulator/current/fuse/if1.h 2012-01-14 13:01:10 UTC (rev 683) @@ -0,0 +1,59 @@ +/* if1.h: Interface I handling routines + Copyright (c) 2004-2005 Gergely Szasz, Philip Kendall + + $Id: if1.h 3327 2007-11-22 23:06:47Z 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: + + Gergely: sz...@hu... + +*/ + +#ifndef FUSE_IF1_H +#define FUSE_IF1_H + +#include <libspectrum.h> + +#include "periph.h" + +/* IF1 */ +extern int if1_active; +extern int if1_available; + +extern const periph_t if1_peripherals[]; +extern const size_t if1_peripherals_count; + +int if1_init( void ); +libspectrum_error if1_end( void ); + +void if1_page( void ); +void if1_unpage( void ); +void if1_memory_map( void ); + +void if1_port_out( libspectrum_word port, libspectrum_byte val ); +libspectrum_byte if1_port_in( libspectrum_word port, int *attached ); + +int if1_mdr_insert( int drive, const char *filename ); +int if1_mdr_write( int drive, const char *filename ); +int if1_mdr_eject( int drive, int write ); +void if1_mdr_writeprotect( int drive, int wrprot ); +void if1_plug( const char *filename, int what ); +void if1_unplug( int what ); + +void if1_update_menu( void ); + +#endif /* #ifndef FUSE_IF1_H */ Copied: vendor/fuse-emulator/current/fuse/if2.c (from rev 681, vendor/fuse-emulator/current/fuse/if2.c) =================================================================== --- vendor/fuse-emulator/current/fuse/if2.c (rev 0) +++ vendor/fuse-emulator/current/fuse/if2.c 2012-01-14 13:01:10 UTC (rev 683) @@ -0,0 +1,204 @@ +/* if2.c: Interface II cartridge handling routines + Copyright (c) 2003 Darren Salt, Fredrick Meunier, Philip Kendall + Copyright (c) 2004 Fredrick Meunier + + $Id: if2.c 4099 2009-10-22 10:59:02Z fredm $ + + This program is free software; ... [truncated message content] |
From: <fr...@us...> - 2012-01-14 12:26:58
|
Revision: 682 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=682&view=rev Author: fredm Date: 2012-01-14 12:26:49 +0000 (Sat, 14 Jan 2012) Log Message: ----------- To prepare to load . into vendor/fuse-emulator/current, perform 24 renames. * vendor/fuse-emulator/current/fuse/peripherals/disk: Renamed from vendor/fuse-emulator/current/fuse/disk. * vendor/fuse-emulator/current/fuse/peripherals/ide: Renamed from vendor/fuse-emulator/current/fuse/ide. * vendor/fuse-emulator/current/fuse/peripherals/ay.c: Renamed from vendor/fuse-emulator/current/fuse/ay.c. * vendor/fuse-emulator/current/fuse/peripherals/ay.h: Renamed from vendor/fuse-emulator/current/fuse/ay.h. * vendor/fuse-emulator/current/fuse/peripherals/dck.c: Renamed from vendor/fuse-emulator/current/fuse/dck.c. * vendor/fuse-emulator/current/fuse/peripherals/dck.h: Renamed from vendor/fuse-emulator/current/fuse/dck.h. * vendor/fuse-emulator/current/fuse/peripherals/fuller.c: Renamed from vendor/fuse-emulator/current/fuse/fuller.c. * vendor/fuse-emulator/current/fuse/peripherals/fuller.h: Renamed from vendor/fuse-emulator/current/fuse/fuller.h. * vendor/fuse-emulator/current/fuse/peripherals/if1.c: Renamed from vendor/fuse-emulator/current/fuse/if1.c. * vendor/fuse-emulator/current/fuse/peripherals/if1.h: Renamed from vendor/fuse-emulator/current/fuse/if1.h. * vendor/fuse-emulator/current/fuse/peripherals/if2.c: Renamed from vendor/fuse-emulator/current/fuse/if2.c. * vendor/fuse-emulator/current/fuse/peripherals/if2.h: Renamed from vendor/fuse-emulator/current/fuse/if2.h. * vendor/fuse-emulator/current/fuse/peripherals/joystick.c: Renamed from vendor/fuse-emulator/current/fuse/joystick.c. * vendor/fuse-emulator/current/fuse/peripherals/joystick.h: Renamed from vendor/fuse-emulator/current/fuse/joystick.h. * vendor/fuse-emulator/current/fuse/peripherals/kempmouse.c: Renamed from vendor/fuse-emulator/current/fuse/kempmouse.c. * vendor/fuse-emulator/current/fuse/peripherals/kempmouse.h: Renamed from vendor/fuse-emulator/current/fuse/kempmouse.h. * vendor/fuse-emulator/current/fuse/peripherals/melodik.c: Renamed from vendor/fuse-emulator/current/fuse/melodik.c. * vendor/fuse-emulator/current/fuse/peripherals/melodik.h: Renamed from vendor/fuse-emulator/current/fuse/melodik.h. * vendor/fuse-emulator/current/fuse/peripherals/printer.c: Renamed from vendor/fuse-emulator/current/fuse/printer.c. * vendor/fuse-emulator/current/fuse/peripherals/printer.h: Renamed from vendor/fuse-emulator/current/fuse/printer.h. * vendor/fuse-emulator/current/fuse/peripherals/scld.c: Renamed from vendor/fuse-emulator/current/fuse/scld.c. * vendor/fuse-emulator/current/fuse/peripherals/scld.h: Renamed from vendor/fuse-emulator/current/fuse/scld.h. * vendor/fuse-emulator/current/fuse/peripherals/ula.c: Renamed from vendor/fuse-emulator/current/fuse/ula.c. * vendor/fuse-emulator/current/fuse/peripherals/ula.h: Renamed from vendor/fuse-emulator/current/fuse/ula.h. Added Paths: ----------- vendor/fuse-emulator/current/fuse/peripherals/ vendor/fuse-emulator/current/fuse/peripherals/ay.c vendor/fuse-emulator/current/fuse/peripherals/ay.h vendor/fuse-emulator/current/fuse/peripherals/dck.c vendor/fuse-emulator/current/fuse/peripherals/dck.h vendor/fuse-emulator/current/fuse/peripherals/disk/ vendor/fuse-emulator/current/fuse/peripherals/fuller.c vendor/fuse-emulator/current/fuse/peripherals/fuller.h vendor/fuse-emulator/current/fuse/peripherals/ide/ vendor/fuse-emulator/current/fuse/peripherals/if1.c vendor/fuse-emulator/current/fuse/peripherals/if1.h vendor/fuse-emulator/current/fuse/peripherals/if2.c vendor/fuse-emulator/current/fuse/peripherals/if2.h vendor/fuse-emulator/current/fuse/peripherals/joystick.c vendor/fuse-emulator/current/fuse/peripherals/joystick.h vendor/fuse-emulator/current/fuse/peripherals/kempmouse.c vendor/fuse-emulator/current/fuse/peripherals/kempmouse.h vendor/fuse-emulator/current/fuse/peripherals/melodik.c vendor/fuse-emulator/current/fuse/peripherals/melodik.h vendor/fuse-emulator/current/fuse/peripherals/printer.c vendor/fuse-emulator/current/fuse/peripherals/printer.h vendor/fuse-emulator/current/fuse/peripherals/scld.c vendor/fuse-emulator/current/fuse/peripherals/scld.h vendor/fuse-emulator/current/fuse/peripherals/ula.c vendor/fuse-emulator/current/fuse/peripherals/ula.h Removed Paths: ------------- vendor/fuse-emulator/current/fuse/ay.c vendor/fuse-emulator/current/fuse/ay.h vendor/fuse-emulator/current/fuse/dck.c vendor/fuse-emulator/current/fuse/dck.h vendor/fuse-emulator/current/fuse/disk/ vendor/fuse-emulator/current/fuse/fuller.c vendor/fuse-emulator/current/fuse/fuller.h vendor/fuse-emulator/current/fuse/ide/ 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/if2.h vendor/fuse-emulator/current/fuse/joystick.c vendor/fuse-emulator/current/fuse/joystick.h vendor/fuse-emulator/current/fuse/kempmouse.c vendor/fuse-emulator/current/fuse/kempmouse.h vendor/fuse-emulator/current/fuse/melodik.c vendor/fuse-emulator/current/fuse/melodik.h vendor/fuse-emulator/current/fuse/printer.c vendor/fuse-emulator/current/fuse/printer.h vendor/fuse-emulator/current/fuse/scld.c vendor/fuse-emulator/current/fuse/scld.h vendor/fuse-emulator/current/fuse/ula.c vendor/fuse-emulator/current/fuse/ula.h Deleted: vendor/fuse-emulator/current/fuse/ay.c =================================================================== --- vendor/fuse-emulator/current/fuse/ay.c 2012-01-14 12:08:15 UTC (rev 681) +++ vendor/fuse-emulator/current/fuse/ay.c 2012-01-14 12:26:49 UTC (rev 682) @@ -1,169 +0,0 @@ -/* ay.c: AY-8-3912 routines - Copyright (c) 1999-2009 Philip Kendall - - $Id: ay.c 4030 2009-06-07 14:38:38Z 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: phi...@sh... - -*/ - -#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 ); -} - -void -ay_state_from_snapshot( libspectrum_snap *snap ) -{ - size_t i; - - 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_from_snapshot( libspectrum_snap *snap ) -{ - if( machine_current->capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_AY ) { - ay_state_from_snapshot( snap ); - } -} - -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] ); -} Deleted: vendor/fuse-emulator/current/fuse/ay.h =================================================================== --- vendor/fuse-emulator/current/fuse/ay.h 2012-01-14 12:08:15 UTC (rev 681) +++ vendor/fuse-emulator/current/fuse/ay.h 2012-01-14 12:26:49 UTC (rev 682) @@ -1,47 +0,0 @@ -/* ay.h: AY-8-3912 routines - Copyright (c) 1999-2009 Philip Kendall - - $Id: ay.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... - -*/ - -#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 ); - -void ay_state_from_snapshot( libspectrum_snap *snap ); - -#endif /* #ifndef FUSE_AY_H */ Deleted: vendor/fuse-emulator/current/fuse/dck.c =================================================================== --- vendor/fuse-emulator/current/fuse/dck.c 2012-01-14 12:08:15 UTC (rev 681) +++ vendor/fuse-emulator/current/fuse/dck.c 2012-01-14 12:26:49 UTC (rev 682) @@ -1,184 +0,0 @@ -/* 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: phi...@sh... - - Darren: li...@yo... - Fred: fr...@sp... - -*/ - -#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 ); -} Deleted: vendor/fuse-emulator/current/fuse/dck.h =================================================================== --- vendor/fuse-emulator/current/fuse/dck.h 2012-01-14 12:08:15 UTC (rev 681) +++ vendor/fuse-emulator/current/fuse/dck.h 2012-01-14 12:26:49 UTC (rev 682) @@ -1,39 +0,0 @@ -/* 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: phi...@sh... - - Darren: li...@yo... - Fred: fr...@sp... - -*/ - -#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 Deleted: vendor/fuse-emulator/current/fuse/fuller.c =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.c 2012-01-14 12:08:15 UTC (rev 681) +++ vendor/fuse-emulator/current/fuse/fuller.c 2012-01-14 12:26:49 UTC (rev 682) @@ -1,90 +0,0 @@ -/* fuller.c: Routines for handling the Fuller Box - Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier - - $Id: fuller.c 4032 2009-06-10 11:09:44Z 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: phi...@sh... - - Stuart: sd...@nt... - -*/ - -#include <config.h> - -#include <libspectrum.h> - -#include "ay.h" -#include "compat.h" -#include "fuller.h" -#include "joystick.h" -#include "module.h" -#include "periph.h" -#include "settings.h" - -static void fuller_enabled_snapshot( libspectrum_snap *snap ); -static void fuller_from_snapshot( libspectrum_snap *snap ); -static void fuller_to_snapshot( libspectrum_snap *snap ); - -static module_info_t fuller_module_info = { - - NULL, - NULL, - fuller_enabled_snapshot, - fuller_from_snapshot, - fuller_to_snapshot, - -}; - -const periph_t fuller_peripherals[] = { - { 0x00ff, 0x003f, ay_registerport_read, ay_registerport_write }, - { 0x00ff, 0x005f, NULL, ay_dataport_write }, - { 0x00ff, 0x007f, joystick_fuller_read, NULL }, -}; - -const size_t fuller_peripherals_count = - sizeof( fuller_peripherals ) / sizeof( periph_t ); - -static void -fuller_enabled_snapshot( libspectrum_snap *snap ) -{ - if( libspectrum_snap_fuller_box_active( snap ) ) - settings_current.fuller = 1; -} - -static void -fuller_from_snapshot( libspectrum_snap *snap ) -{ - if( periph_fuller_active ) { - ay_state_from_snapshot( snap ); - } -} - -static void -fuller_to_snapshot( libspectrum_snap *snap ) -{ - libspectrum_snap_set_fuller_box_active( snap, periph_fuller_active ); -} - -int -fuller_init( void ) -{ - module_register( &fuller_module_info ); - - return 0; -} Deleted: vendor/fuse-emulator/current/fuse/fuller.h =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.h 2012-01-14 12:08:15 UTC (rev 681) +++ vendor/fuse-emulator/current/fuse/fuller.h 2012-01-14 12:26:49 UTC (rev 682) @@ -1,40 +0,0 @@ -/* fuller.h: Routines for handling the Fuller Box - Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier - - $Id: fuller.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... - - Stuart: sd...@nt... - -*/ - -#ifndef FUSE_FULLER_H -#define FUSE_FULLER_H - -#include <libspectrum.h> - -#include "periph.h" - -extern const periph_t fuller_peripherals[]; -extern const size_t fuller_peripherals_count; - -int fuller_init( void ); - -#endif /* #ifndef FUSE_FULLER_H */ Deleted: vendor/fuse-emulator/current/fuse/if1.c =================================================================== --- vendor/fuse-emulator/current/fuse/if1.c 2012-01-14 12:08:15 UTC (rev 681) +++ vendor/fuse-emulator/current/fuse/if1.c 2012-01-14 12:26:49 UTC (rev 682) @@ -1,1304 +0,0 @@ -/* if1.c: Interface I handling routines - Copyright (c) 2004-2008 Gergely Szasz, Philip Kendall - - $Id: if1.c 4180 2010-10-09 12:59:37Z 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: - - Gergely: sz...@hu... - -*/ - -#include <config.h> - -#include <string.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> - -#include <unistd.h> - -#include "compat.h" -#include "debugger/debugger.h" -#include "if1.h" -#include "machine.h" -#include "memory.h" -#include "module.h" -#include "periph.h" -#include "settings.h" -#include "utils.h" -#include "ui/ui.h" - -#undef IF1_DEBUG_MDR -#undef IF1_DEBUG_NET -#undef IF1_DEBUG_NET_1 - -#define BUFF_EMPTY 0x100 - -enum { - SYNC_NO = 0, - SYNC_OK = 0xff -}; - -/* - Microdrive cartridge - GAP PREAMBLE 15 byte GAP PREAMBLE 15 byte 512 1 - [-----][00 00 ... ff ff][BLOCK HEAD][-----][00 00 ... ff ff][REC HEAD][ DATA ][CHK] - Preamble = 10 * 0x00 + 2 * 0xff (12 byte) -*/ - -typedef struct microdrive_t { - utils_file file; - char *filename; /* old filename */ - int inserted; - int modified; - int motor_on; - int head_pos; - int transfered; - int max_bytes; - libspectrum_byte pream[512]; /* preamble/sync area written */ - libspectrum_byte last; - libspectrum_byte gap; - libspectrum_byte sync; - - libspectrum_microdrive *cartridge; /* write protect, len, blocks */ - -} microdrive_t; - -typedef struct if1_ula_t { - int fd_r; /* file descriptor for reading bytes or bits RS232 */ - int fd_t; /* file descriptor for writing bytes or bits RS232 */ - int fd_net; /* file descriptor for rw bytes or bits SinclairNET */ - int rs232_buffer; /* read buffer */ - int s_net_mode; - int status; /* if1_ula/SinclairNET */ - int comms_data; /* the previous data comms state */ - int comms_clk; /* the previous data comms state */ - int cts; /* CTS of peripheral */ - int dtr; /* DTR of peripheral */ - int tx; /* TxD the name is very kind, because this is the read end of - the TxD wire of DATA machine (really RxD the view of - spectrum */ - int rx; /* RxD the name is very kind, because this is the write end of - the RxD wire of DATA machine (really TxD the view of - spectrum */ - int data_in; /* interpreted incoming data */ - int count_in; - int data_out; /* interpreted outgoing data */ - int count_out; - int esc_in; /* if we compose an escape seq */ - - int net; /* Network in/out (really 1 wire bus :-) */ - int net_data; /* Interpreted network data */ - int net_state; /* Interpreted network data */ - int wait; /* Wait state */ - int busy; /* Indicate busy; if1 software never poll it ... */ -} if1_ula_t; - -/* - 7 6 5 4 3 2 1 0 - STATUS RO $EF(239) --- --- --- BSY DTR GAP SYN WPR - - CONTRO WO $EF(239) --- --- WAT CTS ERA R/w CLK DTA - - MDR DT RW $E7(231) D7 D6 D5 D4 D3 D2 D1 D0 - - COMM I RO $F7(247) TX --- --- --- --- --- --- NET - - COMM O WO $F7(247) --- --- --- --- --- --- --- NET/RX - -RS232: - DTR -> Data Terminal Ready (DTE -> DCE) - CTS -> Clear To Send (DCE -> DTE) - TX -> Transmitted Data (DTE -> DCE) - RX -> Received Data (DCE -> DTE) - - The IF1 serial behaves not as a DTE (Data Terminal Equipment, e.g. - a computer) but as a DCE (Data Communications Equipment, e.g. a modem) - - If we were to consider the ZX Spectrum a DTE, we would rename the lines: - DTR := DSR (Data Set Ready) - CTS := RTS (Request To Send) - TX := RX - RX := TX - - On the communication channels: - Bytes interpreted as is, except: - 0x00 0x00 --> DTR ~~\__ - 0x00 0x01 --> DTR __/~~ - 0x00 0x02 --> CTS ~~\__ - 0x00 0x03 --> CTS __/~~ - 0x00 ? --> lost - 0x00 * --> 0x00 - Additionally: - if fuse read 0x00 0x00 => DTR = 0 ~~\__ - if fuse read 0x00 0x01 => DTR = 1 __/~~ - if CTS = ~~\__ fuse send 0x00 0x02 - if CTS = __/~~ fuse send 0x00 0x03 - if fuse lost send 0x00 + 0x3f (?) - every other 0x00 + 0x## are discarded -*/ - -/* Two 8Kb memory chunks accessible by the Z80 when /ROMCS is low */ -static memory_page if1_memory_map_romcs[2]; - -/* IF1 paged out ROM activated? */ -int if1_active = 0; -int if1_available = 0; -static int if1_mdr_status = 0; - -int rnd_factor = ( ( RAND_MAX >> 2 ) << 2 ) / 19 + 1; - -static microdrive_t microdrive[8]; /* We have 8 microdrive */ -static if1_ula_t if1_ula; - -static void microdrives_reset( void ); -static void microdrives_restart( void ); -static void increment_head( int m ); - -#define MDR_IN(m) microdrive[m - 1].inserted -#define MDR_WP(m) libspectrum_microdrive_write_protect( microdrive[m - 1].cartridge ) - -enum if1_menu_item { - - UMENU_ALL = 0, - UMENU_MDRV1, - UMENU_MDRV2, - UMENU_MDRV3, - UMENU_MDRV4, - UMENU_MDRV5, - UMENU_MDRV6, - UMENU_MDRV7, - UMENU_MDRV8, - UMENU_RS232, -}; - -enum if1_port { - PORT_MDR, - PORT_CTR, - PORT_NET, - PORT_UNKNOWN, -}; - -static void if1_reset( int hard_reset ); -static void if1_enabled_snapshot( libspectrum_snap *snap ); -static void if1_from_snapshot( libspectrum_snap *snap ); -static void if1_to_snapshot( libspectrum_snap *snap ); - -static module_info_t if1_module_info = { - - if1_reset, - if1_memory_map, - if1_enabled_snapshot, - if1_from_snapshot, - if1_to_snapshot, - -}; - -const periph_t if1_peripherals[] = { - { 0x0018, 0x0010, if1_port_in, if1_port_out }, - { 0x0018, 0x0008, if1_port_in, if1_port_out }, - { 0x0018, 0x0000, if1_port_in, if1_port_out }, -}; - -const size_t if1_peripherals_count = - sizeof( if1_peripherals ) / sizeof( periph_t ); - -/* Debugger events */ -static const char *event_type_string = "if1"; -static int page_event, unpage_event; - -static void -update_menu( enum if1_menu_item what ) -{ - if( what == UMENU_ALL || what == UMENU_MDRV1 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_EJECT, MDR_IN( 1 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_WP_SET, - !MDR_IN( 1 ) ? 0 : !MDR_WP( 1 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV2 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_EJECT, MDR_IN( 2 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_WP_SET, - !MDR_IN( 2 ) ? 0 : !MDR_WP( 2 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV3 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_EJECT, MDR_IN( 3 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_WP_SET, - !MDR_IN( 3 ) ? 0 : !MDR_WP( 3 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV4 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_EJECT, MDR_IN( 4 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_WP_SET, - !MDR_IN( 4 ) ? 0 : !MDR_WP( 4 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV5 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_EJECT, MDR_IN( 5 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_WP_SET, - !MDR_IN( 5 ) ? 0 : !MDR_WP( 5 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV6 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_EJECT, MDR_IN( 6 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_WP_SET, - !MDR_IN( 6 ) ? 0 : !MDR_WP( 6 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV7 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_EJECT, MDR_IN( 7 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_WP_SET, - !MDR_IN( 7 ) ? 0 : !MDR_WP( 7 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV8 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_EJECT, MDR_IN( 8 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_WP_SET, - !MDR_IN( 8 ) ? 0 : !MDR_WP( 8 ) ); - } - - if( what == UMENU_ALL || what == UMENU_RS232 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_R, - ( if1_ula.fd_r > -1 ) ? 1 : 0 ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_T, - ( if1_ula.fd_t > -1 ) ? 1 : 0 ); -#ifdef BUILD_WITH_SNET - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_SNET_UNPLUG, - ( if1_ula.fd_net > -1 ) ? 1 : 0 ); -#endif - } -} - -int -if1_init( void ) -{ - int m, i; - - if1_ula.fd_r = -1; - if1_ula.fd_t = -1; - if1_ula.dtr = 0; /* No data terminal yet */ - if1_ula.cts = 2; /* force to emit first cts status */ - if1_ula.comms_clk = 0; - if1_ula.comms_data = 0; /* really? */ - if1_ula.fd_net = -1; - if1_ula.s_net_mode = 1; - if1_ula.net = 0; - if1_ula.esc_in = 0; /* empty */ - - for( m = 0; m < 8; m++ ) { - microdrive[m].cartridge = libspectrum_microdrive_alloc(); - microdrive[m].inserted = 0; - microdrive[m].modified = 0; - } - - if( settings_current.rs232_rx ) { - if1_plug( settings_current.rs232_rx, 1 ); - free( settings_current.rs232_rx ); - settings_current.rs232_rx = NULL; - } - - if( settings_current.rs232_tx ) { - if1_plug( settings_current.rs232_tx, 2 ); - free( settings_current.rs232_tx ); - settings_current.rs232_tx = NULL; - } - - if( settings_current.snet ) { - if1_plug( settings_current.snet, 3 ); - free( settings_current.snet ); - settings_current.snet = NULL; - } - - module_register( &if1_module_info ); - for( i = 0; i < 2; i++ ) if1_memory_map_romcs[i].bank = MEMORY_BANK_ROMCS; - - if( periph_register_paging_events( event_type_string, &page_event, - &unpage_event ) ) - return 1; - - return 0; -} - -libspectrum_error -if1_end( void ) -{ - int m; - - for( m = 0; m < 8; m++ ) { - libspectrum_error error = - libspectrum_microdrive_free( microdrive[m].cartridge ); - if( error ) return error; - } - - return LIBSPECTRUM_ERROR_NONE; -} - -void -if1_update_menu( void ) -{ - update_menu( UMENU_ALL ); -} - -static void -if1_reset( int hard_reset GCC_UNUSED ) -{ - if1_active = 0; - if1_available = 0; - - if( !periph_interface1_active ) return; - - machine_load_rom_bank( if1_memory_map_romcs, 0, 0, - settings_current.rom_interface_i, - settings_default.rom_interface_i, - MEMORY_PAGE_SIZE ); - - if1_memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL; - - machine_current->ram.romcs = 0; - - if1_ula.cts = 2; /* force to emit first out if raw */ - if1_ula.comms_clk = 0; - if1_ula.comms_data = 0; - if1_ula.net = 0; - if1_ula.esc_in = 0; - - microdrives_reset(); - - update_menu( UMENU_ALL ); - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_INACTIVE ); - - if1_mdr_status = 0; - - if1_available = 1; -} - -void -if1_page( void ) -{ - if1_active = 1; - machine_current->ram.romcs = 1; - machine_current->memory_map(); - - debugger_event( page_event ); -} - -void -if1_unpage( void ) -{ - if1_active = 0; - machine_current->ram.romcs = 0; - machine_current->memory_map(); - - debugger_event( unpage_event ); -} - -void -if1_memory_map( void ) -{ - if( !if1_active ) return; - - memory_map_read[0] = memory_map_write[0] = if1_memory_map_romcs[0]; -} - -static void -if1_enabled_snapshot( libspectrum_snap *snap ) -{ - if( libspectrum_snap_interface1_active( snap ) ) - settings_current.interface1 = 1; -} - -static void -if1_from_snapshot( libspectrum_snap *snap ) -{ - if( !libspectrum_snap_interface1_active( snap ) ) return; - - if( libspectrum_snap_interface1_custom_rom( snap ) && - libspectrum_snap_interface1_rom( snap, 0 ) && - machine_load_rom_bank_from_buffer( - if1_memory_map_romcs, 0, 0, - libspectrum_snap_interface1_rom( snap, 0 ), - libspectrum_snap_interface1_rom_length( snap, 0 ), - 1 ) ) - return; - - if( libspectrum_snap_interface1_paged( snap ) ) { - if1_page(); - } else { - if1_unpage(); - } -} - -static void -if1_to_snapshot( libspectrum_snap *snap ) -{ - libspectrum_byte *buffer; - - if( !periph_interface1_active ) return; - - libspectrum_snap_set_interface1_active( snap, 1 ); - libspectrum_snap_set_interface1_paged ( snap, if1_active ); - libspectrum_snap_set_interface1_drive_count( snap, 8 ); - - if( if1_memory_map_romcs[0].source == MEMORY_SOURCE_CUSTOMROM ) { - size_t rom_length = MEMORY_PAGE_SIZE; - - if( if1_memory_map_romcs[1].source == MEMORY_SOURCE_CUSTOMROM ) { - rom_length <<= 1; - } - - libspectrum_snap_set_interface1_custom_rom( snap, 1 ); - libspectrum_snap_set_interface1_rom_length( snap, 0, rom_length ); - - buffer = malloc( rom_length ); - if( !buffer ) { - ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ ); - return; - } - - memcpy( buffer, if1_memory_map_romcs[0].page, MEMORY_PAGE_SIZE ); - - if( rom_length == MEMORY_PAGE_SIZE*2 ) { - memcpy( buffer + MEMORY_PAGE_SIZE, if1_memory_map_romcs[1].page, - MEMORY_PAGE_SIZE ); - } - - libspectrum_snap_set_interface1_rom( snap, 0, buffer ); - } -} - -static void -microdrives_reset( void ) -{ - int m; - - for( m = 0; m < 8; m++ ) { - microdrive[m].head_pos = 0; - microdrive[m].motor_on = 0; /* motor off */ - microdrive[m].gap = 15; - microdrive[m].sync = 15; - microdrive[m].transfered = 0; - } - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_INACTIVE ); - if1_mdr_status = 0; -/* - if1_ula.comms_data = 0; - if1_ula.count_in = 0; - if1_ula.count_out = 0; - if1_ula.cts = 0; - if1_ula.dtr = 0; - if1_ula.wait = 0; - if1_ula.busy = 0; - if1_ula.net = 0; - if1_ula.net_state = 0; -*/ -} - -static enum if1_port -decode_port( libspectrum_word port ) -{ - switch( port & 0x0018 ) { - case 0x0000: return PORT_MDR; - case 0x0008: return PORT_CTR; - case 0x0010: return PORT_NET; - default: return PORT_UNKNOWN; - } -} - -static libspectrum_byte -port_mdr_in( void ) -{ - libspectrum_byte ret = 0xff; - int m; - - for( m = 0; m < 8; m++ ) { - - microdrive_t *mdr = µdrive[ m ]; - - if( mdr->motor_on && mdr->inserted ) { - - if( mdr->transfered < mdr->max_bytes ) { - mdr->last = libspectrum_microdrive_data( mdr->cartridge, - mdr->head_pos ); - increment_head( m ); - } - - mdr->transfered++; - ret &= mdr->last; /* I assume negative logic, but how know? */ - } - - } - - return ret; -} - -static libspectrum_byte -port_ctr_in( void ) -{ - libspectrum_byte ret = 0xff; - int m, block; - - for( m = 0; m < 8; m++ ) { - - microdrive_t *mdr = µdrive[ m ]; - - if( mdr->motor_on && mdr->inserted ) { - block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); - if( mdr->pream[block] == SYNC_OK ) { /* if formatted */ - if( mdr->gap ) { - /* ret &= 0xff; GAP and SYNC high ? */ - mdr->gap--; - } else { - ret &= 0xf9; /* GAP and SYNC low */ - if( mdr->sync ) { - mdr->sync--; - } else { - mdr->gap = 15; - mdr->sync = 15; - } - } - } - /* if write protected */ - if( libspectrum_microdrive_write_protect( mdr->cartridge) ) - ret &= 0xfe; /* active bit */ - } - } - /* Here we have to poll, the if1_ula DTR 'line' */ - if( if1_ula.rs232_buffer > 0xff ) { /* buffer empty */ - unsigned char byte; - int yes = 1; - - while( yes && read( if1_ula.fd_r, &byte, 1 ) == 1 ) { - if( if1_ula.esc_in == 1 ) { - if1_ula.esc_in = 0; - if( byte == '*' ) { - if1_ula.rs232_buffer = 0x00; - yes = 0; - } else if( byte == 0x00 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 0; - } else if( byte == 0x01 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 1; - } - } else if( byte == 0x00 ) { - if1_ula.esc_in = 1; - } else { - if1_ula.rs232_buffer = byte; - yes = 0; - break; - } - } - } - - if( if1_ula.dtr == 0 ) - ret &= 0xf7; /* %11110111 */ - - /* Here we have to poll, the 'SinclairNet' busy flag but never used by - software in Interface 1 */ - if( if1_ula.busy == 0 ) - ret &= 0xef; /* %11101111 */ - /* fprintf( stderr, "Read CTR ( %%%d%d%d%d%d%d%d%d ).\n", - !!(ret & 128), !!(ret & 64), !!(ret & 32), !!(ret & 16), - !!(ret & 8), !!(ret & 4), !!(ret & 2), !!(ret & 1)); */ - microdrives_restart(); - - return ret; -} - -/* - return 1 if read a byte - 0 if nothing interesting... -*/ - -static int -read_rs232() -{ - if( if1_ula.rs232_buffer <= 0xff ) { /* we read from the buffer */ - if1_ula.data_in = if1_ula.rs232_buffer; - if1_ula.rs232_buffer = 0x0100; - return 1; - } - while( read( if1_ula.fd_r, &if1_ula.data_in, 1 ) == 1 ) { - if( if1_ula.esc_in == 1 ) { - if1_ula.esc_in = 0; - if( if1_ula.data_in == '*' ) { - if1_ula.data_in = 0x00; - return 1; - } else if( if1_ula.data_in == 0x00 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 0; - } else if( if1_ula.data_in == 0x01 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 1; - } - } else if( if1_ula.data_in == 0x00 ) { - if1_ula.esc_in = 1; - } else { - return 1; - } - } - return 0; -} - -static libspectrum_byte -port_net_in( void ) -{ - libspectrum_byte ret = 0xff; - - if( if1_ula.fd_r == -1 ) - goto no_rs232_in; - - /* Here is the RS232 input routine */ - if( if1_ula.cts ) { /* If CTS == 1 */ - if( if1_ula.count_in == 0 ) { - if( if1_ula.fd_r >= 0 && read_rs232() == 1 ) { - if1_ula.count_in++; /* Ok, if read a byte, we begin */ - } - if1_ula.tx = 0; /* now send __ to if1 - later we raise :-) */ - } else if( if1_ula.count_in >= 1 && if1_ula.count_in < 5 ) { - if1_ula.tx = 1; /* send ~~ (start bit :-) */ - if1_ula.count_in++; - } else if( if1_ula.count_in >= 5 && if1_ula.count_in < 13 ) { - if1_ula.tx = ( if1_ula.data_in & 0x01 ) ? 0 : 1; - /* send .. (data bits :-) */ - if1_ula.data_in >>= 1; /* prepare next bit :-) */ - if1_ula.count_in++; - } else - if1_ula.count_in = 0; - } else { /* if( if1_ula.cts ) */ - if1_ula.count_in = 0; /* reset serial in */ - if1_ula.tx = 0; /* send __ stop bits or s.e. :-) */ - } - -no_rs232_in: - if( if1_ula.fd_net == -1 ) - goto no_snet_in; - - if( if1_ula.s_net_mode == 0 ) { /* if we do raw */ - /* Here is the input routine */ - read( if1_ula.fd_net, &if1_ula.net, 1 ); /* Ok, if no byte, we send last*/ - } else {/* if( if1_ula.s_net_mode == 1 ) if we do interpreted */ -/* Here is the input routine. There are several stage in input - and output. So first for output. if1 first do SEND-SC - (http://www.wearmouth.demon.co.uk/if1_2.htm#L101E) to send - a Sync-Out signal and SEND-SC do first a NET-STATE - (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FBC) to see - the line activity: - 11xxxxxx times (192-255) have to get a zero (bit for network) - plus 1 times more from SEND-SC. Next SEND-SC send a 0 which is - a 1 on the net wire (negated output, straight input!!!) - - OK. In input first if1 call WT-SC-E to check Network activity - (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FD3). Now check - 128 times the net wire (we do two round, because to differentiate - net out routines...) -*/ - - if( if1_ula.net_state < 0x0100 ) { /* if1 may in NET-STATE */ - if1_ula.net_state++; - if1_ula.net = 0; -#ifdef IF1_DEBUG_NET - fprintf( stderr, "NET-STAT(%03d)? We send 0!\n", if1_ula.net_state ); -#endif - } else if( if1_ula.net_state == 0x0100 ) { /* probably waiting for input */ - if( read( if1_ula.fd_net, &if1_ula.net_data, 1 ) == 1 ) { - if1_ula.net_state++; - if1_ula.net = 1; /* Start with __/~~ */ - } /* Ok, if have a byte, we send it! */ - } else if( if1_ula.net_state == 0x0101 ) { - if1_ula.net_state++; - if1_ula.net = 1; /* one more ~~ */ - } else if( if1_ula.net_state > 0x0101 && - if1_ula.net_state < 0x010a ) { /* we send the data bits... */ - if1_ula.net_state++; - if1_ula.net = if1_ula.net_data & 1; - if1_ula.net_data >>= 1; - } else if( if1_ula.net_state == 0x010a ) { - if1_ula.net = 0; - if1_ula.net_state = 0; /* OK, we starting a new byte... */ -#ifdef IF1_DEBUG_NET - fprintf( stderr, "NET-STAT(%03d)? Get a byte!\n", if1_ula.net_state ); -#endif - } - } -no_snet_in: - if( !if1_ula.tx ) - ret &= 0x7f; - if( !if1_ula.net ) - ret &= 0xfe; - microdrives_restart(); - - return ret; -} - -libspectrum_byte -if1_port_in( libspectrum_word port GCC_UNUSED, int *attached ) -{ - libspectrum_byte ret = 0xff; - - if( !if1_active ) return ret; - - *attached = 1; - - switch( decode_port( port ) ) - { - case PORT_MDR: ret &= port_mdr_in(); break; - case PORT_CTR: ret &= port_ctr_in(); break; - case PORT_NET: ret &= port_net_in(); break; - case PORT_UNKNOWN: break; - } - - return ret; -} - -static void -port_mdr_out( libspectrum_byte val ) -{ - int m, block; - - /* allow access to the port only if motor 1 is ON and there's a file open */ - for( m = 0; m < 8; m++ ) { - - microdrive_t *mdr = µdrive[ m ]; - - if( mdr->motor_on && mdr->inserted ) { -#ifdef IF1_DEBUG_MDR - fprintf(stderr, "#%05d %03d(%03d): 0x%02x\n", - mdr->head_pos, mdr->transfered, mdr->max_bytes, val ); -#endif - block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); - if( mdr->transfered == 0 && val == 0x00 ) { /* start pream */ - mdr->pream[block] = 1; - } else if( mdr->transfered > 0 && mdr->transfered < 10 && val == 0x00 ) { - mdr->pream[block]++; - } else if( mdr->transfered > 9 && mdr->transfered < 12 && val == 0xff ) { - mdr->pream[block]++; - } else if( mdr->transfered == 12 && mdr->pream[block] == 12 ) { - mdr->pream[block] = SYNC_OK; - } - if( mdr->transfered > 11 && - mdr->transfered < mdr->max_bytes + 12 ) { - - libspectrum_microdrive_set_data( mdr->cartridge, mdr->head_pos, - val ); - increment_head( m ); - mdr->modified = 1; - } - mdr->transfered++; - } - } -} - -static void -port_ctr_out( libspectrum_byte val ) -{ - int m; - - if( !( val & 0x02 ) && ( if1_ula.comms_clk ) ) { /* ~~\__ */ - - for( m = 7; m > 0; m-- ) { - /* Rotate one drive */ - microdrive[m].motor_on = microdrive[m - 1].motor_on; - } - microdrive[0].motor_on = (val & 0x01) ? 0 : 1; - - if( microdrive[0].motor_on || microdrive[1].motor_on || - microdrive[2].motor_on || microdrive[3].motor_on || - microdrive[4].motor_on || microdrive[5].motor_on || - microdrive[6].motor_on || microdrive[7].motor_on ) { - if( !if1_mdr_status ) { - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_ACTIVE ); - if1_mdr_status = 1; - } - } else if ( if1_mdr_status ) { - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_INACTIVE ); - if1_mdr_status = 0; - } - } - if( val & 0x01 ) { /* comms_data == 1 */ - /* Interface 1 service manual p.:1.4 par.: 1.5.1 - The same pin on IC1 (if1 ULA), pin 33, is used for the network - transmit data and for the RS232 transmit data. In order to select - the required function IC1 uses its COMMS_OUT (pin 30) signal, - borrowed from the microdrive control when the microdrive is not - being used (I do not know what it is exactly meaning. It is a - hardware not being used, or a software should not use..?) This signal - is routed from pin 30 to the emitter of transistor Q3 (RX DATA) and - via resistor R4, to the base of transistor Q1 (NET). When COMMS_OUT - is high Q3 is enabled this selecting RS232, and when it is low - Q1 is enabled selecting the network. - - OK, the schematics offer a different interpretation, because if - COMMS_OUT pin level high (>+3V) then Q3 is off (the basis cannot - be more higher potential then emitter (NPN transistor), so whatever - is on the IC1 RX DATA (pin 33) the basis of Q4 is always on +12V, - so the collector of Q4 (PNP transistor) always on -12V. - If COMMS_OUT pin level goes low (~0V), then Q3 basis (connected - to IC1 RX DATA pin) can be higher level (>+3V) than emitter, so - the basis potential of Q4 depend on IC1 RX DATA. - - OK, Summa summarum I assume that, the COMMS OUT pin is a - negated output of the if1 ULA CTR register's COMMS DATA bit. - */ - /* C_DATA = 1 */ - if( if1_ula.comms_data == 0 ) { - if1_ula.count_out = 0; - if1_ula.data_out = 0; - if1_ula.count_in = 0; - if1_ula.data_in = 0; - } - } - if1_ula.wait = ( val & 0x20 ) ? 1 : 0; - if1_ula.comms_data = ( val & 0x01 ) ? 1 : 0; - if1_ula.comms_clk = ( val & 0x02 ) ? 1 : 0; - val = ( val & 0x10 ) ? 1 : 0; - if( settings_current.rs232_handshake && - if1_ula.fd_t != -1 && if1_ula.cts != val ) { - char data = val ? 0x03 : 0x02; - do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); - do ; while( write( if1_ula.fd_t, &data, 1 ) != 1 ); - } - if1_ula.cts = val; - -#ifdef IF1_DEBUG_NET - fprintf( stderr, "Set CTS to %d, set WAIT to %d and COMMS_DATA to %d\n", - if1_ula.cts, if1_ula.wait, if1_ula.comms_data ); -#endif - - microdrives_restart(); -} - -static void -port_net_out( libspectrum_byte val ) -{ - if( if1_ula.fd_t == -1 ) - return; /* nothing to write */ - - if( if1_ula.comms_data == 1 ) { /* OK, RS232 */ - val &= 0x01; - if( if1_ula.count_out == 0 && !val ) { /* waiting for ~~\__ */ - if1_ula.count_out++; - } else if( if1_ula.count_out == 1 ) { - if( if1_ula.cts != 0 || !val ) - if1_ula.count_out = -1; - else - if1_ula.count_out++; /* else get the start bit __/~~ */ - } else if( if1_ula.count_out >= 2 && if1_ula.count_out <= 9 ) { - if1_ula.data_out >>= 1; - if1_ula.data_out |= val & 0x01 ? 0 : 128; - if1_ula.count_out++; /* waiting for next data bit */ - } else if( if1_ula.count_out >= 10 && if1_ula.count_out <= 11 ) { - if( val ) - if1_ula.count_out = -1; - else - if1_ula.count_out++; - } else if( if1_ula.count_out == 12 ) { - if( !val ) - if1_ula.count_out = -1; - else - if1_ula.count_out++; - } else if( if1_ula.count_out == 13 ) { - if( val ) - if1_ula.count_out = -1; - } - - if( if1_ula.count_out == -1 ) { - if1_ula.count_out = 13; - if1_ula.data_out = '?'; - do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); - } - if( if1_ula.count_out == 13 ) { - /* Here is the output routine */ - if( if1_ula.data_out == 0x00 ) { - if1_ula.data_out = '*'; - do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); - } - do ; while( write( if1_ula.fd_t, &if1_ula.data_out, 1 ) != 1 ); - if1_ula.count_out = 0; - } - if1_ula.rx = val & 0x01; /* set rx */ - } else { /* if( if1_ula.comms_data == 1 ) SinclairNET :-)*/ - if( if1_ula.s_net_mode == 0 ) { /* if we out bit by bit, do it */ - /* Here is the output routine */ - -/* OK, examining the schematics of if1 and the disassembly of if1 ROM, I - see that the Q1 and Q2 transistors negate the RX DATA signal, and the - floating state of the net wire is the ~0V level, the forced is the ~3V. - The if1 software send complemented data and read straight data. -*/ - if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set rx */ - lseek( if1_ula.fd_net, 0, SEEK_SET ); /* we save only the state of the wire*/ - do ; while( write( if1_ula.fd_net, &if1_ula.net, 1 ) == -1 ); -#ifdef HAVE_FSYNC - fsync( if1_ula.fd_net ); -#endif /* #ifdef HAVE_FSYNC */ -#ifdef IF1_DEBUG_NET - fprintf( stderr, "Send SinclairNET: %d\n", if1_ula.net ); -#endif - } else { /* if( if1_ula.s_net_mode == 0 ) if we out byte by byte, do it */ - if( if1_ula.net_state >= 0x0200 && if1_ula.net_state < 0x0208 ) { - if1_ula.net_state++; - if1_ula.net_data <<= 1; - if1_ula.net_data |= ( val & 0x01 ) ? 0 : 1; - } else if( if1_ula.net_state == 0x0208 ) { - if1_ula.net_data &= 0xff; - if1_ula.net_state++; /* OK, now we get data bytes... */ - -/* lseek( if1_ula.fd_net, 0, SEEK_SET ); start a packet */ - /* first we send the station number */ - do ; while( write( if1_ula.fd_net, &if1_ula.net_data, 1 ) == -1 ); -#ifdef HAVE_FSYNC - fsync( if1_ula.fd_net ); -#endif /* #ifdef HAVE_FSYNC */ -#ifdef IF1_DEBUG_NET - fprintf( stderr, "SC-OUT send network number: %d\n", - if1_ula.net_data ^ 0xff ); -#endif - } else if( if1_ula.net_state > 192 && if1_ula.net_state < 0x0200 && - ( ( val & 0x01 ) == 0 ) ) { - /* NET-STATE ask as many times.... and now send a 0 */ -/* if1_ula.net = 1; */ - if1_ula.net_state = 0x0200; /* Send the station number */ - } - if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set net wire? */ - } - } - microdrives_restart(); -} - -void -if1_port_out( libspectrum_word port GCC_UNUSED, libspectrum_byte val ) -{ - if( !if1_active ) return; - -#ifdef IF1_DEBUG_NET_1 - fprintf( stderr, "In if1_port_out( %%%d%d%d%d%d%d%d%d => 0x%04x ).\n", - !!(val & 128), !!(val & 64), !!(val & 32), !!(val & 16), - !!(val & 8), !!(val & 4), !!(val & 2), !!(val & 1), port); -#endif - - switch( decode_port( port ) ) { - case PORT_MDR: port_mdr_out( val ); break; - case PORT_CTR: port_ctr_out( val ); break; - case PORT_NET: port_net_out( val ); break; - case PORT_UNKNOWN: break; - } -} - -static void -increment_head( int m ) -{ - microdrive[m].head_pos++; - if( microdrive[m].head_pos >= - libspectrum_microdrive_cartridge_len( microdrive[m].cartridge ) * - LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) - microdrive[m].head_pos = 0; -} - -static void -microdrives_restart( void ) -{ - int m; - - for( m = 0; m < 8; m++ ) { - while( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != 0 && - ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != LIBSPECTRUM_MICRODRIVE_HEAD_LEN ) - increment_head( m ); /* put head in the start of a block */ - - microdrive[m].transfered = 0; /* reset current number of bytes written */ - - if( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) == 0 ) { - microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN; /* up to 15 bytes for header blocks */ - } else { - microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN + LIBSPECTRUM_MICRODRIVE_DATA_LEN + 1; /* up to 528 bytes for data blocks */ - } - } -} - -void -if1_mdr_writeprotect( int drive, int wrprot ) -{ - libspectrum_microdrive_set_write_protect( microdrive[drive].cartridge, - wrprot ? 1 : 0 ); - microdrive[drive].modified = 1; - - update_menu( UMENU_MDRV1 + drive ); -} - -static void -if1_mdr_new( microdrive_t *mdr ) -{ - libspectrum_byte len; - long int i; - - mdr->filename = NULL; - if( settings_current.mdr_random_len ) { /* Random length */ - len = 171 + ( ( rand() >> 2 ) + ( rand() >> 2 ) + - ( rand() >> 2 ) + ( rand() >> 2 ) ) - / rnd_factor; - } else - len = settings_current.mdr_len = settings_current.mdr_len < 10 ? 10 : - settings_current.mdr_len > LIBSPECTRUM_MICRODRIVE_BLOCK_MAX ? LIBSPECTRUM_MICRODRIVE_BLOCK_MAX : settings_current.mdr_len; - - /* Erase the entire cartridge */ - libspectrum_microdrive_set_cartridge_len( mdr->cartridge, len ); - - for( i = 0; i < len * LIBSPECTRUM_MICRODRIVE_BLOCK_LEN; i++ ) - libspectrum_microdrive_set_data( mdr->cartridge, i, 0xff ); - - for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); - i > 0; i-- ) - mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_NO; - - /* but don't write-protect */ - libspectrum_microdrive_set_write_protect( mdr->cartridge, 0 ); - - mdr->inserted = 1; - mdr->modified = 1; - -} - -int -if1_mdr_insert( int which, const char *filename ) -{ - microdrive_t *mdr; - int m, i; - - if( which == -1 ) { /* find an empty one */ - for( m = 0; m < 8; m++ ) { - if( !microdrive[m].inserted ) { - which = m; - break; - } - } - } - - if( which == -1 ) { - ui_error( UI_ERROR_ERROR, - "Cannot insert cartridge '%s', all Microdrives in use", - filename ); - return 1; - } - - if( which >= 8 ) { - ui_error( UI_ERROR_ERROR, "if1_mdr_insert: unknown drive %d", which ); - return 1; - } - - mdr = µdrive[ which ]; - - /* Eject any cartridge already in the drive */ - if( mdr->inserted ) { - /* Abort the insert if we want to keep the current cartridge */ - if( if1_mdr_eject( which, 0 ) ) return 0; - } - - if( filename == NULL ) { /* insert new unformatted cartridge */ - if1_mdr_new( mdr ); - update_menu( UMENU_MDRV1 + which ); - return 0; - } - - if( utils_read_file( filename, &mdr->file ) ) { - ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); - return 1; - } - - if( libspectrum_microdrive_mdr_read( mdr->cartridge, mdr->file.buffer, - mdr->file.length ) ) { - utils_close_file( &mdr->file ); - ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); - return 1; - } - - if( utils_close_file( &mdr->file ) ) return 1; - - mdr->inserted = 1; - mdr->modified = 0; - mdr->filename = strdup( filename ); - /* we assume formatted cartridges */ - for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); - i > 0; i-- ) - mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_OK; - - update_menu( UMENU_MDRV1 + which ); - - return 0; -} - -int -if1_mdr_eject( int which, int saveas ) -{ - microdrive_t *mdr; - - if( which >= 8 ) - return 1; - - mdr = µdrive[ which ]; - - if( !mdr->inserted ) - return 0; - - if( saveas ) { /* 1 -> save as.., 2 -> save */ - - if( mdr->filename == NULL ) saveas = 1; - if( ui_mdr_write( which, 2 - saveas ) ) return 1; - mdr->modified = 0; - return 0; - - } else { - - if( mdr->modified ) { - - ui_confirm_save_t confirm = ui_confirm_save( - "Cartridge in Microdrive %i has been modified.\n" - "Do you want to save it?", - which + 1 - ); - - switch( confirm ) { - - case UI_CONFIRM_SAVE_SAVE: - if( if1_mdr_eject( which, 2 ) ) return 1; /* first save */ - break; - - case UI_CONFIRM_SAVE_DONTSAVE: break; - case UI_CONFIRM_SAVE_CANCEL: return 1; - - } - } - } - - mdr->inserted = 0; - if( mdr->filename != NULL ) { - free( mdr->filename ); - mdr->filename = NULL; - } - - update_menu( UMENU_MDRV1 + which ); - return 0; -} - -int -if1_mdr_write( int which, const char *filename ) -{ - microdrive_t *mdr = µdrive[which]; - - libspectrum_microdrive_mdr_write( mdr->cartridge, &mdr->file.buffer, - &mdr->file.length ); - - if( filename == NULL ) filename = mdr->filename; /* Write over the original file */ - - if( utils_write_file( filename, mdr->file.buffer, mdr->file.length ) ) - return 1; - - if( mdr->filename && strcmp( filename, mdr->filename ) ) { - free( mdr->filename ); - mdr->filename = strdup( filename ); - } - return 0; -} - -#ifndef O_NONBLOCK -#define O_NONBLOCK FNDELAY -#endif - -void -if1_plug( const char *filename, int what ) -{ -#ifdef WIN32 - ui_error( UI_ERROR_ERROR, "Not yet implemented on Win32" ); - return; -#else - int fd = -1; - - switch( what ) { - case 1: - if( if1_ula.fd_r >= 0 ) - close( if1_ula.fd_r ); - fd = if1_ula.fd_r = open( filename, O_RDWR | O_NONBLOCK ); - if( fcntl( fd, F_SETFL, O_RDONLY | O_NONBLOCK ) ) - ui_error( UI_ERROR_ERROR, "Cannot set O_RDONLY on '%s': %s", - filename, strerror( errno ) ); - if1_ula.rs232_buffer = 0x100; /* buffer is empty */ - break; - case 2: - if( if1_ula.fd_t >= 0 ) - close( if1_ula.fd_t ); - fd = if1_ula.fd_t = open( filename, O_RDWR | O_NONBLOCK ); - if( fcntl( fd, F_SETFL, O_WRONLY | O_NONBLOCK ) ) - ui_error( UI_ERROR_ERROR, "Cannot set O_WRONLY on '%s': %s", - filename, strerror( errno ) ); - break; - case 3: - if( if1_ula.fd_net >= 0 ) - close( if1_ula.fd_net ); - fd = if1_ula.fd_net = open( filename, O_RDWR | O_NONBLOCK ); - break; - } - - /* rs232_handshake == 0 -> we assume DTR(DSR) always... [truncated message content] |
From: <fr...@us...> - 2012-01-14 12:08:24
|
Revision: 681 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=681&view=rev Author: fredm Date: 2012-01-14 12:08:15 +0000 (Sat, 14 Jan 2012) Log Message: ----------- Reverse half imported code. Added Paths: ----------- vendor/fuse-emulator/current/fuse/ay.c vendor/fuse-emulator/current/fuse/ay.h vendor/fuse-emulator/current/fuse/dck.c vendor/fuse-emulator/current/fuse/dck.h vendor/fuse-emulator/current/fuse/disk/ vendor/fuse-emulator/current/fuse/fuller.c vendor/fuse-emulator/current/fuse/fuller.h vendor/fuse-emulator/current/fuse/ide/ 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/if2.h vendor/fuse-emulator/current/fuse/joystick.c vendor/fuse-emulator/current/fuse/joystick.h vendor/fuse-emulator/current/fuse/kempmouse.c vendor/fuse-emulator/current/fuse/kempmouse.h vendor/fuse-emulator/current/fuse/melodik.c vendor/fuse-emulator/current/fuse/melodik.h vendor/fuse-emulator/current/fuse/printer.c vendor/fuse-emulator/current/fuse/printer.h vendor/fuse-emulator/current/fuse/scld.c vendor/fuse-emulator/current/fuse/scld.h vendor/fuse-emulator/current/fuse/ula.c vendor/fuse-emulator/current/fuse/ula.h Removed Paths: ------------- vendor/fuse-emulator/current/fuse/peripherals/ Copied: vendor/fuse-emulator/current/fuse/ay.c (from rev 679, vendor/fuse-emulator/current/fuse/ay.c) =================================================================== --- vendor/fuse-emulator/current/fuse/ay.c (rev 0) +++ vendor/fuse-emulator/current/fuse/ay.c 2012-01-14 12:08:15 UTC (rev 681) @@ -0,0 +1,169 @@ +/* ay.c: AY-8-3912 routines + Copyright (c) 1999-2009 Philip Kendall + + $Id: ay.c 4030 2009-06-07 14:38:38Z 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: phi...@sh... + +*/ + +#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 ); +} + +void +ay_state_from_snapshot( libspectrum_snap *snap ) +{ + size_t i; + + 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_from_snapshot( libspectrum_snap *snap ) +{ + if( machine_current->capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_AY ) { + ay_state_from_snapshot( snap ); + } +} + +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] ); +} Copied: vendor/fuse-emulator/current/fuse/ay.h (from rev 679, vendor/fuse-emulator/current/fuse/ay.h) =================================================================== --- vendor/fuse-emulator/current/fuse/ay.h (rev 0) +++ vendor/fuse-emulator/current/fuse/ay.h 2012-01-14 12:08:15 UTC (rev 681) @@ -0,0 +1,47 @@ +/* ay.h: AY-8-3912 routines + Copyright (c) 1999-2009 Philip Kendall + + $Id: ay.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... + +*/ + +#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 ); + +void ay_state_from_snapshot( libspectrum_snap *snap ); + +#endif /* #ifndef FUSE_AY_H */ Copied: vendor/fuse-emulator/current/fuse/dck.c (from rev 679, vendor/fuse-emulator/current/fuse/dck.c) =================================================================== --- vendor/fuse-emulator/current/fuse/dck.c (rev 0) +++ vendor/fuse-emulator/current/fuse/dck.c 2012-01-14 12:08:15 UTC (rev 681) @@ -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: phi...@sh... + + Darren: li...@yo... + Fred: fr...@sp... + +*/ + +#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 ); +} Copied: vendor/fuse-emulator/current/fuse/dck.h (from rev 679, vendor/fuse-emulator/current/fuse/dck.h) =================================================================== --- vendor/fuse-emulator/current/fuse/dck.h (rev 0) +++ vendor/fuse-emulator/current/fuse/dck.h 2012-01-14 12:08:15 UTC (rev 681) @@ -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: phi...@sh... + + Darren: li...@yo... + Fred: fr...@sp... + +*/ + +#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 Copied: vendor/fuse-emulator/current/fuse/fuller.c (from rev 679, vendor/fuse-emulator/current/fuse/fuller.c) =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.c (rev 0) +++ vendor/fuse-emulator/current/fuse/fuller.c 2012-01-14 12:08:15 UTC (rev 681) @@ -0,0 +1,90 @@ +/* fuller.c: Routines for handling the Fuller Box + Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier + + $Id: fuller.c 4032 2009-06-10 11:09:44Z 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: phi...@sh... + + Stuart: sd...@nt... + +*/ + +#include <config.h> + +#include <libspectrum.h> + +#include "ay.h" +#include "compat.h" +#include "fuller.h" +#include "joystick.h" +#include "module.h" +#include "periph.h" +#include "settings.h" + +static void fuller_enabled_snapshot( libspectrum_snap *snap ); +static void fuller_from_snapshot( libspectrum_snap *snap ); +static void fuller_to_snapshot( libspectrum_snap *snap ); + +static module_info_t fuller_module_info = { + + NULL, + NULL, + fuller_enabled_snapshot, + fuller_from_snapshot, + fuller_to_snapshot, + +}; + +const periph_t fuller_peripherals[] = { + { 0x00ff, 0x003f, ay_registerport_read, ay_registerport_write }, + { 0x00ff, 0x005f, NULL, ay_dataport_write }, + { 0x00ff, 0x007f, joystick_fuller_read, NULL }, +}; + +const size_t fuller_peripherals_count = + sizeof( fuller_peripherals ) / sizeof( periph_t ); + +static void +fuller_enabled_snapshot( libspectrum_snap *snap ) +{ + if( libspectrum_snap_fuller_box_active( snap ) ) + settings_current.fuller = 1; +} + +static void +fuller_from_snapshot( libspectrum_snap *snap ) +{ + if( periph_fuller_active ) { + ay_state_from_snapshot( snap ); + } +} + +static void +fuller_to_snapshot( libspectrum_snap *snap ) +{ + libspectrum_snap_set_fuller_box_active( snap, periph_fuller_active ); +} + +int +fuller_init( void ) +{ + module_register( &fuller_module_info ); + + return 0; +} Copied: vendor/fuse-emulator/current/fuse/fuller.h (from rev 679, vendor/fuse-emulator/current/fuse/fuller.h) =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.h (rev 0) +++ vendor/fuse-emulator/current/fuse/fuller.h 2012-01-14 12:08:15 UTC (rev 681) @@ -0,0 +1,40 @@ +/* fuller.h: Routines for handling the Fuller Box + Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier + + $Id: fuller.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... + + Stuart: sd...@nt... + +*/ + +#ifndef FUSE_FULLER_H +#define FUSE_FULLER_H + +#include <libspectrum.h> + +#include "periph.h" + +extern const periph_t fuller_peripherals[]; +extern const size_t fuller_peripherals_count; + +int fuller_init( void ); + +#endif /* #ifndef FUSE_FULLER_H */ Copied: vendor/fuse-emulator/current/fuse/if1.c (from rev 679, vendor/fuse-emulator/current/fuse/if1.c) =================================================================== --- vendor/fuse-emulator/current/fuse/if1.c (rev 0) +++ vendor/fuse-emulator/current/fuse/if1.c 2012-01-14 12:08:15 UTC (rev 681) @@ -0,0 +1,1304 @@ +/* if1.c: Interface I handling routines + Copyright (c) 2004-2008 Gergely Szasz, Philip Kendall + + $Id: if1.c 4180 2010-10-09 12:59:37Z 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: + + Gergely: sz...@hu... + +*/ + +#include <config.h> + +#include <string.h> +#include <errno.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include <unistd.h> + +#include "compat.h" +#include "debugger/debugger.h" +#include "if1.h" +#include "machine.h" +#include "memory.h" +#include "module.h" +#include "periph.h" +#include "settings.h" +#include "utils.h" +#include "ui/ui.h" + +#undef IF1_DEBUG_MDR +#undef IF1_DEBUG_NET +#undef IF1_DEBUG_NET_1 + +#define BUFF_EMPTY 0x100 + +enum { + SYNC_NO = 0, + SYNC_OK = 0xff +}; + +/* + Microdrive cartridge + GAP PREAMBLE 15 byte GAP PREAMBLE 15 byte 512 1 + [-----][00 00 ... ff ff][BLOCK HEAD][-----][00 00 ... ff ff][REC HEAD][ DATA ][CHK] + Preamble = 10 * 0x00 + 2 * 0xff (12 byte) +*/ + +typedef struct microdrive_t { + utils_file file; + char *filename; /* old filename */ + int inserted; + int modified; + int motor_on; + int head_pos; + int transfered; + int max_bytes; + libspectrum_byte pream[512]; /* preamble/sync area written */ + libspectrum_byte last; + libspectrum_byte gap; + libspectrum_byte sync; + + libspectrum_microdrive *cartridge; /* write protect, len, blocks */ + +} microdrive_t; + +typedef struct if1_ula_t { + int fd_r; /* file descriptor for reading bytes or bits RS232 */ + int fd_t; /* file descriptor for writing bytes or bits RS232 */ + int fd_net; /* file descriptor for rw bytes or bits SinclairNET */ + int rs232_buffer; /* read buffer */ + int s_net_mode; + int status; /* if1_ula/SinclairNET */ + int comms_data; /* the previous data comms state */ + int comms_clk; /* the previous data comms state */ + int cts; /* CTS of peripheral */ + int dtr; /* DTR of peripheral */ + int tx; /* TxD the name is very kind, because this is the read end of + the TxD wire of DATA machine (really RxD the view of + spectrum */ + int rx; /* RxD the name is very kind, because this is the write end of + the RxD wire of DATA machine (really TxD the view of + spectrum */ + int data_in; /* interpreted incoming data */ + int count_in; + int data_out; /* interpreted outgoing data */ + int count_out; + int esc_in; /* if we compose an escape seq */ + + int net; /* Network in/out (really 1 wire bus :-) */ + int net_data; /* Interpreted network data */ + int net_state; /* Interpreted network data */ + int wait; /* Wait state */ + int busy; /* Indicate busy; if1 software never poll it ... */ +} if1_ula_t; + +/* + 7 6 5 4 3 2 1 0 + STATUS RO $EF(239) --- --- --- BSY DTR GAP SYN WPR + + CONTRO WO $EF(239) --- --- WAT CTS ERA R/w CLK DTA + + MDR DT RW $E7(231) D7 D6 D5 D4 D3 D2 D1 D0 + + COMM I RO $F7(247) TX --- --- --- --- --- --- NET + + COMM O WO $F7(247) --- --- --- --- --- --- --- NET/RX + +RS232: + DTR -> Data Terminal Ready (DTE -> DCE) + CTS -> Clear To Send (DCE -> DTE) + TX -> Transmitted Data (DTE -> DCE) + RX -> Received Data (DCE -> DTE) + + The IF1 serial behaves not as a DTE (Data Terminal Equipment, e.g. + a computer) but as a DCE (Data Communications Equipment, e.g. a modem) + + If we were to consider the ZX Spectrum a DTE, we would rename the lines: + DTR := DSR (Data Set Ready) + CTS := RTS (Request To Send) + TX := RX + RX := TX + + On the communication channels: + Bytes interpreted as is, except: + 0x00 0x00 --> DTR ~~\__ + 0x00 0x01 --> DTR __/~~ + 0x00 0x02 --> CTS ~~\__ + 0x00 0x03 --> CTS __/~~ + 0x00 ? --> lost + 0x00 * --> 0x00 + Additionally: + if fuse read 0x00 0x00 => DTR = 0 ~~\__ + if fuse read 0x00 0x01 => DTR = 1 __/~~ + if CTS = ~~\__ fuse send 0x00 0x02 + if CTS = __/~~ fuse send 0x00 0x03 + if fuse lost send 0x00 + 0x3f (?) + every other 0x00 + 0x## are discarded +*/ + +/* Two 8Kb memory chunks accessible by the Z80 when /ROMCS is low */ +static memory_page if1_memory_map_romcs[2]; + +/* IF1 paged out ROM activated? */ +int if1_active = 0; +int if1_available = 0; +static int if1_mdr_status = 0; + +int rnd_factor = ( ( RAND_MAX >> 2 ) << 2 ) / 19 + 1; + +static microdrive_t microdrive[8]; /* We have 8 microdrive */ +static if1_ula_t if1_ula; + +static void microdrives_reset( void ); +static void microdrives_restart( void ); +static void increment_head( int m ); + +#define MDR_IN(m) microdrive[m - 1].inserted +#define MDR_WP(m) libspectrum_microdrive_write_protect( microdrive[m - 1].cartridge ) + +enum if1_menu_item { + + UMENU_ALL = 0, + UMENU_MDRV1, + UMENU_MDRV2, + UMENU_MDRV3, + UMENU_MDRV4, + UMENU_MDRV5, + UMENU_MDRV6, + UMENU_MDRV7, + UMENU_MDRV8, + UMENU_RS232, +}; + +enum if1_port { + PORT_MDR, + PORT_CTR, + PORT_NET, + PORT_UNKNOWN, +}; + +static void if1_reset( int hard_reset ); +static void if1_enabled_snapshot( libspectrum_snap *snap ); +static void if1_from_snapshot( libspectrum_snap *snap ); +static void if1_to_snapshot( libspectrum_snap *snap ); + +static module_info_t if1_module_info = { + + if1_reset, + if1_memory_map, + if1_enabled_snapshot, + if1_from_snapshot, + if1_to_snapshot, + +}; + +const periph_t if1_peripherals[] = { + { 0x0018, 0x0010, if1_port_in, if1_port_out }, + { 0x0018, 0x0008, if1_port_in, if1_port_out }, + { 0x0018, 0x0000, if1_port_in, if1_port_out }, +}; + +const size_t if1_peripherals_count = + sizeof( if1_peripherals ) / sizeof( periph_t ); + +/* Debugger events */ +static const char *event_type_string = "if1"; +static int page_event, unpage_event; + +static void +update_menu( enum if1_menu_item what ) +{ + if( what == UMENU_ALL || what == UMENU_MDRV1 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_EJECT, MDR_IN( 1 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_WP_SET, + !MDR_IN( 1 ) ? 0 : !MDR_WP( 1 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV2 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_EJECT, MDR_IN( 2 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_WP_SET, + !MDR_IN( 2 ) ? 0 : !MDR_WP( 2 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV3 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_EJECT, MDR_IN( 3 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_WP_SET, + !MDR_IN( 3 ) ? 0 : !MDR_WP( 3 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV4 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_EJECT, MDR_IN( 4 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_WP_SET, + !MDR_IN( 4 ) ? 0 : !MDR_WP( 4 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV5 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_EJECT, MDR_IN( 5 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_WP_SET, + !MDR_IN( 5 ) ? 0 : !MDR_WP( 5 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV6 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_EJECT, MDR_IN( 6 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_WP_SET, + !MDR_IN( 6 ) ? 0 : !MDR_WP( 6 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV7 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_EJECT, MDR_IN( 7 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_WP_SET, + !MDR_IN( 7 ) ? 0 : !MDR_WP( 7 ) ); + } + + if( what == UMENU_ALL || what == UMENU_MDRV8 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_EJECT, MDR_IN( 8 ) ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_WP_SET, + !MDR_IN( 8 ) ? 0 : !MDR_WP( 8 ) ); + } + + if( what == UMENU_ALL || what == UMENU_RS232 ) { + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_R, + ( if1_ula.fd_r > -1 ) ? 1 : 0 ); + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_T, + ( if1_ula.fd_t > -1 ) ? 1 : 0 ); +#ifdef BUILD_WITH_SNET + ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_SNET_UNPLUG, + ( if1_ula.fd_net > -1 ) ? 1 : 0 ); +#endif + } +} + +int +if1_init( void ) +{ + int m, i; + + if1_ula.fd_r = -1; + if1_ula.fd_t = -1; + if1_ula.dtr = 0; /* No data terminal yet */ + if1_ula.cts = 2; /* force to emit first cts status */ + if1_ula.comms_clk = 0; + if1_ula.comms_data = 0; /* really? */ + if1_ula.fd_net = -1; + if1_ula.s_net_mode = 1; + if1_ula.net = 0; + if1_ula.esc_in = 0; /* empty */ + + for( m = 0; m < 8; m++ ) { + microdrive[m].cartridge = libspectrum_microdrive_alloc(); + microdrive[m].inserted = 0; + microdrive[m].modified = 0; + } + + if( settings_current.rs232_rx ) { + if1_plug( settings_current.rs232_rx, 1 ); + free( settings_current.rs232_rx ); + settings_current.rs232_rx = NULL; + } + + if( settings_current.rs232_tx ) { + if1_plug( settings_current.rs232_tx, 2 ); + free( settings_current.rs232_tx ); + settings_current.rs232_tx = NULL; + } + + if( settings_current.snet ) { + if1_plug( settings_current.snet, 3 ); + free( settings_current.snet ); + settings_current.snet = NULL; + } + + module_register( &if1_module_info ); + for( i = 0; i < 2; i++ ) if1_memory_map_romcs[i].bank = MEMORY_BANK_ROMCS; + + if( periph_register_paging_events( event_type_string, &page_event, + &unpage_event ) ) + return 1; + + return 0; +} + +libspectrum_error +if1_end( void ) +{ + int m; + + for( m = 0; m < 8; m++ ) { + libspectrum_error error = + libspectrum_microdrive_free( microdrive[m].cartridge ); + if( error ) return error; + } + + return LIBSPECTRUM_ERROR_NONE; +} + +void +if1_update_menu( void ) +{ + update_menu( UMENU_ALL ); +} + +static void +if1_reset( int hard_reset GCC_UNUSED ) +{ + if1_active = 0; + if1_available = 0; + + if( !periph_interface1_active ) return; + + machine_load_rom_bank( if1_memory_map_romcs, 0, 0, + settings_current.rom_interface_i, + settings_default.rom_interface_i, + MEMORY_PAGE_SIZE ); + + if1_memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL; + + machine_current->ram.romcs = 0; + + if1_ula.cts = 2; /* force to emit first out if raw */ + if1_ula.comms_clk = 0; + if1_ula.comms_data = 0; + if1_ula.net = 0; + if1_ula.esc_in = 0; + + microdrives_reset(); + + update_menu( UMENU_ALL ); + ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, + UI_STATUSBAR_STATE_INACTIVE ); + + if1_mdr_status = 0; + + if1_available = 1; +} + +void +if1_page( void ) +{ + if1_active = 1; + machine_current->ram.romcs = 1; + machine_current->memory_map(); + + debugger_event( page_event ); +} + +void +if1_unpage( void ) +{ + if1_active = 0; + machine_current->ram.romcs = 0; + machine_current->memory_map(); + + debugger_event( unpage_event ); +} + +void +if1_memory_map( void ) +{ + if( !if1_active ) return; + + memory_map_read[0] = memory_map_write[0] = if1_memory_map_romcs[0]; +} + +static void +if1_enabled_snapshot( libspectrum_snap *snap ) +{ + if( libspectrum_snap_interface1_active( snap ) ) + settings_current.interface1 = 1; +} + +static void +if1_from_snapshot( libspectrum_snap *snap ) +{ + if( !libspectrum_snap_interface1_active( snap ) ) return; + + if( libspectrum_snap_interface1_custom_rom( snap ) && + libspectrum_snap_interface1_rom( snap, 0 ) && + machine_load_rom_bank_from_buffer( + if1_memory_map_romcs, 0, 0, + libspectrum_snap_interface1_rom( snap, 0 ), + libspectrum_snap_interface1_rom_length( snap, 0 ), + 1 ) ) + return; + + if( libspectrum_snap_interface1_paged( snap ) ) { + if1_page(); + } else { + if1_unpage(); + } +} + +static void +if1_to_snapshot( libspectrum_snap *snap ) +{ + libspectrum_byte *buffer; + + if( !periph_interface1_active ) return; + + libspectrum_snap_set_interface1_active( snap, 1 ); + libspectrum_snap_set_interface1_paged ( snap, if1_active ); + libspectrum_snap_set_interface1_drive_count( snap, 8 ); + + if( if1_memory_map_romcs[0].source == MEMORY_SOURCE_CUSTOMROM ) { + size_t rom_length = MEMORY_PAGE_SIZE; + + if( if1_memory_map_romcs[1].source == MEMORY_SOURCE_CUSTOMROM ) { + rom_length <<= 1; + } + + libspectrum_snap_set_interface1_custom_rom( snap, 1 ); + libspectrum_snap_set_interface1_rom_length( snap, 0, rom_length ); + + buffer = malloc( rom_length ); + if( !buffer ) { + ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ ); + return; + } + + memcpy( buffer, if1_memory_map_romcs[0].page, MEMORY_PAGE_SIZE ); + + if( rom_length == MEMORY_PAGE_SIZE*2 ) { + memcpy( buffer + MEMORY_PAGE_SIZE, if1_memory_map_romcs[1].page, + MEMORY_PAGE_SIZE ); + } + + libspectrum_snap_set_interface1_rom( snap, 0, buffer ); + } +} + +static void +microdrives_reset( void ) +{ + int m; + + for( m = 0; m < 8; m++ ) { + microdrive[m].head_pos = 0; + microdrive[m].motor_on = 0; /* motor off */ + microdrive[m].gap = 15; + microdrive[m].sync = 15; + microdrive[m].transfered = 0; + } + ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, + UI_STATUSBAR_STATE_INACTIVE ); + if1_mdr_status = 0; +/* + if1_ula.comms_data = 0; + if1_ula.count_in = 0; + if1_ula.count_out = 0; + if1_ula.cts = 0; + if1_ula.dtr = 0; + if1_ula.wait = 0; + if1_ula.busy = 0; + if1_ula.net = 0; + if1_ula.net_state = 0; +*/ +} + +static enum if1_port +decode_port( libspectrum_word port ) +{ + switch( port & 0x0018 ) { + case 0x0000: return PORT_MDR; + case 0x0008: return PORT_CTR; + case 0x0010: return PORT_NET; + default: return PORT_UNKNOWN; + } +} + +static libspectrum_byte +port_mdr_in( void ) +{ + libspectrum_byte ret = 0xff; + int m; + + for( m = 0; m < 8; m++ ) { + + microdrive_t *mdr = µdrive[ m ]; + + if( mdr->motor_on && mdr->inserted ) { + + if( mdr->transfered < mdr->max_bytes ) { + mdr->last = libspectrum_microdrive_data( mdr->cartridge, + mdr->head_pos ); + increment_head( m ); + } + + mdr->transfered++; + ret &= mdr->last; /* I assume negative logic, but how know? */ + } + + } + + return ret; +} + +static libspectrum_byte +port_ctr_in( void ) +{ + libspectrum_byte ret = 0xff; + int m, block; + + for( m = 0; m < 8; m++ ) { + + microdrive_t *mdr = µdrive[ m ]; + + if( mdr->motor_on && mdr->inserted ) { + block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); + if( mdr->pream[block] == SYNC_OK ) { /* if formatted */ + if( mdr->gap ) { + /* ret &= 0xff; GAP and SYNC high ? */ + mdr->gap--; + } else { + ret &= 0xf9; /* GAP and SYNC low */ + if( mdr->sync ) { + mdr->sync--; + } else { + mdr->gap = 15; + mdr->sync = 15; + } + } + } + /* if write protected */ + if( libspectrum_microdrive_write_protect( mdr->cartridge) ) + ret &= 0xfe; /* active bit */ + } + } + /* Here we have to poll, the if1_ula DTR 'line' */ + if( if1_ula.rs232_buffer > 0xff ) { /* buffer empty */ + unsigned char byte; + int yes = 1; + + while( yes && read( if1_ula.fd_r, &byte, 1 ) == 1 ) { + if( if1_ula.esc_in == 1 ) { + if1_ula.esc_in = 0; + if( byte == '*' ) { + if1_ula.rs232_buffer = 0x00; + yes = 0; + } else if( byte == 0x00 ) { + if( settings_current.rs232_handshake ) + if1_ula.dtr = 0; + } else if( byte == 0x01 ) { + if( settings_current.rs232_handshake ) + if1_ula.dtr = 1; + } + } else if( byte == 0x00 ) { + if1_ula.esc_in = 1; + } else { + if1_ula.rs232_buffer = byte; + yes = 0; + break; + } + } + } + + if( if1_ula.dtr == 0 ) + ret &= 0xf7; /* %11110111 */ + + /* Here we have to poll, the 'SinclairNet' busy flag but never used by + software in Interface 1 */ + if( if1_ula.busy == 0 ) + ret &= 0xef; /* %11101111 */ + /* fprintf( stderr, "Read CTR ( %%%d%d%d%d%d%d%d%d ).\n", + !!(ret & 128), !!(ret & 64), !!(ret & 32), !!(ret & 16), + !!(ret & 8), !!(ret & 4), !!(ret & 2), !!(ret & 1)); */ + microdrives_restart(); + + return ret; +} + +/* + return 1 if read a byte + 0 if nothing interesting... +*/ + +static int +read_rs232() +{ + if( if1_ula.rs232_buffer <= 0xff ) { /* we read from the buffer */ + if1_ula.data_in = if1_ula.rs232_buffer; + if1_ula.rs232_buffer = 0x0100; + return 1; + } + while( read( if1_ula.fd_r, &if1_ula.data_in, 1 ) == 1 ) { + if( if1_ula.esc_in == 1 ) { + if1_ula.esc_in = 0; + if( if1_ula.data_in == '*' ) { + if1_ula.data_in = 0x00; + return 1; + } else if( if1_ula.data_in == 0x00 ) { + if( settings_current.rs232_handshake ) + if1_ula.dtr = 0; + } else if( if1_ula.data_in == 0x01 ) { + if( settings_current.rs232_handshake ) + if1_ula.dtr = 1; + } + } else if( if1_ula.data_in == 0x00 ) { + if1_ula.esc_in = 1; + } else { + return 1; + } + } + return 0; +} + +static libspectrum_byte +port_net_in( void ) +{ + libspectrum_byte ret = 0xff; + + if( if1_ula.fd_r == -1 ) + goto no_rs232_in; + + /* Here is the RS232 input routine */ + if( if1_ula.cts ) { /* If CTS == 1 */ + if( if1_ula.count_in == 0 ) { + if( if1_ula.fd_r >= 0 && read_rs232() == 1 ) { + if1_ula.count_in++; /* Ok, if read a byte, we begin */ + } + if1_ula.tx = 0; /* now send __ to if1 + later we raise :-) */ + } else if( if1_ula.count_in >= 1 && if1_ula.count_in < 5 ) { + if1_ula.tx = 1; /* send ~~ (start bit :-) */ + if1_ula.count_in++; + } else if( if1_ula.count_in >= 5 && if1_ula.count_in < 13 ) { + if1_ula.tx = ( if1_ula.data_in & 0x01 ) ? 0 : 1; + /* send .. (data bits :-) */ + if1_ula.data_in >>= 1; /* prepare next bit :-) */ + if1_ula.count_in++; + } else + if1_ula.count_in = 0; + } else { /* if( if1_ula.cts ) */ + if1_ula.count_in = 0; /* reset serial in */ + if1_ula.tx = 0; /* send __ stop bits or s.e. :-) */ + } + +no_rs232_in: + if( if1_ula.fd_net == -1 ) + goto no_snet_in; + + if( if1_ula.s_net_mode == 0 ) { /* if we do raw */ + /* Here is the input routine */ + read( if1_ula.fd_net, &if1_ula.net, 1 ); /* Ok, if no byte, we send last*/ + } else {/* if( if1_ula.s_net_mode == 1 ) if we do interpreted */ +/* Here is the input routine. There are several stage in input + and output. So first for output. if1 first do SEND-SC + (http://www.wearmouth.demon.co.uk/if1_2.htm#L101E) to send + a Sync-Out signal and SEND-SC do first a NET-STATE + (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FBC) to see + the line activity: + 11xxxxxx times (192-255) have to get a zero (bit for network) + plus 1 times more from SEND-SC. Next SEND-SC send a 0 which is + a 1 on the net wire (negated output, straight input!!!) + + OK. In input first if1 call WT-SC-E to check Network activity + (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FD3). Now check + 128 times the net wire (we do two round, because to differentiate + net out routines...) +*/ + + if( if1_ula.net_state < 0x0100 ) { /* if1 may in NET-STATE */ + if1_ula.net_state++; + if1_ula.net = 0; +#ifdef IF1_DEBUG_NET + fprintf( stderr, "NET-STAT(%03d)? We send 0!\n", if1_ula.net_state ); +#endif + } else if( if1_ula.net_state == 0x0100 ) { /* probably waiting for input */ + if( read( if1_ula.fd_net, &if1_ula.net_data, 1 ) == 1 ) { + if1_ula.net_state++; + if1_ula.net = 1; /* Start with __/~~ */ + } /* Ok, if have a byte, we send it! */ + } else if( if1_ula.net_state == 0x0101 ) { + if1_ula.net_state++; + if1_ula.net = 1; /* one more ~~ */ + } else if( if1_ula.net_state > 0x0101 && + if1_ula.net_state < 0x010a ) { /* we send the data bits... */ + if1_ula.net_state++; + if1_ula.net = if1_ula.net_data & 1; + if1_ula.net_data >>= 1; + } else if( if1_ula.net_state == 0x010a ) { + if1_ula.net = 0; + if1_ula.net_state = 0; /* OK, we starting a new byte... */ +#ifdef IF1_DEBUG_NET + fprintf( stderr, "NET-STAT(%03d)? Get a byte!\n", if1_ula.net_state ); +#endif + } + } +no_snet_in: + if( !if1_ula.tx ) + ret &= 0x7f; + if( !if1_ula.net ) + ret &= 0xfe; + microdrives_restart(); + + return ret; +} + +libspectrum_byte +if1_port_in( libspectrum_word port GCC_UNUSED, int *attached ) +{ + libspectrum_byte ret = 0xff; + + if( !if1_active ) return ret; + + *attached = 1; + + switch( decode_port( port ) ) + { + case PORT_MDR: ret &= port_mdr_in(); break; + case PORT_CTR: ret &= port_ctr_in(); break; + case PORT_NET: ret &= port_net_in(); break; + case PORT_UNKNOWN: break; + } + + return ret; +} + +static void +port_mdr_out( libspectrum_byte val ) +{ + int m, block; + + /* allow access to the port only if motor 1 is ON and there's a file open */ + for( m = 0; m < 8; m++ ) { + + microdrive_t *mdr = µdrive[ m ]; + + if( mdr->motor_on && mdr->inserted ) { +#ifdef IF1_DEBUG_MDR + fprintf(stderr, "#%05d %03d(%03d): 0x%02x\n", + mdr->head_pos, mdr->transfered, mdr->max_bytes, val ); +#endif + block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); + if( mdr->transfered == 0 && val == 0x00 ) { /* start pream */ + mdr->pream[block] = 1; + } else if( mdr->transfered > 0 && mdr->transfered < 10 && val == 0x00 ) { + mdr->pream[block]++; + } else if( mdr->transfered > 9 && mdr->transfered < 12 && val == 0xff ) { + mdr->pream[block]++; + } else if( mdr->transfered == 12 && mdr->pream[block] == 12 ) { + mdr->pream[block] = SYNC_OK; + } + if( mdr->transfered > 11 && + mdr->transfered < mdr->max_bytes + 12 ) { + + libspectrum_microdrive_set_data( mdr->cartridge, mdr->head_pos, + val ); + increment_head( m ); + mdr->modified = 1; + } + mdr->transfered++; + } + } +} + +static void +port_ctr_out( libspectrum_byte val ) +{ + int m; + + if( !( val & 0x02 ) && ( if1_ula.comms_clk ) ) { /* ~~\__ */ + + for( m = 7; m > 0; m-- ) { + /* Rotate one drive */ + microdrive[m].motor_on = microdrive[m - 1].motor_on; + } + microdrive[0].motor_on = (val & 0x01) ? 0 : 1; + + if( microdrive[0].motor_on || microdrive[1].motor_on || + microdrive[2].motor_on || microdrive[3].motor_on || + microdrive[4].motor_on || microdrive[5].motor_on || + microdrive[6].motor_on || microdrive[7].motor_on ) { + if( !if1_mdr_status ) { + ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, + UI_STATUSBAR_STATE_ACTIVE ); + if1_mdr_status = 1; + } + } else if ( if1_mdr_status ) { + ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, + UI_STATUSBAR_STATE_INACTIVE ); + if1_mdr_status = 0; + } + } + if( val & 0x01 ) { /* comms_data == 1 */ + /* Interface 1 service manual p.:1.4 par.: 1.5.1 + The same pin on IC1 (if1 ULA), pin 33, is used for the network + transmit data and for the RS232 transmit data. In order to select + the required function IC1 uses its COMMS_OUT (pin 30) signal, + borrowed from the microdrive control when the microdrive is not + being used (I do not know what it is exactly meaning. It is a + hardware not being used, or a software should not use..?) This signal + is routed from pin 30 to the emitter of transistor Q3 (RX DATA) and + via resistor R4, to the base of transistor Q1 (NET). When COMMS_OUT + is high Q3 is enabled this selecting RS232, and when it is low + Q1 is enabled selecting the network. + + OK, the schematics offer a different interpretation, because if + COMMS_OUT pin level high (>+3V) then Q3 is off (the basis cannot + be more higher potential then emitter (NPN transistor), so whatever + is on the IC1 RX DATA (pin 33) the basis of Q4 is always on +12V, + so the collector of Q4 (PNP transistor) always on -12V. + If COMMS_OUT pin level goes low (~0V), then Q3 basis (connected + to IC1 RX DATA pin) can be higher level (>+3V) than emitter, so + the basis potential of Q4 depend on IC1 RX DATA. + + OK, Summa summarum I assume that, the COMMS OUT pin is a + negated output of the if1 ULA CTR register's COMMS DATA bit. + */ + /* C_DATA = 1 */ + if( if1_ula.comms_data == 0 ) { + if1_ula.count_out = 0; + if1_ula.data_out = 0; + if1_ula.count_in = 0; + if1_ula.data_in = 0; + } + } + if1_ula.wait = ( val & 0x20 ) ? 1 : 0; + if1_ula.comms_data = ( val & 0x01 ) ? 1 : 0; + if1_ula.comms_clk = ( val & 0x02 ) ? 1 : 0; + val = ( val & 0x10 ) ? 1 : 0; + if( settings_current.rs232_handshake && + if1_ula.fd_t != -1 && if1_ula.cts != val ) { + char data = val ? 0x03 : 0x02; + do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); + do ; while( write( if1_ula.fd_t, &data, 1 ) != 1 ); + } + if1_ula.cts = val; + +#ifdef IF1_DEBUG_NET + fprintf( stderr, "Set CTS to %d, set WAIT to %d and COMMS_DATA to %d\n", + if1_ula.cts, if1_ula.wait, if1_ula.comms_data ); +#endif + + microdrives_restart(); +} + +static void +port_net_out( libspectrum_byte val ) +{ + if( if1_ula.fd_t == -1 ) + return; /* nothing to write */ + + if( if1_ula.comms_data == 1 ) { /* OK, RS232 */ + val &= 0x01; + if( if1_ula.count_out == 0 && !val ) { /* waiting for ~~\__ */ + if1_ula.count_out++; + } else if( if1_ula.count_out == 1 ) { + if( if1_ula.cts != 0 || !val ) + if1_ula.count_out = -1; + else + if1_ula.count_out++; /* else get the start bit __/~~ */ + } else if( if1_ula.count_out >= 2 && if1_ula.count_out <= 9 ) { + if1_ula.data_out >>= 1; + if1_ula.data_out |= val & 0x01 ? 0 : 128; + if1_ula.count_out++; /* waiting for next data bit */ + } else if( if1_ula.count_out >= 10 && if1_ula.count_out <= 11 ) { + if( val ) + if1_ula.count_out = -1; + else + if1_ula.count_out++; + } else if( if1_ula.count_out == 12 ) { + if( !val ) + if1_ula.count_out = -1; + else + if1_ula.count_out++; + } else if( if1_ula.count_out == 13 ) { + if( val ) + if1_ula.count_out = -1; + } + + if( if1_ula.count_out == -1 ) { + if1_ula.count_out = 13; + if1_ula.data_out = '?'; + do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); + } + if( if1_ula.count_out == 13 ) { + /* Here is the output routine */ + if( if1_ula.data_out == 0x00 ) { + if1_ula.data_out = '*'; + do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); + } + do ; while( write( if1_ula.fd_t, &if1_ula.data_out, 1 ) != 1 ); + if1_ula.count_out = 0; + } + if1_ula.rx = val & 0x01; /* set rx */ + } else { /* if( if1_ula.comms_data == 1 ) SinclairNET :-)*/ + if( if1_ula.s_net_mode == 0 ) { /* if we out bit by bit, do it */ + /* Here is the output routine */ + +/* OK, examining the schematics of if1 and the disassembly of if1 ROM, I + see that the Q1 and Q2 transistors negate the RX DATA signal, and the + floating state of the net wire is the ~0V level, the forced is the ~3V. + The if1 software send complemented data and read straight data. +*/ + if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set rx */ + lseek( if1_ula.fd_net, 0, SEEK_SET ); /* we save only the state of the wire*/ + do ; while( write( if1_ula.fd_net, &if1_ula.net, 1 ) == -1 ); +#ifdef HAVE_FSYNC + fsync( if1_ula.fd_net ); +#endif /* #ifdef HAVE_FSYNC */ +#ifdef IF1_DEBUG_NET + fprintf( stderr, "Send SinclairNET: %d\n", if1_ula.net ); +#endif + } else { /* if( if1_ula.s_net_mode == 0 ) if we out byte by byte, do it */ + if( if1_ula.net_state >= 0x0200 && if1_ula.net_state < 0x0208 ) { + if1_ula.net_state++; + if1_ula.net_data <<= 1; + if1_ula.net_data |= ( val & 0x01 ) ? 0 : 1; + } else if( if1_ula.net_state == 0x0208 ) { + if1_ula.net_data &= 0xff; + if1_ula.net_state++; /* OK, now we get data bytes... */ + +/* lseek( if1_ula.fd_net, 0, SEEK_SET ); start a packet */ + /* first we send the station number */ + do ; while( write( if1_ula.fd_net, &if1_ula.net_data, 1 ) == -1 ); +#ifdef HAVE_FSYNC + fsync( if1_ula.fd_net ); +#endif /* #ifdef HAVE_FSYNC */ +#ifdef IF1_DEBUG_NET + fprintf( stderr, "SC-OUT send network number: %d\n", + if1_ula.net_data ^ 0xff ); +#endif + } else if( if1_ula.net_state > 192 && if1_ula.net_state < 0x0200 && + ( ( val & 0x01 ) == 0 ) ) { + /* NET-STATE ask as many times.... and now send a 0 */ +/* if1_ula.net = 1; */ + if1_ula.net_state = 0x0200; /* Send the station number */ + } + if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set net wire? */ + } + } + microdrives_restart(); +} + +void +if1_port_out( libspectrum_word port GCC_UNUSED, libspectrum_byte val ) +{ + if( !if1_active ) return; + +#ifdef IF1_DEBUG_NET_1 + fprintf( stderr, "In if1_port_out( %%%d%d%d%d%d%d%d%d => 0x%04x ).\n", + !!(val & 128), !!(val & 64), !!(val & 32), !!(val & 16), + !!(val & 8), !!(val & 4), !!(val & 2), !!(val & 1), port); +#endif + + switch( decode_port( port ) ) { + case PORT_MDR: port_mdr_out( val ); break; + case PORT_CTR: port_ctr_out( val ); break; + case PORT_NET: port_net_out( val ); break; + case PORT_UNKNOWN: break; + } +} + +static void +increment_head( int m ) +{ + microdrive[m].head_pos++; + if( microdrive[m].head_pos >= + libspectrum_microdrive_cartridge_len( microdrive[m].cartridge ) * + LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) + microdrive[m].head_pos = 0; +} + +static void +microdrives_restart( void ) +{ + int m; + + for( m = 0; m < 8; m++ ) { + while( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != 0 && + ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != LIBSPECTRUM_MICRODRIVE_HEAD_LEN ) + increment_head( m ); /* put head in the start of a block */ + + microdrive[m].transfered = 0; /* reset current number of bytes written */ + + if( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) == 0 ) { + microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN; /* up to 15 bytes for header blocks */ + } else { + microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN + LIBSPECTRUM_MICRODRIVE_DATA_LEN + 1; /* up to 528 bytes for data blocks */ + } + } +} + +void +if1_mdr_writeprotect( int drive, int wrprot ) +{ + libspectrum_microdrive_set_write_protect( microdrive[drive].cartridge, + wrprot ? 1 : 0 ); + microdrive[drive].modified = 1; + + update_menu( UMENU_MDRV1 + drive ); +} + +static void +if1_mdr_new( microdrive_t *mdr ) +{ + libspectrum_byte len; + long int i; + + mdr->filename = NULL; + if( settings_current.mdr_random_len ) { /* Random length */ + len = 171 + ( ( rand() >> 2 ) + ( rand() >> 2 ) + + ( rand() >> 2 ) + ( rand() >> 2 ) ) + / rnd_factor; + } else + len = settings_current.mdr_len = settings_current.mdr_len < 10 ? 10 : + settings_current.mdr_len > LIBSPECTRUM_MICRODRIVE_BLOCK_MAX ? LIBSPECTRUM_MICRODRIVE_BLOCK_MAX : settings_current.mdr_len; + + /* Erase the entire cartridge */ + libspectrum_microdrive_set_cartridge_len( mdr->cartridge, len ); + + for( i = 0; i < len * LIBSPECTRUM_MICRODRIVE_BLOCK_LEN; i++ ) + libspectrum_microdrive_set_data( mdr->cartridge, i, 0xff ); + + for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); + i > 0; i-- ) + mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_NO; + + /* but don't write-protect */ + libspectrum_microdrive_set_write_protect( mdr->cartridge, 0 ); + + mdr->inserted = 1; + mdr->modified = 1; + +} + +int +if1_mdr_insert( int which, const char *filename ) +{ + microdrive_t *mdr; + int m, i; + + if( which == -1 ) { /* find an empty one */ + for( m = 0; m < 8; m++ ) { + if( !microdrive[m].inserted ) { + which = m; + break; + } + } + } + + if( which == -1 ) { + ui_error( UI_ERROR_ERROR, + "Cannot insert cartridge '%s', all Microdrives in use", + filename ); + return 1; + } + + if( which >= 8 ) { + ui_error( UI_ERROR_ERROR, "if1_mdr_insert: unknown drive %d", which ); + return 1; + } + + mdr = µdrive[ which ]; + + /* Eject any cartridge already in the drive */ + if( mdr->inserted ) { + /* Abort the insert if we want to keep the current cartridge */ + if( if1_mdr_eject( which, 0 ) ) return 0; + } + + if( filename == NULL ) { /* insert new unformatted cartridge */ + if1_mdr_new( mdr ); + update_menu( UMENU_MDRV1 + which ); + return 0; + } + + if( utils_read_file( filename, &mdr->file ) ) { + ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); + return 1; + } + + if( libspectrum_microdrive_mdr_read( mdr->cartridge, mdr->file.buffer, + mdr->file.length ) ) { + utils_close_file( &mdr->file ); + ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); + return 1; + } + + if( utils_close_file( &mdr->file ) ) return 1; + + mdr->inserted = 1; + mdr->modified = 0; + mdr->filename = strdup( filename ); + /* we assume formatted cartridges */ + for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); + i > 0; i-- ) + mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_OK; + + update_menu( UMENU_MDRV1 + which ); + + return 0; +} + +int +if1_mdr_eject( int which, int saveas ) +{ + microdrive_t *mdr; + + if( which >= 8 ) + return 1; + + mdr = µdrive[ which ]; + + if( !mdr->inserted ) + return 0; + + if( saveas ) { /* 1 -> save as.., 2 -> save */ + + if( mdr->filename == NULL ) saveas = 1; + if( ui_mdr_write( which, 2 - saveas ) ) return 1; + mdr->modified = 0; + return 0; + + } else { + + if( mdr->modified ) { + + ui_confirm_save_t confirm = ui_confirm_save( + "Cartridge in Microdrive %i has been modified.\n" + "Do you want to save it?", + which + 1 + ); + + switch( confirm ) { + + case UI_CONFIRM_SAVE_SAVE: + if( if1_mdr_eject( which, 2 ) ) return 1; /* first save */ + break; + + case UI_CONFIRM_SAVE_DONTSAVE: break; + case UI_CONFIRM_SAVE_CANCEL: return 1; + + } + } + } + + mdr->inserted = 0; + if( mdr->filename != NULL ) { + free( mdr->filename ); + mdr->filename = NULL; + } + + update_menu( UMENU_MDRV1 + which ); + return 0; +} + +int +if1_mdr_write( int which, const char *filename ) +{ + microdrive_t *mdr = µdrive[which]; + + libspectrum_microdrive_mdr_write( mdr->cartridge, &mdr->file.buffer, + &mdr->file.length ); + + if( filename == NULL ) filename = mdr->filename; /* Write over the original file */ + + if( utils_write_file( filename, mdr->file.buffer, mdr->file.length ) ) + return 1; + + if( mdr->filename && strcmp( filename, mdr->filename ) ) { + free( mdr->filename ); + mdr->filename = strdup( filename ); + } + return 0; +} + +#ifndef O_NONBLOCK +#define O_NONBLOCK FNDELAY +#endif + +void +if1_plug( const char *filename, int what ) +{ +#ifdef WIN32 + ui_error( UI_ERROR_ERROR, "Not yet implemented on Win32" ); + return; +#else + int fd = -1; + + switch( what ) { + case 1: + if( if1_ula.fd_r >= 0 ) + close( if1_ula.fd_r ); + fd = if1_ula.fd_r = open( filename, O_RDWR | O_NONBLOCK ); + if( fcntl( fd, F_SETFL, O_RDONLY | O_NONBLOCK ) ) + ui_error( UI_ERROR_ERROR, "Cannot set O_RDONLY on '%s': %s", + filename, strerror( errno ) ); + if1_ula.rs232_buffer = 0x100; /* buffer is empty */ + break; + case 2: + if( if1_ula.fd_t >= 0 ) + close( if1_ula.fd_t ); + fd = if1_ula.fd_t = open( filename, O_RDWR | O_NONBLOCK ); + if( fcntl( fd, F_SETFL, O_WRONLY | O_NONBLOCK ) ) + ui_error( UI_ERROR_ERROR, "Cannot set O_WRONLY on '%s': %s", + filename, strerror( errno ) ); + break; + case 3: + if( if1_ula.fd_net >= 0 ) + close( if1_ula.fd_net ); + fd = if1_ula.fd_net = open( filename, O_RDWR | O_NONBLOCK ); + break; + } + + /* rs232_handshake == 0 -> we assume DTR(DSR) always 1 if tx and rx plugged */ + if( !settings_current.rs232_handshake && + if1_ula.fd_t != -1 && if1_ula.fd_r != -1 ) + if1_ula.dtr = 1; + + if( fd < 0 ) { + ui_error( UI_ERROR_ERROR, "Error opening '%s': %s", + filename, strerror( errno ) ); + return; + } + + if1_ula.s_net_mode = settings_current.raw_s_net ? 0 : 1; + update_menu( UMENU_RS232 ); +#endif +} + +void +if1_unplug( int what ) +{ + switch( what ) { + case 1: + if( if1_ula.fd_r >= 0 ) + close( if1_ula.fd_r ); + if1_ula.fd_r = -1; + break; + case 2: + if( if1_ula.fd_t >= 0 ) + close( if1_ula.fd_t ); + if1_ula.fd_t = -1; + if1_ula.dtr = 0; + break; + case 3: + if( if1_ula.fd_net >= 0 ) + close( if1_ula.fd_net ); + if1_ula.fd_net = -1; + break; + } + /* rs232_handshake == 0 -> we assume DTR(DSR) always 1 if tx and rx plugged */ + if( !settings_current.rs232_handshake && + ( if1_ula.fd_t == -1 || if1_ula.fd_r == -1 ) ) + if1_ula.dtr = 0; + update_menu( UMENU_RS232 ); +} Copied: vendor/fuse-emulator/current/fuse/if1.h (from rev 679, vendor/fuse-emulator/current/fuse/if1.h) =================================================================== --- vendor/fuse-emulator/current/fuse/if1.h (rev 0) +++ vendor/fuse-emulator/current/fuse/if1.h 2012-01-14 12:08:15 UTC (rev 681) @@ -0,0 +1,59 @@ +/* if1.h: Interface I handling routines + Copyright (c) 2004-2005 Gergely Szasz, Philip Kendall + + $Id: if1.h 3327 2007-11-22 23:06:47Z 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: + + Gergely: sz...@hu... + +*/ + +#ifndef FUSE_IF1_H +#define FUSE_IF1_H + +#include <libspectrum.h> + +#include "periph.h" + +/* IF1 */ +extern int if1_active; +extern int if1_available; + +extern const periph_t if1_peripherals[]; +extern const size_t if1_peripherals_count; + +int if1_init( void ); +libspectrum_error if1_end( void ); + +void if1_page( void ); +void if1_unpage( void ); +void if1_memory_map( void ); + +void if1_port_out( libspectrum_word port, libspectrum_byte val ); +libspectrum_byte if1_port_in( libspectrum_word port, int *attached ); + +int if1_mdr_insert( int drive, const char *filename ); +int if1_mdr_write( int drive, const char *filename ); +int if1_mdr_eject( int drive, int write ); +void if1_mdr_writeprotect( int drive, int wrprot ); +void if1_plug( const char *filename, int what ); +void if1_unplug( int what ); + +void if1_update_menu( void ); + +#endif /* #ifndef FUSE_IF1_H */ Copied: vendor/fuse-emulator/current/fuse/if2.c (from rev 679, vendor/fuse-emulator/current/fuse/if2.c) =================================================================== --- vendor/fuse-emulator/current/fuse/if2.c (rev 0) +++ vendor/fuse-emulator/current/fuse/if2.c 2012-01-14 12:08:15 UTC (rev 681) @@ -0,0 +1,204 @@ +/* if2.c: Interface II cartridge handling routines + Copyright (c) 2003 Darren Salt, Fredrick Meunier, Philip Kendall + Copyright (c) 2004 Fredrick Meunier + + $Id: if2.c 4099 2009-10-22 10:59:02Z fredm $ + + This program is free software; you can redistr... [truncated message content] |
From: <fr...@us...> - 2012-01-14 05:18:20
|
Revision: 680 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=680&view=rev Author: fredm Date: 2012-01-14 05:18:11 +0000 (Sat, 14 Jan 2012) Log Message: ----------- To prepare to load . into vendor/fuse-emulator/current, perform 24 renames. * vendor/fuse-emulator/current/fuse/peripherals/disk: Renamed from vendor/fuse-emulator/current/fuse/disk. * vendor/fuse-emulator/current/fuse/peripherals/ide: Renamed from vendor/fuse-emulator/current/fuse/ide. * vendor/fuse-emulator/current/fuse/peripherals/ay.c: Renamed from vendor/fuse-emulator/current/fuse/ay.c. * vendor/fuse-emulator/current/fuse/peripherals/ay.h: Renamed from vendor/fuse-emulator/current/fuse/ay.h. * vendor/fuse-emulator/current/fuse/peripherals/dck.c: Renamed from vendor/fuse-emulator/current/fuse/dck.c. * vendor/fuse-emulator/current/fuse/peripherals/dck.h: Renamed from vendor/fuse-emulator/current/fuse/dck.h. * vendor/fuse-emulator/current/fuse/peripherals/fuller.c: Renamed from vendor/fuse-emulator/current/fuse/fuller.c. * vendor/fuse-emulator/current/fuse/peripherals/fuller.h: Renamed from vendor/fuse-emulator/current/fuse/fuller.h. * vendor/fuse-emulator/current/fuse/peripherals/if1.c: Renamed from vendor/fuse-emulator/current/fuse/if1.c. * vendor/fuse-emulator/current/fuse/peripherals/if1.h: Renamed from vendor/fuse-emulator/current/fuse/if1.h. * vendor/fuse-emulator/current/fuse/peripherals/if2.c: Renamed from vendor/fuse-emulator/current/fuse/if2.c. * vendor/fuse-emulator/current/fuse/peripherals/if2.h: Renamed from vendor/fuse-emulator/current/fuse/if2.h. * vendor/fuse-emulator/current/fuse/peripherals/joystick.c: Renamed from vendor/fuse-emulator/current/fuse/joystick.c. * vendor/fuse-emulator/current/fuse/peripherals/joystick.h: Renamed from vendor/fuse-emulator/current/fuse/joystick.h. * vendor/fuse-emulator/current/fuse/peripherals/kempmouse.c: Renamed from vendor/fuse-emulator/current/fuse/kempmouse.c. * vendor/fuse-emulator/current/fuse/peripherals/kempmouse.h: Renamed from vendor/fuse-emulator/current/fuse/kempmouse.h. * vendor/fuse-emulator/current/fuse/peripherals/melodik.c: Renamed from vendor/fuse-emulator/current/fuse/melodik.c. * vendor/fuse-emulator/current/fuse/peripherals/melodik.h: Renamed from vendor/fuse-emulator/current/fuse/melodik.h. * vendor/fuse-emulator/current/fuse/peripherals/printer.c: Renamed from vendor/fuse-emulator/current/fuse/printer.c. * vendor/fuse-emulator/current/fuse/peripherals/printer.h: Renamed from vendor/fuse-emulator/current/fuse/printer.h. * vendor/fuse-emulator/current/fuse/peripherals/scld.c: Renamed from vendor/fuse-emulator/current/fuse/scld.c. * vendor/fuse-emulator/current/fuse/peripherals/scld.h: Renamed from vendor/fuse-emulator/current/fuse/scld.h. * vendor/fuse-emulator/current/fuse/peripherals/ula.c: Renamed from vendor/fuse-emulator/current/fuse/ula.c. * vendor/fuse-emulator/current/fuse/peripherals/ula.h: Renamed from vendor/fuse-emulator/current/fuse/ula.h. Added Paths: ----------- vendor/fuse-emulator/current/fuse/peripherals/ vendor/fuse-emulator/current/fuse/peripherals/ay.c vendor/fuse-emulator/current/fuse/peripherals/ay.h vendor/fuse-emulator/current/fuse/peripherals/dck.c vendor/fuse-emulator/current/fuse/peripherals/dck.h vendor/fuse-emulator/current/fuse/peripherals/disk/ vendor/fuse-emulator/current/fuse/peripherals/fuller.c vendor/fuse-emulator/current/fuse/peripherals/fuller.h vendor/fuse-emulator/current/fuse/peripherals/ide/ vendor/fuse-emulator/current/fuse/peripherals/if1.c vendor/fuse-emulator/current/fuse/peripherals/if1.h vendor/fuse-emulator/current/fuse/peripherals/if2.c vendor/fuse-emulator/current/fuse/peripherals/if2.h vendor/fuse-emulator/current/fuse/peripherals/joystick.c vendor/fuse-emulator/current/fuse/peripherals/joystick.h vendor/fuse-emulator/current/fuse/peripherals/kempmouse.c vendor/fuse-emulator/current/fuse/peripherals/kempmouse.h vendor/fuse-emulator/current/fuse/peripherals/melodik.c vendor/fuse-emulator/current/fuse/peripherals/melodik.h vendor/fuse-emulator/current/fuse/peripherals/printer.c vendor/fuse-emulator/current/fuse/peripherals/printer.h vendor/fuse-emulator/current/fuse/peripherals/scld.c vendor/fuse-emulator/current/fuse/peripherals/scld.h vendor/fuse-emulator/current/fuse/peripherals/ula.c vendor/fuse-emulator/current/fuse/peripherals/ula.h Removed Paths: ------------- vendor/fuse-emulator/current/fuse/ay.c vendor/fuse-emulator/current/fuse/ay.h vendor/fuse-emulator/current/fuse/dck.c vendor/fuse-emulator/current/fuse/dck.h vendor/fuse-emulator/current/fuse/disk/ vendor/fuse-emulator/current/fuse/fuller.c vendor/fuse-emulator/current/fuse/fuller.h vendor/fuse-emulator/current/fuse/ide/ 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/if2.h vendor/fuse-emulator/current/fuse/joystick.c vendor/fuse-emulator/current/fuse/joystick.h vendor/fuse-emulator/current/fuse/kempmouse.c vendor/fuse-emulator/current/fuse/kempmouse.h vendor/fuse-emulator/current/fuse/melodik.c vendor/fuse-emulator/current/fuse/melodik.h vendor/fuse-emulator/current/fuse/printer.c vendor/fuse-emulator/current/fuse/printer.h vendor/fuse-emulator/current/fuse/scld.c vendor/fuse-emulator/current/fuse/scld.h vendor/fuse-emulator/current/fuse/ula.c vendor/fuse-emulator/current/fuse/ula.h Deleted: vendor/fuse-emulator/current/fuse/ay.c =================================================================== --- vendor/fuse-emulator/current/fuse/ay.c 2011-11-19 11:19:30 UTC (rev 679) +++ vendor/fuse-emulator/current/fuse/ay.c 2012-01-14 05:18:11 UTC (rev 680) @@ -1,169 +0,0 @@ -/* ay.c: AY-8-3912 routines - Copyright (c) 1999-2009 Philip Kendall - - $Id: ay.c 4030 2009-06-07 14:38:38Z 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: phi...@sh... - -*/ - -#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 ); -} - -void -ay_state_from_snapshot( libspectrum_snap *snap ) -{ - size_t i; - - 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_from_snapshot( libspectrum_snap *snap ) -{ - if( machine_current->capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_AY ) { - ay_state_from_snapshot( snap ); - } -} - -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] ); -} Deleted: vendor/fuse-emulator/current/fuse/ay.h =================================================================== --- vendor/fuse-emulator/current/fuse/ay.h 2011-11-19 11:19:30 UTC (rev 679) +++ vendor/fuse-emulator/current/fuse/ay.h 2012-01-14 05:18:11 UTC (rev 680) @@ -1,47 +0,0 @@ -/* ay.h: AY-8-3912 routines - Copyright (c) 1999-2009 Philip Kendall - - $Id: ay.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... - -*/ - -#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 ); - -void ay_state_from_snapshot( libspectrum_snap *snap ); - -#endif /* #ifndef FUSE_AY_H */ Deleted: vendor/fuse-emulator/current/fuse/dck.c =================================================================== --- vendor/fuse-emulator/current/fuse/dck.c 2011-11-19 11:19:30 UTC (rev 679) +++ vendor/fuse-emulator/current/fuse/dck.c 2012-01-14 05:18:11 UTC (rev 680) @@ -1,184 +0,0 @@ -/* 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: phi...@sh... - - Darren: li...@yo... - Fred: fr...@sp... - -*/ - -#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 ); -} Deleted: vendor/fuse-emulator/current/fuse/dck.h =================================================================== --- vendor/fuse-emulator/current/fuse/dck.h 2011-11-19 11:19:30 UTC (rev 679) +++ vendor/fuse-emulator/current/fuse/dck.h 2012-01-14 05:18:11 UTC (rev 680) @@ -1,39 +0,0 @@ -/* 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: phi...@sh... - - Darren: li...@yo... - Fred: fr...@sp... - -*/ - -#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 Deleted: vendor/fuse-emulator/current/fuse/fuller.c =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.c 2011-11-19 11:19:30 UTC (rev 679) +++ vendor/fuse-emulator/current/fuse/fuller.c 2012-01-14 05:18:11 UTC (rev 680) @@ -1,90 +0,0 @@ -/* fuller.c: Routines for handling the Fuller Box - Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier - - $Id: fuller.c 4032 2009-06-10 11:09:44Z 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: phi...@sh... - - Stuart: sd...@nt... - -*/ - -#include <config.h> - -#include <libspectrum.h> - -#include "ay.h" -#include "compat.h" -#include "fuller.h" -#include "joystick.h" -#include "module.h" -#include "periph.h" -#include "settings.h" - -static void fuller_enabled_snapshot( libspectrum_snap *snap ); -static void fuller_from_snapshot( libspectrum_snap *snap ); -static void fuller_to_snapshot( libspectrum_snap *snap ); - -static module_info_t fuller_module_info = { - - NULL, - NULL, - fuller_enabled_snapshot, - fuller_from_snapshot, - fuller_to_snapshot, - -}; - -const periph_t fuller_peripherals[] = { - { 0x00ff, 0x003f, ay_registerport_read, ay_registerport_write }, - { 0x00ff, 0x005f, NULL, ay_dataport_write }, - { 0x00ff, 0x007f, joystick_fuller_read, NULL }, -}; - -const size_t fuller_peripherals_count = - sizeof( fuller_peripherals ) / sizeof( periph_t ); - -static void -fuller_enabled_snapshot( libspectrum_snap *snap ) -{ - if( libspectrum_snap_fuller_box_active( snap ) ) - settings_current.fuller = 1; -} - -static void -fuller_from_snapshot( libspectrum_snap *snap ) -{ - if( periph_fuller_active ) { - ay_state_from_snapshot( snap ); - } -} - -static void -fuller_to_snapshot( libspectrum_snap *snap ) -{ - libspectrum_snap_set_fuller_box_active( snap, periph_fuller_active ); -} - -int -fuller_init( void ) -{ - module_register( &fuller_module_info ); - - return 0; -} Deleted: vendor/fuse-emulator/current/fuse/fuller.h =================================================================== --- vendor/fuse-emulator/current/fuse/fuller.h 2011-11-19 11:19:30 UTC (rev 679) +++ vendor/fuse-emulator/current/fuse/fuller.h 2012-01-14 05:18:11 UTC (rev 680) @@ -1,40 +0,0 @@ -/* fuller.h: Routines for handling the Fuller Box - Copyright (c) 2007-2009 Stuart Brady, Fredrick Meunier - - $Id: fuller.h 4030 2009-06-07 14:38:38Z 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: phi...@sh... - - Stuart: sd...@nt... - -*/ - -#ifndef FUSE_FULLER_H -#define FUSE_FULLER_H - -#include <libspectrum.h> - -#include "periph.h" - -extern const periph_t fuller_peripherals[]; -extern const size_t fuller_peripherals_count; - -int fuller_init( void ); - -#endif /* #ifndef FUSE_FULLER_H */ Deleted: vendor/fuse-emulator/current/fuse/if1.c =================================================================== --- vendor/fuse-emulator/current/fuse/if1.c 2011-11-19 11:19:30 UTC (rev 679) +++ vendor/fuse-emulator/current/fuse/if1.c 2012-01-14 05:18:11 UTC (rev 680) @@ -1,1304 +0,0 @@ -/* if1.c: Interface I handling routines - Copyright (c) 2004-2008 Gergely Szasz, Philip Kendall - - $Id: if1.c 4180 2010-10-09 12:59:37Z 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: - - Gergely: sz...@hu... - -*/ - -#include <config.h> - -#include <string.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> - -#include <unistd.h> - -#include "compat.h" -#include "debugger/debugger.h" -#include "if1.h" -#include "machine.h" -#include "memory.h" -#include "module.h" -#include "periph.h" -#include "settings.h" -#include "utils.h" -#include "ui/ui.h" - -#undef IF1_DEBUG_MDR -#undef IF1_DEBUG_NET -#undef IF1_DEBUG_NET_1 - -#define BUFF_EMPTY 0x100 - -enum { - SYNC_NO = 0, - SYNC_OK = 0xff -}; - -/* - Microdrive cartridge - GAP PREAMBLE 15 byte GAP PREAMBLE 15 byte 512 1 - [-----][00 00 ... ff ff][BLOCK HEAD][-----][00 00 ... ff ff][REC HEAD][ DATA ][CHK] - Preamble = 10 * 0x00 + 2 * 0xff (12 byte) -*/ - -typedef struct microdrive_t { - utils_file file; - char *filename; /* old filename */ - int inserted; - int modified; - int motor_on; - int head_pos; - int transfered; - int max_bytes; - libspectrum_byte pream[512]; /* preamble/sync area written */ - libspectrum_byte last; - libspectrum_byte gap; - libspectrum_byte sync; - - libspectrum_microdrive *cartridge; /* write protect, len, blocks */ - -} microdrive_t; - -typedef struct if1_ula_t { - int fd_r; /* file descriptor for reading bytes or bits RS232 */ - int fd_t; /* file descriptor for writing bytes or bits RS232 */ - int fd_net; /* file descriptor for rw bytes or bits SinclairNET */ - int rs232_buffer; /* read buffer */ - int s_net_mode; - int status; /* if1_ula/SinclairNET */ - int comms_data; /* the previous data comms state */ - int comms_clk; /* the previous data comms state */ - int cts; /* CTS of peripheral */ - int dtr; /* DTR of peripheral */ - int tx; /* TxD the name is very kind, because this is the read end of - the TxD wire of DATA machine (really RxD the view of - spectrum */ - int rx; /* RxD the name is very kind, because this is the write end of - the RxD wire of DATA machine (really TxD the view of - spectrum */ - int data_in; /* interpreted incoming data */ - int count_in; - int data_out; /* interpreted outgoing data */ - int count_out; - int esc_in; /* if we compose an escape seq */ - - int net; /* Network in/out (really 1 wire bus :-) */ - int net_data; /* Interpreted network data */ - int net_state; /* Interpreted network data */ - int wait; /* Wait state */ - int busy; /* Indicate busy; if1 software never poll it ... */ -} if1_ula_t; - -/* - 7 6 5 4 3 2 1 0 - STATUS RO $EF(239) --- --- --- BSY DTR GAP SYN WPR - - CONTRO WO $EF(239) --- --- WAT CTS ERA R/w CLK DTA - - MDR DT RW $E7(231) D7 D6 D5 D4 D3 D2 D1 D0 - - COMM I RO $F7(247) TX --- --- --- --- --- --- NET - - COMM O WO $F7(247) --- --- --- --- --- --- --- NET/RX - -RS232: - DTR -> Data Terminal Ready (DTE -> DCE) - CTS -> Clear To Send (DCE -> DTE) - TX -> Transmitted Data (DTE -> DCE) - RX -> Received Data (DCE -> DTE) - - The IF1 serial behaves not as a DTE (Data Terminal Equipment, e.g. - a computer) but as a DCE (Data Communications Equipment, e.g. a modem) - - If we were to consider the ZX Spectrum a DTE, we would rename the lines: - DTR := DSR (Data Set Ready) - CTS := RTS (Request To Send) - TX := RX - RX := TX - - On the communication channels: - Bytes interpreted as is, except: - 0x00 0x00 --> DTR ~~\__ - 0x00 0x01 --> DTR __/~~ - 0x00 0x02 --> CTS ~~\__ - 0x00 0x03 --> CTS __/~~ - 0x00 ? --> lost - 0x00 * --> 0x00 - Additionally: - if fuse read 0x00 0x00 => DTR = 0 ~~\__ - if fuse read 0x00 0x01 => DTR = 1 __/~~ - if CTS = ~~\__ fuse send 0x00 0x02 - if CTS = __/~~ fuse send 0x00 0x03 - if fuse lost send 0x00 + 0x3f (?) - every other 0x00 + 0x## are discarded -*/ - -/* Two 8Kb memory chunks accessible by the Z80 when /ROMCS is low */ -static memory_page if1_memory_map_romcs[2]; - -/* IF1 paged out ROM activated? */ -int if1_active = 0; -int if1_available = 0; -static int if1_mdr_status = 0; - -int rnd_factor = ( ( RAND_MAX >> 2 ) << 2 ) / 19 + 1; - -static microdrive_t microdrive[8]; /* We have 8 microdrive */ -static if1_ula_t if1_ula; - -static void microdrives_reset( void ); -static void microdrives_restart( void ); -static void increment_head( int m ); - -#define MDR_IN(m) microdrive[m - 1].inserted -#define MDR_WP(m) libspectrum_microdrive_write_protect( microdrive[m - 1].cartridge ) - -enum if1_menu_item { - - UMENU_ALL = 0, - UMENU_MDRV1, - UMENU_MDRV2, - UMENU_MDRV3, - UMENU_MDRV4, - UMENU_MDRV5, - UMENU_MDRV6, - UMENU_MDRV7, - UMENU_MDRV8, - UMENU_RS232, -}; - -enum if1_port { - PORT_MDR, - PORT_CTR, - PORT_NET, - PORT_UNKNOWN, -}; - -static void if1_reset( int hard_reset ); -static void if1_enabled_snapshot( libspectrum_snap *snap ); -static void if1_from_snapshot( libspectrum_snap *snap ); -static void if1_to_snapshot( libspectrum_snap *snap ); - -static module_info_t if1_module_info = { - - if1_reset, - if1_memory_map, - if1_enabled_snapshot, - if1_from_snapshot, - if1_to_snapshot, - -}; - -const periph_t if1_peripherals[] = { - { 0x0018, 0x0010, if1_port_in, if1_port_out }, - { 0x0018, 0x0008, if1_port_in, if1_port_out }, - { 0x0018, 0x0000, if1_port_in, if1_port_out }, -}; - -const size_t if1_peripherals_count = - sizeof( if1_peripherals ) / sizeof( periph_t ); - -/* Debugger events */ -static const char *event_type_string = "if1"; -static int page_event, unpage_event; - -static void -update_menu( enum if1_menu_item what ) -{ - if( what == UMENU_ALL || what == UMENU_MDRV1 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_EJECT, MDR_IN( 1 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M1_WP_SET, - !MDR_IN( 1 ) ? 0 : !MDR_WP( 1 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV2 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_EJECT, MDR_IN( 2 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M2_WP_SET, - !MDR_IN( 2 ) ? 0 : !MDR_WP( 2 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV3 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_EJECT, MDR_IN( 3 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M3_WP_SET, - !MDR_IN( 3 ) ? 0 : !MDR_WP( 3 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV4 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_EJECT, MDR_IN( 4 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M4_WP_SET, - !MDR_IN( 4 ) ? 0 : !MDR_WP( 4 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV5 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_EJECT, MDR_IN( 5 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M5_WP_SET, - !MDR_IN( 5 ) ? 0 : !MDR_WP( 5 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV6 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_EJECT, MDR_IN( 6 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M6_WP_SET, - !MDR_IN( 6 ) ? 0 : !MDR_WP( 6 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV7 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_EJECT, MDR_IN( 7 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M7_WP_SET, - !MDR_IN( 7 ) ? 0 : !MDR_WP( 7 ) ); - } - - if( what == UMENU_ALL || what == UMENU_MDRV8 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_EJECT, MDR_IN( 8 ) ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_M8_WP_SET, - !MDR_IN( 8 ) ? 0 : !MDR_WP( 8 ) ); - } - - if( what == UMENU_ALL || what == UMENU_RS232 ) { - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_R, - ( if1_ula.fd_r > -1 ) ? 1 : 0 ); - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_RS232_UNPLUG_T, - ( if1_ula.fd_t > -1 ) ? 1 : 0 ); -#ifdef BUILD_WITH_SNET - ui_menu_activate( UI_MENU_ITEM_MEDIA_IF1_SNET_UNPLUG, - ( if1_ula.fd_net > -1 ) ? 1 : 0 ); -#endif - } -} - -int -if1_init( void ) -{ - int m, i; - - if1_ula.fd_r = -1; - if1_ula.fd_t = -1; - if1_ula.dtr = 0; /* No data terminal yet */ - if1_ula.cts = 2; /* force to emit first cts status */ - if1_ula.comms_clk = 0; - if1_ula.comms_data = 0; /* really? */ - if1_ula.fd_net = -1; - if1_ula.s_net_mode = 1; - if1_ula.net = 0; - if1_ula.esc_in = 0; /* empty */ - - for( m = 0; m < 8; m++ ) { - microdrive[m].cartridge = libspectrum_microdrive_alloc(); - microdrive[m].inserted = 0; - microdrive[m].modified = 0; - } - - if( settings_current.rs232_rx ) { - if1_plug( settings_current.rs232_rx, 1 ); - free( settings_current.rs232_rx ); - settings_current.rs232_rx = NULL; - } - - if( settings_current.rs232_tx ) { - if1_plug( settings_current.rs232_tx, 2 ); - free( settings_current.rs232_tx ); - settings_current.rs232_tx = NULL; - } - - if( settings_current.snet ) { - if1_plug( settings_current.snet, 3 ); - free( settings_current.snet ); - settings_current.snet = NULL; - } - - module_register( &if1_module_info ); - for( i = 0; i < 2; i++ ) if1_memory_map_romcs[i].bank = MEMORY_BANK_ROMCS; - - if( periph_register_paging_events( event_type_string, &page_event, - &unpage_event ) ) - return 1; - - return 0; -} - -libspectrum_error -if1_end( void ) -{ - int m; - - for( m = 0; m < 8; m++ ) { - libspectrum_error error = - libspectrum_microdrive_free( microdrive[m].cartridge ); - if( error ) return error; - } - - return LIBSPECTRUM_ERROR_NONE; -} - -void -if1_update_menu( void ) -{ - update_menu( UMENU_ALL ); -} - -static void -if1_reset( int hard_reset GCC_UNUSED ) -{ - if1_active = 0; - if1_available = 0; - - if( !periph_interface1_active ) return; - - machine_load_rom_bank( if1_memory_map_romcs, 0, 0, - settings_current.rom_interface_i, - settings_default.rom_interface_i, - MEMORY_PAGE_SIZE ); - - if1_memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL; - - machine_current->ram.romcs = 0; - - if1_ula.cts = 2; /* force to emit first out if raw */ - if1_ula.comms_clk = 0; - if1_ula.comms_data = 0; - if1_ula.net = 0; - if1_ula.esc_in = 0; - - microdrives_reset(); - - update_menu( UMENU_ALL ); - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_INACTIVE ); - - if1_mdr_status = 0; - - if1_available = 1; -} - -void -if1_page( void ) -{ - if1_active = 1; - machine_current->ram.romcs = 1; - machine_current->memory_map(); - - debugger_event( page_event ); -} - -void -if1_unpage( void ) -{ - if1_active = 0; - machine_current->ram.romcs = 0; - machine_current->memory_map(); - - debugger_event( unpage_event ); -} - -void -if1_memory_map( void ) -{ - if( !if1_active ) return; - - memory_map_read[0] = memory_map_write[0] = if1_memory_map_romcs[0]; -} - -static void -if1_enabled_snapshot( libspectrum_snap *snap ) -{ - if( libspectrum_snap_interface1_active( snap ) ) - settings_current.interface1 = 1; -} - -static void -if1_from_snapshot( libspectrum_snap *snap ) -{ - if( !libspectrum_snap_interface1_active( snap ) ) return; - - if( libspectrum_snap_interface1_custom_rom( snap ) && - libspectrum_snap_interface1_rom( snap, 0 ) && - machine_load_rom_bank_from_buffer( - if1_memory_map_romcs, 0, 0, - libspectrum_snap_interface1_rom( snap, 0 ), - libspectrum_snap_interface1_rom_length( snap, 0 ), - 1 ) ) - return; - - if( libspectrum_snap_interface1_paged( snap ) ) { - if1_page(); - } else { - if1_unpage(); - } -} - -static void -if1_to_snapshot( libspectrum_snap *snap ) -{ - libspectrum_byte *buffer; - - if( !periph_interface1_active ) return; - - libspectrum_snap_set_interface1_active( snap, 1 ); - libspectrum_snap_set_interface1_paged ( snap, if1_active ); - libspectrum_snap_set_interface1_drive_count( snap, 8 ); - - if( if1_memory_map_romcs[0].source == MEMORY_SOURCE_CUSTOMROM ) { - size_t rom_length = MEMORY_PAGE_SIZE; - - if( if1_memory_map_romcs[1].source == MEMORY_SOURCE_CUSTOMROM ) { - rom_length <<= 1; - } - - libspectrum_snap_set_interface1_custom_rom( snap, 1 ); - libspectrum_snap_set_interface1_rom_length( snap, 0, rom_length ); - - buffer = malloc( rom_length ); - if( !buffer ) { - ui_error( UI_ERROR_ERROR, "Out of memory at %s:%d", __FILE__, __LINE__ ); - return; - } - - memcpy( buffer, if1_memory_map_romcs[0].page, MEMORY_PAGE_SIZE ); - - if( rom_length == MEMORY_PAGE_SIZE*2 ) { - memcpy( buffer + MEMORY_PAGE_SIZE, if1_memory_map_romcs[1].page, - MEMORY_PAGE_SIZE ); - } - - libspectrum_snap_set_interface1_rom( snap, 0, buffer ); - } -} - -static void -microdrives_reset( void ) -{ - int m; - - for( m = 0; m < 8; m++ ) { - microdrive[m].head_pos = 0; - microdrive[m].motor_on = 0; /* motor off */ - microdrive[m].gap = 15; - microdrive[m].sync = 15; - microdrive[m].transfered = 0; - } - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_INACTIVE ); - if1_mdr_status = 0; -/* - if1_ula.comms_data = 0; - if1_ula.count_in = 0; - if1_ula.count_out = 0; - if1_ula.cts = 0; - if1_ula.dtr = 0; - if1_ula.wait = 0; - if1_ula.busy = 0; - if1_ula.net = 0; - if1_ula.net_state = 0; -*/ -} - -static enum if1_port -decode_port( libspectrum_word port ) -{ - switch( port & 0x0018 ) { - case 0x0000: return PORT_MDR; - case 0x0008: return PORT_CTR; - case 0x0010: return PORT_NET; - default: return PORT_UNKNOWN; - } -} - -static libspectrum_byte -port_mdr_in( void ) -{ - libspectrum_byte ret = 0xff; - int m; - - for( m = 0; m < 8; m++ ) { - - microdrive_t *mdr = µdrive[ m ]; - - if( mdr->motor_on && mdr->inserted ) { - - if( mdr->transfered < mdr->max_bytes ) { - mdr->last = libspectrum_microdrive_data( mdr->cartridge, - mdr->head_pos ); - increment_head( m ); - } - - mdr->transfered++; - ret &= mdr->last; /* I assume negative logic, but how know? */ - } - - } - - return ret; -} - -static libspectrum_byte -port_ctr_in( void ) -{ - libspectrum_byte ret = 0xff; - int m, block; - - for( m = 0; m < 8; m++ ) { - - microdrive_t *mdr = µdrive[ m ]; - - if( mdr->motor_on && mdr->inserted ) { - block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); - if( mdr->pream[block] == SYNC_OK ) { /* if formatted */ - if( mdr->gap ) { - /* ret &= 0xff; GAP and SYNC high ? */ - mdr->gap--; - } else { - ret &= 0xf9; /* GAP and SYNC low */ - if( mdr->sync ) { - mdr->sync--; - } else { - mdr->gap = 15; - mdr->sync = 15; - } - } - } - /* if write protected */ - if( libspectrum_microdrive_write_protect( mdr->cartridge) ) - ret &= 0xfe; /* active bit */ - } - } - /* Here we have to poll, the if1_ula DTR 'line' */ - if( if1_ula.rs232_buffer > 0xff ) { /* buffer empty */ - unsigned char byte; - int yes = 1; - - while( yes && read( if1_ula.fd_r, &byte, 1 ) == 1 ) { - if( if1_ula.esc_in == 1 ) { - if1_ula.esc_in = 0; - if( byte == '*' ) { - if1_ula.rs232_buffer = 0x00; - yes = 0; - } else if( byte == 0x00 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 0; - } else if( byte == 0x01 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 1; - } - } else if( byte == 0x00 ) { - if1_ula.esc_in = 1; - } else { - if1_ula.rs232_buffer = byte; - yes = 0; - break; - } - } - } - - if( if1_ula.dtr == 0 ) - ret &= 0xf7; /* %11110111 */ - - /* Here we have to poll, the 'SinclairNet' busy flag but never used by - software in Interface 1 */ - if( if1_ula.busy == 0 ) - ret &= 0xef; /* %11101111 */ - /* fprintf( stderr, "Read CTR ( %%%d%d%d%d%d%d%d%d ).\n", - !!(ret & 128), !!(ret & 64), !!(ret & 32), !!(ret & 16), - !!(ret & 8), !!(ret & 4), !!(ret & 2), !!(ret & 1)); */ - microdrives_restart(); - - return ret; -} - -/* - return 1 if read a byte - 0 if nothing interesting... -*/ - -static int -read_rs232() -{ - if( if1_ula.rs232_buffer <= 0xff ) { /* we read from the buffer */ - if1_ula.data_in = if1_ula.rs232_buffer; - if1_ula.rs232_buffer = 0x0100; - return 1; - } - while( read( if1_ula.fd_r, &if1_ula.data_in, 1 ) == 1 ) { - if( if1_ula.esc_in == 1 ) { - if1_ula.esc_in = 0; - if( if1_ula.data_in == '*' ) { - if1_ula.data_in = 0x00; - return 1; - } else if( if1_ula.data_in == 0x00 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 0; - } else if( if1_ula.data_in == 0x01 ) { - if( settings_current.rs232_handshake ) - if1_ula.dtr = 1; - } - } else if( if1_ula.data_in == 0x00 ) { - if1_ula.esc_in = 1; - } else { - return 1; - } - } - return 0; -} - -static libspectrum_byte -port_net_in( void ) -{ - libspectrum_byte ret = 0xff; - - if( if1_ula.fd_r == -1 ) - goto no_rs232_in; - - /* Here is the RS232 input routine */ - if( if1_ula.cts ) { /* If CTS == 1 */ - if( if1_ula.count_in == 0 ) { - if( if1_ula.fd_r >= 0 && read_rs232() == 1 ) { - if1_ula.count_in++; /* Ok, if read a byte, we begin */ - } - if1_ula.tx = 0; /* now send __ to if1 - later we raise :-) */ - } else if( if1_ula.count_in >= 1 && if1_ula.count_in < 5 ) { - if1_ula.tx = 1; /* send ~~ (start bit :-) */ - if1_ula.count_in++; - } else if( if1_ula.count_in >= 5 && if1_ula.count_in < 13 ) { - if1_ula.tx = ( if1_ula.data_in & 0x01 ) ? 0 : 1; - /* send .. (data bits :-) */ - if1_ula.data_in >>= 1; /* prepare next bit :-) */ - if1_ula.count_in++; - } else - if1_ula.count_in = 0; - } else { /* if( if1_ula.cts ) */ - if1_ula.count_in = 0; /* reset serial in */ - if1_ula.tx = 0; /* send __ stop bits or s.e. :-) */ - } - -no_rs232_in: - if( if1_ula.fd_net == -1 ) - goto no_snet_in; - - if( if1_ula.s_net_mode == 0 ) { /* if we do raw */ - /* Here is the input routine */ - read( if1_ula.fd_net, &if1_ula.net, 1 ); /* Ok, if no byte, we send last*/ - } else {/* if( if1_ula.s_net_mode == 1 ) if we do interpreted */ -/* Here is the input routine. There are several stage in input - and output. So first for output. if1 first do SEND-SC - (http://www.wearmouth.demon.co.uk/if1_2.htm#L101E) to send - a Sync-Out signal and SEND-SC do first a NET-STATE - (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FBC) to see - the line activity: - 11xxxxxx times (192-255) have to get a zero (bit for network) - plus 1 times more from SEND-SC. Next SEND-SC send a 0 which is - a 1 on the net wire (negated output, straight input!!!) - - OK. In input first if1 call WT-SC-E to check Network activity - (http://www.wearmouth.demon.co.uk/if1_2.htm#L0FD3). Now check - 128 times the net wire (we do two round, because to differentiate - net out routines...) -*/ - - if( if1_ula.net_state < 0x0100 ) { /* if1 may in NET-STATE */ - if1_ula.net_state++; - if1_ula.net = 0; -#ifdef IF1_DEBUG_NET - fprintf( stderr, "NET-STAT(%03d)? We send 0!\n", if1_ula.net_state ); -#endif - } else if( if1_ula.net_state == 0x0100 ) { /* probably waiting for input */ - if( read( if1_ula.fd_net, &if1_ula.net_data, 1 ) == 1 ) { - if1_ula.net_state++; - if1_ula.net = 1; /* Start with __/~~ */ - } /* Ok, if have a byte, we send it! */ - } else if( if1_ula.net_state == 0x0101 ) { - if1_ula.net_state++; - if1_ula.net = 1; /* one more ~~ */ - } else if( if1_ula.net_state > 0x0101 && - if1_ula.net_state < 0x010a ) { /* we send the data bits... */ - if1_ula.net_state++; - if1_ula.net = if1_ula.net_data & 1; - if1_ula.net_data >>= 1; - } else if( if1_ula.net_state == 0x010a ) { - if1_ula.net = 0; - if1_ula.net_state = 0; /* OK, we starting a new byte... */ -#ifdef IF1_DEBUG_NET - fprintf( stderr, "NET-STAT(%03d)? Get a byte!\n", if1_ula.net_state ); -#endif - } - } -no_snet_in: - if( !if1_ula.tx ) - ret &= 0x7f; - if( !if1_ula.net ) - ret &= 0xfe; - microdrives_restart(); - - return ret; -} - -libspectrum_byte -if1_port_in( libspectrum_word port GCC_UNUSED, int *attached ) -{ - libspectrum_byte ret = 0xff; - - if( !if1_active ) return ret; - - *attached = 1; - - switch( decode_port( port ) ) - { - case PORT_MDR: ret &= port_mdr_in(); break; - case PORT_CTR: ret &= port_ctr_in(); break; - case PORT_NET: ret &= port_net_in(); break; - case PORT_UNKNOWN: break; - } - - return ret; -} - -static void -port_mdr_out( libspectrum_byte val ) -{ - int m, block; - - /* allow access to the port only if motor 1 is ON and there's a file open */ - for( m = 0; m < 8; m++ ) { - - microdrive_t *mdr = µdrive[ m ]; - - if( mdr->motor_on && mdr->inserted ) { -#ifdef IF1_DEBUG_MDR - fprintf(stderr, "#%05d %03d(%03d): 0x%02x\n", - mdr->head_pos, mdr->transfered, mdr->max_bytes, val ); -#endif - block = mdr->head_pos / 543 + ( mdr->max_bytes == 15 ? 0 : 256 ); - if( mdr->transfered == 0 && val == 0x00 ) { /* start pream */ - mdr->pream[block] = 1; - } else if( mdr->transfered > 0 && mdr->transfered < 10 && val == 0x00 ) { - mdr->pream[block]++; - } else if( mdr->transfered > 9 && mdr->transfered < 12 && val == 0xff ) { - mdr->pream[block]++; - } else if( mdr->transfered == 12 && mdr->pream[block] == 12 ) { - mdr->pream[block] = SYNC_OK; - } - if( mdr->transfered > 11 && - mdr->transfered < mdr->max_bytes + 12 ) { - - libspectrum_microdrive_set_data( mdr->cartridge, mdr->head_pos, - val ); - increment_head( m ); - mdr->modified = 1; - } - mdr->transfered++; - } - } -} - -static void -port_ctr_out( libspectrum_byte val ) -{ - int m; - - if( !( val & 0x02 ) && ( if1_ula.comms_clk ) ) { /* ~~\__ */ - - for( m = 7; m > 0; m-- ) { - /* Rotate one drive */ - microdrive[m].motor_on = microdrive[m - 1].motor_on; - } - microdrive[0].motor_on = (val & 0x01) ? 0 : 1; - - if( microdrive[0].motor_on || microdrive[1].motor_on || - microdrive[2].motor_on || microdrive[3].motor_on || - microdrive[4].motor_on || microdrive[5].motor_on || - microdrive[6].motor_on || microdrive[7].motor_on ) { - if( !if1_mdr_status ) { - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_ACTIVE ); - if1_mdr_status = 1; - } - } else if ( if1_mdr_status ) { - ui_statusbar_update( UI_STATUSBAR_ITEM_MICRODRIVE, - UI_STATUSBAR_STATE_INACTIVE ); - if1_mdr_status = 0; - } - } - if( val & 0x01 ) { /* comms_data == 1 */ - /* Interface 1 service manual p.:1.4 par.: 1.5.1 - The same pin on IC1 (if1 ULA), pin 33, is used for the network - transmit data and for the RS232 transmit data. In order to select - the required function IC1 uses its COMMS_OUT (pin 30) signal, - borrowed from the microdrive control when the microdrive is not - being used (I do not know what it is exactly meaning. It is a - hardware not being used, or a software should not use..?) This signal - is routed from pin 30 to the emitter of transistor Q3 (RX DATA) and - via resistor R4, to the base of transistor Q1 (NET). When COMMS_OUT - is high Q3 is enabled this selecting RS232, and when it is low - Q1 is enabled selecting the network. - - OK, the schematics offer a different interpretation, because if - COMMS_OUT pin level high (>+3V) then Q3 is off (the basis cannot - be more higher potential then emitter (NPN transistor), so whatever - is on the IC1 RX DATA (pin 33) the basis of Q4 is always on +12V, - so the collector of Q4 (PNP transistor) always on -12V. - If COMMS_OUT pin level goes low (~0V), then Q3 basis (connected - to IC1 RX DATA pin) can be higher level (>+3V) than emitter, so - the basis potential of Q4 depend on IC1 RX DATA. - - OK, Summa summarum I assume that, the COMMS OUT pin is a - negated output of the if1 ULA CTR register's COMMS DATA bit. - */ - /* C_DATA = 1 */ - if( if1_ula.comms_data == 0 ) { - if1_ula.count_out = 0; - if1_ula.data_out = 0; - if1_ula.count_in = 0; - if1_ula.data_in = 0; - } - } - if1_ula.wait = ( val & 0x20 ) ? 1 : 0; - if1_ula.comms_data = ( val & 0x01 ) ? 1 : 0; - if1_ula.comms_clk = ( val & 0x02 ) ? 1 : 0; - val = ( val & 0x10 ) ? 1 : 0; - if( settings_current.rs232_handshake && - if1_ula.fd_t != -1 && if1_ula.cts != val ) { - char data = val ? 0x03 : 0x02; - do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); - do ; while( write( if1_ula.fd_t, &data, 1 ) != 1 ); - } - if1_ula.cts = val; - -#ifdef IF1_DEBUG_NET - fprintf( stderr, "Set CTS to %d, set WAIT to %d and COMMS_DATA to %d\n", - if1_ula.cts, if1_ula.wait, if1_ula.comms_data ); -#endif - - microdrives_restart(); -} - -static void -port_net_out( libspectrum_byte val ) -{ - if( if1_ula.fd_t == -1 ) - return; /* nothing to write */ - - if( if1_ula.comms_data == 1 ) { /* OK, RS232 */ - val &= 0x01; - if( if1_ula.count_out == 0 && !val ) { /* waiting for ~~\__ */ - if1_ula.count_out++; - } else if( if1_ula.count_out == 1 ) { - if( if1_ula.cts != 0 || !val ) - if1_ula.count_out = -1; - else - if1_ula.count_out++; /* else get the start bit __/~~ */ - } else if( if1_ula.count_out >= 2 && if1_ula.count_out <= 9 ) { - if1_ula.data_out >>= 1; - if1_ula.data_out |= val & 0x01 ? 0 : 128; - if1_ula.count_out++; /* waiting for next data bit */ - } else if( if1_ula.count_out >= 10 && if1_ula.count_out <= 11 ) { - if( val ) - if1_ula.count_out = -1; - else - if1_ula.count_out++; - } else if( if1_ula.count_out == 12 ) { - if( !val ) - if1_ula.count_out = -1; - else - if1_ula.count_out++; - } else if( if1_ula.count_out == 13 ) { - if( val ) - if1_ula.count_out = -1; - } - - if( if1_ula.count_out == -1 ) { - if1_ula.count_out = 13; - if1_ula.data_out = '?'; - do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); - } - if( if1_ula.count_out == 13 ) { - /* Here is the output routine */ - if( if1_ula.data_out == 0x00 ) { - if1_ula.data_out = '*'; - do ; while( write( if1_ula.fd_t, "", 1 ) != 1 ); - } - do ; while( write( if1_ula.fd_t, &if1_ula.data_out, 1 ) != 1 ); - if1_ula.count_out = 0; - } - if1_ula.rx = val & 0x01; /* set rx */ - } else { /* if( if1_ula.comms_data == 1 ) SinclairNET :-)*/ - if( if1_ula.s_net_mode == 0 ) { /* if we out bit by bit, do it */ - /* Here is the output routine */ - -/* OK, examining the schematics of if1 and the disassembly of if1 ROM, I - see that the Q1 and Q2 transistors negate the RX DATA signal, and the - floating state of the net wire is the ~0V level, the forced is the ~3V. - The if1 software send complemented data and read straight data. -*/ - if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set rx */ - lseek( if1_ula.fd_net, 0, SEEK_SET ); /* we save only the state of the wire*/ - do ; while( write( if1_ula.fd_net, &if1_ula.net, 1 ) == -1 ); -#ifdef HAVE_FSYNC - fsync( if1_ula.fd_net ); -#endif /* #ifdef HAVE_FSYNC */ -#ifdef IF1_DEBUG_NET - fprintf( stderr, "Send SinclairNET: %d\n", if1_ula.net ); -#endif - } else { /* if( if1_ula.s_net_mode == 0 ) if we out byte by byte, do it */ - if( if1_ula.net_state >= 0x0200 && if1_ula.net_state < 0x0208 ) { - if1_ula.net_state++; - if1_ula.net_data <<= 1; - if1_ula.net_data |= ( val & 0x01 ) ? 0 : 1; - } else if( if1_ula.net_state == 0x0208 ) { - if1_ula.net_data &= 0xff; - if1_ula.net_state++; /* OK, now we get data bytes... */ - -/* lseek( if1_ula.fd_net, 0, SEEK_SET ); start a packet */ - /* first we send the station number */ - do ; while( write( if1_ula.fd_net, &if1_ula.net_data, 1 ) == -1 ); -#ifdef HAVE_FSYNC - fsync( if1_ula.fd_net ); -#endif /* #ifdef HAVE_FSYNC */ -#ifdef IF1_DEBUG_NET - fprintf( stderr, "SC-OUT send network number: %d\n", - if1_ula.net_data ^ 0xff ); -#endif - } else if( if1_ula.net_state > 192 && if1_ula.net_state < 0x0200 && - ( ( val & 0x01 ) == 0 ) ) { - /* NET-STATE ask as many times.... and now send a 0 */ -/* if1_ula.net = 1; */ - if1_ula.net_state = 0x0200; /* Send the station number */ - } - if1_ula.net = ( val & 0x01 ) ? 0 : 1; /* set net wire? */ - } - } - microdrives_restart(); -} - -void -if1_port_out( libspectrum_word port GCC_UNUSED, libspectrum_byte val ) -{ - if( !if1_active ) return; - -#ifdef IF1_DEBUG_NET_1 - fprintf( stderr, "In if1_port_out( %%%d%d%d%d%d%d%d%d => 0x%04x ).\n", - !!(val & 128), !!(val & 64), !!(val & 32), !!(val & 16), - !!(val & 8), !!(val & 4), !!(val & 2), !!(val & 1), port); -#endif - - switch( decode_port( port ) ) { - case PORT_MDR: port_mdr_out( val ); break; - case PORT_CTR: port_ctr_out( val ); break; - case PORT_NET: port_net_out( val ); break; - case PORT_UNKNOWN: break; - } -} - -static void -increment_head( int m ) -{ - microdrive[m].head_pos++; - if( microdrive[m].head_pos >= - libspectrum_microdrive_cartridge_len( microdrive[m].cartridge ) * - LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) - microdrive[m].head_pos = 0; -} - -static void -microdrives_restart( void ) -{ - int m; - - for( m = 0; m < 8; m++ ) { - while( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != 0 && - ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) != LIBSPECTRUM_MICRODRIVE_HEAD_LEN ) - increment_head( m ); /* put head in the start of a block */ - - microdrive[m].transfered = 0; /* reset current number of bytes written */ - - if( ( microdrive[m].head_pos % LIBSPECTRUM_MICRODRIVE_BLOCK_LEN ) == 0 ) { - microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN; /* up to 15 bytes for header blocks */ - } else { - microdrive[m].max_bytes = LIBSPECTRUM_MICRODRIVE_HEAD_LEN + LIBSPECTRUM_MICRODRIVE_DATA_LEN + 1; /* up to 528 bytes for data blocks */ - } - } -} - -void -if1_mdr_writeprotect( int drive, int wrprot ) -{ - libspectrum_microdrive_set_write_protect( microdrive[drive].cartridge, - wrprot ? 1 : 0 ); - microdrive[drive].modified = 1; - - update_menu( UMENU_MDRV1 + drive ); -} - -static void -if1_mdr_new( microdrive_t *mdr ) -{ - libspectrum_byte len; - long int i; - - mdr->filename = NULL; - if( settings_current.mdr_random_len ) { /* Random length */ - len = 171 + ( ( rand() >> 2 ) + ( rand() >> 2 ) + - ( rand() >> 2 ) + ( rand() >> 2 ) ) - / rnd_factor; - } else - len = settings_current.mdr_len = settings_current.mdr_len < 10 ? 10 : - settings_current.mdr_len > LIBSPECTRUM_MICRODRIVE_BLOCK_MAX ? LIBSPECTRUM_MICRODRIVE_BLOCK_MAX : settings_current.mdr_len; - - /* Erase the entire cartridge */ - libspectrum_microdrive_set_cartridge_len( mdr->cartridge, len ); - - for( i = 0; i < len * LIBSPECTRUM_MICRODRIVE_BLOCK_LEN; i++ ) - libspectrum_microdrive_set_data( mdr->cartridge, i, 0xff ); - - for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); - i > 0; i-- ) - mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_NO; - - /* but don't write-protect */ - libspectrum_microdrive_set_write_protect( mdr->cartridge, 0 ); - - mdr->inserted = 1; - mdr->modified = 1; - -} - -int -if1_mdr_insert( int which, const char *filename ) -{ - microdrive_t *mdr; - int m, i; - - if( which == -1 ) { /* find an empty one */ - for( m = 0; m < 8; m++ ) { - if( !microdrive[m].inserted ) { - which = m; - break; - } - } - } - - if( which == -1 ) { - ui_error( UI_ERROR_ERROR, - "Cannot insert cartridge '%s', all Microdrives in use", - filename ); - return 1; - } - - if( which >= 8 ) { - ui_error( UI_ERROR_ERROR, "if1_mdr_insert: unknown drive %d", which ); - return 1; - } - - mdr = µdrive[ which ]; - - /* Eject any cartridge already in the drive */ - if( mdr->inserted ) { - /* Abort the insert if we want to keep the current cartridge */ - if( if1_mdr_eject( which, 0 ) ) return 0; - } - - if( filename == NULL ) { /* insert new unformatted cartridge */ - if1_mdr_new( mdr ); - update_menu( UMENU_MDRV1 + which ); - return 0; - } - - if( utils_read_file( filename, &mdr->file ) ) { - ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); - return 1; - } - - if( libspectrum_microdrive_mdr_read( mdr->cartridge, mdr->file.buffer, - mdr->file.length ) ) { - utils_close_file( &mdr->file ); - ui_error( UI_ERROR_ERROR, "Failed to open cartridge image" ); - return 1; - } - - if( utils_close_file( &mdr->file ) ) return 1; - - mdr->inserted = 1; - mdr->modified = 0; - mdr->filename = strdup( filename ); - /* we assume formatted cartridges */ - for( i = libspectrum_microdrive_cartridge_len( mdr->cartridge ); - i > 0; i-- ) - mdr->pream[255 + i] = mdr->pream[i-1] = SYNC_OK; - - update_menu( UMENU_MDRV1 + which ); - - return 0; -} - -int -if1_mdr_eject( int which, int saveas ) -{ - microdrive_t *mdr; - - if( which >= 8 ) - return 1; - - mdr = µdrive[ which ]; - - if( !mdr->inserted ) - return 0; - - if( saveas ) { /* 1 -> save as.., 2 -> save */ - - if( mdr->filename == NULL ) saveas = 1; - if( ui_mdr_write( which, 2 - saveas ) ) return 1; - mdr->modified = 0; - return 0; - - } else { - - if( mdr->modified ) { - - ui_confirm_save_t confirm = ui_confirm_save( - "Cartridge in Microdrive %i has been modified.\n" - "Do you want to save it?", - which + 1 - ); - - switch( confirm ) { - - case UI_CONFIRM_SAVE_SAVE: - if( if1_mdr_eject( which, 2 ) ) return 1; /* first save */ - break; - - case UI_CONFIRM_SAVE_DONTSAVE: break; - case UI_CONFIRM_SAVE_CANCEL: return 1; - - } - } - } - - mdr->inserted = 0; - if( mdr->filename != NULL ) { - free( mdr->filename ); - mdr->filename = NULL; - } - - update_menu( UMENU_MDRV1 + which ); - return 0; -} - -int -if1_mdr_write( int which, const char *filename ) -{ - microdrive_t *mdr = µdrive[which]; - - libspectrum_microdrive_mdr_write( mdr->cartridge, &mdr->file.buffer, - &mdr->file.length ); - - if( filename == NULL ) filename = mdr->filename; /* Write over the original file */ - - if( utils_write_file( filename, mdr->file.buffer, mdr->file.length ) ) - return 1; - - if( mdr->filename && strcmp( filename, mdr->filename ) ) { - free( mdr->filename ); - mdr->filename = strdup( filename ); - } - return 0; -} - -#ifndef O_NONBLOCK -#define O_NONBLOCK FNDELAY -#endif - -void -if1_plug( const char *filename, int what ) -{ -#ifdef WIN32 - ui_error( UI_ERROR_ERROR, "Not yet implemented on Win32" ); - return; -#else - int fd = -1; - - switch( what ) { - case 1: - if( if1_ula.fd_r >= 0 ) - close( if1_ula.fd_r ); - fd = if1_ula.fd_r = open( filename, O_RDWR | O_NONBLOCK ); - if( fcntl( fd, F_SETFL, O_RDONLY | O_NONBLOCK ) ) - ui_error( UI_ERROR_ERROR, "Cannot set O_RDONLY on '%s': %s", - filename, strerror( errno ) ); - if1_ula.rs232_buffer = 0x100; /* buffer is empty */ - break; - case 2: - if( if1_ula.fd_t >= 0 ) - close( if1_ula.fd_t ); - fd = if1_ula.fd_t = open( filename, O_RDWR | O_NONBLOCK ); - if( fcntl( fd, F_SETFL, O_WRONLY | O_NONBLOCK ) ) - ui_error( UI_ERROR_ERROR, "Cannot set O_WRONLY on '%s': %s", - filename, strerror( errno ) ); - break; - case 3: - if( if1_ula.fd_net >= 0 ) - close( if1_ula.fd_net ); - fd = if1_ula.fd_net = open( filename, O_RDWR | O_NONBLOCK ); - break; - } - - /* rs232_handshake == 0 -> we assume DTR(DSR) always... [truncated message content] |
From: <fr...@us...> - 2011-11-19 11:19:36
|
Revision: 679 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=679&view=rev Author: fredm Date: 2011-11-19 11:19:30 +0000 (Sat, 19 Nov 2011) Log Message: ----------- Track multiple symbol and shift presses arising from mutiple extended keys being pressed at once so that symbol and shift are only released when the last shifted key is released (fixes bug #3435102, thanks, Simon Owen). Modified Paths: -------------- trunk/fuse/input.c Modified: trunk/fuse/input.c =================================================================== --- trunk/fuse/input.c 2011-11-05 05:34:36 UTC (rev 678) +++ trunk/fuse/input.c 2011-11-19 11:19:30 UTC (rev 679) @@ -61,6 +61,9 @@ } +static int key_symbol_count = 0; +static int key_caps_count = 0; + static int keypress( const input_event_key_t *event ) { @@ -101,6 +104,22 @@ ptr = keyboard_get_spectrum_keys( event->spectrum_key ); if( ptr ) { + if ( ptr->key1 == KEYBOARD_Symbol ) { + key_symbol_count++; + } + + if ( ptr->key2 == KEYBOARD_Symbol ) { + key_symbol_count++; + } + + if ( ptr->key1 == KEYBOARD_Caps ) { + key_caps_count++; + } + + if ( ptr->key2 == KEYBOARD_Caps ) { + key_caps_count++; + } + keyboard_press( ptr->key1 ); keyboard_press( ptr->key2 ); } @@ -110,6 +129,24 @@ return 0; } +static void +keydorelease( const keyboard_key_name key ) +{ + if ( key == KEYBOARD_Symbol ) { + key_symbol_count--; + if( key_symbol_count == 0 ) { + keyboard_release( key ); + } + } else if ( key == KEYBOARD_Caps ) { + key_caps_count--; + if( key_caps_count == 0 ) { + keyboard_release( key ); + } + } else { + keyboard_release( key ); + } +} + static int keyrelease( const input_event_key_t *event ) { @@ -118,8 +155,8 @@ ptr = keyboard_get_spectrum_keys( event->spectrum_key ); if( ptr ) { - keyboard_release( ptr->key1 ); - keyboard_release( ptr->key2 ); + keydorelease( ptr->key1 ); + keydorelease( ptr->key2 ); } /* Joystick emulation via keyboard keys */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-11-05 05:34:42
|
Revision: 678 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=678&view=rev Author: fredm Date: 2011-11-05 05:34:36 +0000 (Sat, 05 Nov 2011) Log Message: ----------- Allow cursor keys to be pressed simulaneously (fixes bug #3431251, thanks Simon Owen). Modified Paths: -------------- trunk/fuse/fusepb/models/Emulator.m Modified: trunk/fuse/fusepb/models/Emulator.m =================================================================== --- trunk/fuse/fusepb/models/Emulator.m 2011-10-29 12:38:54 UTC (rev 677) +++ trunk/fuse/fusepb/models/Emulator.m 2011-11-05 05:34:36 UTC (rev 678) @@ -744,10 +744,6 @@ -(BOOL) isSpecial:(input_key)type { switch( type ) { - case INPUT_KEY_Up: - case INPUT_KEY_Down: - case INPUT_KEY_Left: - case INPUT_KEY_Right: case INPUT_KEY_BackSpace: case INPUT_KEY_minus: case INPUT_KEY_underscore: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-10-29 12:39:00
|
Revision: 677 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=677&view=rev Author: fredm Date: 2011-10-29 12:38:54 +0000 (Sat, 29 Oct 2011) Log Message: ----------- Fix tag name. Added Paths: ----------- tags/Release-1_0_0_1a/ Removed Paths: ------------- tags/Release-1_0_0_1/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-10-29 12:25:53
|
Revision: 676 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=676&view=rev Author: fredm Date: 2011-10-29 12:25:48 +0000 (Sat, 29 Oct 2011) Log Message: ----------- Tag 1.0.0.1 release. Added Paths: ----------- tags/Release-1_0_0_1/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-10-29 12:17:33
|
Revision: 675 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=675&view=rev Author: fredm Date: 2011-10-29 12:17:26 +0000 (Sat, 29 Oct 2011) Log Message: ----------- Update for Fuse 1.0.0.1 Modified Paths: -------------- trunk/fuse/fusepb/resources/Fuse Help/Fuse Help.helpindex trunk/fuse/fusepb/resources/Fuse Help/html/divide.html trunk/fuse/fusepb/resources/Fuse Help/html/machine.html trunk/fuse/fusepb/resources/Fuse Help/html/menus.html trunk/fuse/fusepb/resources/Fuse Help/html/opus.html trunk/fuse/fusepb/resources/Fuse Help/html/printer.html trunk/fuse/fusepb/resources/Fuse Help/html/roms.html trunk/fuse/fusepb/resources/Fuse Help/html/zxatasp.html Modified: trunk/fuse/fusepb/resources/Fuse Help/Fuse Help.helpindex =================================================================== (Binary files differ) Modified: trunk/fuse/fusepb/resources/Fuse Help/html/divide.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/divide.html 2011-10-29 12:16:04 UTC (rev 674) +++ trunk/fuse/fusepb/resources/Fuse Help/html/divide.html 2011-10-29 12:17:26 UTC (rev 675) @@ -1,21 +1,26 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> <head> -<!-- AppleSegStart="DivIDE" --> + +<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><!-- AppleSegStart="DivIDE" --> <title>DivIDE</title> </head> +<body> <font face="Lucida Grande,Helvetica,Arial"><a name="DivIDE"></a><!-- AppleSegDescription="This section describes the DivIDE interface emulation in Fuse." --></font> <div class="refsect1" xml:lang="en" lang="en"> <h2><font face="Lucida Grande,Helvetica,Arial">DivIDE</font></h2> </div> <p> <font face="Lucida Grande,Helvetica,Arial">The DivIDE is another IDE -interface for the Spectrum, of which full details can be found at -http://baze.au.com/divide/. The interface can be activated via the </font><font - face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>DivIDE +interface for the Spectrum, of which full details can be found <a + href="http://baze.au.com/divide/">here</a>. The interface can be +activated via the </font><font face="Lucida Grande,Helvetica,Arial"><span + class="emphasis"><em>DivIDE interface</em></span></font><font face="Lucida Grande,Helvetica,Arial"> option on the </font><font face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>Preferences, -Peripherals...</em></span></font><font - face="Lucida Grande,Helvetica,Arial"> dialog, and the state of its +Peripherals</em></span></font><font face="Lucida Grande,Helvetica,Arial"> +dialog, and the state of its write protect jumper controlled via the </font><font face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>DivIDE write protect option</em></span></font><font @@ -23,3 +28,5 @@ DivIDE, you'll probably want one of the firmwares available from the DivIDE homepage.</font></p> <!-- AppleSegEnd --> +</body> +</html> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/machine.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/machine.html 2011-10-29 12:16:04 UTC (rev 674) +++ trunk/fuse/fusepb/resources/Fuse Help/html/machine.html 2011-10-29 12:17:26 UTC (rev 675) @@ -65,7 +65,8 @@ +3e</em></font></span> <font face="Lucida Grande,Helvetica,Arial">A +3 with modified ROMs allowing access to IDE hard disks via the simple 8-bit interface, -as activated from the <span class="emphasis"><em>Options, +as activated from the <span style="font-style: italic;">Preferences</span><span + class="emphasis"><em>, Peripherals</em></span> dialog. See the <a href="http://www.zxplus3e.plus.com/">http://www.zxplus3e.plus.com/</a> for more details.<br> @@ -93,7 +94,12 @@ era Pentagon-128K with the optional AY sound chip and the integrated Beta 128 disk interface, and is the version of the machine most often emulated. More technical details can be found at -<a href="http://www.worldofspectrum.org/rusfaq/index.html">http://www.worldofspectrum.org/rusfaq/index.html</a>.</font></p> +<a href="http://www.worldofspectrum.org/rusfaq/index.html">http://www.worldofspectrum.org/rusfaq/index.html</a>. +<span style="font-weight: bold;">Note:</span> as there is no explicit +permission to distribute the ROM files for the Pentagon machines they +must be downloaded separately and configured for use with Fuse in the </font><font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>Preferences, +ROM</em></span> dialog.</font></p> <p style="margin-left: 40px;"><span class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><em>Pentagon 512K</em></font></span> <span class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><em>Pentagon @@ -105,9 +111,17 @@ Russian Spectrum clones -which incorporate more +which +incorporate more memory and the "Mr Gluk Reset Service" ROM offering a more powerful -firmware.</font></p> +firmware.</font><font face="Lucida Grande,Helvetica,Arial"> </font><font + face="Lucida Grande,Helvetica,Arial"><span style="font-weight: bold;">Note:</span> +a</font><font face="Lucida Grande,Helvetica,Arial">s there is no +explicit +permission to distribute the ROM files for the Pentagon machines they +must be downloaded separately and configured for use with Fuse in the </font><font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>Preferences, +ROM</em></span> dialog.</font></p> <p style="margin-left: 40px;"><span class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><em>Scorpion ZS 256</em></font></span> <font face="Lucida Grande,Helvetica,Arial">Another @@ -119,7 +133,8 @@ Some details can -be found at +be +found at <a href="http://www.worldofspectrum.org/rusfaq/index.html">http://www.worldofspectrum.org/rusfaq/index.html</a>, like all @@ -128,11 +143,20 @@ clones they have -built in 3.5" disk drives, +built +in 3.5" disk drives, accessed via the Betadisk interface and TR-DOS (the Technology Research Disk Operating System). The most important distinction from the Pentagon -128k and similar machines is the display timing details.</font></p> +128k and similar machines is the display timing details.</font><font + face="Lucida Grande,Helvetica,Arial"> </font><font + face="Lucida Grande,Helvetica,Arial"><span style="font-weight: bold;">Note:</span> +a</font><font face="Lucida Grande,Helvetica,Arial">s there is no +explicit +permission to distribute the ROM files for the Scorpion machine they +must be downloaded separately and configured for use with Fuse in the </font><font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>Preferences, +ROM</em></span> dialog.</font></p> <p style="margin-left: 40px;"> <span class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><em>Spectrum SE</em></font></span> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/menus.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/menus.html 2011-10-29 12:16:04 UTC (rev 674) +++ trunk/fuse/fusepb/resources/Fuse Help/html/menus.html 2011-10-29 12:17:26 UTC (rev 675) @@ -327,7 +327,10 @@ virtual-tape file to load from. If <span class="emphasis"><em>Auto-load tapes/disks</em></span> is set -in the General Options dialog (as it is by default), the tape will +in the </font><font face="Lucida Grande,Helvetica,Arial"><span + class="emphasis"><em>Preferences, +General</em></span></font><font face="Lucida Grande,Helvetica,Arial"> +dialog (as it is by default), the tape will begin loading. Otherwise, you have to start the load in the emulated machine (with LOAD "" or the 128's Tape Loader option, though you may need to reset first).</font></p> @@ -336,7 +339,10 @@ face="Lucida Grande,Helvetica,Arial">To <span class="emphasis"><em>guarantee</em></span> that TZX files will load properly, you should select the file, make sure -tape-loading traps are disabled in the General Options dialog, then +tape-loading traps are disabled in the </font><font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>Preferences, +General</em></span></font><font face="Lucida Grande,Helvetica,Arial"> +dialog, then select the <span class="emphasis"><em>Tape, Play</em></span> option. That said, most TZXs will work with tape-loading traps enabled (often quickly loading partway, then loading the rest @@ -355,7 +361,10 @@ face="Lucida Grande,Helvetica,Arial">Start playing the TAP or TZX file, if required. (Choosing the option again pauses playback, and a further press resumes). To explain - if tape-loading traps -have been disabled (in the General Options dialog), starting the +have been disabled (in the </font><font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>Preferences, +General</em></span></font><font face="Lucida Grande,Helvetica,Arial"> +dialog), starting the loading process in the emulated machine isn't enough. You also have to `press play', so to speak :-), and this is how you do that. You may also need to `press play' like this in certain other @@ -509,7 +518,8 @@ class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><em>Microdrive 1 > -Save as...</em></font></span></td> +Save +as...</em></font></span></td> <td style="vertical-align: top;"><br> </td> <td style="vertical-align: top;"><font @@ -625,7 +635,8 @@ <span class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><em>Drive A: > -Save as...</em></font></span></td> +Save +as...</em></font></span></td> <td style="vertical-align: top;"><br> </td> <td style="vertical-align: top;"><font Modified: trunk/fuse/fusepb/resources/Fuse Help/html/opus.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/opus.html 2011-10-29 12:16:04 UTC (rev 674) +++ trunk/fuse/fusepb/resources/Fuse Help/html/opus.html 2011-10-29 12:17:26 UTC (rev 675) @@ -1,8 +1,8 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> - -<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> + <meta http-equiv="content-type" + content="text/html; charset=ISO-8859-1"> <!-- AppleSegStart="Opus Discovery Emulation" --> <title>Opus Discovery Emulation</title> </head> @@ -28,6 +28,17 @@ 16K, 48K, 128K, TC2048 and +2 (not +2A) emulation.<br> </font></p> <p><font face="Lucida Grande,Helvetica,Arial">To access disks, use the -same syntax as Interface I and Microdrives.</font></p> +same syntax as Interface I and Microdrives.<br> +</font></p> +<h3><font face="Lucida Grande,Helvetica,Arial">ROM File<br> +</font></h3> +<p><font face="Lucida Grande,Helvetica,Arial">The ROM file for the Opus +</font><font face="Lucida Grande,Helvetica,Arial">Discovery is not +freely distributable and so is not included in this package. In order +to use the Opus Discovery emulation you will need to download a copy of +the ROM file and use the </font><font + face="Lucida Grande,Helvetica,Arial"><span class="emphasis"><em>Preferences, +ROM</em></span> dialog to configure the file for use with Fuse.<br> +</font></p> </body> </html> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/printer.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/printer.html 2011-10-29 12:16:04 UTC (rev 674) +++ trunk/fuse/fusepb/resources/Fuse Help/html/printer.html 2011-10-29 12:17:26 UTC (rev 675) @@ -1,7 +1,11 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> <head> -<!-- AppleSegStart="Printer Emulation" --> + +<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><!-- AppleSegStart="Printer Emulation" --> <title>Printer Emulation</title> </head> +<body> <font face="Lucida Grande,Helvetica,Arial"><a name="Printer Emulation"></a><!-- AppleSegDescription="This section describes the printer emulation in Fuse." --></font> <div class="refsect1" xml:lang="en" lang="en"> <h2><font face="Lucida Grande,Helvetica,Arial">Printer @@ -16,7 +20,9 @@ <div class="variablelist"> <dl> <dt> <span class="term"><font face="Lucida Grande,Helvetica,Arial"><em>16</em>, + <span class="emphasis"><em>48</em></span>, <span class="emphasis"><em>TC2048</em></span>, + <span class="emphasis"><em>TC2068</em></span></font></span></dt> <dd> <p><font face="Lucida Grande,Helvetica,Arial"><em>ZX @@ -49,9 +55,9 @@ <span class="emphasis"><em>printout.txt</em></span> for text output, and <span class="emphasis"><em>printout.pbm</em></span> for graphics (PBM images are supported by most image viewers and -converters). These names can be changed with the -<span class="emphasis"><em>Options, Printer...</em></span> menu -option. While the ZX Printer can +converters). These names can be changed with the <span + style="font-style: italic;"></span><span class="emphasis"><em>Preferences, +Peripherals</em></span> dialog. While the ZX Printer can <span class="emphasis"><em>only</em></span> output graphically, simulated text output is generated at the same time using a crude sort of OCR based on the current character set (a bit like using @@ -69,3 +75,5 @@ appended to.</font></p> <!-- AppleSegEnd --> +</body> +</html> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/roms.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/roms.html 2011-10-29 12:16:04 UTC (rev 674) +++ trunk/fuse/fusepb/resources/Fuse Help/html/roms.html 2011-10-29 12:17:26 UTC (rev 675) @@ -14,7 +14,73 @@ available for each Spectrum variant emulated by Fuse which allows selection of the ROM(s) used by that machine. Simply select the ROM you wish to use, and then reset the Spectrum for the change to take -effect.</font><!-- AppleSegEnd --> -</p> +effect.<br> +</font></p> +<h3><font face="Lucida Grande,Helvetica,Arial">Copyrights</font></h3> +<font face="Lucida Grande,Helvetica,Arial">Note that the ROM files +distributed with this emulator are <span style="font-style: italic;">not</span> +covered by the GNU GPL.<br> +<br> +The following licenses apply:<br> +<br> +128-0.rom<br> +128-1.rom<br> +48.rom<br> +plus2-0.rom<br> +plus2-1.rom<br> +plus3-0.rom<br> +plus3-1.rom<br> +plus3-2.rom<br> +plus3-3.rom<br> +tc2048.rom<br> +<br> +<div style="margin-left: 40px;">These are copyright Amstrad, who allow +distribution of the ROMs but +retain the copyright. You may not sell the ROMs or embed the ROMs in +hardware, although it is allowed to sell a product which contains the +ROMs, so long as the charge is being made for the product, not for the +ROMs themselves. See <a + href="http://groups.google.com/group/comp.sys.amstrad.8bit/msg/c092cc4d4943131e">here</a> +for more details.<br> +</div> +<br> +tc2068-0.rom<br> +tc2068-1.rom<br> +<br> +<div style="margin-left: 40px;">These are derived from Amstrad code, so +the above statement applies. +The modifications made by Timex are in the public domain.<br> +</div> +<br> +plus3e-0.rom<br> +plus3e-1.rom<br> +plus3e-2.rom<br> +plus3e-3.rom<br> +<br> +<div style="margin-left: 40px;">These are derived from Amstrad code, so +the above statement applies. +The modifications are copyright Garry Lancaster.<br> +<br> +</div> +se-0.rom<br> +se-1.rom<br> +<br> +<div style="margin-left: 40px;">These are derived from Amstrad code, so +the above statement applies. +The modifications are by Andrew Owen and are subject to the same +conditions.<br> +<br> +</div> +plusd.rom<br> +<br> +<div style="margin-left: 40px;">This is copyright Datel +Microelectronics, who allow distribution. See <a + href="http://www.shadowmagic.org.uk/spectrum/datel.html">here</a> for +details.<br> +</div> +<br> +</font> +<p><!-- AppleSegEnd --></p> +<br> </body> </html> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/zxatasp.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/zxatasp.html 2011-10-29 12:16:04 UTC (rev 674) +++ trunk/fuse/fusepb/resources/Fuse Help/html/zxatasp.html 2011-10-29 12:17:26 UTC (rev 675) @@ -1,8 +1,9 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> - -<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><!-- AppleSegStart="ZXATASP and ZXCF" --> + <meta http-equiv="content-type" + content="text/html; charset=ISO-8859-1"> +<!-- AppleSegStart="ZXATASP and ZXCF" --> <title>ZXATASP and ZXCF</title> </head> <body> @@ -18,7 +19,8 @@ Spectrum. More details on both are available from Sami's homepage, <a href="http://user.tninet.se/%7Evjz762w/">http://user.tninet.se/~vjz762w/</a>, but -a brief overview is given +a +brief overview is given here.</font></p> <p> <font face="Lucida Grande,Helvetica,Arial">The real ZXATASP comes with @@ -33,8 +35,9 @@ <p> <font face="Lucida Grande,Helvetica,Arial">To activate the ZXATASP, simply select the ZXATASP interface option -from the <span class="emphasis"><em>Options, -Peripherals...</em></span> dialog. The state of the upload and +from the <span style="font-style: italic;">Preferences</span><span + class="emphasis"><em>, +Peripherals</em></span> dialog. The state of the upload and write protect jumpers is then controlled by the ZXATASP upload and ZXATASP write protect options. Similarly, the ZXCF is controlled by the ZXCF interface and ZXCF upload options (the ZXCF write protect This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-10-29 12:16:10
|
Revision: 674 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=674&view=rev Author: fredm Date: 2011-10-29 12:16:04 +0000 (Sat, 29 Oct 2011) Log Message: ----------- Update version number. Modified Paths: -------------- trunk/fuse/fusepb/English.lproj/InfoPlist.strings Modified: trunk/fuse/fusepb/English.lproj/InfoPlist.strings =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-10-29 12:15:27
|
Revision: 673 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=673&view=rev Author: fredm Date: 2011-10-29 12:15:21 +0000 (Sat, 29 Oct 2011) Log Message: ----------- Fix typo. Modified Paths: -------------- trunk/fuse/fusepb/Credits.html Modified: trunk/fuse/fusepb/Credits.html =================================================================== --- trunk/fuse/fusepb/Credits.html 2011-04-04 11:56:05 UTC (rev 672) +++ trunk/fuse/fusepb/Credits.html 2011-10-29 12:15:21 UTC (rev 673) @@ -1,4 +1,4 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" @@ -7,7 +7,8 @@ </head> <body> <p class="MsoNormal"><span style="font-family: Helvetica;" lang="EN-US">Fuse -for Mac OS X has a home page at:</span></p> +for +Mac OS X has a home page at:</span></p> <p class="MsoNormal"><span style="font-family: Helvetica;" lang="EN-US"><a href="http://fuse-for-macosx.sourceforge.net/">http://fuse-for-macosx.sourceforge.net/</a><br> </span><br> @@ -20,11 +21,13 @@ If you're interested in more general Speccy related discussions, visit the <a href="http://www.worldofspectrum.org/forums/">World of Spectrum Forums</a> or the Usenet group '<a href="news:comp.sys.sinclair">comp.sys.sinclair</a>', -but do read the <a href="http://www.worldofspectrum.org/faq/index.html">FAQ</a> +but +do read the <a href="http://www.worldofspectrum.org/faq/index.html">FAQ</a> first!<br> </span></p> <p class="MsoNormal"><span style="font-family: Helvetica;" lang="EN-US">Fuse -has been brought to you by:</span></p> +has +been brought to you by:</span></p> <ul> <li><span style="font-family: Helvetica;" lang="EN-US">Matan Ziv-Av: SVGAlib and framebuffer user interfaces, the glib replacement code, @@ -118,9 +121,10 @@ Kendall: everything else.</span></li> </ul> <p class="MsoNormal"><span style="font-family: Helvetica;" lang="EN-US">This -program is free software; you can redistribute it and/or modify it +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 Fuoundation; either version 2 of the License, or +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 WARRENTY; without even the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-04-04 11:56:11
|
Revision: 672 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=672&view=rev Author: fredm Date: 2011-04-04 11:56:05 +0000 (Mon, 04 Apr 2011) Log Message: ----------- Merge in vendor revision 4234 change to handle missing peripheral ROM files (patch #3147415). Revision Links: -------------- http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=4234&view=rev Modified Paths: -------------- trunk/fuse/disk/beta.c trunk/fuse/disk/opus.c trunk/fuse/disk/plusd.c trunk/fuse/hacking/ChangeLog trunk/fuse/if1.c trunk/fuse/if2.c Modified: trunk/fuse/disk/beta.c =================================================================== --- trunk/fuse/disk/beta.c 2011-04-04 11:54:04 UTC (rev 671) +++ trunk/fuse/disk/beta.c 2011-04-04 11:56:05 UTC (rev 672) @@ -205,9 +205,15 @@ } if( !beta_builtin ) { - machine_load_rom_bank( beta_memory_map_romcs, 0, 0, - settings_current.rom_beta128, - settings_default.rom_beta128, 0x4000 ); + if( machine_load_rom_bank( beta_memory_map_romcs, 0, 0, + settings_current.rom_beta128, + settings_default.rom_beta128, 0x4000 ) ) { + beta_active = 0; + beta_available = 0; + periph_beta128_active = 0; + settings_current.beta128 = 0; + return; + } beta_memory_map_romcs[ 0 ].writable = 0; beta_memory_map_romcs[ 1 ].writable = 0; Modified: trunk/fuse/disk/opus.c =================================================================== --- trunk/fuse/disk/opus.c 2011-04-04 11:54:04 UTC (rev 671) +++ trunk/fuse/disk/opus.c 2011-04-04 11:56:05 UTC (rev 672) @@ -162,9 +162,13 @@ if( !periph_opus_active ) return; - machine_load_rom_bank( opus_memory_map_romcs, 0, 0, - settings_current.rom_opus, - settings_default.rom_opus, 0x2000 ); + if( machine_load_rom_bank( opus_memory_map_romcs, 0, 0, + settings_current.rom_opus, + settings_default.rom_opus, 0x2000 ) ) { + settings_current.opus = 0; + periph_opus_active = 0; + return; + } opus_memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL; Modified: trunk/fuse/disk/plusd.c =================================================================== --- trunk/fuse/disk/plusd.c 2011-04-04 11:54:04 UTC (rev 671) +++ trunk/fuse/disk/plusd.c 2011-04-04 11:56:05 UTC (rev 672) @@ -174,9 +174,13 @@ if( !periph_plusd_active ) return; - machine_load_rom_bank( plusd_memory_map_romcs, 0, 0, - settings_current.rom_plusd, - settings_default.rom_plusd, 0x2000 ); + if( machine_load_rom_bank( plusd_memory_map_romcs, 0, 0, + settings_current.rom_plusd, + settings_default.rom_plusd, 0x2000 ) ) { + settings_current.plusd = 0; + periph_plusd_active = 0; + return; + } plusd_memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL; Modified: trunk/fuse/hacking/ChangeLog =================================================================== --- trunk/fuse/hacking/ChangeLog 2011-04-04 11:54:04 UTC (rev 671) +++ trunk/fuse/hacking/ChangeLog 2011-04-04 11:56:05 UTC (rev 672) @@ -3373,8 +3373,10 @@ system (fixes bugs #3124787 and #3124788) (rkd77). 20101216 ChangeLog,README,configure.in,man/fuse.1: update for 1.0.0 release. 20101217 keysyms.pl: fix SVGAlib compilation (rkd77). -20101229 debugger/breakpoint.c: don't free temporary breakpoint until after we have run - it (fixes bug #3084862) (thanks, Chris Cowley) (Fred). +20101229 disk/{beta.c,opus.c,plusd.c},if1.c,if2.c: handle missing peripheral ROM + files (patch #3147415) (Alberto Garcia). +20101229 debugger/breakpoint.c: don't free temporary breakpoint until after we + have run it (fixes bug #3084862) (thanks, Chris Cowley) (Fred). 20101230 debugger/breakpoint.c: stop evaluating breakpoints when we have hit a temporary breakpoint (really fixes bug #3084862) (patch #3142840) (Sergio Baldovi). Modified: trunk/fuse/if1.c =================================================================== --- trunk/fuse/if1.c 2011-04-04 11:54:04 UTC (rev 671) +++ trunk/fuse/if1.c 2011-04-04 11:56:05 UTC (rev 672) @@ -364,10 +364,14 @@ if( !periph_interface1_active ) return; - machine_load_rom_bank( if1_memory_map_romcs, 0, 0, - settings_current.rom_interface_i, - settings_default.rom_interface_i, - MEMORY_PAGE_SIZE ); + if( machine_load_rom_bank( if1_memory_map_romcs, 0, 0, + settings_current.rom_interface_i, + settings_default.rom_interface_i, + MEMORY_PAGE_SIZE ) ) { + settings_current.interface1 = 0; + periph_interface1_active = 0; + return; + } if1_memory_map_romcs[0].source = MEMORY_SOURCE_PERIPHERAL; Modified: trunk/fuse/if2.c =================================================================== --- trunk/fuse/if2.c 2011-04-04 11:54:04 UTC (rev 671) +++ trunk/fuse/if2.c 2011-04-04 11:56:05 UTC (rev 672) @@ -121,10 +121,11 @@ if ( !periph_interface2_active ) return; - machine_load_rom_bank( if2_memory_map_romcs, 0, 0, - settings_current.if2_file, - NULL, - 2 * MEMORY_PAGE_SIZE ); + if ( machine_load_rom_bank( if2_memory_map_romcs, 0, 0, + settings_current.if2_file, + NULL, + 2 * MEMORY_PAGE_SIZE ) ) + return; if2_memory_map_romcs[0].source = if2_memory_map_romcs[1].source = MEMORY_SOURCE_CARTRIDGE; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-04-04 11:54:10
|
Revision: 671 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=671&view=rev Author: fredm Date: 2011-04-04 11:54:04 +0000 (Mon, 04 Apr 2011) Log Message: ----------- Update changelog for 1.0.0.1 and 1.0.0.1a changes. Modified Paths: -------------- trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html Modified: trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html 2011-04-03 11:11:05 UTC (rev 670) +++ trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html 2011-04-04 11:54:04 UTC (rev 671) @@ -13,6 +13,34 @@ <!-- AppleSegStart="What's New In Fuse?" --><a name="What's New In Fuse?" id="What's New In Fuse?"></a><!-- AppleSegDescription="This section describes the changes for version 1.0.0 of the Fuse emulator." --></font><br> <div class="refsect1" xml:lang="en" lang="en"> +<h2><font><font face="Lucida Grande,Helvetica,Arial">What's new in Fuse +For Mac OS X 1.0.0.1a</font></font></h2> +<ul> + <li><font face="Lucida Grande,Helvetica,Arial">New policy:</font></li> + <li + style="list-style-type: none; list-style-image: none; list-style-position: outside;"> + <ul> + <li><font face="Lucida Grande,Helvetica,Arial">Remove all ROMs +for which there isn't explicit permission to distribute (Philip +Kendall). All the affected hardware is still supported, but the ROM +images will need to be obtained elsewhere and then the Fuse preferences +set to refer to these new ROM images. This applies to the following +machines; Pentagon series and Scorpion, and the following interfaces; +Interface I, Opus Discovery, Betadisk.<br> + </font></li> + </ul> + <br> + </li> + <li><font face="Lucida Grande,Helvetica,Arial">Bug fixes:</font></li> + <li + style="list-style-type: none; list-style-image: none; list-style-position: outside;"> + <ul> + <li><font face="Lucida Grande,Helvetica,Arial">Fix temporary +breakpoints in the debugger (Fredrick Meunier, +Sergio Baldovi; thanks, Chris Cowley).</font></li> + </ul> + </li> +</ul> <h2><font face="Lucida Grande,Helvetica,Arial">What's new in Fuse For Mac OS X 1.0.0</font></h2> <ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-04-03 11:11:13
|
Revision: 670 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=670&view=rev Author: fredm Date: 2011-04-03 11:11:05 +0000 (Sun, 03 Apr 2011) Log Message: ----------- Merge in vendor release 1.0.0.1a changes - still need to address handling of missing ROMs. Modified Paths: -------------- trunk/FuseGenerator/config.h trunk/FuseImporter/config.h trunk/fuse/ChangeLog trunk/fuse/README trunk/fuse/configure.in trunk/fuse/debugger/breakpoint.c trunk/fuse/fuse.c trunk/fuse/fusepb/English.lproj/InfoPlist.strings trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj trunk/fuse/fusepb/Info-Fuse.plist trunk/fuse/hacking/ChangeLog trunk/fuse/ide/divide.c trunk/fuse/ide/divide.h trunk/fuse/ide/ide.c trunk/fuse/ide/ide.h trunk/fuse/ide/simpleide.c trunk/fuse/ide/simpleide.h trunk/fuse/ide/zxatasp.c trunk/fuse/ide/zxatasp.h trunk/fuse/ide/zxcf.c trunk/fuse/ide/zxcf.h trunk/fuse/keysyms.pl trunk/fuse/man/fuse.1 trunk/fuse/memory.c trunk/fuse/roms/Makefile.am trunk/fuse/ui/fb/fbdisplay.c trunk/fuse/ui/widget/filesel.c trunk/libspectrum/config.h trunk/libspectrum/libspectrum/ChangeLog trunk/libspectrum/libspectrum/Makefile.am trunk/libspectrum/libspectrum/README trunk/libspectrum/libspectrum/configure.in trunk/libspectrum/libspectrum/doc/libspectrum.txt trunk/libspectrum/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum/test/Makefile.am trunk/libspectrum/libspectrum/warajevo_read.c Added Paths: ----------- trunk/fuse/roms/README.copyright Removed Paths: ------------- trunk/fuse/roms/128p-0.rom trunk/fuse/roms/128p-1.rom trunk/fuse/roms/256s-0.rom trunk/fuse/roms/256s-1.rom trunk/fuse/roms/256s-2.rom trunk/fuse/roms/256s-3.rom trunk/fuse/roms/gluck.rom trunk/fuse/roms/if1-1.rom trunk/fuse/roms/if1-2.rom trunk/fuse/roms/opus.rom trunk/fuse/roms/trdos.rom Property Changed: ---------------- trunk/fuse/ trunk/fuse/fusepb/libspectrum.h trunk/libspectrum/libspectrum/ Modified: trunk/FuseGenerator/config.h =================================================================== --- trunk/FuseGenerator/config.h 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/FuseGenerator/config.h 2011-04-03 11:11:05 UTC (rev 670) @@ -83,7 +83,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "1.0.0" +#define VERSION "1.0.0.1a" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ Modified: trunk/FuseImporter/config.h =================================================================== --- trunk/FuseImporter/config.h 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/FuseImporter/config.h 2011-04-03 11:11:05 UTC (rev 670) @@ -83,7 +83,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "1.0.0" +#define VERSION "1.0.0.1a" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ Property changes on: trunk/fuse ___________________________________________________________________ Modified: svn:mergeinfo - /vendor/fuse-emulator/0.10.0/fuse:556-557 /vendor/fuse-emulator/0.10.0-pre1/fuse:545-546 /vendor/fuse-emulator/current/fuse:530-662 + /vendor/fuse-emulator/0.10.0/fuse:556-557 /vendor/fuse-emulator/0.10.0-pre1/fuse:545-546 /vendor/fuse-emulator/current/fuse:530-667 /vendor/fuse-emulator/fuse-1.0.0a/fuse:668-669 Modified: trunk/fuse/ChangeLog =================================================================== --- trunk/fuse/ChangeLog 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ChangeLog 2011-04-03 11:11:05 UTC (rev 670) @@ -1,3 +1,19 @@ +2011-04-01 Philip Kendall <phi...@sh...> + + * Fuse 1.0.0.1a released. + + * Remove all ROMs for which there isn't explicit permission to + distribute (Philip Kendall). + +2011-01-12 Philip Kendall <phi...@sh...> + + * Fuse 1.0.0.1 released. + + * Fix temporary breakpoints on platforms using replacement Glib + (Fredrick Meunier, Sergio Baldovi; thanks, Chris Cowley) + * Ensure Amiga port can load files (Chris Young) + * Fix SVGAlib compilation (rkd77) + 2010-12-16 Philip Kendall <phi...@sh...> * Fuse 1.0.0 released. @@ -1035,4 +1051,4 @@ * Version 0.1.0 released. -$Id: ChangeLog 4220 2010-12-17 10:54:29Z fredm $ +$Id: ChangeLog 4331 2011-04-01 07:47:06Z pak21 $ Modified: trunk/fuse/README =================================================================== --- trunk/fuse/README 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/README 2011-04-03 11:11:05 UTC (rev 670) @@ -1,5 +1,5 @@ -The Free Unix Spectrum Emulator (Fuse) 1.0.0 -============================================ +The Free Unix Spectrum Emulator (Fuse) 1.0.0.1a +=============================================== Fuse (the Free Unix Spectrum Emulator) was originally, and somewhat unsurprisingly, an emulator of the ZX Spectrum (a popular 1980s home @@ -214,6 +214,6 @@ <http://www.worldofspectrum.org/forums/>. Philip Kendall <phi...@sh...> -16 December 2010 +28 March 2011 -$Id: README 4220 2010-12-17 10:54:29Z fredm $ +$Id: README 4329 2011-03-27 22:26:07Z pak21 $ Modified: trunk/fuse/configure.in =================================================================== --- trunk/fuse/configure.in 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/configure.in 2011-04-03 11:11:05 UTC (rev 670) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Id: configure.in 4220 2010-12-17 10:54:29Z fredm $ +dnl $Id: configure.in 4329 2011-03-27 22:26:07Z 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 @@ -23,7 +23,7 @@ AM_CONFIG_HEADER(config.h) AC_CANONICAL_SYSTEM -define(FUSE_VERSION, [1.0.0]) +define(FUSE_VERSION, [1.0.0.1a]) dnl Use automake to produce `Makefile.in' AM_INIT_AUTOMAKE(fuse, FUSE_VERSION) Modified: trunk/fuse/debugger/breakpoint.c =================================================================== --- trunk/fuse/debugger/breakpoint.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/debugger/breakpoint.c 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* breakpoint.c: a debugger breakpoint Copyright (c) 2002-2008 Philip Kendall - $Id: breakpoint.c 3685 2008-06-21 12:37:24Z pak21 $ + $Id: breakpoint.c 4239 2011-01-01 15:41:13Z 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 @@ -237,19 +237,26 @@ debugger_check( debugger_breakpoint_type type, libspectrum_dword value ) { GSList *ptr; debugger_breakpoint *bp; + GSList *ptr_next; switch( debugger_mode ) { case DEBUGGER_MODE_INACTIVE: return 0; case DEBUGGER_MODE_ACTIVE: - for( ptr = debugger_breakpoints; ptr; ptr = ptr->next ) { + for( ptr = debugger_breakpoints; ptr; ptr = ptr_next ) { bp = ptr->data; + ptr_next = ptr->next; if( breakpoint_check( bp, type, value ) ) { - debugger_mode = DEBUGGER_MODE_HALTED; - debugger_command_evaluate( bp->commands ); + debugger_mode = DEBUGGER_MODE_HALTED; + debugger_command_evaluate( bp->commands ); + + if( bp->life == DEBUGGER_BREAKPOINT_LIFE_ONESHOT ) { + debugger_breakpoints = g_slist_remove( debugger_breakpoints, bp ); + free( bp ); + } } } @@ -352,11 +359,6 @@ 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; Modified: trunk/fuse/fuse.c =================================================================== --- trunk/fuse/fuse.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/fuse.c 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* fuse.c: The Free Unix Spectrum Emulator Copyright (c) 1999-2010 Philip Kendall and others - $Id: fuse.c 4165 2010-09-30 21:55:05Z pak21 $ + $Id: fuse.c 4329 2011-03-27 22:26: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 @@ -383,7 +383,7 @@ printf( "\n" ); fuse_show_version(); printf( - "Copyright (c) 1999-2010 Philip Kendall and others; see the file\n" + "Copyright (c) 1999-2011 Philip Kendall and others; see the file\n" "'AUTHORS' for more details.\n" "\n" "For help, please mail <fus...@li...> or use\n" Modified: trunk/fuse/fusepb/English.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj =================================================================== --- trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2011-04-03 11:11:05 UTC (rev 670) @@ -33,14 +33,6 @@ B61F460C09121DF100C8096C /* 48.rom in Resources */ = {isa = PBXBuildFile; fileRef = F559854C0389212301A804BA /* 48.rom */; }; B61F460D09121DF100C8096C /* 128-0.rom in Resources */ = {isa = PBXBuildFile; fileRef = F559854D0389212301A804BA /* 128-0.rom */; }; B61F460E09121DF100C8096C /* 128-1.rom in Resources */ = {isa = PBXBuildFile; fileRef = F559854E0389212301A804BA /* 128-1.rom */; }; - B61F460F09121DF100C8096C /* 128p-0.rom in Resources */ = {isa = PBXBuildFile; fileRef = B66D5C9D03CF1B3C00FE73F2 /* 128p-0.rom */; }; - B61F461009121DF100C8096C /* 128p-1.rom in Resources */ = {isa = PBXBuildFile; fileRef = B66D5C9E03CF1B3C00FE73F2 /* 128p-1.rom */; }; - B61F461109121DF100C8096C /* 256s-0.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6E093F40607EEDC008B5DEC /* 256s-0.rom */; }; - B61F461209121DF100C8096C /* 256s-1.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6E093F50607EEDC008B5DEC /* 256s-1.rom */; }; - B61F461309121DF100C8096C /* 256s-2.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6E093F60607EEDC008B5DEC /* 256s-2.rom */; }; - B61F461409121DF100C8096C /* 256s-3.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6E093F70607EEDC008B5DEC /* 256s-3.rom */; }; - B61F461509121DF100C8096C /* if1-1.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6AE204307704CFD00990F65 /* if1-1.rom */; }; - B61F461609121DF100C8096C /* if1-2.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6AE204407704CFD00990F65 /* if1-2.rom */; }; B61F461709121DF100C8096C /* plus2-0.rom in Resources */ = {isa = PBXBuildFile; fileRef = F55985520389213E01A804BA /* plus2-0.rom */; }; B61F461809121DF100C8096C /* plus2-1.rom in Resources */ = {isa = PBXBuildFile; fileRef = F55985530389213E01A804BA /* plus2-1.rom */; }; B61F461909121DF100C8096C /* plus3-0.rom in Resources */ = {isa = PBXBuildFile; fileRef = F55985540389213E01A804BA /* plus3-0.rom */; }; @@ -56,7 +48,6 @@ B61F462309121DF100C8096C /* tc2048.rom in Resources */ = {isa = PBXBuildFile; fileRef = F55985580389213E01A804BA /* tc2048.rom */; }; B61F462409121DF100C8096C /* tc2068-0.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6FEA44B0444C2CC0013916D /* tc2068-0.rom */; }; B61F462509121DF100C8096C /* tc2068-1.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6FEA44C0444C2CC0013916D /* tc2068-1.rom */; }; - B61F462609121DF100C8096C /* trdos.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6AA8A3C03D2FC1C00FED55D /* trdos.rom */; }; B61F462909121DF100C8096C /* 48k.png in Resources */ = {isa = PBXBuildFile; fileRef = F56B6A6203A628A901CA65B5 /* 48k.png */; }; B61F462A09121DF100C8096C /* ts2068.png in Resources */ = {isa = PBXBuildFile; fileRef = B6C3479F044B091100E1BBA7 /* ts2068.png */; }; B61F462B09121DF100C8096C /* Fuse.icns in Resources */ = {isa = PBXBuildFile; fileRef = F5F4333103903ED801E7A043 /* Fuse.icns */; }; @@ -154,7 +145,6 @@ B62B1A2A0DD667EC00D42AAF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B62B1A290DD667EC00D42AAF /* main.m */; }; B631B9FF10257CA400BE1EE1 /* opus.c in Sources */ = {isa = PBXBuildFile; fileRef = B631B9FD10257CA400BE1EE1 /* opus.c */; }; B631BA0010257CA400BE1EE1 /* opus.h in Headers */ = {isa = PBXBuildFile; fileRef = B631B9FE10257CA400BE1EE1 /* opus.h */; }; - B631BA0F1025878600BE1EE1 /* opus.rom in Resources */ = {isa = PBXBuildFile; fileRef = B631BA0E1025878600BE1EE1 /* opus.rom */; }; B63225EC0C66BA1300BB081B /* osname.c in Sources */ = {isa = PBXBuildFile; fileRef = B63225EB0C66BA1300BB081B /* osname.c */; }; B63225EE0C66BA3700BB081B /* paths.c in Sources */ = {isa = PBXBuildFile; fileRef = B63225ED0C66BA3700BB081B /* paths.c */; }; B635EAE7116A0FE500A166F2 /* keystate.c in Sources */ = {isa = PBXBuildFile; fileRef = B635EAE5116A0FE500A166F2 /* keystate.c */; }; @@ -237,7 +227,6 @@ B6CE3A0C0CD2160A005ACDC8 /* fdd.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE3A040CD2160A005ACDC8 /* fdd.c */; }; B6CE3A100CD21617005ACDC8 /* wd_fdc.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE3A0E0CD21617005ACDC8 /* wd_fdc.c */; }; B6CE3A130CD217C2005ACDC8 /* pentagon1024.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE3A120CD217C2005ACDC8 /* pentagon1024.c */; }; - B6CE3A190CD218A6005ACDC8 /* gluck.rom in Resources */ = {isa = PBXBuildFile; fileRef = B6CE3A180CD218A6005ACDC8 /* gluck.rom */; }; B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */; }; B6CE7FCE0B28FBD600EB65B3 /* DisplayOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7FCC0B28FBD600EB65B3 /* DisplayOpenGLView.m */; }; B6DCBBBF114FA0E700DC9A11 /* bzip2.c in Sources */ = {isa = PBXBuildFile; fileRef = B6DCBB62114FA0E700DC9A11 /* bzip2.c */; }; @@ -1528,17 +1517,7 @@ B61F460009121DF100C8096C /* Credits.html in Resources */, B61F460D09121DF100C8096C /* 128-0.rom in Resources */, B61F460E09121DF100C8096C /* 128-1.rom in Resources */, - B61F460F09121DF100C8096C /* 128p-0.rom in Resources */, - B61F461009121DF100C8096C /* 128p-1.rom in Resources */, - B61F461109121DF100C8096C /* 256s-0.rom in Resources */, - B61F461209121DF100C8096C /* 256s-1.rom in Resources */, - B61F461309121DF100C8096C /* 256s-2.rom in Resources */, - B61F461409121DF100C8096C /* 256s-3.rom in Resources */, B61F460C09121DF100C8096C /* 48.rom in Resources */, - B6CE3A190CD218A6005ACDC8 /* gluck.rom in Resources */, - B61F461509121DF100C8096C /* if1-1.rom in Resources */, - B61F461609121DF100C8096C /* if1-2.rom in Resources */, - B631BA0F1025878600BE1EE1 /* opus.rom in Resources */, B61F461709121DF100C8096C /* plus2-0.rom in Resources */, B61F461809121DF100C8096C /* plus2-1.rom in Resources */, B61F461909121DF100C8096C /* plus3-0.rom in Resources */, @@ -1555,7 +1534,6 @@ B61F462309121DF100C8096C /* tc2048.rom in Resources */, B61F462409121DF100C8096C /* tc2068-0.rom in Resources */, B61F462509121DF100C8096C /* tc2068-1.rom in Resources */, - B61F462609121DF100C8096C /* trdos.rom in Resources */, B61F462909121DF100C8096C /* 48k.png in Resources */, B61F462A09121DF100C8096C /* ts2068.png in Resources */, B61F462B09121DF100C8096C /* Fuse.icns in Resources */, Modified: trunk/fuse/fusepb/Info-Fuse.plist =================================================================== --- trunk/fuse/fusepb/Info-Fuse.plist 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/fusepb/Info-Fuse.plist 2011-04-03 11:11:05 UTC (rev 670) @@ -514,7 +514,7 @@ <key>CFBundleSignature</key> <string>FUSE</string> <key>CFBundleVersion</key> - <string>1.0.0</string> + <string>1.0.0.1a</string> <key>NSMainNibFile</key> <string>MainMenu</string> <key>NSPrincipalClass</key> Property changes on: trunk/fuse/fusepb/libspectrum.h ___________________________________________________________________ Modified: svn:mergeinfo - /vendor/fuse-emulator/current/fuse/fusepb/libspectrum.h:638-662 /vendor/fuse-emulator/current/libspectrum/libspectrum.h.in:538-600 + /vendor/fuse-emulator/current/fuse/fusepb/libspectrum.h:638-667 /vendor/fuse-emulator/current/libspectrum/libspectrum.h.in:538-600 /vendor/fuse-emulator/fuse-1.0.0a/fuse/fusepb/libspectrum.h:668-669 Modified: trunk/fuse/hacking/ChangeLog =================================================================== --- trunk/fuse/hacking/ChangeLog 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/hacking/ChangeLog 2011-04-03 11:11:05 UTC (rev 670) @@ -3372,3 +3372,22 @@ 20101203 ui/fb/fbdisplay.c: improve fb colour handling and initialise scaler system (fixes bugs #3124787 and #3124788) (rkd77). 20101216 ChangeLog,README,configure.in,man/fuse.1: update for 1.0.0 release. +20101217 keysyms.pl: fix SVGAlib compilation (rkd77). +20101229 debugger/breakpoint.c: don't free temporary breakpoint until after we have run + it (fixes bug #3084862) (thanks, Chris Cowley) (Fred). +20101230 debugger/breakpoint.c: stop evaluating breakpoints when we have hit a + temporary breakpoint (really fixes bug #3084862) (patch #3142840) + (Sergio Baldovi). +20110101 debugger/breakpoint.c: evaluate all breakpoints again, but store the + next breakpoint before deleteing the current one from the list + (really really fixes bug #3084862) (thanks, Phil) (Fred). +20110109 ui/widget/filesel.c: make Amiga work again (Chris Young). +20110112 ChangeLog,README,configure.in,man/fuse.1: updates for 1.0.0.1 release. +20110327 man/fuse.1,roms/{128p-[01].rom,256s-[0123].rom,Makefile.am, + README.copyright,gluck.rom,if1-[12].rom,opus.rom,trdos.rom, + Makefile.am}: remove ROMs that there is no formal permission to + distribute. +20110327 roms/Makefile.am: distribute README.copyright. +20110327 ChangeLog,README,configure.in,fuse.c,man/fuse.1: updates for 1.0.0.1a + release. +20110401 ChangeLog,man/fuse.1: didn't manage to release this earlier. Modified: trunk/fuse/ide/divide.c =================================================================== --- trunk/fuse/ide/divide.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/divide.c 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* divide.c: DivIDE interface routines Copyright (c) 2005-2008 Matthew Westcott, Philip Kendall - $Id: divide.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: divide.c 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/ide/divide.h =================================================================== --- trunk/fuse/ide/divide.h 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/divide.h 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* divide.h: DivIDE interface routines Copyright (c) 2005 Matthew Westcott - $Id: divide.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: divide.h 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/ide/ide.c =================================================================== --- trunk/fuse/ide/ide.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/ide.c 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* ide.c: Generic routines shared between the various IDE devices Copyright (c) 2005 Philip Kendall - $Id: ide.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: ide.c 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/ide/ide.h =================================================================== --- trunk/fuse/ide/ide.h 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/ide.h 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* ide.h: Generic routines shared between the various IDE devices Copyright (c) 2005 Philip Kendall - $Id: ide.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: ide.h 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/ide/simpleide.c =================================================================== --- trunk/fuse/ide/simpleide.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/simpleide.c 2011-04-03 11:11:05 UTC (rev 670) @@ -3,7 +3,7 @@ 2004 Philip Kendall, 2008 Fredrick Meunier - $Id: simpleide.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: simpleide.c 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/ide/simpleide.h =================================================================== --- trunk/fuse/ide/simpleide.h 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/simpleide.h 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* simpleide.h: Simple 8-bit IDE interface routines Copyright (c) 2003-2004 Garry Lancaster - $Id: simpleide.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: simpleide.h 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/ide/zxatasp.c =================================================================== --- trunk/fuse/ide/zxatasp.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/zxatasp.c 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* zxatasp.c: ZXATASP interface routines Copyright (c) 2003-2008 Garry Lancaster and Philip Kendall - $Id: zxatasp.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: zxatasp.c 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/ide/zxatasp.h =================================================================== --- trunk/fuse/ide/zxatasp.h 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/zxatasp.h 2011-04-03 11:11:05 UTC (rev 670) @@ -2,7 +2,7 @@ Copyright (c) 2003-2004 Garry Lancaster, 2004 Philip Kendall - $Id: zxatasp.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: zxatasp.h 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/ide/zxcf.c =================================================================== --- trunk/fuse/ide/zxcf.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/zxcf.c 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* zxcf.c: ZXCF interface routines Copyright (c) 2003-2008 Garry Lancaster and Philip Kendall - $Id: zxcf.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: zxcf.c 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/ide/zxcf.h =================================================================== --- trunk/fuse/ide/zxcf.h 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ide/zxcf.h 2011-04-03 11:11:05 UTC (rev 670) @@ -2,7 +2,7 @@ Copyright (c) 2003-2004 Garry Lancaster, 2004 Philip Kendall - $Id: zxcf.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: zxcf.h 4225 2010-12-17 20:14:40Z 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 Modified: trunk/fuse/keysyms.pl =================================================================== --- trunk/fuse/keysyms.pl 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/keysyms.pl 2011-04-03 11:11:05 UTC (rev 670) @@ -4,7 +4,7 @@ # Copyright (c) 2000-2007 Philip Kendall, Matan Ziv-Av, Russell Marks, # Fredrick Meunier, Catalin Mihaila, Stuart Brady -# $Id: keysyms.pl 4103 2009-11-21 10:16:36Z fredm $ +# $Id: keysyms.pl 4225 2010-12-17 20:14:40Z 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 @@ -203,6 +203,7 @@ Down => 'CURSORBLOCKDOWN', Up => 'CURSORBLOCKUP', Right => 'CURSORBLOCKRIGHT', + KP_Enter => 'KEYPADENTER', }, function => \&svga_keysym, }, Modified: trunk/fuse/man/fuse.1 =================================================================== --- trunk/fuse/man/fuse.1 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/man/fuse.1 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ .\" -*- nroff -*- .\" .\" fuse.1: Fuse man page -.\" Copyright (c) 2001-2010 Russell Marks, Philip Kendall, Darren Salt, +.\" Copyright (c) 2001-2011 Russell Marks, Philip Kendall, Darren Salt, .\" Fredrick Meunier, Stuart Brady .\" .\" This program is free software; you can redistribute it and/or modify @@ -23,7 +23,7 @@ .\" E-mail: phi...@sh... .\" .\" -.TH fuse 1 "16th December, 2010" "Version 1.0.0" "Emulators" +.TH fuse 1 "1st April, 2011" "Version 1.0.0.1a" "Emulators" .\" .\"------------------------------------------------------------------ .\" @@ -670,7 +670,9 @@ .RI ( plusd.rom ), and the TR-DOS ROM for Beta 128 emulation with the 48K, TC2048, 128K or +2 .RI ( trdos.rom ). -The names in brackets denote the defaults. +The names in brackets denote the defaults. Note that not all these ROMs +are supplied with Fuse - you must supply your own copies of those which +are not. .RE .PP .I \-\-no\-rs232\-handshake Modified: trunk/fuse/memory.c =================================================================== --- trunk/fuse/memory.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/memory.c 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ /* memory.c: Routines for accessing memory Copyright (c) 1999-2004 Philip Kendall - $Id: memory.c 4186 2010-10-25 10:29:45Z fredm $ + $Id: memory.c 4207 2010-12-05 10:01:23Z 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 Deleted: trunk/fuse/roms/128p-0.rom =================================================================== (Binary files differ) Deleted: trunk/fuse/roms/128p-1.rom =================================================================== (Binary files differ) Deleted: trunk/fuse/roms/256s-0.rom =================================================================== (Binary files differ) Deleted: trunk/fuse/roms/256s-1.rom =================================================================== (Binary files differ) Deleted: trunk/fuse/roms/256s-2.rom =================================================================== (Binary files differ) Deleted: trunk/fuse/roms/256s-3.rom =================================================================== (Binary files differ) Modified: trunk/fuse/roms/Makefile.am =================================================================== --- trunk/fuse/roms/Makefile.am 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/roms/Makefile.am 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 1999-2001 Philip Kendall -## $Id: Makefile.am 4060 2009-07-30 13:21:38Z fredm $ +## $Id: Makefile.am 4328 2011-03-27 22:19:27Z 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,18 +25,14 @@ ROMS = 128-0.rom 128-1.rom \ 48.rom \ - opus.rom \ plus2-0.rom plus2-1.rom \ plus3-0.rom plus3-1.rom plus3-2.rom plus3-3.rom \ plus3e-0.rom plus3e-1.rom plus3e-2.rom plus3e-3.rom \ tc2048.rom \ tc2068-0.rom tc2068-1.rom \ - gluck.rom 128p-0.rom 128p-1.rom trdos.rom \ - 256s-0.rom 256s-1.rom 256s-2.rom 256s-3.rom \ se-0.rom se-1.rom \ - if1-1.rom if1-2.rom \ plusd.rom pkgdata_DATA = $(ROMS) -EXTRA_DIST = $(ROMS) +EXTRA_DIST = $(ROMS) README.copyright Copied: trunk/fuse/roms/README.copyright (from rev 669, vendor/fuse-emulator/fuse-1.0.0a/fuse/roms/README.copyright) =================================================================== --- trunk/fuse/roms/README.copyright (rev 0) +++ trunk/fuse/roms/README.copyright 2011-04-03 11:11:05 UTC (rev 670) @@ -0,0 +1,47 @@ +Note that the files in this directory are _not_ covered by the GNU GPL. + +The following licenses apply: + +128-0.rom +128-1.rom +48.rom +plus2-0.rom +plus2-1.rom +plus3-0.rom +plus3-1.rom +plus3-2.rom +plus3-3.rom +tc2048.rom + +These are copyright Amstrad, who allow distribution of the ROMs but +retain the copyright. You may not sell the ROMs or embed the ROMs in +hardware, although it is allowed to sell a product which contains the +ROMs, so long as the charge is being made for the product, not for the +ROMs themselves. See +<http://groups.google.com/group/comp.sys.amstrad.8bit/msg/c092cc4d4943131e> +for more details. + +tc2068-0.rom +tc2068-1.rom + +These are derived from Amstrad code, so the above statement applies. The +modifications made by Timex are in the public domain. + +plus3e-0.rom +plus3e-1.rom +plus3e-2.rom +plus3e-3.rom + +These are derived from Amstrad code, so the above statement applies. The +modifications are copyright Garry Lancaster. + +se-0.rom +se-1.rom + +These are derived from Amstrad code, so the above statement applies. The +modifications are by Andrew Owen and are subject to the same conditions. + +plusd.rom + +This is copyright Datel Microelectronics, who allow distribution. See +<http://www.shadowmagic.org.uk/spectrum/datel.html> for details. Deleted: trunk/fuse/roms/gluck.rom =================================================================== (Binary files differ) Deleted: trunk/fuse/roms/if1-1.rom =================================================================== (Binary files differ) Deleted: trunk/fuse/roms/if1-2.rom =================================================================== (Binary files differ) Deleted: trunk/fuse/roms/opus.rom =================================================================== (Binary files differ) Deleted: trunk/fuse/roms/trdos.rom =================================================================== (Binary files differ) Modified: trunk/fuse/ui/fb/fbdisplay.c =================================================================== --- trunk/fuse/ui/fb/fbdisplay.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ui/fb/fbdisplay.c 2011-04-03 11:11:05 UTC (rev 670) @@ -2,7 +2,7 @@ Copyright (c) 2000-2003 Philip Kendall, Matan Ziv-Av, Darren Salt, Witold Filipczyk - $Id: fbdisplay.c 4205 2010-12-03 10:39:39Z fredm $ + $Id: fbdisplay.c 4206 2010-12-03 11:59:23Z 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 Modified: trunk/fuse/ui/widget/filesel.c =================================================================== --- trunk/fuse/ui/widget/filesel.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/fuse/ui/widget/filesel.c 2011-04-03 11:11:05 UTC (rev 670) @@ -2,7 +2,7 @@ Copyright (c) 2001-2005 Matan Ziv-Av, Philip Kendall, Russell Marks, Marek Januszewski - $Id: filesel.c 4103 2009-11-21 10:16:36Z fredm $ + $Id: filesel.c 4246 2011-01-09 20:47:53Z 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 @@ -64,6 +64,9 @@ int err = 0; + +char *amiga_asl( char *title, BOOL is_saving ); + #endif /* ifdef AMIGA */ struct widget_dirent **widget_filenames; /* Filenames in the current @@ -145,13 +148,21 @@ char * ui_get_open_filename( const char *title ) { +#if !defined AMIGA && !defined __MORPHOS__ return widget_get_filename( title, 0 ); +#else + return amiga_asl( title, FALSE ); +#endif } char * ui_get_save_filename( const char *title ) { +#if !defined AMIGA && !defined __MORPHOS__ return widget_get_filename( title, 1 ); +#else + return amiga_asl( title, TRUE ); +#endif } static int widget_add_filename( int *allocated, int *number, @@ -207,8 +218,8 @@ } #if defined AMIGA || defined __MORPHOS__ -static char * -amiga_asl( char *title ) { +char * +amiga_asl( char *title, BOOL is_saving ) { char *filename; struct FileRequester *filereq; @@ -499,8 +510,7 @@ /* Show all the filenames */ widget_print_all_filenames( widget_filenames, widget_numfiles, top_left_file, current_file, directory ); -#else /* ifndef AMIGA */ - amiga_asl(title); + #endif /* ifndef AMIGA */ return 0; Modified: trunk/libspectrum/config.h =================================================================== --- trunk/libspectrum/config.h 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/libspectrum/config.h 2011-04-03 11:11:05 UTC (rev 670) @@ -86,7 +86,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "1.0.0" +#define VERSION "1.0.0.1a" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ Property changes on: trunk/libspectrum/libspectrum ___________________________________________________________________ Modified: svn:mergeinfo - /vendor/fuse-emulator/0.10.0/libspectrum:556-557 /vendor/fuse-emulator/0.10.0-pre1/libspectrum:545-546 /vendor/fuse-emulator/current/libspectrum:530-662 + /vendor/fuse-emulator/0.10.0/libspectrum:556-557 /vendor/fuse-emulator/0.10.0-pre1/libspectrum:545-546 /vendor/fuse-emulator/current/libspectrum:530-667 /vendor/fuse-emulator/fuse-1.0.0a/libspectrum:668-669 Modified: trunk/libspectrum/libspectrum/ChangeLog =================================================================== --- trunk/libspectrum/libspectrum/ChangeLog 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/libspectrum/libspectrum/ChangeLog 2011-04-03 11:11:05 UTC (rev 670) @@ -310,5 +310,5 @@ * libspectrum separated from Fuse just before the 0.5.0 release of Fuse; see Fuse's ChangeLog for changes up to this point -$Id: ChangeLog 4220 2010-12-17 10:54:29Z fredm $ +$Id: ChangeLog 4212 2010-12-16 21:36:50Z pak21 $ Modified: trunk/libspectrum/libspectrum/Makefile.am =================================================================== --- trunk/libspectrum/libspectrum/Makefile.am 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/libspectrum/libspectrum/Makefile.am 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2001-2004 Philip Kendall -## $Id: Makefile.am 4220 2010-12-17 10:54:29Z fredm $ +## $Id: Makefile.am 4222 2010-12-17 18:56: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 @@ -53,6 +53,7 @@ tzx_write.c \ warajevo_read.c \ wav.c \ + windres.rc \ z80.c \ z80em.c \ zlib.c \ Modified: trunk/libspectrum/libspectrum/README =================================================================== --- trunk/libspectrum/libspectrum/README 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/libspectrum/libspectrum/README 2011-04-03 11:11:05 UTC (rev 670) @@ -69,4 +69,4 @@ Philip Kendall <phi...@sh...> 16 December 2010 -$Id: README 4220 2010-12-17 10:54:29Z fredm $ +$Id: README 4210 2010-12-16 21:34:52Z pak21 $ Modified: trunk/libspectrum/libspectrum/configure.in =================================================================== --- trunk/libspectrum/libspectrum/configure.in 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/libspectrum/libspectrum/configure.in 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. dnl Copyright (c) 1999-2008 Philip Kendall -dnl $Id: configure.in 4220 2010-12-17 10:54:29Z fredm $ +dnl $Id: configure.in 4210 2010-12-16 21:34:52Z 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 Modified: trunk/libspectrum/libspectrum/doc/libspectrum.txt =================================================================== --- trunk/libspectrum/libspectrum/doc/libspectrum.txt 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/libspectrum/libspectrum/doc/libspectrum.txt 2011-04-03 11:11:05 UTC (rev 670) @@ -1745,4 +1745,4 @@ Write `data' to register `reg' of the IDE channel `chn'. -$Id: libspectrum.txt 4220 2010-12-17 10:54:29Z fredm $ +$Id: libspectrum.txt 4193 2010-11-29 20:29:25Z pak21 $ Modified: trunk/libspectrum/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/libspectrum/hacking/ChangeLog 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/libspectrum/libspectrum/hacking/ChangeLog 2011-04-03 11:11:05 UTC (rev 670) @@ -794,3 +794,5 @@ for 1.0.0 release. 20101216 ChangeLog: update date here as well. 20101216 test/Makefile.am: ensure all test files are distributed. +20101217 Makefile.am: mark windres.rc as a source file so it is distributed + (thanks, Guesser). Modified: trunk/libspectrum/libspectrum/test/Makefile.am =================================================================== --- trunk/libspectrum/libspectrum/test/Makefile.am 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/libspectrum/libspectrum/test/Makefile.am 2011-04-03 11:11:05 UTC (rev 670) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2007 Philip Kendall -## $Id: Makefile.am 4220 2010-12-17 10:54:29Z fredm $ +## $Id: Makefile.am 4218 2010-12-16 21:56:33Z 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 Modified: trunk/libspectrum/libspectrum/warajevo_read.c =================================================================== --- trunk/libspectrum/libspectrum/warajevo_read.c 2011-04-02 12:26:20 UTC (rev 669) +++ trunk/libspectrum/libspectrum/warajevo_read.c 2011-04-03 11:11:05 UTC (rev 670) @@ -2,7 +2,7 @@ Copyright (c) 2001, 2002 Philip Kendall, Darren Salt Copyright (c) 2003 Fredrick Meunier - $Id: warajevo_read.c 4196 2010-11-30 18:45:18Z pak21 $ + $Id: warajevo_read.c 4197 2010-11-30 18:48:20Z 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-04-02 12:26:27
|
Revision: 669 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=669&view=rev Author: fredm Date: 2011-04-02 12:26:20 +0000 (Sat, 02 Apr 2011) Log Message: ----------- Some manual page updates. Modified Paths: -------------- trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html trunk/fuse/fusepb/resources/Fuse Help/html/graphics_filter.html Modified: trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html 2011-04-02 12:19:42 UTC (rev 668) +++ trunk/fuse/fusepb/resources/Fuse Help/html/changelog.html 2011-04-02 12:26:20 UTC (rev 669) @@ -111,7 +111,7 @@ drives to accept disks up to 84 tracks and 40 track drives to accept disks up to 42 tracks (Gergely Szasz).</font></li> <li><font face="Lucida Grande,Helvetica,Arial">Fix stuck key -problem with shfted extended punctuation keys <>:"_+ (Fredrick +problem with shifted extended punctuation keys <>:"_+ (Fredrick Meunier).</font></li> <li><font face="Lucida Grande,Helvetica,Arial">Remove RZX compression option (Fredrick Meunier).</font></li> Modified: trunk/fuse/fusepb/resources/Fuse Help/html/graphics_filter.html =================================================================== --- trunk/fuse/fusepb/resources/Fuse Help/html/graphics_filter.html 2011-04-02 12:19:42 UTC (rev 668) +++ trunk/fuse/fusepb/resources/Fuse Help/html/graphics_filter.html 2011-04-02 12:26:20 UTC (rev 669) @@ -59,6 +59,18 @@ allows you to choose whether the PAL TV scalers should also simulate TV scanlines.</font></td> </tr> + <tr> + <td style="vertical-align: top;"><span class="emphasis"><font + face="Lucida Grande,Helvetica,Arial"><em>Panoramic full screen<br> + </em></font></span></td> + <td style="vertical-align: top;"><font + face="Lucida Grande,Helvetica,Arial">This option allows you +to choose whether the full screen mode should fill the whole screen on +a widescreen monitor by trimming the upper and lower borders, or +whether the full border should be shown with black bars on the left and +right of the square spectrum image.<br> + </font></td> + </tr> </tbody> </table> <span class="emphasis"><font face="Lucida Grande,Helvetica,Arial"><em></em></font></span><!-- AppleSegEnd --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-04-02 12:19:50
|
Revision: 668 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=668&view=rev Author: fredm Date: 2011-04-02 12:19:42 +0000 (Sat, 02 Apr 2011) Log Message: ----------- Tag vendor/fuse-emulator/current as vendor/fuse-emulator/fuse-1.0.0a. Added Paths: ----------- vendor/fuse-emulator/fuse-1.0.0a/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-04-02 12:18:59
|
Revision: 667 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=667&view=rev Author: fredm Date: 2011-04-02 12:18:51 +0000 (Sat, 02 Apr 2011) Log Message: ----------- Load . into vendor/fuse-emulator/current. Modified Paths: -------------- vendor/fuse-emulator/current/fuse/ChangeLog vendor/fuse-emulator/current/fuse/README vendor/fuse-emulator/current/fuse/configure.in vendor/fuse-emulator/current/fuse/debugger/breakpoint.c vendor/fuse-emulator/current/fuse/fuse.c vendor/fuse-emulator/current/fuse/hacking/ChangeLog vendor/fuse-emulator/current/fuse/ide/divide.c vendor/fuse-emulator/current/fuse/ide/divide.h vendor/fuse-emulator/current/fuse/ide/ide.c vendor/fuse-emulator/current/fuse/ide/ide.h vendor/fuse-emulator/current/fuse/ide/simpleide.c vendor/fuse-emulator/current/fuse/ide/simpleide.h vendor/fuse-emulator/current/fuse/ide/zxatasp.c vendor/fuse-emulator/current/fuse/ide/zxatasp.h vendor/fuse-emulator/current/fuse/ide/zxcf.c vendor/fuse-emulator/current/fuse/ide/zxcf.h vendor/fuse-emulator/current/fuse/keysyms.pl vendor/fuse-emulator/current/fuse/man/fuse.1 vendor/fuse-emulator/current/fuse/memory.c vendor/fuse-emulator/current/fuse/roms/Makefile.am vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c vendor/fuse-emulator/current/fuse/ui/widget/filesel.c vendor/fuse-emulator/current/libspectrum/ChangeLog vendor/fuse-emulator/current/libspectrum/Makefile.am vendor/fuse-emulator/current/libspectrum/README vendor/fuse-emulator/current/libspectrum/configure.in vendor/fuse-emulator/current/libspectrum/doc/libspectrum.txt vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog vendor/fuse-emulator/current/libspectrum/test/Makefile.am vendor/fuse-emulator/current/libspectrum/warajevo_read.c Added Paths: ----------- vendor/fuse-emulator/current/fuse/roms/README.copyright Removed Paths: ------------- vendor/fuse-emulator/current/fuse/roms/128p-0.rom vendor/fuse-emulator/current/fuse/roms/128p-1.rom vendor/fuse-emulator/current/fuse/roms/256s-0.rom vendor/fuse-emulator/current/fuse/roms/256s-1.rom vendor/fuse-emulator/current/fuse/roms/256s-2.rom vendor/fuse-emulator/current/fuse/roms/256s-3.rom vendor/fuse-emulator/current/fuse/roms/gluck.rom vendor/fuse-emulator/current/fuse/roms/if1-1.rom vendor/fuse-emulator/current/fuse/roms/if1-2.rom vendor/fuse-emulator/current/fuse/roms/opus.rom vendor/fuse-emulator/current/fuse/roms/trdos.rom Modified: vendor/fuse-emulator/current/fuse/ChangeLog =================================================================== --- vendor/fuse-emulator/current/fuse/ChangeLog 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ChangeLog 2011-04-02 12:18:51 UTC (rev 667) @@ -1,3 +1,19 @@ +2011-04-01 Philip Kendall <phi...@sh...> + + * Fuse 1.0.0.1a released. + + * Remove all ROMs for which there isn't explicit permission to + distribute (Philip Kendall). + +2011-01-12 Philip Kendall <phi...@sh...> + + * Fuse 1.0.0.1 released. + + * Fix temporary breakpoints on platforms using replacement Glib + (Fredrick Meunier, Sergio Baldovi; thanks, Chris Cowley) + * Ensure Amiga port can load files (Chris Young) + * Fix SVGAlib compilation (rkd77) + 2010-12-16 Philip Kendall <phi...@sh...> * Fuse 1.0.0 released. @@ -1035,4 +1051,4 @@ * Version 0.1.0 released. -$Id: ChangeLog 4220 2010-12-17 10:54:29Z fredm $ +$Id: ChangeLog 4331 2011-04-01 07:47:06Z pak21 $ Modified: vendor/fuse-emulator/current/fuse/README =================================================================== --- vendor/fuse-emulator/current/fuse/README 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/README 2011-04-02 12:18:51 UTC (rev 667) @@ -1,5 +1,5 @@ -The Free Unix Spectrum Emulator (Fuse) 1.0.0 -============================================ +The Free Unix Spectrum Emulator (Fuse) 1.0.0.1a +=============================================== Fuse (the Free Unix Spectrum Emulator) was originally, and somewhat unsurprisingly, an emulator of the ZX Spectrum (a popular 1980s home @@ -214,6 +214,6 @@ <http://www.worldofspectrum.org/forums/>. Philip Kendall <phi...@sh...> -16 December 2010 +28 March 2011 -$Id: README 4220 2010-12-17 10:54:29Z fredm $ +$Id: README 4329 2011-03-27 22:26:07Z pak21 $ Modified: vendor/fuse-emulator/current/fuse/configure.in =================================================================== --- vendor/fuse-emulator/current/fuse/configure.in 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/configure.in 2011-04-02 12:18:51 UTC (rev 667) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Id: configure.in 4220 2010-12-17 10:54:29Z fredm $ +dnl $Id: configure.in 4329 2011-03-27 22:26:07Z 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 @@ -23,7 +23,7 @@ AM_CONFIG_HEADER(config.h) AC_CANONICAL_SYSTEM -define(FUSE_VERSION, [1.0.0]) +define(FUSE_VERSION, [1.0.0.1a]) dnl Use automake to produce `Makefile.in' AM_INIT_AUTOMAKE(fuse, FUSE_VERSION) Modified: vendor/fuse-emulator/current/fuse/debugger/breakpoint.c =================================================================== --- vendor/fuse-emulator/current/fuse/debugger/breakpoint.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/debugger/breakpoint.c 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* breakpoint.c: a debugger breakpoint Copyright (c) 2002-2008 Philip Kendall - $Id: breakpoint.c 3685 2008-06-21 12:37:24Z pak21 $ + $Id: breakpoint.c 4239 2011-01-01 15:41:13Z 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 @@ -237,19 +237,26 @@ debugger_check( debugger_breakpoint_type type, libspectrum_dword value ) { GSList *ptr; debugger_breakpoint *bp; + GSList *ptr_next; switch( debugger_mode ) { case DEBUGGER_MODE_INACTIVE: return 0; case DEBUGGER_MODE_ACTIVE: - for( ptr = debugger_breakpoints; ptr; ptr = ptr->next ) { + for( ptr = debugger_breakpoints; ptr; ptr = ptr_next ) { bp = ptr->data; + ptr_next = ptr->next; if( breakpoint_check( bp, type, value ) ) { - debugger_mode = DEBUGGER_MODE_HALTED; - debugger_command_evaluate( bp->commands ); + debugger_mode = DEBUGGER_MODE_HALTED; + debugger_command_evaluate( bp->commands ); + + if( bp->life == DEBUGGER_BREAKPOINT_LIFE_ONESHOT ) { + debugger_breakpoints = g_slist_remove( debugger_breakpoints, bp ); + free( bp ); + } } } @@ -352,11 +359,6 @@ 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; Modified: vendor/fuse-emulator/current/fuse/fuse.c =================================================================== --- vendor/fuse-emulator/current/fuse/fuse.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/fuse.c 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* fuse.c: The Free Unix Spectrum Emulator Copyright (c) 1999-2010 Philip Kendall and others - $Id: fuse.c 4165 2010-09-30 21:55:05Z pak21 $ + $Id: fuse.c 4329 2011-03-27 22:26: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 @@ -393,7 +393,7 @@ printf( "\n" ); fuse_show_version(); printf( - "Copyright (c) 1999-2010 Philip Kendall and others; see the file\n" + "Copyright (c) 1999-2011 Philip Kendall and others; see the file\n" "'AUTHORS' for more details.\n" "\n" "For help, please mail <fus...@li...> or use\n" Modified: vendor/fuse-emulator/current/fuse/hacking/ChangeLog =================================================================== --- vendor/fuse-emulator/current/fuse/hacking/ChangeLog 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/hacking/ChangeLog 2011-04-02 12:18:51 UTC (rev 667) @@ -3372,3 +3372,22 @@ 20101203 ui/fb/fbdisplay.c: improve fb colour handling and initialise scaler system (fixes bugs #3124787 and #3124788) (rkd77). 20101216 ChangeLog,README,configure.in,man/fuse.1: update for 1.0.0 release. +20101217 keysyms.pl: fix SVGAlib compilation (rkd77). +20101229 debugger/breakpoint.c: don't free temporary breakpoint until after we have run + it (fixes bug #3084862) (thanks, Chris Cowley) (Fred). +20101230 debugger/breakpoint.c: stop evaluating breakpoints when we have hit a + temporary breakpoint (really fixes bug #3084862) (patch #3142840) + (Sergio Baldovi). +20110101 debugger/breakpoint.c: evaluate all breakpoints again, but store the + next breakpoint before deleteing the current one from the list + (really really fixes bug #3084862) (thanks, Phil) (Fred). +20110109 ui/widget/filesel.c: make Amiga work again (Chris Young). +20110112 ChangeLog,README,configure.in,man/fuse.1: updates for 1.0.0.1 release. +20110327 man/fuse.1,roms/{128p-[01].rom,256s-[0123].rom,Makefile.am, + README.copyright,gluck.rom,if1-[12].rom,opus.rom,trdos.rom, + Makefile.am}: remove ROMs that there is no formal permission to + distribute. +20110327 roms/Makefile.am: distribute README.copyright. +20110327 ChangeLog,README,configure.in,fuse.c,man/fuse.1: updates for 1.0.0.1a + release. +20110401 ChangeLog,man/fuse.1: didn't manage to release this earlier. Modified: vendor/fuse-emulator/current/fuse/ide/divide.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/divide.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/divide.c 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* divide.c: DivIDE interface routines Copyright (c) 2005-2008 Matthew Westcott, Philip Kendall - $Id: divide.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: divide.c 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/ide/divide.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/divide.h 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/divide.h 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* divide.h: DivIDE interface routines Copyright (c) 2005 Matthew Westcott - $Id: divide.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: divide.h 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/ide/ide.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/ide.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/ide.c 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* ide.c: Generic routines shared between the various IDE devices Copyright (c) 2005 Philip Kendall - $Id: ide.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: ide.c 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/ide/ide.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/ide.h 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/ide.h 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* ide.h: Generic routines shared between the various IDE devices Copyright (c) 2005 Philip Kendall - $Id: ide.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: ide.h 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/ide/simpleide.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/simpleide.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/simpleide.c 2011-04-02 12:18:51 UTC (rev 667) @@ -3,7 +3,7 @@ 2004 Philip Kendall, 2008 Fredrick Meunier - $Id: simpleide.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: simpleide.c 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/ide/simpleide.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/simpleide.h 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/simpleide.h 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* simpleide.h: Simple 8-bit IDE interface routines Copyright (c) 2003-2004 Garry Lancaster - $Id: simpleide.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: simpleide.h 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/ide/zxatasp.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/zxatasp.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/zxatasp.c 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* zxatasp.c: ZXATASP interface routines Copyright (c) 2003-2008 Garry Lancaster and Philip Kendall - $Id: zxatasp.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: zxatasp.c 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/ide/zxatasp.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/zxatasp.h 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/zxatasp.h 2011-04-02 12:18:51 UTC (rev 667) @@ -2,7 +2,7 @@ Copyright (c) 2003-2004 Garry Lancaster, 2004 Philip Kendall - $Id: zxatasp.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: zxatasp.h 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/ide/zxcf.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/zxcf.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/zxcf.c 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* zxcf.c: ZXCF interface routines Copyright (c) 2003-2008 Garry Lancaster and Philip Kendall - $Id: zxcf.c 4220 2010-12-17 10:54:29Z fredm $ + $Id: zxcf.c 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/ide/zxcf.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/zxcf.h 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ide/zxcf.h 2011-04-02 12:18:51 UTC (rev 667) @@ -2,7 +2,7 @@ Copyright (c) 2003-2004 Garry Lancaster, 2004 Philip Kendall - $Id: zxcf.h 4220 2010-12-17 10:54:29Z fredm $ + $Id: zxcf.h 4225 2010-12-17 20:14:40Z 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 Modified: vendor/fuse-emulator/current/fuse/keysyms.pl =================================================================== --- vendor/fuse-emulator/current/fuse/keysyms.pl 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/keysyms.pl 2011-04-02 12:18:51 UTC (rev 667) @@ -4,7 +4,7 @@ # Copyright (c) 2000-2007 Philip Kendall, Matan Ziv-Av, Russell Marks, # Fredrick Meunier, Catalin Mihaila, Stuart Brady -# $Id: keysyms.pl 4103 2009-11-21 10:16:36Z fredm $ +# $Id: keysyms.pl 4225 2010-12-17 20:14:40Z 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 @@ -203,6 +203,7 @@ Down => 'CURSORBLOCKDOWN', Up => 'CURSORBLOCKUP', Right => 'CURSORBLOCKRIGHT', + KP_Enter => 'KEYPADENTER', }, function => \&svga_keysym, }, Modified: vendor/fuse-emulator/current/fuse/man/fuse.1 =================================================================== --- vendor/fuse-emulator/current/fuse/man/fuse.1 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/man/fuse.1 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ .\" -*- nroff -*- .\" .\" fuse.1: Fuse man page -.\" Copyright (c) 2001-2010 Russell Marks, Philip Kendall, Darren Salt, +.\" Copyright (c) 2001-2011 Russell Marks, Philip Kendall, Darren Salt, .\" Fredrick Meunier, Stuart Brady .\" .\" This program is free software; you can redistribute it and/or modify @@ -23,7 +23,7 @@ .\" E-mail: phi...@sh... .\" .\" -.TH fuse 1 "16th December, 2010" "Version 1.0.0" "Emulators" +.TH fuse 1 "1st April, 2011" "Version 1.0.0.1a" "Emulators" .\" .\"------------------------------------------------------------------ .\" @@ -670,7 +670,9 @@ .RI ( plusd.rom ), and the TR-DOS ROM for Beta 128 emulation with the 48K, TC2048, 128K or +2 .RI ( trdos.rom ). -The names in brackets denote the defaults. +The names in brackets denote the defaults. Note that not all these ROMs +are supplied with Fuse - you must supply your own copies of those which +are not. .RE .PP .I \-\-no\-rs232\-handshake Modified: vendor/fuse-emulator/current/fuse/memory.c =================================================================== --- vendor/fuse-emulator/current/fuse/memory.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/memory.c 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ /* memory.c: Routines for accessing memory Copyright (c) 1999-2004 Philip Kendall - $Id: memory.c 4186 2010-10-25 10:29:45Z fredm $ + $Id: memory.c 4207 2010-12-05 10:01:23Z 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 Deleted: vendor/fuse-emulator/current/fuse/roms/128p-0.rom =================================================================== (Binary files differ) Deleted: vendor/fuse-emulator/current/fuse/roms/128p-1.rom =================================================================== (Binary files differ) Deleted: vendor/fuse-emulator/current/fuse/roms/256s-0.rom =================================================================== (Binary files differ) Deleted: vendor/fuse-emulator/current/fuse/roms/256s-1.rom =================================================================== (Binary files differ) Deleted: vendor/fuse-emulator/current/fuse/roms/256s-2.rom =================================================================== (Binary files differ) Deleted: vendor/fuse-emulator/current/fuse/roms/256s-3.rom =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/roms/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse/roms/Makefile.am 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/roms/Makefile.am 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 1999-2001 Philip Kendall -## $Id: Makefile.am 4060 2009-07-30 13:21:38Z fredm $ +## $Id: Makefile.am 4328 2011-03-27 22:19:27Z 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,18 +25,14 @@ ROMS = 128-0.rom 128-1.rom \ 48.rom \ - opus.rom \ plus2-0.rom plus2-1.rom \ plus3-0.rom plus3-1.rom plus3-2.rom plus3-3.rom \ plus3e-0.rom plus3e-1.rom plus3e-2.rom plus3e-3.rom \ tc2048.rom \ tc2068-0.rom tc2068-1.rom \ - gluck.rom 128p-0.rom 128p-1.rom trdos.rom \ - 256s-0.rom 256s-1.rom 256s-2.rom 256s-3.rom \ se-0.rom se-1.rom \ - if1-1.rom if1-2.rom \ plusd.rom pkgdata_DATA = $(ROMS) -EXTRA_DIST = $(ROMS) +EXTRA_DIST = $(ROMS) README.copyright Added: vendor/fuse-emulator/current/fuse/roms/README.copyright =================================================================== --- vendor/fuse-emulator/current/fuse/roms/README.copyright (rev 0) +++ vendor/fuse-emulator/current/fuse/roms/README.copyright 2011-04-02 12:18:51 UTC (rev 667) @@ -0,0 +1,47 @@ +Note that the files in this directory are _not_ covered by the GNU GPL. + +The following licenses apply: + +128-0.rom +128-1.rom +48.rom +plus2-0.rom +plus2-1.rom +plus3-0.rom +plus3-1.rom +plus3-2.rom +plus3-3.rom +tc2048.rom + +These are copyright Amstrad, who allow distribution of the ROMs but +retain the copyright. You may not sell the ROMs or embed the ROMs in +hardware, although it is allowed to sell a product which contains the +ROMs, so long as the charge is being made for the product, not for the +ROMs themselves. See +<http://groups.google.com/group/comp.sys.amstrad.8bit/msg/c092cc4d4943131e> +for more details. + +tc2068-0.rom +tc2068-1.rom + +These are derived from Amstrad code, so the above statement applies. The +modifications made by Timex are in the public domain. + +plus3e-0.rom +plus3e-1.rom +plus3e-2.rom +plus3e-3.rom + +These are derived from Amstrad code, so the above statement applies. The +modifications are copyright Garry Lancaster. + +se-0.rom +se-1.rom + +These are derived from Amstrad code, so the above statement applies. The +modifications are by Andrew Owen and are subject to the same conditions. + +plusd.rom + +This is copyright Datel Microelectronics, who allow distribution. See +<http://www.shadowmagic.org.uk/spectrum/datel.html> for details. Deleted: vendor/fuse-emulator/current/fuse/roms/gluck.rom =================================================================== (Binary files differ) Deleted: vendor/fuse-emulator/current/fuse/roms/if1-1.rom =================================================================== (Binary files differ) Deleted: vendor/fuse-emulator/current/fuse/roms/if1-2.rom =================================================================== (Binary files differ) Deleted: vendor/fuse-emulator/current/fuse/roms/opus.rom =================================================================== (Binary files differ) Deleted: vendor/fuse-emulator/current/fuse/roms/trdos.rom =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c =================================================================== --- vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ui/fb/fbdisplay.c 2011-04-02 12:18:51 UTC (rev 667) @@ -2,7 +2,7 @@ Copyright (c) 2000-2003 Philip Kendall, Matan Ziv-Av, Darren Salt, Witold Filipczyk - $Id: fbdisplay.c 4205 2010-12-03 10:39:39Z fredm $ + $Id: fbdisplay.c 4206 2010-12-03 11:59:23Z 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 Modified: vendor/fuse-emulator/current/fuse/ui/widget/filesel.c =================================================================== --- vendor/fuse-emulator/current/fuse/ui/widget/filesel.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/fuse/ui/widget/filesel.c 2011-04-02 12:18:51 UTC (rev 667) @@ -2,7 +2,7 @@ Copyright (c) 2001-2005 Matan Ziv-Av, Philip Kendall, Russell Marks, Marek Januszewski - $Id: filesel.c 4103 2009-11-21 10:16:36Z fredm $ + $Id: filesel.c 4246 2011-01-09 20:47:53Z 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 @@ -64,6 +64,9 @@ int err = 0; + +char *amiga_asl( char *title, BOOL is_saving ); + #endif /* ifdef AMIGA */ struct widget_dirent **widget_filenames; /* Filenames in the current @@ -145,13 +148,21 @@ char * ui_get_open_filename( const char *title ) { +#if !defined AMIGA && !defined __MORPHOS__ return widget_get_filename( title, 0 ); +#else + return amiga_asl( title, FALSE ); +#endif } char * ui_get_save_filename( const char *title ) { +#if !defined AMIGA && !defined __MORPHOS__ return widget_get_filename( title, 1 ); +#else + return amiga_asl( title, TRUE ); +#endif } static int widget_add_filename( int *allocated, int *number, @@ -207,8 +218,8 @@ } #if defined AMIGA || defined __MORPHOS__ -static char * -amiga_asl( char *title ) { +char * +amiga_asl( char *title, BOOL is_saving ) { char *filename; struct FileRequester *filereq; @@ -499,8 +510,7 @@ /* Show all the filenames */ widget_print_all_filenames( widget_filenames, widget_numfiles, top_left_file, current_file, directory ); -#else /* ifndef AMIGA */ - amiga_asl(title); + #endif /* ifndef AMIGA */ return 0; Modified: vendor/fuse-emulator/current/libspectrum/ChangeLog =================================================================== --- vendor/fuse-emulator/current/libspectrum/ChangeLog 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/libspectrum/ChangeLog 2011-04-02 12:18:51 UTC (rev 667) @@ -310,5 +310,5 @@ * libspectrum separated from Fuse just before the 0.5.0 release of Fuse; see Fuse's ChangeLog for changes up to this point -$Id: ChangeLog 4220 2010-12-17 10:54:29Z fredm $ +$Id: ChangeLog 4212 2010-12-16 21:36:50Z pak21 $ Modified: vendor/fuse-emulator/current/libspectrum/Makefile.am =================================================================== --- vendor/fuse-emulator/current/libspectrum/Makefile.am 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/libspectrum/Makefile.am 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2001-2004 Philip Kendall -## $Id: Makefile.am 4220 2010-12-17 10:54:29Z fredm $ +## $Id: Makefile.am 4222 2010-12-17 18:56: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 @@ -53,6 +53,7 @@ tzx_write.c \ warajevo_read.c \ wav.c \ + windres.rc \ z80.c \ z80em.c \ zlib.c \ Modified: vendor/fuse-emulator/current/libspectrum/README =================================================================== --- vendor/fuse-emulator/current/libspectrum/README 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/libspectrum/README 2011-04-02 12:18:51 UTC (rev 667) @@ -69,4 +69,4 @@ Philip Kendall <phi...@sh...> 16 December 2010 -$Id: README 4220 2010-12-17 10:54:29Z fredm $ +$Id: README 4210 2010-12-16 21:34:52Z pak21 $ Modified: vendor/fuse-emulator/current/libspectrum/configure.in =================================================================== --- vendor/fuse-emulator/current/libspectrum/configure.in 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/libspectrum/configure.in 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. dnl Copyright (c) 1999-2008 Philip Kendall -dnl $Id: configure.in 4220 2010-12-17 10:54:29Z fredm $ +dnl $Id: configure.in 4210 2010-12-16 21:34:52Z 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 Modified: vendor/fuse-emulator/current/libspectrum/doc/libspectrum.txt =================================================================== --- vendor/fuse-emulator/current/libspectrum/doc/libspectrum.txt 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/libspectrum/doc/libspectrum.txt 2011-04-02 12:18:51 UTC (rev 667) @@ -1745,4 +1745,4 @@ Write `data' to register `reg' of the IDE channel `chn'. -$Id: libspectrum.txt 4220 2010-12-17 10:54:29Z fredm $ +$Id: libspectrum.txt 4193 2010-11-29 20:29:25Z pak21 $ Modified: vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog =================================================================== --- vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog 2011-04-02 12:18:51 UTC (rev 667) @@ -794,3 +794,5 @@ for 1.0.0 release. 20101216 ChangeLog: update date here as well. 20101216 test/Makefile.am: ensure all test files are distributed. +20101217 Makefile.am: mark windres.rc as a source file so it is distributed + (thanks, Guesser). Modified: vendor/fuse-emulator/current/libspectrum/test/Makefile.am =================================================================== --- vendor/fuse-emulator/current/libspectrum/test/Makefile.am 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/libspectrum/test/Makefile.am 2011-04-02 12:18:51 UTC (rev 667) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2007 Philip Kendall -## $Id: Makefile.am 4220 2010-12-17 10:54:29Z fredm $ +## $Id: Makefile.am 4218 2010-12-16 21:56:33Z 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 Modified: vendor/fuse-emulator/current/libspectrum/warajevo_read.c =================================================================== --- vendor/fuse-emulator/current/libspectrum/warajevo_read.c 2011-04-02 11:51:55 UTC (rev 666) +++ vendor/fuse-emulator/current/libspectrum/warajevo_read.c 2011-04-02 12:18:51 UTC (rev 667) @@ -2,7 +2,7 @@ Copyright (c) 2001, 2002 Philip Kendall, Darren Salt Copyright (c) 2003 Fredrick Meunier - $Id: warajevo_read.c 4196 2010-11-30 18:45:18Z pak21 $ + $Id: warajevo_read.c 4197 2010-11-30 18:48:20Z 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2011-04-02 11:52:02
|
Revision: 666 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=666&view=rev Author: fredm Date: 2011-04-02 11:51:55 +0000 (Sat, 02 Apr 2011) Log Message: ----------- Tweaks for build settings. Modified Paths: -------------- trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj Modified: trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj =================================================================== --- trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2010-12-18 09:43:31 UTC (rev 665) +++ trunk/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2011-04-02 11:51:55 UTC (rev 666) @@ -1808,6 +1808,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(HOME)/Library/Frameworks", ../../, @@ -1835,6 +1836,7 @@ "-lz", ); PRODUCT_NAME = Fuse; + SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SECTORDER_FLAGS = ""; USE_ALTIVEC = 1; WARNING_CFLAGS = "-Wall"; @@ -1848,6 +1850,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(HOME)/Library/Frameworks", ../../, @@ -1875,6 +1878,7 @@ ); PREBINDING = NO; PRODUCT_NAME = Fuse; + SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SECTORDER_FLAGS = ""; WARNING_CFLAGS = "-Wall"; WRAPPER_EXTENSION = app; @@ -1886,6 +1890,7 @@ B61F46A809121DF100C8096C /* Default */ = { isa = XCBuildConfiguration; buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(HOME)/Library/Frameworks", ../../, @@ -1909,6 +1914,7 @@ "-lz", ); PRODUCT_NAME = Fuse; + SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES; SECTORDER_FLAGS = ""; WARNING_CFLAGS = "-Wall"; WRAPPER_EXTENSION = app; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2010-12-18 09:43:37
|
Revision: 665 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=665&view=rev Author: fredm Date: 2010-12-18 09:43:31 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Create 1.0.0 release tag. Added Paths: ----------- tags/Release-1_0_0/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2010-12-18 09:36:42
|
Revision: 664 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=664&view=rev Author: fredm Date: 2010-12-18 09:36:36 +0000 (Sat, 18 Dec 2010) Log Message: ----------- Create 1.0.0 release branch. Added Paths: ----------- branches/Release-1_0_0-branch/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |