[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[648] vendor/fuse-emulator/current
Brought to you by:
fredm
From: <fr...@us...> - 2010-10-07 11:32:05
|
Revision: 648 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=648&view=rev Author: fredm Date: 2010-10-07 11:31:54 +0000 (Thu, 07 Oct 2010) 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/disk/beta.c vendor/fuse-emulator/current/fuse/disk/disk.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/lib/Makefile.am vendor/fuse-emulator/current/fuse/lib/compressed/disk_plus3.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_128.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_16.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_2048.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_2068.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_48.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_pentagon.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_plus2.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_plus2a.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_plus3.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_plus3e.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_scorpion.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_se.szx vendor/fuse-emulator/current/fuse/lib/compressed/tape_ts2068.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/disk_plus3.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_128.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_16.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_2048.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_2068.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_48.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_pentagon.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_plus2.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_plus2a.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_plus3.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_plus3e.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_scorpion.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_se.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_ts2068.szx vendor/fuse-emulator/current/fuse/machine.c vendor/fuse-emulator/current/fuse/machines/Makefile.am vendor/fuse-emulator/current/fuse/machines/machines.h vendor/fuse-emulator/current/fuse/man/fuse.1 vendor/fuse-emulator/current/fuse/menu.c vendor/fuse-emulator/current/fuse/menu.h vendor/fuse-emulator/current/fuse/rzx.c vendor/fuse-emulator/current/fuse/rzx.h vendor/fuse-emulator/current/fuse/settings.pl vendor/fuse-emulator/current/fuse/sound/coreaudiosound.c vendor/fuse-emulator/current/fuse/tape.c vendor/fuse-emulator/current/fuse/ui/gtk/gtkdisplay.c vendor/fuse-emulator/current/fuse/ui/gtk/gtkkeyboard.c vendor/fuse-emulator/current/fuse/ui/gtk/gtkui.c vendor/fuse-emulator/current/fuse/ui/gtk/statusbar.c vendor/fuse-emulator/current/fuse/ui/gtk/stock.c vendor/fuse-emulator/current/fuse/ui/win32/installer/fuse.nsi vendor/fuse-emulator/current/fuse/ui.c 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-utils/Makefile.am vendor/fuse-emulator/current/fuse-utils/acinclude.m4 vendor/fuse-emulator/current/fuse-utils/configure.in vendor/fuse-emulator/current/fuse-utils/converter/romloader.cc vendor/fuse-emulator/current/fuse-utils/hacking/ChangeLog vendor/fuse-emulator/current/fuse-utils/man/snapconv.1 vendor/fuse-emulator/current/fuse-utils/man/tzxlist.1 vendor/fuse-emulator/current/fuse-utils/raw2hdf.c vendor/fuse-emulator/current/fuse-utils/snapconv.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/configure.in vendor/fuse-emulator/current/libspectrum/doc/libspectrum.txt vendor/fuse-emulator/current/libspectrum/hacking/ChangeLog vendor/fuse-emulator/current/libspectrum/libspectrum.c vendor/fuse-emulator/current/libspectrum/libspectrum.h.in vendor/fuse-emulator/current/libspectrum/rzx.c vendor/fuse-emulator/current/libspectrum/sna.c vendor/fuse-emulator/current/libspectrum/szx.c vendor/fuse-emulator/current/libspectrum/tape_block.c vendor/fuse-emulator/current/libspectrum/test/test.c vendor/fuse-emulator/current/libspectrum/timings.c vendor/fuse-emulator/current/libspectrum/z80.c Added Paths: ----------- vendor/fuse-emulator/current/fuse/lib/compressed/tape_48_ntsc.szx vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_48_ntsc.szx vendor/fuse-emulator/current/fuse/machines/spec48_ntsc.c vendor/fuse-emulator/current/fuse-utils/config.rpath vendor/fuse-emulator/current/libspectrum/test/empty.szx vendor/fuse-emulator/current/libspectrum/test/plus3.z80 vendor/fuse-emulator/current/libspectrum/windres.rc Modified: vendor/fuse-emulator/current/fuse/ChangeLog =================================================================== --- vendor/fuse-emulator/current/fuse/ChangeLog 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ChangeLog 2010-10-07 11:31:54 UTC (rev 648) @@ -1,6 +1,6 @@ -2010-xx-xx Philip Kendall <phi...@sh...> +2010-10-xx Philip Kendall <phi...@sh...> - * Fuse 0.11.0 released + * Fuse 1.0.0 released. * Add Opus Discovery disk interface support (Gergely Szasz and Fredrick Meunier). @@ -8,6 +8,8 @@ * Many improvements to Win32 UI, including an installer (Marek Januszewski). * Support weak data in +3 disk images (Gergely Szasz). + * NTSC Spectrum support (Philip Kendall, with thanks to Claudio + Bernet). * Add support for flipping disk images in single sided drives (Gergely Szasz). * Add support for automatically merging both both disk images where @@ -47,8 +49,6 @@ notebooks (thanks, Andrew Owen) (Fredrick Meunier). * Fixes for speed estimation (Gergely Szasz). * Fix border colour in Timex HiRes screenshots (Fredrick Meunier). - * Fix accelerated loaders when compiling with gcc 3.x (Carlos - Almeida, Alberto Garcia and Philip Kendall). * Allow "combo" boxes in widget UI (Gergely Szasz). * Allow Home and End keys to work in widget UI (Gergely Szasz). * Fix poke finder passing the wrong page to the debugger (Marek @@ -1035,4 +1035,4 @@ * Version 0.1.0 released. -$Id: ChangeLog 4134 2010-05-21 13:16:19Z fredm $ +$Id: ChangeLog 4165 2010-09-30 21:55:05Z pak21 $ Modified: vendor/fuse-emulator/current/fuse/README =================================================================== --- vendor/fuse-emulator/current/fuse/README 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/README 2010-10-07 11:31:54 UTC (rev 648) @@ -1,5 +1,5 @@ -The Free Unix Spectrum Emulator (Fuse) 0.10.0.2 -=============================================== +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 @@ -209,11 +209,11 @@ and the Fuse project page on SourceForge, http://sourceforge.net/projects/fuse-emulator/ -If you're interested in more general Speccy related discussions, visit -the Usenet group 'comp.sys.sinclair', but do read the FAQ -( http://www.worldofspectrum.org/faq/index.html ) first! +For Spectrum discussions not directly related to Fuse, visit either the +Usenet newsgroup `comp.sys.sinclair' or the World of Spectrum forums +<http://www.worldofspectrum.org/forums/>. Philip Kendall <phi...@sh...> -14 January 2009 +FIXME October 2010 -$Id: README 4132 2010-05-20 12:06:53Z fredm $ +$Id: README 4172 2010-10-03 22:51:59Z pak21 $ Modified: vendor/fuse-emulator/current/fuse/configure.in =================================================================== --- vendor/fuse-emulator/current/fuse/configure.in 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/configure.in 2010-10-07 11:31:54 UTC (rev 648) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Id: configure.in 4132 2010-05-20 12:06:53Z fredm $ +dnl $Id: configure.in 4175 2010-10-06 10:44:19Z 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,8 +23,10 @@ AM_CONFIG_HEADER(config.h) AC_CANONICAL_SYSTEM +define(FUSE_VERSION, [0.10.0.2]) + dnl Use automake to produce `Makefile.in' -AM_INIT_AUTOMAKE(fuse, 0.10.0.2) +AM_INIT_AUTOMAKE(fuse, FUSE_VERSION) dnl Checks for programs. AC_PROG_CC @@ -40,8 +42,10 @@ AC_SUBST(WINDRES) if test "$WINDRES" != no; then WINDRES_OBJ="windres.o" + AC_DEFINE([VERSION_WIN32], [translit(FUSE_VERSION, [.], [,])], [Define version information for win32 executable]) fi AC_SUBST(WINDRES_OBJ) +AM_SUBST_NOTMAKE(WINDRES_OBJ) dnl Generate commandy.h YFLAGS="$YFLAGS -d" @@ -247,7 +251,11 @@ fi dnl Check for the MIT-SHM extension - AC_CHECK_HEADERS( X11/extensions/XShm.h ) + AC_CHECK_HEADERS( X11/extensions/XShm.h,,,[[ + #include <sys/ipc.h> + #include <sys/shm.h> + #include <X11/Xlib.h> + ]]) AC_CHECK_LIB( Xext, XShmAttach, LIBS="$LIBS -lXext" ) AC_DEFINE([UI_X], 1, [Defined if Xlib UI in use]) Modified: vendor/fuse-emulator/current/fuse/disk/beta.c =================================================================== --- vendor/fuse-emulator/current/fuse/disk/beta.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/disk/beta.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* beta.c: Routines for handling the Beta disk interface Copyright (c) 2004-2008 Stuart Brady - $Id: beta.c 4131 2010-05-19 10:52:37Z fredm $ + $Id: beta.c 4147 2010-08-19 12:25: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 @@ -65,6 +65,8 @@ int beta_active = 0; int beta_builtin = 0; +static libspectrum_byte beta_system_register; /* FDC system register */ + libspectrum_word beta_pc_mask; libspectrum_word beta_pc_value; @@ -365,6 +367,8 @@ fdd_set_head( &beta_fdc->current_drive->fdd, ( ( b & 0x10 ) ? 0 : 1 ) ); /* 0x20 = density, reset = FM, set = MFM */ beta_fdc->dden = b & 0x20 ? 1 : 0; + + beta_system_register = b; } libspectrum_byte @@ -725,7 +729,6 @@ void beta_to_snapshot( libspectrum_snap *snap ) { - int attached; wd_fdc *f = beta_fdc; libspectrum_byte *buffer; int drive_count = 0; @@ -759,9 +762,9 @@ libspectrum_snap_set_beta_paged ( snap, beta_active ); libspectrum_snap_set_beta_direction( snap, beta_fdc->direction ); - libspectrum_snap_set_beta_status( snap, beta_sr_read( 0x001f, &attached ) ); + libspectrum_snap_set_beta_status( snap, f->status_register ); libspectrum_snap_set_beta_track ( snap, f->track_register ); libspectrum_snap_set_beta_sector( snap, f->sector_register ); libspectrum_snap_set_beta_data ( snap, f->data_register ); - libspectrum_snap_set_beta_system( snap, beta_sp_read( 0x00ff, &attached ) ); + libspectrum_snap_set_beta_system( snap, beta_system_register ); } Modified: vendor/fuse-emulator/current/fuse/disk/disk.c =================================================================== --- vendor/fuse-emulator/current/fuse/disk/disk.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/disk/disk.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* disk.c: Routines for handling disk images Copyright (c) 2007-2010 Gergely Szasz - $Id: disk.c 4114 2010-01-15 13:45:51Z fredm $ + $Id: disk.c 4141 2010-07-19 11:30:21Z 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 @@ -102,6 +102,8 @@ size_t index; } buffer_t; +void disk_update_tlens( disk_t *d ); + const char * disk_strerror( int error ) { @@ -742,6 +744,7 @@ d->wrprot = 0; d->dirty = 0; + disk_update_tlens( d ); return d->status = DISK_OK; } Modified: vendor/fuse-emulator/current/fuse/fuse.c =================================================================== --- vendor/fuse-emulator/current/fuse/fuse.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/fuse.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* fuse.c: The Free Unix Spectrum Emulator - Copyright (c) 1999-2009 Philip Kendall + Copyright (c) 1999-2010 Philip Kendall and others - $Id: fuse.c 4109 2009-12-27 06:15:10Z fredm $ + $Id: fuse.c 4165 2010-09-30 21:55:05Z 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-2009 Philip Kendall and others; see the file\n" + "Copyright (c) 1999-2010 Philip Kendall and others; see the file\n" "'AUTHORS' for more details.\n" "\n" "For help, please mail <fus...@li...> or use\n" @@ -638,7 +638,7 @@ static int do_start_files( start_files_t *start_files ) { - int autoload, error, i; + int autoload, error, i, check_snapshot; /* Can't do both input recording and playback */ if( start_files->playback && start_files->recording ) { @@ -783,7 +783,8 @@ /* Input recordings */ if( start_files->playback ) { - error = utils_open_file( start_files->playback, autoload, NULL ); + check_snapshot = start_files->snapshot ? 0 : 1; + error = rzx_start_playback( start_files->playback, check_snapshot ); if( error ) return error; } Modified: vendor/fuse-emulator/current/fuse/hacking/ChangeLog =================================================================== --- vendor/fuse-emulator/current/fuse/hacking/ChangeLog 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/hacking/ChangeLog 2010-10-07 11:31:54 UTC (rev 648) @@ -3299,3 +3299,55 @@ changes from 0.10.0.2 onto trunk (Fred). 20100521 ChangeLog: remove duplicate entry (Fred). 20100522 sound.c: allow a little more treble in the TV Speaker mode (Fred). +20100527 sound/coreaudiosound.c: add some casts in output statements to avoid + annoying warnings about format mismatches (Fred). +20100530 ChangeLog: remove another duplicate entry (Fred). +20100627 ui/gtk/gtkdisplay.c: ensure an appropriate scaler is selected when + the Fuse window is resized by the user. +20100719 disk/disk.c: set track lengths when inserting a new disk (fixes bug + #3031299) (Gergely Szasz). +20100819 disk/beta.c: correct writing of status and system regeisters to + snapshots (Patrik Rak). +20100825 machine.c,machines/{Makefile.am,machines.h},tape.c: reintegrate + NTSC Spectrum branch. +20100831 lib/[un]compressed/{disk_plus3.szx,tape_128.szx,tape_16.szx, + tape_2048.szx,tape_2068.szx,tape_48.szx,tape_pentagon.szx, + tape_plus2.szx,tape_plus2a.szx,tape_plus3.szx,tape_plus3e.szx, + tape_scorpion.szx,tape_se.szx,tape_ts2068.szx}: swap A and F and A' + and F' registers in autoload snapshots which were written when + libspectrum still suffered from bug #2857419 (fixes bug #3040262) + (thanks, Gergely Szasz) (Fred). +20100831 machines/spec48_ntsc.c: add some more peripherals and add display + setup code (Fred). +20100901 lib/{[un]compressed/tape_48_ntsc.szx,Makefile.am}: add autoload + snapshot for NTSC Spectrum (Fred). +20100905 tape.c: remove obsolete reference to munmap (Fred). +20100909 settings.pl: remove the 80 character limit in ini file settings + names+values and change 256 char path lengths to MAX_PATH (patch + #3013768) (Gergely Szasz). +20100912 menu.c,rzx.[ch]: query for an initial snapshot when opening a rzx file + which doesn't have one as is common in competition mode rzx files + (patch #3054536) (Sergio Baldovi). +20100912 configure.in,windres.rc: enhancements to Windows version encoding + (patch #3061430) (Sergio Baldovi). +20100913 fuse.c,menu.[ch],rzx.[ch],utils.[ch]: extend RZX playback handling of + files without initial embedded snapshots to cover File->Open, the + command line and some miscellaneous RZX playback initialisation bugs + (more from patch #3054536) (Sergio Baldovi). +20100919 ui/win32/installer/fuse.nsi: windows installer improvements; correct + uninstall registry key, parameterise installation directory path, add + version information fields, optionally register file types, make start + menu shortcuts optional and add desktop shortcut (patch #3069264) + (Sergio Baldovi). +20100930 ChangeLog,fuse.c,man/fuse.1,README: first updates for a "1.0" release. +20101002 lib/{compressed,uncompressed}/*.szx: update libspectrum signature in + each file so we know they don't have the A-F swap bug. +20101003 README: small update to mention WoS forums. +20101006 configure.in: update header check for XShm.h (patch #3081497) (Gergely + Szasz). +20101006 ui/gtk/{gtkkeyboard.c,gtkui.c,statusbar.c,stock.c}: use F1 as shortcut to + open menus, set window dialogs as transient for the main window and set a + fixed width for the emulation speed display (patch #3081729) (Sergio + Baldovi). +20101007 ui.c: don't close a disk or mdr if a write fails (patch #3058156) (thanks, + Crisis) (Gergely Szasz). Modified: vendor/fuse-emulator/current/fuse/ide/divide.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/divide.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/divide.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* divide.c: DivIDE interface routines Copyright (c) 2005-2008 Matthew Westcott, Philip Kendall - $Id: divide.c 4099 2009-10-22 10:59:02Z fredm $ + $Id: divide.c 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/ide/divide.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/divide.h 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/divide.h 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* divide.h: DivIDE interface routines Copyright (c) 2005 Matthew Westcott - $Id: divide.h 4060 2009-07-30 13:21:38Z fredm $ + $Id: divide.h 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/ide/ide.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/ide.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/ide.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* ide.c: Generic routines shared between the various IDE devices Copyright (c) 2005 Philip Kendall - $Id: ide.c 4060 2009-07-30 13:21:38Z fredm $ + $Id: ide.c 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/ide/ide.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/ide.h 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/ide.h 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* ide.h: Generic routines shared between the various IDE devices Copyright (c) 2005 Philip Kendall - $Id: ide.h 4060 2009-07-30 13:21:38Z fredm $ + $Id: ide.h 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/ide/simpleide.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/simpleide.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/simpleide.c 2010-10-07 11:31:54 UTC (rev 648) @@ -3,7 +3,7 @@ 2004 Philip Kendall, 2008 Fredrick Meunier - $Id: simpleide.c 4060 2009-07-30 13:21:38Z fredm $ + $Id: simpleide.c 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/ide/simpleide.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/simpleide.h 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/simpleide.h 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* simpleide.h: Simple 8-bit IDE interface routines Copyright (c) 2003-2004 Garry Lancaster - $Id: simpleide.h 4060 2009-07-30 13:21:38Z fredm $ + $Id: simpleide.h 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/ide/zxatasp.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/zxatasp.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/zxatasp.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* zxatasp.c: ZXATASP interface routines Copyright (c) 2003-2008 Garry Lancaster and Philip Kendall - $Id: zxatasp.c 4099 2009-10-22 10:59:02Z fredm $ + $Id: zxatasp.c 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/ide/zxatasp.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/zxatasp.h 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/zxatasp.h 2010-10-07 11:31:54 UTC (rev 648) @@ -2,7 +2,7 @@ Copyright (c) 2003-2004 Garry Lancaster, 2004 Philip Kendall - $Id: zxatasp.h 4060 2009-07-30 13:21:38Z fredm $ + $Id: zxatasp.h 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/ide/zxcf.c =================================================================== --- vendor/fuse-emulator/current/fuse/ide/zxcf.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/zxcf.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* zxcf.c: ZXCF interface routines Copyright (c) 2003-2008 Garry Lancaster and Philip Kendall - $Id: zxcf.c 4099 2009-10-22 10:59:02Z fredm $ + $Id: zxcf.c 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/ide/zxcf.h =================================================================== --- vendor/fuse-emulator/current/fuse/ide/zxcf.h 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/ide/zxcf.h 2010-10-07 11:31:54 UTC (rev 648) @@ -2,7 +2,7 @@ Copyright (c) 2003-2004 Garry Lancaster, 2004 Philip Kendall - $Id: zxcf.h 4060 2009-07-30 13:21:38Z fredm $ + $Id: zxcf.h 4148 2010-08-25 21:20: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 Modified: vendor/fuse-emulator/current/fuse/lib/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse/lib/Makefile.am 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/lib/Makefile.am 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 1999-2004 Philip Kendall -## $Id: Makefile.am 3150 2007-09-05 14:05:00Z pak21 $ +## $Id: Makefile.am 4154 2010-08-31 14:14: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 @@ -33,6 +33,7 @@ @AUTOLOAD_SNAPS@/tape_2048.szx \ @AUTOLOAD_SNAPS@/tape_2068.szx \ @AUTOLOAD_SNAPS@/tape_48.szx \ + @AUTOLOAD_SNAPS@/tape_48_ntsc.szx \ @AUTOLOAD_SNAPS@/tape_plus2.szx \ @AUTOLOAD_SNAPS@/tape_plus2a.szx \ @AUTOLOAD_SNAPS@/tape_plus3.szx \ @@ -51,6 +52,7 @@ compressed/tape_2048.szx \ compressed/tape_2068.szx \ compressed/tape_48.szx \ + compressed/tape_48_ntsc.szx \ compressed/tape_plus2.szx \ compressed/tape_plus2a.szx \ compressed/tape_plus3.szx \ @@ -65,6 +67,7 @@ uncompressed/tape_2048.szx \ uncompressed/tape_2068.szx \ uncompressed/tape_48.szx \ + uncompressed/tape_48_ntsc.szx \ uncompressed/tape_plus2.szx \ uncompressed/tape_plus2a.szx \ uncompressed/tape_plus3.szx \ Modified: vendor/fuse-emulator/current/fuse/lib/compressed/disk_plus3.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_128.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_16.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_2048.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_2068.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_48.szx =================================================================== (Binary files differ) Added: vendor/fuse-emulator/current/fuse/lib/compressed/tape_48_ntsc.szx =================================================================== (Binary files differ) Property changes on: vendor/fuse-emulator/current/fuse/lib/compressed/tape_48_ntsc.szx ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_pentagon.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_plus2.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_plus2a.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_plus3.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_plus3e.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_scorpion.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_se.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/compressed/tape_ts2068.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/disk_plus3.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_128.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_16.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_2048.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_2068.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_48.szx =================================================================== (Binary files differ) Added: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_48_ntsc.szx =================================================================== (Binary files differ) Property changes on: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_48_ntsc.szx ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_pentagon.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_plus2.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_plus2a.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_plus3.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_plus3e.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_scorpion.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_se.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/lib/uncompressed/tape_ts2068.szx =================================================================== (Binary files differ) Modified: vendor/fuse-emulator/current/fuse/machine.c =================================================================== --- vendor/fuse-emulator/current/fuse/machine.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/machine.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* machine.c: Routines for handling the various machine types Copyright (c) 1999-2008 Philip Kendall - $Id: machine.c 3937 2009-01-07 14:02:30Z pak21 $ + $Id: machine.c 4148 2010-08-25 21:20: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 @@ -69,6 +69,8 @@ if (error ) return error; error = machine_add_machine( spec48_init ); if (error ) return error; + error = machine_add_machine( spec48_ntsc_init ); + if (error ) return error; error = machine_add_machine( spec128_init ); if (error ) return error; error = machine_add_machine( specplus2_init ); Modified: vendor/fuse-emulator/current/fuse/machines/Makefile.am =================================================================== --- vendor/fuse-emulator/current/fuse/machines/Makefile.am 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/machines/Makefile.am 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 2004 Philip Kendall -## $Id: Makefile.am 3341 2007-11-26 14:48:01Z zubzero $ +## $Id: Makefile.am 4148 2010-08-25 21:20: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 @@ -36,6 +36,7 @@ spec128.c \ spec16.c \ spec48.c \ + spec48_ntsc.c \ specplus2.c \ spec_se.c \ specplus2a.c \ Modified: vendor/fuse-emulator/current/fuse/machines/machines.h =================================================================== --- vendor/fuse-emulator/current/fuse/machines/machines.h 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/machines/machines.h 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* machines.h: machine specific routines Copyright (c) 1999-2004 Philip Kendall - $Id: machines.h 3341 2007-11-26 14:48:01Z zubzero $ + $Id: machines.h 4148 2010-08-25 21:20: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 @@ -36,6 +36,7 @@ int pentagon1024_init( fuse_machine_info *machine ); int spec16_init( fuse_machine_info *machine ); +int spec48_ntsc_init( fuse_machine_info *machine ); int spec_se_init( fuse_machine_info *machine ); int specplus2_init( fuse_machine_info *machine ); int specplus2a_init( fuse_machine_info *machine ); Added: vendor/fuse-emulator/current/fuse/machines/spec48_ntsc.c =================================================================== --- vendor/fuse-emulator/current/fuse/machines/spec48_ntsc.c (rev 0) +++ vendor/fuse-emulator/current/fuse/machines/spec48_ntsc.c 2010-10-07 11:31:54 UTC (rev 648) @@ -0,0 +1,103 @@ +/* spec48_ntsc.c: NTSC Spectrum 48K specific routines + Copyright (c) 1999-2009 Philip Kendall + + $Id: spec48.c 3566 2008-03-18 12:59:16Z 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 <stdio.h> + +#include <libspectrum.h> + +#include "joystick.h" +#include "machine.h" +#include "memory.h" +#include "periph.h" +#include "printer.h" +#include "settings.h" +#include "spec48.h" +#include "spectrum.h" +#include "ula.h" +#include "if1.h" + +static int spec48_ntsc_reset( void ); + +static const periph_t peripherals[] = { + { 0x0001, 0x0000, ula_read, ula_write }, + { 0x0004, 0x0000, printer_zxp_read, printer_zxp_write }, + { 0x00e0, 0x0000, joystick_kempston_read, NULL }, +}; + +static const size_t peripherals_count = + sizeof( peripherals ) / sizeof( periph_t ); + +int spec48_ntsc_init( fuse_machine_info *machine ) +{ + machine->machine = LIBSPECTRUM_MACHINE_48_NTSC; + machine->id = "48_ntsc"; + + machine->reset = spec48_ntsc_reset; + + machine->timex = 0; + machine->ram.port_from_ula = spec48_port_from_ula; + machine->ram.contend_delay = spectrum_contend_delay_65432100; + machine->ram.contend_delay_no_mreq = spectrum_contend_delay_65432100; + + machine->unattached_port = spectrum_unattached_port; + + machine->shutdown = NULL; + + machine->memory_map = spec48_memory_map; + + return 0; + +} + +static int +spec48_ntsc_reset( void ) +{ + int error; + + error = machine_load_rom( 0, 0, settings_current.rom_48, + settings_default.rom_48, 0x4000 ); + if( error ) return error; + + error = periph_setup( peripherals, peripherals_count ); + if( error ) return error; + periph_setup_kempston( PERIPH_PRESENT_OPTIONAL ); + periph_setup_interface1( PERIPH_PRESENT_OPTIONAL ); + periph_setup_interface2( PERIPH_PRESENT_OPTIONAL ); + periph_setup_opus( PERIPH_PRESENT_OPTIONAL ); + periph_setup_plusd( PERIPH_PRESENT_OPTIONAL ); + periph_setup_beta128( PERIPH_PRESENT_OPTIONAL ); + periph_setup_fuller( PERIPH_PRESENT_OPTIONAL ); + periph_setup_melodik( PERIPH_PRESENT_OPTIONAL ); + periph_update(); + + memory_current_screen = 5; + memory_screen_mask = 0xffff; + + spec48_common_display_setup(); + + return spec48_common_reset(); +} Modified: vendor/fuse-emulator/current/fuse/man/fuse.1 =================================================================== --- vendor/fuse-emulator/current/fuse/man/fuse.1 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/man/fuse.1 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ .\" -*- nroff -*- .\" .\" fuse.1: Fuse man page -.\" Copyright (c) 2001-2008 Russell Marks, Philip Kendall, Darren Salt, +.\" Copyright (c) 2001-2010 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 "14th January, 2009" "Version 0.10.0.2" "Emulators" +.TH fuse 1 "FIXME October, 2010" "Version 1.0.0" "Emulators" .\" .\"------------------------------------------------------------------ .\" Modified: vendor/fuse-emulator/current/fuse/menu.c =================================================================== --- vendor/fuse-emulator/current/fuse/menu.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/menu.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* menu.c: general menu callbacks Copyright (c) 2004-2005 Philip Kendall - $Id: menu.c 4109 2009-12-27 06:15:10Z fredm $ + $Id: menu.c 4159 2010-09-13 11:51:13Z 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 @@ -136,13 +136,13 @@ recording = ui_get_open_filename( "Fuse - Start Replay" ); if( !recording ) { fuse_emulation_unpause(); return; } - rzx_start_playback( recording ); + rzx_start_playback( recording, 1 ); free( recording ); display_refresh_all(); - ui_menu_activate( UI_MENU_ITEM_RECORDING, 1 ); + if( rzx_playback ) ui_menu_activate( UI_MENU_ITEM_RECORDING, 1 ); fuse_emulation_unpause(); } @@ -839,20 +839,6 @@ } int -menu_open_snap( void ) -{ - char *filename; - int error; - - filename = ui_get_open_filename( "Fuse - Load Snapshot" ); - if( !filename ) return -1; - - error = snapshot_read( filename ); - free( filename ); - return error; -} - -int menu_check_media_changed( void ) { int confirm, i; Modified: vendor/fuse-emulator/current/fuse/menu.h =================================================================== --- vendor/fuse-emulator/current/fuse/menu.h 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/menu.h 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* menu.h: general menu callbacks Copyright (c) 2004 Philip Kendall - $Id: menu.h 4101 2009-11-13 12:54:28Z fredm $ + $Id: menu.h 4159 2010-09-13 11:51:13Z 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 @@ -105,8 +105,6 @@ MENU_CALLBACK( menu_media_ide_zxcf_upload ); MENU_CALLBACK( menu_media_ide_divide_writeprotect ); -int menu_open_snap( void ); - /* * Things to be defined elsewhere */ Modified: vendor/fuse-emulator/current/fuse/rzx.c =================================================================== --- vendor/fuse-emulator/current/fuse/rzx.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/rzx.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* rzx.c: .rzx files Copyright (c) 2002-2003 Philip Kendall - $Id: rzx.c 4085 2009-09-02 13:24:48Z fredm $ + $Id: rzx.c 4159 2010-09-13 11:51:13Z 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 @@ -37,7 +37,6 @@ #include "event.h" #include "fuse.h" #include "machine.h" -#include "menu.h" #include "rzx.h" #include "settings.h" #include "snapshot.h" @@ -234,10 +233,45 @@ return 0; } -int rzx_start_playback( const char *filename ) +libspectrum_snap* +rzx_get_initial_snapshot( void ) { + libspectrum_rzx_iterator it; + + 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: + /* If we get this then there can't have been an initial snap to start + from */ + return NULL; + break; + + case LIBSPECTRUM_RZX_SNAPSHOT_BLOCK: + /* Got initial snap */ + return libspectrum_rzx_iterator_get_snap( it ); + break; + + default: + continue; + + } + + } + + return NULL; +} + +int rzx_start_playback( const char *filename, int check_snapshot ) +{ utils_file file; libspectrum_error libspec_error; int error; + libspectrum_snap* snap; if( rzx_recording ) return 1; @@ -257,6 +291,14 @@ return 1; } + snap = rzx_get_initial_snapshot(); + if( !snap && check_snapshot ) { + /* We need to load an external snapshot. Could be skipped if the snapshot + is preloaded from command line */ + error = utils_open_snap(); + if( error ) return error; + } + error = start_playback( rzx ); if( error ) { libspectrum_rzx_free( rzx ); @@ -270,6 +312,7 @@ rzx_start_playback_from_buffer( const unsigned char *buffer, size_t length ) { int error; + libspectrum_snap* snap; if( rzx_recording ) return 0; @@ -278,6 +321,15 @@ error = libspectrum_rzx_read( rzx, buffer, length ); if( error ) return error; + snap = rzx_get_initial_snapshot(); + if( !snap ) { + error = utils_open_snap(); + if( error ) { + libspectrum_rzx_free( rzx ); + return error; + } + } + error = start_playback( rzx ); if( error ) { libspectrum_rzx_free( rzx ); Modified: vendor/fuse-emulator/current/fuse/rzx.h =================================================================== --- vendor/fuse-emulator/current/fuse/rzx.h 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/rzx.h 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* rzx.h: .rzx files Copyright (c) 2002-2003 Philip Kendall - $Id: rzx.h 3681 2008-06-16 09:40:29Z pak21 $ + $Id: rzx.h 4159 2010-09-13 11:51:13Z 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 @@ -64,7 +64,7 @@ int rzx_start_recording( const char *filename, int embed_snapshot ); int rzx_stop_recording( void ); -int rzx_start_playback( const char *filename ); +int rzx_start_playback( const char *filename, int check_snapshot ); int rzx_start_playback_from_buffer( const unsigned char *buffer, size_t length ); Modified: vendor/fuse-emulator/current/fuse/settings.pl =================================================================== --- vendor/fuse-emulator/current/fuse/settings.pl 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/settings.pl 2010-10-07 11:31:54 UTC (rev 648) @@ -3,7 +3,7 @@ # settings.pl: generate settings.c from settings.dat # Copyright (c) 2002-2005 Philip Kendall -# $Id: settings.pl 4096 2009-10-07 08:43:00Z fredm $ +# $Id: settings.pl 4156 2010-09-09 13:01: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 @@ -166,14 +166,14 @@ static int read_config_file( settings_info *settings ) { - const char *home; char path[256]; + const char *home; char path[ PATH_MAX ]; struct stat stat_info; xmlDocPtr doc; home = compat_get_home_path(); if( !home ) return 1; - snprintf( path, 256, "%s/%s", home, CONFIG_FILE_NAME ); + snprintf( path, PATH_MAX, "%s/%s", home, CONFIG_FILE_NAME ); /* See if the file exists; if doesn't, it's not a problem */ if( stat( path, &stat_info ) ) { @@ -275,13 +275,13 @@ int settings_write_config( settings_info *settings ) { - const char *home; char path[256], buffer[80]; + const char *home; char path[ PATH_MAX ], buffer[80]; xmlDocPtr doc; xmlNodePtr root; home = compat_get_home_path(); if( !home ) return 1; - snprintf( path, 256, "%s/%s", home, CONFIG_FILE_NAME ); + snprintf( path, PATH_MAX, "%s/%s", home, CONFIG_FILE_NAME ); /* Create the XML document */ doc = xmlNewDoc( (const xmlChar*)"1.0" ); @@ -329,7 +329,7 @@ static int read_config_file( settings_info *settings ) { - const char *home; char path[256]; + const char *home; char path[ PATH_MAX ]; struct stat stat_info; int error; @@ -337,7 +337,7 @@ home = compat_get_home_path(); if( !home ) return 1; - snprintf( path, 256, "%s/%s", home, CONFIG_FILE_NAME ); + snprintf( path, PATH_MAX, "%s/%s", home, CONFIG_FILE_NAME ); /* See if the file exists; if doesn't, it's not a problem */ if( stat( path, &stat_info ) ) { @@ -363,139 +363,158 @@ return 0; } -/* special_trim() trims that are characters less then equal than space (32). - This will eliminate extra tabs, \r (if line ends with \r\n, or \n\r), - and spaces (if someone edits the config with external editor), - both leading and trailing. - */ -static void -special_trim( char string[80] ) { +static int +settings_var( settings_info *settings, unsigned char *name, unsigned char *last, + int **val_int, char ***val_char, unsigned char **next ) +{ + unsigned char* cpos; + size_t n; - size_t trim_pos; + *val_int = NULL; + *val_char = NULL; - /* Trim leading chars */ - trim_pos = 0; - while( string[ trim_pos ] && ( string[ trim_pos ] <= 32 ) ) - trim_pos++; - if( trim_pos > 0 ) - strcpy( string, &string[ trim_pos ] ); - - /* Trim trailing chars */ - trim_pos = strlen( string ); - while( ( --trim_pos > 0 ) && ( string[ trim_pos ] <= 32 ) ) { - string[ trim_pos ] = '\0'; + *next = name; + while( name < last && ( *name == ' ' || *name == '\t' || *name == '\r' || + *name == '\n' ) ) { + *next = ++name; /* seek to first char */ } -} + cpos = name; -static int -parse_ini( utils_file *file, settings_info *settings ) -{ - unsigned char* current_pos; - char setting_name[80], setting_value[80]; - size_t chars_copied; - - current_pos = file->buffer; + while( cpos < last && ( *cpos != '=' && *cpos != ' ' && *cpos != '\t' && + *cpos != '\r' && *cpos != '\n' ) ) cpos++; + *next = cpos; + n = cpos - name; /* length of name */ - /* Read until the end of file */ - while( current_pos < file->buffer + file->length ) { + while( *next < last && **next != '=' ) { /* search for '=' */ + if( **next != ' ' && **next != '\t' && **next != '\r' && **next != '\n' ) + return 1; /* error in value */ + (*next)++; + } + if( *next < last) (*next)++; /* set after '=' */ +/* ui_error( UI_ERROR_WARNING, "Config: (%5s): ", name ); */ - /* Safely copy the text to setting_name, delimted by "=", until \n or eof */ - chars_copied = 0; - while( ( current_pos < file->buffer + file->length ) - && ( *current_pos != '\n' ) && ( *current_pos != '=' ) - && ( chars_copied < 79 ) ) { /* leave one char for \0 */ - setting_name[ chars_copied ] = *current_pos; - current_pos++; - chars_copied++; - } - setting_name[ chars_copied ] = '\0'; - - if( *current_pos != '=' ) { - /* line misses the "=" delimiter, skip to next line */ - current_pos++; - continue; - } - - /* Safely copy the text to setting_value, until \n or eof */ - current_pos++; - chars_copied = 0; - while( ( current_pos < file->buffer + file->length ) - && ( *current_pos != '\n' ) - && ( chars_copied < 79 ) ) { /* leave one char for \0 */ - setting_value[ chars_copied ] = *current_pos; - current_pos++; - chars_copied++; - } - setting_value[ chars_copied ] = '\0'; - - current_pos++; - - special_trim( setting_name ); - special_trim( setting_value ); - CODE - +my %type = ('null' => 0, 'boolean' => 1, 'numeric' => 1, 'string' => 2 ); foreach my $name ( sort keys %options ) { + my $len = length $options{$name}->{configfile}; - my $type = $options{$name}->{type}; - - if( $type eq 'boolean' or $type eq 'numeric' ) { - - print << "CODE"; - if( !strcmp( setting_name, "$options{$name}->{configfile}" ) ) { - settings->$name = atoi( setting_value ); - } else + print << "CODE"; + if( n == $len && !strncmp( (const char *)name, "$options{$name}->{configfile}", n ) ) { CODE - - } elsif( $type eq 'string' ) { - - print << "CODE"; - if( !strcmp( setting_name, "$options{$name}->{configfile}" ) ) { - free( settings->$name ); - settings->$name = strdup( setting_value ); - } else + print " *val_int = \&settings->$name;\n" if( $options{$name}->{type} eq 'boolean' or $options{$name}->{type} eq 'numeric' ); + print " *val_char = \&settings->$name;\n" if( $options{$name}->{type} eq 'string' ); + print "/* *val_null = \&settings->$name; */\n" if( $options{$name}->{type} eq 'null' ); + print << "CODE"; + return 0; + } CODE +} + print << "CODE"; + return 1; +} - } elsif( $type eq 'null' ) { +static int +parse_ini( utils_file *file, settings_info *settings ) +{ + unsigned char *cpos, *cpos_new; + int *val_int; + char **val_char; - print << "CODE"; - if( !strcmp( setting_name, "$options{$name}->{configfile}" ) ) { - /* Do nothing */ - } else -CODE + cpos = file->buffer; - } else { - die "Unknown setting type `$type'"; + /* Read until the end of file */ + while( cpos < file->buffer + file->length ) { + if( settings_var( settings, cpos, file->buffer + file->length, &val_int, + &val_char, &cpos_new ) ) { + /* error in name or something else ... */ + cpos = cpos_new + 1; + ui_error( UI_ERROR_WARNING, + "Unknown and/or invalid setting '%s' in config file", cpos ); + continue; } -} + cpos = cpos_new; + if( val_int ) { + *val_int = atoi( (char *)cpos ); + while( cpos < file->buffer + file->length && + ( *cpos != '\\0' && *cpos != '\\r' && *cpos != '\\n' ) ) cpos++; + } else if( val_char ) { + char *value = (char *)cpos; + size_t n = 0; + while( cpos < file->buffer + file->length && + ( *cpos != '\\0' && *cpos != '\\r' && *cpos != '\\n' ) ) cpos++; + n = (char *)cpos - value; + if( n > 0 ) { + if( *val_char != NULL ) { + free( *val_char ); + *val_char = NULL; + } + *val_char = malloc( n + 1 ); + if( ! *val_char ) { + ui_error( UI_ERROR_WARNING, "Out of memory!" ); + return 1; + } + (*val_char)[n] = '\\0'; + memcpy( *val_char, value, n ); + } + } + /* skip 'new line' like chars */ + while( ( cpos < ( file->buffer + file->length ) ) && + ( *cpos == '\\r' || *cpos == '\\n' ) ) cpos++; +CODE print hashline( __LINE__ ), << 'CODE'; - if( !strcmp( setting_name, "text" ) ) { - /* Do nothing */ - } else { - ui_error( UI_ERROR_WARNING, "Unknown setting '%s' in config file", - setting_name ); - } } return 0; } +static int +settings_file_write( compat_fd fd, const char *buffer, size_t length ) +{ + return compat_file_write( fd, (const unsigned char *)buffer, length ); +} + +static int +settings_string_write( compat_fd doc, const char* name, const char* config ) +{ + if( config != NULL && + ( settings_file_write( doc, name, strlen( name ) ) || + settings_file_write( doc, "=", 1 ) || + settings_file_write( doc, config, strlen( config ) ) || + settings_file_write( doc, "\n", 1 ) ) ) + return 1; + return 0; +} + +static int +settings_boolean_write( compat_fd doc, const char* name, int config ) +{ + return settings_string_write( doc, name, config ? "1" : "0" ); +} + +static int +settings_numeric_write( compat_fd doc, const char* name, int config ) +{ + char buffer[80]; + snprintf( buffer, sizeof( buffer ), "%d", config ); + return settings_string_write( doc, name, buffer ); +} + int settings_write_config( settings_info *settings ) { - const char *home; char path[256], buffer[80]; + const char *home; char path[ PATH_MAX ]; compat_fd doc; home = compat_get_home_path(); if( !home ) return 1; - snprintf( path, 256, "%s/%s", home, CONFIG_FILE_NAME ); + snprintf( path, PATH_MAX, "%s/%s", home, CONFIG_FILE_NAME ); doc = compat_file_open( path, 1 ); if( doc == COMPAT_FILE_OPEN_FAILED ) { ui_error( UI_ERROR_ERROR, "couldn't open `%s' for writing: %s\n", - path, strerror( errno ) ); + path, strerror( errno ) ); return 1; } @@ -504,38 +523,28 @@ foreach my $name ( sort keys %options ) { my $type = $options{$name}->{type}; + my $len = length "$options{$name}->{configfile}"; if( $type eq 'boolean' ) { print << "CODE"; - snprintf( buffer, 80, "%s=%s\\n", "$options{$name}->{configfile}", settings->$name ? "1" : "0" ); - if( compat_file_write( doc, ( const unsigned char * ) buffer, - strlen( buffer ) > 80 ? 80 : strlen( buffer ) ) ) { - compat_file_close( doc ); - return 1; - } + if( settings_boolean_write( doc, "$options{$name}->{configfile}", + settings->$name ) ) + goto error; CODE } elsif( $type eq 'string' ) { print << "CODE"; - if( settings->$name ) { - snprintf( buffer, 80, "%s=%s\\n", "$options{$name}->{configfile}", settings->$name ); - if( compat_file_write( doc, ( const unsigned char * ) buffer, - strlen( buffer ) > 80 ? 80 : strlen( buffer ) ) ) { - compat_file_close( doc ); - return 1; - } - } + if( settings_string_write( doc, "$options{$name}->{configfile}", + settings->$name ) ) + goto error; CODE } elsif( $type eq 'numeric' ) { print << "CODE"; - snprintf( buffer, 80, "%s=%d\\n", "$options{$name}->{configfile}", settings->$name ); - if( compat_file_write( doc, ( const unsigned char * ) buffer, - strlen( buffer ) > 80 ? 80 : strlen( buffer ) ) ) { - compat_file_close( doc ); - return 1; - } + if( settings_numeric_write( doc, "$options{$name}->{configfile}", + settings->$name ) ) + goto error; CODE } elsif( $type eq 'null' ) { @@ -550,6 +559,10 @@ compat_file_close( doc ); return 0; +error: + compat_file_close( doc ); + + return 1; } #endif /* #ifdef HAVE_LIB_XML2 */ Modified: vendor/fuse-emulator/current/fuse/sound/coreaudiosound.c =================================================================== --- vendor/fuse-emulator/current/fuse/sound/coreaudiosound.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/sound/coreaudiosound.c 2010-10-07 11:31:54 UTC (rev 648) @@ -73,8 +73,8 @@ 0, NULL, &count, device); if ( err != kAudioHardwareNoError && device != kAudioObjectUnknown ) { ui_error( UI_ERROR_ERROR, - "get kAudioHardwarePropertyDefaultOutputDevice error %d", - err ); + "get kAudioHardwarePropertyDefaultOutputDevice error %ld", + (long)err ); return 1; } @@ -100,8 +100,8 @@ rate); if ( err != kAudioHardwareNoError ) { ui_error( UI_ERROR_ERROR, - "get kAudioDevicePropertyNominalSampleRate error %d", - err ); + "get kAudioDevicePropertyNominalSampleRate error %ld", + (long)err ); return 1; } @@ -150,7 +150,7 @@ err = OpenAComponent( comp, &gOutputUnit ); if( comp == NULL ) { - ui_error( UI_ERROR_ERROR, "OpenAComponent=%d", err ); + ui_error( UI_ERROR_ERROR, "OpenAComponent=%ld", (long)err ); return 1; } @@ -166,7 +166,7 @@ &input, sizeof( input ) ); if( err ) { - ui_error( UI_ERROR_ERROR, "AudioUnitSetProperty-CB=%d", err ); + ui_error( UI_ERROR_ERROR, "AudioUnitSetProperty-CB=%ld", (long)err ); return 1; } @@ -177,13 +177,14 @@ &deviceFormat, sizeof( AudioStreamBasicDescription ) ); if( err ) { - ui_error( UI_ERROR_ERROR, "AudioUnitSetProperty-SF=%4.4s, %d", (char*)&err, err ); + ui_error( UI_ERROR_ERROR, "AudioUnitSetProperty-SF=%4.4s, %ld", (char*)&err, + (long)err ); return 1; } err = AudioUnitInitialize( gOutputUnit ); if( err ) { - ui_error( UI_ERROR_ERROR, "AudioUnitInitialize=%d", err ); + ui_error( UI_ERROR_ERROR, "AudioUnitInitialize=%ld", (long)err ); return 1; } @@ -224,7 +225,7 @@ err = AudioUnitUninitialize( gOutputUnit ); if( err ) { - printf( "AudioUnitUninitialize=%d", err ); + printf( "AudioUnitUninitialize=%ld", (long)err ); } CloseComponent( gOutputUnit ); @@ -263,7 +264,7 @@ default device */ OSStatus err = AudioOutputUnitStart( gOutputUnit ); if( err ) { - ui_error( UI_ERROR_ERROR, "AudioOutputUnitStart=%d", err ); + ui_error( UI_ERROR_ERROR, "AudioOutputUnitStart=%ld", (long)err ); return; } Modified: vendor/fuse-emulator/current/fuse/tape.c =================================================================== --- vendor/fuse-emulator/current/fuse/tape.c 2010-09-28 11:58:20 UTC (rev 647) +++ vendor/fuse-emulator/current/fuse/tape.c 2010-10-07 11:31:54 UTC (rev 648) @@ -1,7 +1,7 @@ /* tape.c: tape handling routines Copyright (c) 1999-2008 Philip Kendall, Darren Salt, Witold Filipczyk - $Id: tape.c 4086 2009-09-02 13:27:22Z fredm $ + $Id: tape.c 4155 2010-09-05 11:58: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 @@ -198,7 +198,7 @@ if( error ) { utils_close_file( &snap ); return error; } if( utils_close_file( &snap ) ) { - ui_error( UI_ERROR_ERROR, "Couldn't munmap '%s': %s", filename, + ui_error( UI_ERROR_ERROR, "Couldn't close '%s': %s", filename, strerror( errno ) ); return 1; } @@ -564,6 ... [truncated message content] |