[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[539] trunk
Brought to you by:
fredm
From: <fr...@us...> - 2008-11-03 12:27:42
|
Revision: 539 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=539&view=rev Author: fredm Date: 2008-11-03 12:27:34 +0000 (Mon, 03 Nov 2008) Log Message: ----------- Merge up to vendor revision 3804. Revision Links: -------------- http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=3804&view=rev Modified Paths: -------------- trunk/FuseGenerator/libspectrum.h trunk/FuseImporter/libspectrum.h trunk/fuse/ChangeLog trunk/fuse/README trunk/fuse/compat/unix/file.c trunk/fuse/configure.in trunk/fuse/disk/fdd.c trunk/fuse/disk/upd_fdc.c trunk/fuse/fuse.c trunk/fuse/fusepb/English.lproj/InfoPlist.strings trunk/fuse/fusepb/Info-Fuse.plist trunk/fuse/fusepb/models/Emulator.m trunk/fuse/hacking/ChangeLog trunk/fuse/man/fuse.1 trunk/fuse/menu.c trunk/fuse/rzx.c trunk/fuse/settings.dat trunk/fuse/ui/options.dat trunk/fuse/ui/win32/win32internals.h trunk/fuse/ui/win32/win32joystick.c trunk/fuse/ui/win32/win32joystick.h trunk/fuse/ui/win32/win32ui.c trunk/fuse/z80/tests/README trunk/libspectrum/libspectrum/ChangeLog trunk/libspectrum/libspectrum/README trunk/libspectrum/libspectrum/doc/libspectrum.txt trunk/libspectrum/libspectrum/hacking/ChangeLog trunk/libspectrum/libspectrum/libspectrum.h.in trunk/libspectrum/libspectrum/rzx.c trunk/libspectrum/libspectrum/sna.c trunk/libspectrum/libspectrum/tap.c trunk/libspectrum/libspectrum/tape_block.c trunk/libspectrum/libspectrum/test/test.c trunk/libspectrum/libspectrum/tzx_read.c trunk/libspectrum/libspectrum/tzx_write.c trunk/libspectrum/libspectrum/warajevo_read.c trunk/libspectrum/libspectrum/z80.c trunk/libspectrum/libspectrum.h Added Paths: ----------- trunk/libspectrum/libspectrum/test/empty.z80 Property Changed: ---------------- trunk/fuse/ trunk/libspectrum/libspectrum/ Modified: trunk/FuseGenerator/libspectrum.h =================================================================== --- trunk/FuseGenerator/libspectrum.h 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/FuseGenerator/libspectrum.h 2008-11-03 12:27:34 UTC (rev 539) @@ -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 3771 2008-09-11 11:23:17Z pak21 $ + $Id: libspectrum.h.in 3792 2008-10-27 20:49:34Z specu $ 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 @@ -785,24 +785,6 @@ 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 ); -/* DEPRECATED: use libspectrum_snap_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_sna_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ); - -/* DEPRECATED: use libspectrum_snap_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_z80_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ); - -/* DEPRECATED: use libspectrum_snap_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_z80_write( libspectrum_byte **buffer, size_t *length, - libspectrum_snap *snap ); - /* * Tape handling routines */ @@ -900,7 +882,7 @@ int WIN32_DLL libspectrum_tape_block_metadata( libspectrum_tape_block *block ); -libspectrum_dword +libspectrum_dword WIN32_DLL libspectrum_tape_block_length( libspectrum_tape_block *block ); /* Accessor functions */ @@ -1028,42 +1010,6 @@ libspectrum_tape_block *block, size_t position ); -/*** Routines for .tap format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tap_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ); - -/* DEPRECATED: use libspectrum_tape_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tap_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ); - -/*** Routines for .tzx format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tzx_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ); - -/* DEPRECATED: use libspectrum_tape_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tzx_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ); - -/*** Routines for Warajevo .tap format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_warajevo_read( libspectrum_tape *tape, - const libspectrum_byte *buffer, size_t length ); - /*** Routines for iterating through a tape ***/ libspectrum_tape_block WIN32_DLL * @@ -1113,7 +1059,7 @@ libspectrum_error WIN32_DLL libspectrum_rzx_stop_input( libspectrum_rzx *rzx ); libspectrum_error WIN32_DLL -libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap ); +libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int automatic ); libspectrum_error WIN32_DLL libspectrum_rzx_rollback( libspectrum_rzx *rzx, libspectrum_snap **snap ); libspectrum_error WIN32_DLL @@ -1207,6 +1153,8 @@ libspectrum_rzx_iterator it ); libspectrum_snap* WIN32_DLL libspectrum_rzx_iterator_get_snap( libspectrum_rzx_iterator it ); +int WIN32_DLL +libspectrum_rzx_iterator_snap_is_automatic( libspectrum_rzx_iterator it ); /* * Microdrive image handling routines Modified: trunk/FuseImporter/libspectrum.h =================================================================== --- trunk/FuseImporter/libspectrum.h 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/FuseImporter/libspectrum.h 2008-11-03 12:27:34 UTC (rev 539) @@ -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 3771 2008-09-11 11:23:17Z pak21 $ + $Id: libspectrum.h.in 3792 2008-10-27 20:49:34Z specu $ 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 @@ -785,24 +785,6 @@ 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 ); -/* DEPRECATED: use libspectrum_snap_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_sna_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ); - -/* DEPRECATED: use libspectrum_snap_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_z80_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, size_t buffer_length ); - -/* DEPRECATED: use libspectrum_snap_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_z80_write( libspectrum_byte **buffer, size_t *length, - libspectrum_snap *snap ); - /* * Tape handling routines */ @@ -900,7 +882,7 @@ int WIN32_DLL libspectrum_tape_block_metadata( libspectrum_tape_block *block ); -libspectrum_dword +libspectrum_dword WIN32_DLL libspectrum_tape_block_length( libspectrum_tape_block *block ); /* Accessor functions */ @@ -1028,42 +1010,6 @@ libspectrum_tape_block *block, size_t position ); -/*** Routines for .tap format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tap_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ); - -/* DEPRECATED: use libspectrum_tape_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tap_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ); - -/*** Routines for .tzx format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tzx_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ); - -/* DEPRECATED: use libspectrum_tape_write() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_tzx_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ); - -/*** Routines for Warajevo .tap format files ***/ - -/* DEPRECATED: use libspectrum_tape_read() instead */ -DEPRECATED -libspectrum_error WIN32_DLL -libspectrum_warajevo_read( libspectrum_tape *tape, - const libspectrum_byte *buffer, size_t length ); - /*** Routines for iterating through a tape ***/ libspectrum_tape_block WIN32_DLL * @@ -1113,7 +1059,7 @@ libspectrum_error WIN32_DLL libspectrum_rzx_stop_input( libspectrum_rzx *rzx ); libspectrum_error WIN32_DLL -libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap ); +libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int automatic ); libspectrum_error WIN32_DLL libspectrum_rzx_rollback( libspectrum_rzx *rzx, libspectrum_snap **snap ); libspectrum_error WIN32_DLL @@ -1207,6 +1153,8 @@ libspectrum_rzx_iterator it ); libspectrum_snap* WIN32_DLL libspectrum_rzx_iterator_get_snap( libspectrum_rzx_iterator it ); +int WIN32_DLL +libspectrum_rzx_iterator_snap_is_automatic( libspectrum_rzx_iterator it ); /* * Microdrive image handling routines Property changes on: trunk/fuse ___________________________________________________________________ Modified: svn:mergeinfo - /vendor/fuse-emulator/current/fuse:530-533 + /vendor/fuse-emulator/current/fuse:530-538 Modified: trunk/fuse/ChangeLog =================================================================== --- trunk/fuse/ChangeLog 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/ChangeLog 2008-11-03 12:27:34 UTC (rev 539) @@ -1,3 +1,54 @@ +2008-11-?? Philip Kendall <phi...@sh...> + + * Fuse 0.10.0 released + + * New upd765 FDC emulation; all known +3 DSK images now work (Gergely + Szasz; thanks to Simon Owen for expert technical advice). + * Loading acceleration (Philip Kendall). + * Automatic saves while using RZX recording (Philip Kendall). + * Many improvements to Win32 UI (mostly Marek Januszewski). + * Improved widget UI, with look and feel borrowed from that in FuseX + (Fredrick Meunier; thanks, crabfists). + + * Emulation core improvements: + * New --late-timings option to emulate machines with 1 tstate + later timings (Philip Kendall) + * Reading from the 128K's memory control port causes that byte to + be written back to the port (Philip Kendall; thanks, Marat + Fayzullin). + * NMI causes Z80 to unHALT (Philip Kendall; thanks, Simon Owen). + * Emulate C, H and P/V flags on repeated IO instructions (Philip + Kendall). + * Fix crash when using Interface 1 on unoptimised Fuse builds + (Philip Kendall). + + * Debugger improvements: + * Debugger events to allow the debugger to stop when various + Spectrum-level events happen (Philip Kendall). + * Allow debugger commands to be run when a breakpoint is hit. + No UI for this at present, but can be set from the command line. + (Philip Kendall). + * Command to exit emulator (Philip Kendall). + * Make time breakpoints work properly when more than one is present + (Philip Kendall). + + * Miscellaneous improvements: + * Loader detection now works with the Digital Integration loader + (Philip Kendall). + * New HQ2X and HQ3x scalers (Gergely Szasz). + * Revert Pentagon 128 to being the "base" machine without extra + ROMs (Fredrick Meunier). + * Updated +3e ROMs (Fredrick Meunier; thanks, Garry Lancaster). + * Allow DivIDE, custom ROMs, Kempston mouse status and Simple 8-bit + IDE interface to be saved in snapshots (Fredrick Meunier). + * Better (but probably not perfect) TS2068 contention (Philip + Kendall). + * OpenSolaris compilation fixes (Fredrick Meunier; thanks, Andrew + Owen). + * C89 compatibility fixes (Fredrick Meunier; thanks, sweetlilmr). + * Remove GTK+'s build explicit dependency on Xlib (Philip Kendall). + * Minor AmigaOS improvements (Chris Young). + 2008-01-05 Philip Kendall <phi...@sh...> * Fuse 0.9.0 released @@ -878,4 +929,4 @@ * Version 0.1.0 released. -$Id: ChangeLog 3482 2008-01-07 12:32:26Z pak21 $ +$Id: ChangeLog 3787 2008-10-22 19:10:25Z pak21 $ Modified: trunk/fuse/README =================================================================== --- trunk/fuse/README 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/README 2008-11-03 12:27:34 UTC (rev 539) @@ -5,8 +5,9 @@ unsurprisingly, an emulator of the ZX Spectrum (a popular 1980s home computer, especially in the UK) for Unix. However, it has now also been ported to Mac OS X, which may or may not count as a Unix variant -depending on your advocacy position and emulates some of the -better-known ZX Spectrum clones as well. +depending on your advocacy position and Windows which definitely isn't +a Unix variant. Fuse also emulates some of the better-known ZX Spectrum +clones as well. What Fuse does have: @@ -15,7 +16,7 @@ Pentagon 128, "512" (Pentagon 128 with extra memory) and 1024 and Scorpion ZS 256 emulation. * Runs at true Speccy speed on any computer you're likely to try it on. -* Support for loading from .tzx files. +* Support for loading from .tzx files, including accelerated loading. * Sound (on systems supporting the Open Sound System, SDL, or OpenBSD/ Solaris's /dev/audio). * Emulation of most of the common joysticks used on the Spectrum @@ -151,4 +152,4 @@ Philip Kendall <phi...@sh...> 5 January 2008 -$Id: README 3718 2008-07-19 12:29:41Z pak21 $ +$Id: README 3801 2008-10-31 16:22:13Z pak21 $ Modified: trunk/fuse/compat/unix/file.c =================================================================== --- trunk/fuse/compat/unix/file.c 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/compat/unix/file.c 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* file.c: File-related compatibility routines Copyright (c) 2008 Philip Kendall - $Id: file.c 3722 2008-07-22 03:12:28Z specu $ + $Id: file.c 3776 2008-10-06 00:49:45Z 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 @@ -48,7 +48,7 @@ compat_file_open( const char *path, int write ) { int flags = write ? O_WRONLY | O_CREAT | O_BINARY : O_RDONLY | O_BINARY; - return open( path, flags ); + return open( path, flags, 0666 ); } off_t Modified: trunk/fuse/configure.in =================================================================== --- trunk/fuse/configure.in 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/configure.in 2008-11-03 12:27:34 UTC (rev 539) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Id: configure.in 3756 2008-08-24 13:41:23Z specu $ +dnl $Id: configure.in 3796 2008-10-28 20:44:45Z specu $ 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 @@ -381,7 +381,7 @@ dnl Check if libsamplerate is available AC_MSG_CHECKING(whether libsamplerate support requested) AC_ARG_WITH(libsamplerate, - [ --without-libsamplerate use libsamplerate], + [ --without-libsamplerate don't use libsamplerate], if test "$withval" = no; then libsamplerate=no; else libsamplerate=yes; fi, libsamplerate=yes) AC_MSG_RESULT($libsamplerate) Modified: trunk/fuse/disk/fdd.c =================================================================== --- trunk/fuse/disk/fdd.c 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/disk/fdd.c 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* fdd.c: Routines for emulating floppy disk drives Copyright (c) 2007 Gergely Szasz - $Id: fdd.c 3681 2008-06-16 09:40:29Z pak21 $ + $Id: fdd.c 3802 2008-11-02 17:06:41Z 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 @@ -165,7 +165,7 @@ machine_current->timings.processor_speed / 10, motor_event, d ); } else { - event_add_with_data( tstates + 2 * /* 1 revolution */ + event_add_with_data( tstates + 3 * /* 1.5 revolution */ machine_current->timings.processor_speed / 10, motor_event, d ); } Modified: trunk/fuse/disk/upd_fdc.c =================================================================== --- trunk/fuse/disk/upd_fdc.c 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/disk/upd_fdc.c 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* upd_fdc.c: NEC floppy disk controller emulation Copyright (c) 2007 Gergely Szasz - $Id: upd_fdc.c 3723 2008-07-22 07:49:06Z pak21 $ + $Id: upd_fdc.c 3802 2008-11-02 17:06:41Z 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 @@ -187,7 +187,7 @@ UPD_FDC_ST1_NO_DATA ); f->id_mark = UPD_FDC_AM_NONE; i = f->rev; - while( i == f->rev ) { + while( i == f->rev && d->fdd.ready ) { fdd_read_write_data( &d->fdd, FDD_READ ); if( d->fdd.index ) f->rev--; crc_preset( f ); if( f->mf ) { /* double density (MFM) */ @@ -242,6 +242,7 @@ return 0; /* found and OK */ } } + if(!d->fdd.ready) f->rev = 0; f->status_register[1] |= UPD_FDC_ST1_MISSING_AM | UPD_FDC_ST1_NO_DATA; /*FIXME _NO_DATA? */ return 2; /* not found */ } Modified: trunk/fuse/fuse.c =================================================================== --- trunk/fuse/fuse.c 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/fuse.c 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* fuse.c: The Free Unix Spectrum Emulator Copyright (c) 1999-2008 Philip Kendall - $Id: fuse.c 3718 2008-07-19 12:29:41Z pak21 $ + $Id: fuse.c 3797 2008-10-29 12:04:34Z 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/fusepb/English.lproj/InfoPlist.strings =================================================================== (Binary files differ) Modified: trunk/fuse/fusepb/Info-Fuse.plist =================================================================== --- trunk/fuse/fusepb/Info-Fuse.plist 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/fusepb/Info-Fuse.plist 2008-11-03 12:27:34 UTC (rev 539) @@ -480,7 +480,7 @@ <key>CFBundleSignature</key> <string>FUSE</string> <key>CFBundleVersion</key> - <string>3775</string> + <string>3804</string> <key>NSMainNibFile</key> <string>MainMenu</string> <key>NSPrincipalClass</key> Modified: trunk/fuse/fusepb/models/Emulator.m =================================================================== --- trunk/fuse/fusepb/models/Emulator.m 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/fusepb/models/Emulator.m 2008-11-03 12:27:34 UTC (rev 539) @@ -433,7 +433,7 @@ error = snapshot_copy_to( snap ); if( error ) { libspectrum_snap_free( snap ); return; } - libspectrum_rzx_add_snap( rzx, snap ); + libspectrum_rzx_add_snap( rzx, snap, 0 ); libspectrum_rzx_start_input( rzx, tstates ); } Modified: trunk/fuse/hacking/ChangeLog =================================================================== --- trunk/fuse/hacking/ChangeLog 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/hacking/ChangeLog 2008-11-03 12:27:34 UTC (rev 539) @@ -2895,3 +2895,29 @@ rollback.rc,select_template.rc}: Win32: Changed style for all dialogs to make those dialogs show on the taskbar, converted select_template.rc from DOS to UNIX (Marek). +20081006 compat/unix/file.c: make sure mode is specified when opening a file + for writing (fixes bug #2146742) (thanks, Cygnus) (Fred). +20081021 z80/tests/README: small documentation update (patch #2183257) + (Matthew Westcott). +20081021 ChangeLog: update for 0.10.0 release. +20081022 menu.c,rzx.c,settings.dat,ui/options.dat: support for autosaves + when using RZX recording. +20081024 man/fuse.1: update. Still TODO: debugger updates. +20081024 man/fuse.1: debugger updates. +20081024 man/fuse.1: minor update for disk formats and compressed disk images + (Fred). +20081028 configure.in: Fixed a typo in the configure script + (was '--without-libsamplerate use libsamplerate') (Marek). +20081029 fuse.c: move up settings_end to happen just after printer_end for + similar reasons - on OS X settings_end refers to machine and other + entries, so must be complete before deallocating the machine arrays + (Fred). +20081031 README: small update for 0.10.0. +20081102 disk/{fdd.c,upd_fdc.c}: stop hang if asked for index hole when disk + motor is off, and change spindown time so that The Running Man disk + works (bug #2212424) (Gergely Szasz; thanks, Mark Woodmass). +20081102 ui/win32/win32ui.c: Win32: Made ui_error_specific function work + similarly to the gtk ui equivalent (Marek). +20081102 ui/win32/{win32ui.c,win32internals.h,win32joystick.[ch}: Win32: + Implemented joystick handling using mmsystem API (and tested using PPJoy + joystick emulator, hope it works with real hardware) (Marek). Modified: trunk/fuse/man/fuse.1 =================================================================== --- trunk/fuse/man/fuse.1 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/man/fuse.1 2008-11-03 12:27:34 UTC (rev 539) @@ -80,6 +80,17 @@ .\" the options list is in alphabetical order by long option name (or .\" short option name if none). .\" +.I \-\-accelerate\-loader +.RS +Specify whether Fuse should attempt to accelerate tape loaders by "short +circuiting" the loading loop. This will in general speed up loading, but +may cause some loaders to fail. (Enabled by default, but you can use +.RI ` \-\-no\-accelerate\-loader ' +to disable). The same as the General Options dialog's +.I "Accelerate loaders" +option. +.RE +.PP .I \-\-aspect\-hint .RS Specify whether the GTK+ and Xlib user interfaces should `hint' to the @@ -115,6 +126,14 @@ option. .RE .PP +.I \-\-beeper\-stereo +.RS +Specify whether fake stereo should be added to the emulation of the +Spectrum beeper. Same as the Sound Options dialog's +.I "Beeper pseudo-stereo" +option. +.RE +.PP .I \-\-beta128 .RS Emulate a Beta 128 interface. Same as the Peripherals Options dialog's @@ -122,12 +141,9 @@ option. .RE .PP -.I \-\-beeper\-stereo .RS -Specify whether fake stereo should be added to the emulation of the -Spectrum beeper. Same as the Sound Options dialog's -.I "Beeper pseudo-stereo" -option. +.I \-\-betadisk +Specify a Betadisk image to load. .RE .PP .I \-\-bw\-tv @@ -178,6 +194,15 @@ option. .RE .PP +.I "\-\-debugger\-command string" +.RS +Specify a debugger command to be run before emulator startup. This can +be used to set breakpoints or the like. Currently, this is the only +method to input multi-line debugger commands. (See the +.B "MONITOR/DEBUGGER" +section for more information). +.RE +.PP .I "\-\-detect\-loader" .RS Specify whether Fuse should attempt to detect when the tape is being @@ -189,12 +214,42 @@ option. .RE .PP +.I \-\-divide +.RS +Emulate the DivIDE interface. The same as the Peripherals Options +dialog's +.I "DivIDE interface" +option. +.RE +.PP +.I "\-\-divide\-masterfile file" +.br +.I "\-\-divide\-slavefile file" +.RS +Specify an IDE image to be loaded into the DivIDE's emulated master +and slave drives respectively. +.RE +.PP +.I \-\-divide\-write\-protect +.RS +Specify that the emulated DivIDE's write protect jumper should be +considered set. The same as the Peripherals Options dialog's +.I "DivIDE write protect" +option. +.RE +.PP .I "\-\-dock file" .RS Insert the specified file into the emulated Timex 2068 variant dock; also select the TC2068 on startup if available. .RE .PP +.I "\-\-doublescan\-mode" +.RS +Specify the the framebuffer UI should attempt to use a double scan mode +(where each line is displayed twice). +.RE +.PP .I "\-\-embed\-snapshot" .RS Specify whether a snapshot should be embedded in an RZX file when @@ -291,7 +346,9 @@ .PP .I \-\-interface2 .RS -Emulate a Sinclair Interface II. Same as the Peripherals Options dialog's +Emulate a Sinclair Interface II. (Enabled by default, but you can use +.RI ` \-\-no\-interface2 ' +to disable). Same as the Peripherals Options dialog's .I "Interface II" option. .RE @@ -326,6 +383,16 @@ .RI ` /dev/js1 "'." .RE .PP +.I \-\-joystick-prompt +.RS +If this option is specified, Fuse Fuse will prompt you which form of +joystick emulation you wish to use when loading a snapshot. No prompt +will be issued if the configuration in the snapshot matches what you +are currently using. The same as the General Options dialog's +.I "Snap joystick prompt" +option. +.RE +.PP .I \-\-kempston .RS Emulate a Kempston joystick. Same as the Peripherals Options dialog's @@ -340,6 +407,16 @@ option. .RE .PP +.I \-\-late\-timings +.RS +It has been observed that some real Spectrums run such that the screen +is rendered one tstate later than on other real hardware. This option +specifies that Fuse should emulate such a machine. Same as the General +Options dialog's +.I "Late timings" +option. +.RE +.PP .I \-\-loading\-sound .RS Specify whether the sound made while tapes are loading should be @@ -576,6 +653,16 @@ options. .RE .PP +.I \-\-rzx-autosaves +.RS +Specify that, while recording an RZX file, Fuse should automatically add +a snapshot to the recording stream every 5 seconds. (Default to on, but +you can use +.RI ` \-\-no-rzx-autosaves ' +to disable). Same as the RZX Options dialog's "Create autosaves" option; +see there for more details. +.RE +.PP .I \-\-separation .RS Give stereo separation of the 128's AY sound channels. Same as the @@ -1453,7 +1540,15 @@ to connect to the joystick interface enabled in the snapshot unless it already matches your current configuration. .RE +.PP +.I "Late timings" +.RS +If selected, Fuse will cause all screen-related timings (for example, +when the screen is rendered and when memory contention occurs) to be +one tstate later than "normal", an effect which is present on some real +hardware. .RE +.RE .PP .I "Options, Sound..." .RS @@ -1677,6 +1772,20 @@ aborts). Note that any changed settings only apply to the currently-running Fuse. .PP +.I "Create autosaves" +.RS +If this option is selected, Fuse will add a snapshot into the recording +stream every 5 seconds while creating an RZX file, thus enabling the +rollback facilities to be used without having to explicitly add +snapshots into the stream. Older snapshots will be pruned from the +stream to keep the file size and number of snapshots down: each snapshot +up to 15 seconds will be kept, then one snapshot every 15 seconds until +one minute, then one snapshot every minute until 5 minutes, and then one +snapshot every 5 minutes. Note that this "pruning" applies only to +automatically inserted snapshots: snapshots manually inserted into the +stream will never be pruned. +.RE +.PP .I "Compress RZX data" .RS If this option is selected, and @@ -1960,11 +2069,11 @@ .RS Another Russian clone of the Spectrum. Some details can be found at -.IR "http://www.worldofspectrum.org/rusfaq/index.html" , like all the -Russian clones they they have built in 3.5" disk drives, accessed via -the Beta 128 disk 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. +.IR "http://www.worldofspectrum.org/rusfaq/index.html" , +like all the Russian clones they they have built in 3.5" disk drives, +accessed via the Beta 128 disk 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. .RE .PP .I "Spectrum SE" @@ -2899,11 +3008,65 @@ .RS Set a breakpoint to occur .I time -tstates after the start of the current frame, assuming +tstates after the start of the every frame, assuming .I condition evaluates true (if one is given). .RE .PP +br{eakpoint} ev{ent} +.IR area : detail " [" condition ] +.RS +Set a breakpoint to occur when the event specified by +.IR area : detail +occurs and +.I condition +evaluates to true. The events which can be caught are: +.PP +divide:page +.br +divide:unpage +.RS +The DivIDE interface is paged into or out of memory respectively +.RE +.br +if1:page +.br +if1:unpage +.RS +The Interface 1 shadow ROM is paged into or out of memory +.RE +.br +rzx:end +.RS +An RZX recording finishes playing +.RE +.br +tape:play +.br +tape:stop +.RS +The emulated tape starts or stops playing +.RE +.br +zxcf:page +.br +zxcf:unpage +.RS +The ZXCF interface is paged into or out of memory +.RE +.br +zxatasp:page +.br +zxatasp:unpage +.RS +The ZXATASP interface is paged into or out of memory +.RE +.PP +In all cases, the event can be specified as +.IR area :* +to catch all events from that area. +.RE +.PP cl{ear} .RI [ address ] .RS @@ -2914,6 +3077,25 @@ is omitted. Port read/write breakpoints are unaffected. .RE .PP +com{mmands} +.I id <newline> +.br +.I <debugger command> <newline> +.br +.I <debugger command> <newline> +.br +.I ... +.br +end +.RS +Set things such that the specified debugger commands will be +automatically executed when breakpoint +.I id +is triggered. There is currently no user interface for entering +multi-line debugger commands, so the only way to specify this command is +on the command-line via the \-\-debugger\-command option. +.RE +.PP cond{ition} .IR "id " [ condition ] .RS @@ -2950,6 +3132,11 @@ .IR address . .RE .PP +ex{it} +.RS +Exit the emulator immediately. +.RE +.PP fi{nish} .RS Exit from the current CALL or equivalent. This isn't infallible: it @@ -3217,8 +3404,9 @@ .RE .PP .I .SAD +.I .SDF .RS -For compatibility with SAM Coup\('e disk images using this format. +For compatibility with SAM Coup\('e disk images using these formats. Note that SAM Coup\('e `.DSK' images share the same format as `.MGT'. .RE .PP @@ -3251,11 +3439,6 @@ .I http://www.cpc-emu.org/linux/cpcemu_e.txt .RE .PP -.I .SDF -.RS -TODO -.RE -.PP Fuse supports most of them for writing: .I .UDI .FDI .MGT .IMG .SAD .TRD .SCL .DSK (only the old CPC format). @@ -3285,9 +3468,7 @@ or .IR gzip (3) just as if they were uncompressed. -.I libdsk -provides an equivalent functionality for +3 images if available, -but there is currently no support for reading compressed +D or Beta +There is currently no support for reading compressed +3, +D or Beta disk images. .\" .\"------------------------------------------------------------------ @@ -3319,7 +3500,8 @@ .PP The libao file output devices not work properly with the GTK+ UI. No error reporting, but the created file does not contain any sound data. -If you use a `weak' machine alsa09 make a lot of click and pop with +If you use a `weak' machine alsa09 makes a lot of clicks and pops and +will output .RI ` "ALSA: underrun, at least 0ms." ' error messages. .\" Modified: trunk/fuse/menu.c =================================================================== --- trunk/fuse/menu.c 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/menu.c 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* menu.c: general menu callbacks Copyright (c) 2004-2005 Philip Kendall - $Id: menu.c 3714 2008-07-06 18:10:29Z fredm $ + $Id: menu.c 3787 2008-10-22 19:10:25Z 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 @@ -93,7 +93,7 @@ error = snapshot_copy_to( snap ); if( error ) { libspectrum_snap_free( snap ); return; } - libspectrum_rzx_add_snap( rzx, snap ); + libspectrum_rzx_add_snap( rzx, snap, 0 ); libspectrum_rzx_start_input( rzx, tstates ); } Modified: trunk/fuse/rzx.c =================================================================== --- trunk/fuse/rzx.c 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/rzx.c 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* rzx.c: .rzx files Copyright (c) 2002-2003 Philip Kendall - $Id: rzx.c 3703 2008-06-30 20:36:11Z pak21 $ + $Id: rzx.c 3787 2008-10-22 19:10:25Z 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 @@ -58,6 +58,9 @@ /* The number of bytes read via IN during the current frame */ size_t rzx_in_count; +/* The number of frames we've recorded in this RZX file */ +static size_t autosave_frame_count; + /* And the values of those bytes */ libspectrum_byte *rzx_in_bytes; @@ -95,6 +98,9 @@ a competition mode RZX file */ static const float SPEED_TOLERANCE = 5; +/* How often will we create an autosave file */ +static const size_t AUTOSAVE_INTERVAL = 5 * 50; + /* Debugger events */ static const char *event_type_string = "rzx"; static const char *end_event_detail_string = "end"; @@ -152,7 +158,7 @@ return 1; } - error = libspectrum_rzx_add_snap( rzx, snap ); + error = libspectrum_rzx_add_snap( rzx, snap, 0 ); if( error ) { libspectrum_snap_free( snap ); return error; @@ -160,13 +166,12 @@ } - /* Put an input recording block into the RZX file */ libspectrum_rzx_start_input( rzx, tstates ); - /* Start the count of instruction fetches here */ - counter_reset(); rzx_in_count = 0; + counter_reset(); + rzx_in_count = 0; + autosave_frame_count = 0; - /* Note that we're recording */ rzx_recording = 1; ui_menu_activate( UI_MENU_ITEM_RECORDING, 1 ); @@ -366,6 +371,80 @@ return 0; } +typedef struct prune_info_t { + libspectrum_rzx_iterator it; + size_t frames; +} prune_info_t; + +static void +autosave_prune( void ) +{ + GArray *autosaves = g_array_new( FALSE, FALSE, sizeof( prune_info_t ) ); + libspectrum_rzx_iterator it; + size_t i, frames = 0; + + for( it = libspectrum_rzx_iterator_begin( rzx ); + it; + it = libspectrum_rzx_iterator_next( it ) ) { + + libspectrum_rzx_block_id id = libspectrum_rzx_iterator_get_type( it ); + + switch( id ) { + + case LIBSPECTRUM_RZX_INPUT_BLOCK: + frames += libspectrum_rzx_iterator_get_frames( it ); break; + + case LIBSPECTRUM_RZX_SNAPSHOT_BLOCK: + if( libspectrum_rzx_iterator_snap_is_automatic( it ) ) { + prune_info_t info = { it, frames }; + g_array_append_val( autosaves, info ); + } + break; + + default: + break; + } + } + + /* Convert 'time from start' into 'time before now' */ + for( i = 0; i < autosaves->len; i++ ) { + prune_info_t *info = &( g_array_index( autosaves, prune_info_t, i ) ); + info->frames = frames - info->frames; + } + + for( i = autosaves->len - 1; i > 0; i-- ) { + prune_info_t save1 = g_array_index( autosaves, prune_info_t, i ), + save2 = g_array_index( autosaves, prune_info_t, i - 1 ); + + if( ( save1.frames == 15 * 50 || + save1.frames == 60 * 50 || + save1.frames == 300 * 50 ) && + save2.frames < 2 * save1.frames + ) + /* FIXME: could possibly merge adjacent IRBs here */ + libspectrum_rzx_iterator_delete( rzx, save1.it ); + } + + g_array_set_size( autosaves, 0 ); +} + +static void +autosave_frame( void ) +{ + libspectrum_snap *snap; + + if( ++autosave_frame_count % AUTOSAVE_INTERVAL ) return; + + snap = libspectrum_snap_alloc(); + snapshot_copy_to( snap ); + + libspectrum_rzx_stop_input( rzx ); + libspectrum_rzx_add_snap( rzx, snap, 1 ); + libspectrum_rzx_start_input( rzx, tstates ); + + autosave_prune(); +} + static int recording_frame( void ) { libspectrum_error error; @@ -395,6 +474,8 @@ } + if( settings_current.rzx_autosaves ) autosave_frame(); + return 0; } Modified: trunk/fuse/settings.dat =================================================================== --- trunk/fuse/settings.dat 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/settings.dat 2008-11-03 12:27:34 UTC (rev 539) @@ -2,7 +2,7 @@ # Copyright (c) 2002-2008 Philip Kendall # Copyright (c) 2003-2005 Fredrick Meunier -# $Id: settings.dat 3751 2008-08-19 15:46:09Z specu $ +# $Id: settings.dat 3787 2008-10-22 19:10:25Z 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 @@ -122,6 +122,7 @@ competition_mode, boolean, 0 competition_code, numeric, 0 embed_snapshot, boolean, 1 +rzx_autosaves, boolean, 1 snapshot, string, NULL, 's' tape_file, string, NULL, 't', tape, tapefile Modified: trunk/fuse/ui/options.dat =================================================================== --- trunk/fuse/ui/options.dat 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/ui/options.dat 2008-11-03 12:27:34 UTC (rev 539) @@ -48,6 +48,7 @@ rzx RZX Options +Checkbox, Create (a)utosaves, rzx_autosaves, INPUT_KEY_a Checkbox, (C)ompress RZX data, rzx_compression, INPUT_KEY_c Checkbox, C(o)mpetition mode, competition_mode, INPUT_KEY_o Entry, Co(m)petition code, competition_code, INPUT_KEY_m, 8, Modified: trunk/fuse/ui/win32/win32internals.h =================================================================== --- trunk/fuse/ui/win32/win32internals.h 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/ui/win32/win32internals.h 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* win32internals.h: stuff internal to the Win32 UI Copyright (c) 2004 Marek Januszewski - $Id: win32internals.h 3768 2008-09-07 01:33:19Z specu $ + $Id: win32internals.h 3804 2008-11-03 04:21:02Z specu $ 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,10 @@ #include <commdlg.h> #include <shellapi.h> +/* FIXME: this should be included as part of windows.h, but is not + because WIN32_LEAN_AND_MEAN is defined along the way somewhere */ +#include <mmsystem.h> + #include <libspectrum.h> #define ID_STATUSBAR 900 Modified: trunk/fuse/ui/win32/win32joystick.c =================================================================== --- trunk/fuse/ui/win32/win32joystick.c 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/ui/win32/win32joystick.c 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* gtkjoystick.c: Joystick emulation Copyright (c) 2003-2008 Darren Salt, Philip Kendall, Marek Januszewski - $Id: win32joystick.c 3751 2008-08-19 15:46:09Z specu $ + $Id: win32joystick.c 3804 2008-11-03 04:21:02Z specu $ 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,17 +27,12 @@ #include <config.h> -#if !defined USE_JOYSTICK || defined HAVE_JSW_H -#include "../uijoystick.c" -#else - /* FIXME: implement win32 joystick using mmsystem, not jsw */ -#endif - #include <tchar.h> #include <windows.h> #include "fuse.h" #include "joystick.h" +#include "input.h" #include "keyboard.h" #include "menu.h" #include "settings.h" @@ -45,6 +40,126 @@ #include "win32joystick.h" +#if !defined USE_JOYSTICK || defined HAVE_JSW_H + +#include "../uijoystick.c" + +#else /* #if !defined USE_JOYSTICK || defined HAVE_JSW_H */ + +/* Functions to handle Joystick events */ +#include "ui/ui.h" +#include "ui/uijoystick.h" + +static void do_axis( int which, WORD value, + input_key negative, input_key positive ); + +int +ui_joystick_init( void ) +{ + int retval; + JOYINFO joyinfo; + + retval = joyGetNumDevs(); + + if( retval >= 2 ) { + + retval = 2; + + if( joyGetPos( JOYSTICKID2, &joyinfo ) == JOYERR_UNPLUGGED ) { + ui_error( UI_ERROR_ERROR, "failed to initialise joystick 2" ); + return 0; + } + } + + if( retval > 0 ) { + + if( joyGetPos( JOYSTICKID1, &joyinfo ) == JOYERR_UNPLUGGED ) { + ui_error( UI_ERROR_ERROR, "failed to initialise joystick 1" ); + return 0; + } + } + + return retval; +} + +void +ui_joystick_poll( void ) +{ + /* No action needed; joysticks already handled by the Window messages + sent by mmsystem */ +} + +void +win32joystick_buttonevent( int which_joystick, int button_down, + unsigned int wParam ) +{ + input_event_t event; + int button = 0; + + if( wParam & JOY_BUTTON1 ) button = INPUT_JOYSTICK_FIRE_1; + else if( wParam & JOY_BUTTON2 ) button = INPUT_JOYSTICK_FIRE_2; + else if( wParam & JOY_BUTTON3 ) button = INPUT_JOYSTICK_FIRE_3; + else if( wParam & JOY_BUTTON4 ) button = INPUT_JOYSTICK_FIRE_4; + else if( wParam & JOY_BUTTON5 ) button = INPUT_JOYSTICK_FIRE_5; + else if( wParam & JOY_BUTTON6 ) button = INPUT_JOYSTICK_FIRE_6; + else if( wParam & JOY_BUTTON7 ) button = INPUT_JOYSTICK_FIRE_7; + else if( wParam & JOY_BUTTON8 ) button = INPUT_JOYSTICK_FIRE_8; + else if( wParam & JOY_BUTTON9 ) button = INPUT_JOYSTICK_FIRE_9; + else if( wParam & JOY_BUTTON10 ) button = INPUT_JOYSTICK_FIRE_10; + else return; /* Fuse supports up to 10 joystick buttons */ + + event.types.joystick.which = which_joystick; + event.type = button_down + ? INPUT_EVENT_JOYSTICK_PRESS : INPUT_EVENT_JOYSTICK_RELEASE; + event.types.joystick.button = button; + input_event( &event ); +} + +void +win32joystick_move( int which_joystick, unsigned short pos_x, + unsigned short pos_y ) +{ + do_axis( which_joystick, pos_x, + INPUT_JOYSTICK_LEFT, INPUT_JOYSTICK_RIGHT ); + do_axis( which_joystick, pos_y, + INPUT_JOYSTICK_UP, INPUT_JOYSTICK_DOWN ); +} + +static void +do_axis( int which, WORD value, input_key negative, input_key positive ) +{ + input_event_t event1, event2; + + event1.types.joystick.which = event2.types.joystick.which = which; + + event1.types.joystick.button = negative; + event2.types.joystick.button = positive; + + /* MS Windows sends a value between 0 and 65535, hopefully those will work */ + if( value > 49152 ) { + event1.type = INPUT_EVENT_JOYSTICK_RELEASE; + event2.type = INPUT_EVENT_JOYSTICK_PRESS; + } else if( value < 16384 ) { + event1.type = INPUT_EVENT_JOYSTICK_PRESS; + event2.type = INPUT_EVENT_JOYSTICK_RELEASE; + } else { + event1.type = INPUT_EVENT_JOYSTICK_RELEASE; + event2.type = INPUT_EVENT_JOYSTICK_RELEASE; + } + + input_event( &event1 ); + input_event( &event2 ); +} + +void +ui_joystick_end( void ) +{ + /* Initialization and unitialization is handled by MS Windows */ +} + +#endif /* #if !defined USE_JOYSTICK || defined HAVE_JSW_H */ + +/* Win32 UI functions to handle Joystick options menus */ struct button_info { int *setting; TCHAR name[80]; Modified: trunk/fuse/ui/win32/win32joystick.h =================================================================== --- trunk/fuse/ui/win32/win32joystick.h 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/ui/win32/win32joystick.h 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* win32joystick.h: Joystick emulation Copyright (c) 2008 Marek Januszewski - $Id: win32joystick.h 3588 2008-03-27 17:48:10Z zubzero $ + $Id: win32joystick.h 3804 2008-11-03 04:21:02Z specu $ 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 @@ -62,3 +62,15 @@ #define IDC_JOYSTICKS_BUTTON_BUTTON10 ( IDC_JOYSTICKS_BUTTON_BUTTON9 + 1 ) #define IDR_JOYSTICKS_POPUP ( IDC_JOYSTICKS_BUTTON_BUTTON10 + 1 ) + +/* + win32joystick_buttonevent parameters: + which_joystick = 0 => JOYSTICK1 + which_joystick = 1 => JOYSTICK2 + button_down = 1 => button pressed + button_down = 0 => button released +*/ +void win32joystick_buttonevent( int which_joystick, int button_down, + unsigned int wParam ); +void win32joystick_move( int which_joystick, + unsigned short pos_x, unsigned short pos_y ); Modified: trunk/fuse/ui/win32/win32ui.c =================================================================== --- trunk/fuse/ui/win32/win32ui.c 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/ui/win32/win32ui.c 2008-11-03 12:27:34 UTC (rev 539) @@ -1,7 +1,7 @@ /* win32ui.c: Win32 routines for dealing with the user interface Copyright (c) 2003-2007 Marek Januszewski, Philip Kendall, Stuart Brady - $Id: win32ui.c 3768 2008-09-07 01:33:19Z specu $ + $Id: win32ui.c 3804 2008-11-03 04:21:02Z specu $ 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 @@ -28,6 +28,7 @@ #include "debugger/debugger.h" #include "display.h" #include "fuse.h" +#include "joystick.h" #include "keyboard.h" #include "menu.h" #include "menu_data.h" @@ -40,9 +41,9 @@ #include "timer/timer.h" #include "timer/timer.h" #include "ui/ui.h" -#include "ui/uijoystick.h" #include "utils.h" #include "win32internals.h" +#include "win32joystick.h" /* fuse_hPrevInstance is needed only to register window class */ static HINSTANCE fuse_hPrevInstance; @@ -120,6 +121,20 @@ fuse_window_proc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { switch( msg ) { + +#if defined USE_JOYSTICK && !defined HAVE_JSW_H + + case WM_CREATE: + if( joysticks_supported > 0 ) + if( joySetCapture( hWnd, JOYSTICKID1, 0, FALSE ) ) + ui_error( UI_ERROR_ERROR, "Couldn't start capture for joystick 1" ); + if( joysticks_supported > 1 ) + if( joySetCapture( hWnd, JOYSTICKID2, 0, FALSE ) ) + ui_error( UI_ERROR_ERROR, "Couldn't start capture for joystick 2" ); + break; + +#endif /* if defined USE_JOYSTICK && !defined HAVE_JSW_H */ + case WM_COMMAND: if( ! handle_menu( LOWORD( wParam ), hWnd ) ) return 0; @@ -228,8 +243,36 @@ else if( LOWORD( wParam ) == WA_INACTIVE ) return win32ui_lose_focus( hWnd, wParam, lParam ); break; + +#if defined USE_JOYSTICK && !defined HAVE_JSW_H + + case MM_JOY1BUTTONDOWN: + win32joystick_buttonevent( 0, 1, wParam ); + break; + + case MM_JOY1BUTTONUP: + win32joystick_buttonevent( 0, 0, wParam ); + break; + + case MM_JOY2BUTTONDOWN: + win32joystick_buttonevent( 1, 1, wParam ); + break; + + case MM_JOY2BUTTONUP: + win32joystick_buttonevent( 1, 0, wParam ); + break; + + case MM_JOY1MOVE: + win32joystick_move( 0, LOWORD( lParam ), HIWORD( lParam ) ); + break; + + case MM_JOY2MOVE: + win32joystick_move( 1, LOWORD( lParam ), HIWORD( lParam ) ); + break; + +#endif /* if defined USE_JOYSTICK && !defined HAVE_JSW_H */ + } - return( DefWindowProc( hWnd, msg, wParam, lParam ) ); } @@ -362,33 +405,27 @@ int ui_error_specific( ui_error_level severity, const char *message ) { - /* finish - can ui be not initialized? */ - HWND hWnd; + /* If we don't have a UI yet, we can't output widgets */ + if( !display_ui_initialised ) return 0; - fuse_emulation_pause(); - - hWnd = GetActiveWindow(); - switch( severity ) { case UI_ERROR_INFO: - MessageBox( hWnd, message, "Fuse - Info", MB_ICONINFORMATION | MB_OK ); + MessageBox( fuse_hWnd, message, "Fuse - Info", MB_ICONINFORMATION | MB_OK ); break; case UI_ERROR_WARNING: - MessageBox( hWnd, message, "Fuse - Warning", MB_ICONWARNING | MB_OK ); + MessageBox( fuse_hWnd, message, "Fuse - Warning", MB_ICONWARNING | MB_OK ); break; case UI_ERROR_ERROR: - MessageBox( hWnd, message, "Fuse - Error", MB_ICONERROR | MB_OK ); + MessageBox( fuse_hWnd, message, "Fuse - Error", MB_ICONERROR | MB_OK ); break; default: - MessageBox( hWnd, message, "Fuse - (Unknown Error Level)", + MessageBox( fuse_hWnd, message, "Fuse - (Unknown Error Level)", MB_ICONINFORMATION | MB_OK ); break; } - fuse_emulation_unpause(); - return 0; } @@ -644,25 +681,6 @@ return UI_CONFIRM_JOYSTICK_NONE; } -int -ui_joystick_init( void ) -{ - STUB; - return 0; -} - -void -ui_joystick_end( void ) -{ - STUB; -} - -void -ui_joystick_poll( void ) -{ - /* STUB; */ -} - /* * Font code */ Modified: trunk/fuse/z80/tests/README =================================================================== --- trunk/fuse/z80/tests/README 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/fuse/z80/tests/README 2008-11-03 12:27:34 UTC (rev 539) @@ -8,10 +8,12 @@ <arbitrary test description> AF BC DE HL AF' BC' DE' HL' IX IY SP PC -I R IFF1 IFF2 <halted> <tstates> +I R IFF1 IFF2 IM <halted> <tstates> <halted> specifies whether the Z80 is halted. -<tstates> specifies the number of tstates to run the test for. +<tstates> specifies the number of tstates to run the test for, in + decimal; the number actually executed may be higher, as the final + instruction is allowed to complete. Then followed by lines specifying the initial memory setup. Each has the format: Property changes on: trunk/libspectrum/libspectrum ___________________________________________________________________ Modified: svn:mergeinfo - /vendor/fuse-emulator/current/libspectrum:530-533 + /vendor/fuse-emulator/current/libspectrum:530-538 Modified: trunk/libspectrum/libspectrum/ChangeLog =================================================================== --- trunk/libspectrum/libspectrum/ChangeLog 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/libspectrum/libspectrum/ChangeLog 2008-11-03 12:27:34 UTC (rev 539) @@ -1,3 +1,47 @@ +2008-11-?? Philip Kendall <phi...@sh...> + + * libspectrum 0.5.0 released. + + * Memory management change: memory allocation functions now abort + on failure. Leads to simpler code both internally and for + users of the library (Philip Kendall). + + * Support for tape acceleration (Philip Kendall) + + * IDE improvements to allow DivIDE to support FATware (Philip + Kendall; thanks, http://www.dusky.sk/zxs/) + + * New API to deal with flagging automatic snapshots in RZX files + (Philip Kendall). + + * New function to get length (time) of a tape block (Philip Kendall, + Fredrick Meunier). + + * 128K SNA files are now treated as being for the Pentagon 128 + rather than the Spectrum 128 (Fredrick Meunier) + + * SNA files now written out correctly (Philip Kendall). + + * Handle MDR write protection flag correctly (Philip Kendall) + + * Allow MDR images with bad checksums to load (the error will + be handled by the If1 ROM) (Gergely Szasz) + + * Support saving custom ROMs in SZX snapshots (Fredrick Meunier, + Stuart Brady) + + * Support for DivIDE, Kempston mouse and the simple IDE interface + in SZX snapshots (Fredrick Meunier) + + * Allow building without libgcrypt (Stuart Brady) + + * Amiga and MorphOS compilation fixes (Chris Young, Q-Master) + + * Don't produce empty libraries to fix build process on + OpenSolaris (Fredrick Meunier) + + * Remove deprecated functions (Fredrick Meunier). + 2008-01-05 Philip Kendall <phi...@sh...> * libspectrum 0.4.0 released. @@ -225,5 +269,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 3480 2008-01-07 12:19:50Z pak21 $ +$Id: ChangeLog 3791 2008-10-27 20:20:40Z pak21 $ Modified: trunk/libspectrum/libspectrum/README =================================================================== --- trunk/libspectrum/libspectrum/README 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/libspectrum/libspectrum/README 2008-11-03 12:27:34 UTC (rev 539) @@ -42,14 +42,14 @@ http://fuse-emulator.sourceforge.net/libspectrum.php -Compiling from CVS ------------------- +Compiling from Subversion +------------------------- -If you're using version of libspectrum from CVS rather than one of the -released tarballs, you'll need to run `autogen.sh' before running -'configure' for the first time. +If you're using version of libspectrum from Subversion rather than one +of the released tarballs, you'll need to run `autogen.sh' before +running 'configure' for the first time. Philip Kendall <phi...@sh...> 5 January 2008 -$Id: README 3480 2008-01-07 12:19:50Z pak21 $ +$Id: README 3795 2008-10-27 21:02:43Z pak21 $ Modified: trunk/libspectrum/libspectrum/doc/libspectrum.txt =================================================================== --- trunk/libspectrum/libspectrum/doc/libspectrum.txt 2008-11-03 11:45:06 UTC (rev 538) +++ trunk/libspectrum/libspectrum/doc/libspectrum.txt 2008-11-03 12:27:34 UTC (rev 539) @@ -61,9 +61,9 @@ libspectrum_error libspectrum_init( void ) This routine must be called before any other libspectrum routines, -other than `libspectrum_version' and `libspectrum_check_version' to -initialise the library. If it isn't called, undefined behaviour may -result. +other than `libspectrum_version', `libspectrum_check_version' and +`libspectrum_mem_set_vtable' to initialise the library. If it isn't +called, undefined behaviour may result. const char *libspectrum_version( void ) @@ -83,6 +83,34 @@ returns non-zero if the libspectrum version in use is at least `version' or zero if it is not. +Memory handling +=============== + +By default, libspectrum will use the standard library's malloc(), +calloc(), realloc() and free() for memory handling, but wrapped so that +they are "strong" (they will either succeed or abort the program). It is +possible to replace these with custom allocation routines if you wish. + +typedef void* (*libspectrum_malloc_fn_t)( size_t size ); +typedef void* (*libspectrum_calloc_fn_t)( size_t nmemb, size_t size ); +typedef void* (*libspectrum_realloc_fn_t)( void *ptr, size_t size ); +typedef void (*libspectrum_free_fn_t)( void *ptr ); + +typedef struct libspectrum_mem_vtable_t { + libspectrum_malloc_fn_t malloc; + libspectrum_calloc_fn_t calloc; + libspectrum_realloc_fn_t realloc; + libspectrum_free_fn_t free; +} libspectrum_mem_vtable_t; + +void libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ) + +Set the memory handling routines to be those specified by `table'. This +function may *not* be called after libspectrum_init() has been called. +Note that libspectrum will ensure that the memory allocators are still +strong, and will abort the program if any of the allocators returns +NULL. + Error handling ============== @@ -391,7 +419,7 @@ libspectrum provides a `libspectrum_creator' structure to store this information. -libspectrum_error libspectrum_creator_alloc( libspectrum_creator **creator ) +libspectrum_creator* libspectrum_creator_alloc( void ) Allocate a new `libspectrum_creator' structure. @@ -451,7 +479,7 @@ `libspectrum_snap' structure, which can be accessed via the following routines: -libspectrum_error libspectrum_snap_alloc( libspectrum_snap **snap ) +libspectrum_snap* libspectrum_snap_alloc( void ) Allocate a new libspectrum_snap structure. @@ -695,34 +723,6 @@ The only formats for which serialisation is supported are .sna, .szx and .z80. -Deprecated snapshot routines ----------------------------- - -There are also three format-specific functions. However, *these -functions are deprecated and should not be used in new code*: - -libspectrum_error libspectrum_sna_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, - size_t buffer_length ) - -Take the .sna snapshot of length `buffer_length' bytes at `buffer' and -convert it to a `libspectrum_snap' structure. - -libspectrum_error libspectrum_z80_read( libspectrum_snap *snap, - const libspectrum_byte *buffer, - size_t buffer_length ) - -Similarly for a .z80 snapshot. - -libspectrum_error libspectrum_z80_write( libspectrum_byte **buffer, - size_t *length, - libspectrum_snap *snap ) - -Take the snapshot in `snap' and serialise it into a .z80 file at -'*buffer'. On entry, '*buffer' is assumed to be allocated '*length' -bytes, and will grow if necessary; if '*length' is zero, '*buffer' can -be uninitialised on entry. - Tape functions ============== @@ -732,7 +732,7 @@ The routines for dealing with tapes are: -libspectrum_error libspectrum_tape_alloc( libspectrum_tape **tape ) +libspectrum_tape* libspectrum_tape_alloc( void ) Allocate a new libspectrum_tape object. @@ -793,6 +793,10 @@ forced high at this edge LIBSPECTRUM_TAPE_FLAGS_NO_EDGE This "edge" isn't really an edge and doesn't change the input signal from the tape. +LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT This edge is a "short" edge; used + for loader acceleration +LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG This edge is a "long" edge; again + used for loader acceleration int libspectrum_tape_present( libspectrum_tape *tape ) @@ -809,12 +813,27 @@ Set the current block on the tape to be the `n'th block and initialise it. Again, the first block on the tape is block 0. -libspectrum_error +void libspectrum_tape_append_block( libspectrum_tape *tape, libspectrum_tape_block *block ) Append `block' to `tape'. +void +libspectrum_tape_remove_block( libspectrum_tape *tape, + libspectrum_tape_iterator it ) + +Remove the block pointed to by `it' (see the "Tape iterators" section) +from the tape. + +libspectrum_error +libspectrum_tape_insert_block( libspectrum_tape *tape, + libspectrum_tape_block *block, + size_t position ) + +Insert `block' into `tape` in position `position', where position 0 +would make the new block the first block on the tape. + libspectrum_tape_block* libspectrum_tape_current_block( libspectrum_tape *tape ) @@ -832,50 +851,6 @@ Move the tape along so it points to the next block, initialise that block and return it. -Deprecated tape routines ------------------------- - -*These functions are deprecated and should not be used in new code*: - -libspectrum_error -libspectrum_tap_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ) - -Form a tape object in `tape' from the .tap file of `length' bytes -starting at `buffer'. This routine deals with the `normal' (Z80-style) -.tap files, not with Warajevo .tap files. - -libspectrum_error -libspectrum_tap_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ) - -Attempt to convert the tape in `tape' to a .tap file in `*buffer', which -has previously been allocated `*length' bytes by user code. The .tap -format can handle only standard speed loading blocks; a best guess -attempt will be made to convert other blocks, but the resultant .tap -file probably won't work. - -libspectrum_error -libspectrum_tzx_read( libspectrum_tape *tape, const libspectrum_byte *buffer, - const size_t length ) - -Just as `libspectrum_tap_read', but for .tzx format files. - -libspectrum_error -libspectrum_tzx_write( libspectrum_byte **buffer, size_t *length, - libspectrum_tape *tape ) - -Just as `libspectrum_tap_write', but for .tzx files. The conversion to -.tzx format is not lossy as it is with converting to .tap. - -libspectrum_error -libspectrum_warajevo_read( libspectrum_tape *tape, - const libspectrum_byte *buffer, - const size_t length ) - -Just as `libspectrum_tap_read', but for Warajevo-style .tap files. -There is no currently no function to write a Warajevo-style .tap file. - Tape iterators -------------- @@ -946,9 +921,8 @@ The basic routines for dealing with tape blocks are: -libspectrum_error -libspectrum_tape_block_alloc( libspectrum_tape_block **block, - libspectrum_tape_type type ) +libspectrum_tape_block* +libspectrum_tape_block_alloc( libspectrum_tape_type type ) Allocate a new tape block of `type'. @@ -994,6 +968,11 @@ Returns 1 if the block consists solely of metadata (comments, etc.) or 0 if ... [truncated message content] |