[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx: [309] vendor/fuse/current
Brought to you by:
fredm
|
From: <fr...@us...> - 2007-03-10 12:02:08
|
Revision: 309
http://svn.sourceforge.net/fuse-for-macosx/?rev=309&view=rev
Author: fredm
Date: 2007-03-10 04:02:05 -0800 (Sat, 10 Mar 2007)
Log Message:
-----------
Load . into vendor/fuse/current.
Modified Paths:
--------------
vendor/fuse/current/configure.in
vendor/fuse/current/display.c
vendor/fuse/current/fuse.c
vendor/fuse/current/hacking/ChangeLog
vendor/fuse/current/hacking/cvs-tags
vendor/fuse/current/if1.c
vendor/fuse/current/man/fuse.1
vendor/fuse/current/rzx.c
vendor/fuse/current/settings.dat
vendor/fuse/current/sound/aosound.c
vendor/fuse/current/sound/coreaudiosound.c
vendor/fuse/current/sound/sdlsound.c
vendor/fuse/current/sound.c
vendor/fuse/current/ui/gtk/gtkui.c
vendor/fuse/current/ui.c
vendor/fuse/current/utils.c
vendor/fuse/current/widget/filesel.c
Modified: vendor/fuse/current/configure.in
===================================================================
--- vendor/fuse/current/configure.in 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/configure.in 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $Id: configure.in,v 1.155 2007/02/02 16:21:50 pak21 Exp $
+dnl $Id: configure.in,v 1.155.2.1 2007/03/03 21:26:14 pak21 Exp $
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
@@ -388,9 +388,9 @@
dnl Check if a version of libao which supplies ao_open_live is available
AC_MSG_CHECKING(whether libao requested)
AC_ARG_WITH(libao,
-[ --without-libao don't use libao],
+[ --with-libao use libao for sound output],
if test "$withval" = no; then libao=no; else libao=yes; fi,
-libao=yes)
+libao=no)
AC_MSG_RESULT($libao)
if test "$libao" = yes; then
AC_CHECK_LIB( ao, ao_open_live,
Modified: vendor/fuse/current/display.c
===================================================================
--- vendor/fuse/current/display.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/display.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -2,7 +2,7 @@
Copyright (c) 1999-2006 Philip Kendall, Thomas Harte, Witold Filipczyk
and Fredrick Meunier
- $Id: display.c,v 1.59 2007/02/02 16:21:50 pak21 Exp $
+ $Id: display.c,v 1.59.2.1 2007/03/06 11:39:47 fredm Exp $
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
@@ -651,7 +651,9 @@
*y = ( tstates - machine_current->line_times[ 0 ] ) /
machine_current->timings.tstates_per_line;
- *x = ( tstates - machine_current->line_times[ *y ] ) / 4;
+ if( *y >= 0 && *y <= DISPLAY_SCREEN_HEIGHT )
+ *x = ( tstates - machine_current->line_times[ *y ] ) / 4;
+ else *x = 0;
}
void
Modified: vendor/fuse/current/fuse.c
===================================================================
--- vendor/fuse/current/fuse.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/fuse.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,7 +1,7 @@
/* fuse.c: The Free Unix Spectrum Emulator
Copyright (c) 1999-2005 Philip Kendall
- $Id: fuse.c,v 1.133 2007/02/02 16:21:51 pak21 Exp $
+ $Id: fuse.c,v 1.133.2.1 2007/02/17 17:12:29 pak21 Exp $
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
@@ -113,6 +113,7 @@
const char *zxatasp_master, *zxatasp_slave;
const char *zxcf;
const char *divide_master, *divide_slave;
+ const char *mdr[8];
} start_files_t;
@@ -474,6 +475,15 @@
start_files->divide_master = settings_current.divide_master_file;
start_files->divide_slave = settings_current.divide_slave_file;
+ start_files->mdr[0] = settings_current.mdr_file;
+ start_files->mdr[1] = settings_current.mdr_file2;
+ start_files->mdr[2] = settings_current.mdr_file3;
+ start_files->mdr[3] = settings_current.mdr_file4;
+ start_files->mdr[4] = settings_current.mdr_file5;
+ start_files->mdr[5] = settings_current.mdr_file6;
+ start_files->mdr[6] = settings_current.mdr_file7;
+ start_files->mdr[7] = settings_current.mdr_file8;
+
return 0;
}
@@ -482,7 +492,7 @@
parse_nonoption_args( int argc, char **argv, int first_arg,
start_files_t *start_files )
{
- size_t i;
+ size_t i, j;
const char *filename;
utils_file file;
libspectrum_id_t type;
@@ -536,6 +546,15 @@
case LIBSPECTRUM_CLASS_SNAPSHOT:
start_files->snapshot = filename; break;
+ case LIBSPECTRUM_CLASS_MICRODRIVE:
+ for( j = 0; j < 8; j++ ) {
+ if( !start_files->mdr[j] ) {
+ start_files->mdr[j] = filename;
+ break;
+ }
+ }
+ break;
+
case LIBSPECTRUM_CLASS_TAPE:
start_files->tape = filename; break;
@@ -558,7 +577,7 @@
static int
do_start_files( start_files_t *start_files )
{
- int autoload, error;
+ int autoload, error, i;
/* Can't do both input recording and playback */
if( start_files->playback && start_files->recording ) {
@@ -637,6 +656,15 @@
if( error ) return error;
}
+ /* Microdrive cartridges */
+
+ for( i = 0; i < 8; i++ ) {
+ if( start_files->mdr[i] ) {
+ error = utils_open_file( start_files->mdr[i], autoload, NULL );
+ if( error ) return error;
+ }
+ }
+
/* IDE hard disk images */
if( start_files->simpleide_master ) {
Modified: vendor/fuse/current/hacking/ChangeLog
===================================================================
--- vendor/fuse/current/hacking/ChangeLog 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/hacking/ChangeLog 2007-03-10 12:02:05 UTC (rev 309)
@@ -1524,4 +1524,41 @@
20070202 BRANCH: Release-0_8_0-branch
20070202 TAG: Release-0_8_0-pre1 (Release-0_8_0-branch)
20070204 sound.c: don't disable sound completely if we don't enable sound
- after an unpause (fixes bug #1648246) (Fred).
+ after an unpause (fixes bug #1648246) (Release-0_8_0-branch) (Fred).
+20070204 rzx.c: use new libspectrum_rzx_playback_frame() API to allow
+ loading of snapshots (necessary for playing back RZX files made with
+ SPIN's "RZX Pause" feature).
+20070207 man/fuse.1: document that metacity needs --no-aspect-hint
+ (Thanks, Stuart Brady and dave in #spin) (Release-0_8_0-branch).
+20070208 rzx.c: ensure tstates is sane after RZX completion
+ (bug #1654165) (Release-0_8_0-branch).
+20070209 rzx.c: ensure tstates is sane after RZX desync
+ (Release-0_8_0-branch).
+20070210 sound/{coreaudiosound.c,sdlsound.c}: make sound fifo two frames in
+ size rather than a multiple of the sound fragment size, make sound
+ callbacks run after some sound is available, calculate SDL fragment
+ size based on machine speed and output frequency
+ (Release-0_8_0-branch) (Fred).
+20070217 widget/filesel.c: allow absolute pathnames to be used (fixes bug
+ #1651433) (Release-0_8_0-branch) (Gergely Szasz).
+20070217 sound/aosound.c: stop possible segfaults (part of bug #1659865)
+ (Release-0_8_0-branch) (Gergely Szasz).
+20070217 man/fuse.1: small ao improvements (rest of bug #1659865)
+ (Release-0_8_0-branch) (Gergely Szasz).
+20070217 fuse.c,if1.c,settings.dat,utils.c: allow microdrive cartridge images
+ to be used on startup (bug #1660099) (Release-0_8_0-branch)
+ (Gergely Szasz).
+20070303 settings.dat,man/fuse.1,ui/gtk/gtkui.c: new --strict-aspect-hint
+ option to improve situation with Metacity not being able to resize
+ or move GTK+ window (bug #1539655) (Release-0_8_0-branch).
+20070303 configure.in: don't use libao by default (bug #1668916)
+ (Release-0_8_0-branch).
+20070303 TAG: Release-0_8_0-pre2 (Release-0_8_0-branch)
+20070303 man/fuse.1: document --rom-* options (bug #1262547)
+ (Release-0_8_0-branch).
+20070304 ui.c: swap Kempston mouse buttons (bug #1507684)
+ (Release-0_8_0-branch).
+20070306 sound.c: don't leak memory for tape_buf (Release-0_8_0-branch) (Fred).
+20070306 display.c: don't overrun line_times array (Release-0_8_0-branch)
+ (Fred).
+20070310 man/fuse.1: add divide url (Release-0_8_0-branch) (Fred).
Modified: vendor/fuse/current/hacking/cvs-tags
===================================================================
--- vendor/fuse/current/hacking/cvs-tags 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/hacking/cvs-tags 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,6 +1,6 @@
CVS tags for Fuse
-$Id: cvs-tags,v 1.32 2007/02/02 17:16:19 pak21 Exp $
+$Id: cvs-tags,v 1.32.2.1 2007/03/03 21:49:10 pak21 Exp $
| Release-0_3_1
| Release-0_3_2pre1
@@ -145,6 +145,7 @@
|
+-\
| | Release-0_8_0-pre1
+| | Release-0_8_0-pre2
| |
| | Release-0_8_0-branch
|
Modified: vendor/fuse/current/if1.c
===================================================================
--- vendor/fuse/current/if1.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/if1.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,7 +1,7 @@
/* if2.c: Interface I handling routines
Copyright (c) 2004-2007 Gergely Szasz, Philip Kendall
- $Id: if1.c,v 1.14 2007/01/20 17:54:51 pak21 Exp $
+ $Id: if1.c,v 1.14.2.1 2007/02/17 17:12:29 pak21 Exp $
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
@@ -788,8 +788,26 @@
void
if1_mdr_insert( const char *filename, int drive )
{
- microdrive_t *mdr = µdrive[drive];
+ microdrive_t *mdr;
+ int i;
+
+ if( drive == -1 ) { /* find an emtpty one */
+ for( i = 0; i < 8; i++ ) {
+ if( !microdrive[i].inserted ) {
+ drive = i;
+ break;
+ }
+ }
+ }
+
+ if( drive == -1 ) {
+ ui_error( UI_ERROR_ERROR,
+ "Cannot insert cartridge '%s', all microdrive loaded", filename );
+ return;
+ }
+ mdr = µdrive[drive];
+
if( mdr->inserted && if1_mdr_eject( NULL, drive ) ) {
ui_error( UI_ERROR_ERROR,
"New cartridge in drive, please eject manually" );
Modified: vendor/fuse/current/man/fuse.1
===================================================================
--- vendor/fuse/current/man/fuse.1 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/man/fuse.1 2007-03-10 12:02:05 UTC (rev 309)
@@ -83,15 +83,15 @@
.I \-\-aspect\-hint
.RS
Specify whether the GTK+ and Xlib user interfaces should `hint' to the
-window manager about the preferred aspect ratio for the top-level
+window manager about the preferred aspect ratio for the graphics
window, thus preventing resizing to non-square sizes which lead to
-Fuse not displaying correctly. However, with some window managers (for
-example
-.IR icewm (1))
-this prevents the window from being resized at all. (Enabled by
+Fuse not displaying correctly. This option has been observed to cause
+problems with some window managers when using the GTK+ UI which can
+prevent the window from being resized or moved at all. (Enabled by
default, but you can use
.RI ` \-\-no\-aspect\-hint '
-to disable).
+to disable). See also the
+.RI ` \-\-strict\-aspect\-hint ' option.
.RE
.PP
.I \-\-autosave\-settings
@@ -406,6 +406,102 @@
Specify an RZX file to begin recording to.
.RE
.PP
+.I "\-\-rom\-16 file"
+.br
+.I "\-\-rom\-48 file"
+.br
+.I "\-\-rom\-128-0 file"
+.br
+.I "\-\-rom\-128-1 file"
+.br
+.I "\-\-rom\-plus2-0 file"
+.br
+.I "\-\-rom\-plus2-1 file"
+.br
+.I "\-\-rom\-plus2a-0 file"
+.br
+.I "\-\-rom\-plus2a-1 file"
+.br
+.I "\-\-rom\-plus2a-2 file"
+.br
+.I "\-\-rom\-plus2a-3 file"
+.br
+.I "\-\-rom\-plus3-0 file"
+.br
+.I "\-\-rom\-plus3-1 file"
+.br
+.I "\-\-rom\-plus3-2 file"
+.br
+.I "\-\-rom\-plus3-3 file"
+.br
+.I "\-\-rom\-plus3e-0 file"
+.br
+.I "\-\-rom\-plus3e-1 file"
+.br
+.I "\-\-rom\-plus3e-2 file"
+.br
+.I "\-\-rom\-plus3e-3 file"
+.br
+.I "\-\-rom\-tc2048 file"
+.br
+.I "\-\-rom\-tc2068-0 file"
+.br
+.I "\-\-rom\-tc2068-1 file"
+.br
+.I "\-\-rom\-ts2068-0 file"
+.br
+.I "\-\-rom\-ts2068-1 file"
+.br
+.I "\-\-rom\-pentagon-0 file"
+.br
+.I "\-\-rom\-pentagon-1 file"
+.br
+.I "\-\-rom\-pentagon-2 file"
+.br
+.I "\-\-rom\-scorpion-0 file"
+.br
+.I "\-\-rom\-scorpion-1 file"
+.br
+.I "\-\-rom\-scorpion-2 file"
+.br
+.I "\-\-rom\-scorpion-3 file"
+.br
+.I "\-\-rom\-spec-se-0 file"
+.br
+.I "\-\-rom\-spec-se-1 file"
+.br
+.I "\-\-rom\-interface-1 file"
+.RS
+Specify the file to be used for ROM(s) used for each machine. The
+options respectively refer to the 16K Spectrum
+.RI ( 48.rom ),
+48K Spectrum
+.RI ( 48.rom ),
+the two ROMs for the 128K Spectrum
+.RI ( 128-0.rom " and " 128-1.rom ),
+the two ROMs for the +2
+.RI ( plus2-0.rom " and " plus2-1.rom ),
+the four ROMs for the +2A
+.RI ( plus3-0.rom ", " plus3-1.rom ", " plus3-2.rom " and " plus3-3.rom ),
+the four ROMs for the +3
+.RI ( plus3-0.rom ", " plus3-1.rom ", " plus3-2.rom " and " plus3-3.rom ),
+the TC2048 ROM
+.RI ( tc2048.rom ),
+the two ROMs for the TC2068
+.RI ( tc2068-0.rom " and " tc2068-1.rom ),
+the two ROMs for the TS2068
+.RI ( tc2068-0.rom " and " tc2068-1.rom ),
+the two main ROMs and the TR-DOS ROM for the Pentagon 128
+.RI ( 128p-0.rom ", " 128p-1.rom " and " trdos.rom ),
+the four ROMs for the Scorpion 256
+.RI ( 256s-0.rom ", " 256s-1.rom ", " 256s-2.rom " and " 256s-3.rom ),
+the two ROMs for the Spectrum SE
+.RI ( se-0.rom " and " se-1.rom ),
+and the Interface I ROM
+.RI ( if1-2.rom ).
+The names in brackets denote the defaults.
+.RE
+.PP
.I \-\-separation
.RS
Give stereo separation of the 128's AY sound channels. Same as the
@@ -556,12 +652,16 @@
.RI buffer_time= num
.br
.RI ` num '
-gives the ALSA buffer time.
+gives the ALSA buffer time in microseconds.
.IP \[bu]
.RI period_time= num
.br
.RI ` num '
-gives the ALSA period time.
+gives the ALSA period time in microseconds.
+.IP \[bu]
+.RI use_mmap= yes|y|true|t|1
+.br
+specifies that libao use memory mapped transfer.
.RE
.IP \[bu]
.IR arts :
@@ -691,6 +791,19 @@
option.
.RE
.PP
+.I "\-\-strict\-aspect\-hint"
+.RS
+For the GTK+ UI, use stricter limits for the aspect ratio limits set
+by the
+.RI ` \-\-aspect\-hint '
+option. This can cause some window managers (for example,
+.IR metacity (1))
+to not allow the window to be resized and moved, but is necessary to
+prevent others (for example,
+.IR fvwm (1))
+from being able resize the window away from square.
+.RE
+.PP
.I "\-v mode"
.br
.I "\-\-svgamode mode"
@@ -2358,7 +2471,7 @@
.SH "DIVIDE"
The DivIDE is another IDE interface for the Spectrum, of which full
details can be found at
-.IR "http://insert.divide.url/" .
+.IR "http://baze.au.com/divide/" .
The interface can be activated via the
.I "DivIDE interface"
option from the
Modified: vendor/fuse/current/rzx.c
===================================================================
--- vendor/fuse/current/rzx.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/rzx.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,7 +1,7 @@
/* rzx.c: .rzx files
Copyright (c) 2002-2003 Philip Kendall
- $Id: rzx.c,v 1.70 2007/02/02 16:21:51 pak21 Exp $
+ $Id: rzx.c,v 1.70.2.3 2007/02/09 08:21:33 pak21 Exp $
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
@@ -307,9 +307,22 @@
out of frames, as this occurs just before a normal end of frame
and everything works normally as rzx_playback is now zero again */
if( add_interrupt ) {
+
error = event_add( machine_current->timings.tstates_per_frame,
EVENT_TYPE_FRAME );
if( error ) return error;
+
+ /* We're no longer doing RZX playback, so tstates now be <= the
+ normal frame count */
+ if( tstates > machine_current->timings.tstates_per_frame )
+ tstates = machine_current->timings.tstates_per_frame;
+
+ } else {
+
+ /* Ensure that tstates will be zero after it is reduced in
+ spectrum_frame() */
+ tstates = machine_current->timings.tstates_per_frame;
+
}
libspec_error = libspectrum_rzx_free( rzx );
@@ -360,8 +373,9 @@
static int playback_frame( void )
{
int error, finished;
+ libspectrum_snap *snap;
- error = libspectrum_rzx_playback_frame( rzx, &finished );
+ error = libspectrum_rzx_playback_frame( rzx, &finished, &snap );
if( error ) return rzx_stop_playback( 0 );
if( finished ) {
@@ -369,6 +383,11 @@
return rzx_stop_playback( 0 );
}
+ if( snap ) {
+ error = snapshot_copy_from( snap );
+ if( error ) return rzx_stop_playback( 0 );
+ }
+
/* If we've got another frame to do, fetch the new instruction count and
continue */
rzx_instruction_count = libspectrum_rzx_instructions( rzx );
Modified: vendor/fuse/current/settings.dat
===================================================================
--- vendor/fuse/current/settings.dat 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/settings.dat 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,7 +1,7 @@
# settings.dat: configuration options for Fuse
# Copyright (c) 2002-2004 Philip Kendall
-# $Id: settings.dat,v 1.56 2007/02/02 16:21:52 pak21 Exp $
+# $Id: settings.dat,v 1.56.2.2 2007/03/03 21:02:01 pak21 Exp $
# 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
@@ -107,6 +107,14 @@
dck_file, string, NULL,, dock
if2_file, string, NULL,, if2cart
+mdr_file, string, NULL,, microdrive-file
+mdr_file2, string, NULL,, microdrive-2-file
+mdr_file3, string, NULL,, microdrive-3-file
+mdr_file4, string, NULL,, microdrive-4-file
+mdr_file5, string, NULL,, microdrive-5-file
+mdr_file6, string, NULL,, microdrive-6-file
+mdr_file7, string, NULL,, microdrive-7-file
+mdr_file8, string, NULL,, microdrive-8-file
simpleide_active, boolean, 0,, simpleide
simpleide_master_file, string, NULL,, simpleide-masterfile
simpleide_slave_file, string, NULL,, simpleide-slavefile
@@ -127,6 +135,7 @@
printer_text_filename, string, "printout.txt",, textfile
aspect_hint, boolean, 1
+strict_aspect_hint, boolean, 0
svga_mode, numeric, 320, 'v', svgamode
doublescan_mode, numeric, 1, 'D', doublescan-mode
Modified: vendor/fuse/current/sound/aosound.c
===================================================================
--- vendor/fuse/current/sound/aosound.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/sound/aosound.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,7 +1,7 @@
/* aosound.c: libao sound I/O
Copyright (c) 2004 Gergely Szasz, Philip Kendall
- $Id: aosound.c,v 1.3 2007/02/02 16:21:55 pak21 Exp $
+ $Id: aosound.c,v 1.3.2.1 2007/02/17 17:05:43 pak21 Exp $
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
@@ -43,6 +43,7 @@
static int sixteenbit = 1;
static char *filename = NULL;
static const char *default_filename = "fuse-sound.ao";
+static int first_init = 1;
static void
driver_error( void )
@@ -87,6 +88,9 @@
char *mutable, *option, *key, *value;
/* Get a copy of the device string we can modify */
+ if( !device || *device == '\0' )
+ return 0;
+
mutable = strdup( device );
if( !mutable ) {
ui_error( UI_ERROR_ERROR, "out of memory at %s:%d", __FILE__, __LINE__ );
@@ -97,7 +101,8 @@
option = strchr( mutable, ':' );
if( option ) *option++ = '\0';
- *driver_id = ao_driver_id( mutable );
+ if( *mutable ) /* ! \0 */
+ *driver_id = ao_driver_id( mutable );
/* Now parse any further options */
while( option ) {
@@ -118,8 +123,11 @@
free( mutable );
return 1;
}
- } else {
+ } else if( key && value) {
ao_append_option( options, key, value );
+ } else if ( first_init ) {
+ ui_error( UI_ERROR_ERROR, "ignoring badly formed libao option (%s%s)",
+ key ? key : "", value ? value : "" );
}
}
@@ -148,21 +156,16 @@
ao_initialize();
- if( !device || *device == '\0' ) {
+ error = parse_driver_options( device, &driver_id, &options );
+ if( error ) {
+ settings_current.sound = 0;
+ sound_lowlevel_init_in_progress = 0;
+ return error;
+ }
+ if( driver_id == -1 )
driver_id = ao_default_driver_id();
- } else {
-
- error = parse_driver_options( device, &driver_id, &options );
- if( error ) {
- settings_current.sound = 0;
- sound_lowlevel_init_in_progress = 0;
- return error;
- }
-
- }
-
if( driver_id == -1 ) {
ui_error( UI_ERROR_ERROR, "ao: driver '%s' unknown",
device );
@@ -191,7 +194,7 @@
} else {
- if( !filename ) filename = default_filename;
+ if( !filename ) filename = (char *)default_filename;
dev_for_ao = ao_open_file( driver_id, filename, 1, &format, options);
}
@@ -206,6 +209,7 @@
ao_free_options( options );
sound_lowlevel_init_in_progress = 0;
+ first_init = 0;
return 0;
}
@@ -221,8 +225,8 @@
void
sound_lowlevel_frame( libspectrum_signed_word *data, int len )
{
- static unsigned char buf8[4096];
- signed char *data8 = ( signed char* )data;
+ static signed char buf8[4096];
+ void *data8 = data;
len <<= 1; /* now in bytes */
Modified: vendor/fuse/current/sound/coreaudiosound.c
===================================================================
--- vendor/fuse/current/sound/coreaudiosound.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/sound/coreaudiosound.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -28,12 +28,16 @@
#include <CoreAudio/AudioHardware.h>
#include <AudioUnit/AudioUnit.h>
+#include "settings.h"
#include "sfifo.h"
#include "sound.h"
#include "ui/ui.h"
sfifo_t sound_fifo;
+/* Number of Spectrum frames audio latency to use */
+#define NUM_FRAMES 2
+
static
OSStatus coreaudiowrite( void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
@@ -49,6 +53,9 @@
*/
static AudioUnit gOutputUnit;
+/* Records sound writer status information */
+static int audio_output_started;
+
int
sound_lowlevel_init( const char *dev, int *freqptr, int *stereoptr )
{
@@ -58,6 +65,8 @@
UInt32 deviceBufferSize; /* bufferSize returned by
kAudioDevicePropertyBufferSize */
int error;
+ float hz;
+ int sound_framesiz;
/* get the default output device for the HAL */
count = sizeof( device );
@@ -158,21 +167,21 @@
return 1;
}
- if( ( error = sfifo_init( &sound_fifo, 2 * deviceFormat.mChannelsPerFrame
- * deviceBufferSize + 1 ) ) ) {
+ hz = (float)machine_current->timings.processor_speed /
+ machine_current->timings.tstates_per_frame;
+ sound_framesiz = deviceFormat.mSampleRate / hz;
+
+ if( ( error = sfifo_init( &sound_fifo, NUM_FRAMES
+ * deviceFormat.mBytesPerFrame
+ * deviceFormat.mChannelsPerFrame
+ * sound_framesiz + 1 ) ) ) {
ui_error( UI_ERROR_ERROR, "Problem initialising sound fifo: %s",
strerror ( error ) );
return 1;
}
- /* Start the rendering
- The DefaultOutputUnit will do any format conversions to the format of the
- default device */
- err = AudioOutputUnitStart( gOutputUnit );
- if( err ) {
- ui_error( UI_ERROR_ERROR, "AudioOutputUnitStart=%ld", err );
- return 1;
- }
+ /* wait to run sound until we have some sound to play */
+ audio_output_started = 0;
return 0;
}
@@ -182,7 +191,8 @@
{
OSStatus err;
- verify_noerr( AudioOutputUnitStop( gOutputUnit ) );
+ if( audio_output_started )
+ verify_noerr( AudioOutputUnitStop( gOutputUnit ) );
err = AudioUnitUninitialize( gOutputUnit );
if( err ) {
@@ -218,6 +228,19 @@
ui_error( UI_ERROR_ERROR, "Couldn't write sound fifo: %s",
strerror( i ) );
}
+
+ if( !audio_output_started ) {
+ /* Start the rendering
+ The DefaultOutputUnit will do any format conversions to the format of the
+ default device */
+ OSStatus err = AudioOutputUnitStart( gOutputUnit );
+ if( err ) {
+ ui_error( UI_ERROR_ERROR, "AudioOutputUnitStart=%ld", err );
+ return;
+ }
+
+ audio_output_started = 1;
+ }
}
/* This is the audio processing callback. */
Modified: vendor/fuse/current/sound/sdlsound.c
===================================================================
--- vendor/fuse/current/sound/sdlsound.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/sound/sdlsound.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -2,7 +2,7 @@
Copyright (c) 2002-2004 Alexander Yurchenko, Russell Marks, Philip Kendall,
Fredrick Meunier
- $Id: sdlsound.c,v 1.18 2006/12/22 10:55:46 fredm Exp $
+ $Id: sdlsound.c,v 1.18.2.1 2007/02/10 00:59:36 fredm Exp $
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 <errno.h>
#include <fcntl.h>
+#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
@@ -41,19 +42,23 @@
#include "sound.h"
#include "ui/ui.h"
-/* using (7) 32 byte frags for 8kHz, scale up for higher */
-#define BASE_SOUND_FRAG_PWR 7
-
static void sdlwrite( void *userdata, Uint8 *stream, int len );
sfifo_t sound_fifo;
+/* Number of Spectrum frames audio latency to use */
+#define NUM_FRAMES 2
+
+/* Records sound writer status information */
+static int audio_output_started;
+
int
sound_lowlevel_init( const char *device, int *freqptr, int *stereoptr )
{
SDL_AudioSpec requested, received;
- int frag;
int error;
+ float hz;
+ int sound_framesiz;
/* I'd rather just use setenv, but Windows doesn't have it */
if( device ) {
@@ -80,16 +85,11 @@
requested.format = AUDIO_S16SYS;
requested.callback = sdlwrite;
- frag = BASE_SOUND_FRAG_PWR;
- if (*freqptr > 8250)
- frag++;
- if (*freqptr > 16500)
- frag++;
- if (*freqptr > 33000)
- frag++;
+ hz = (float)machine_current->timings.processor_speed /
+ machine_current->timings.tstates_per_frame;
+ sound_framesiz = *freqptr / hz;
+ requested.samples = pow(2.0, floor(log2(sound_framesiz)));
- requested.samples = 1 << frag;
-
if ( SDL_OpenAudio( &requested, &received ) < 0 ) {
settings_current.sound = 0;
ui_error( UI_ERROR_ERROR, "Couldn't open sound device: %s",
@@ -106,39 +106,36 @@
requested.freq = *freqptr;
- frag = BASE_SOUND_FRAG_PWR;
- if (*freqptr > 8250)
- frag++;
- if (*freqptr > 16500)
- frag++;
- if (*freqptr > 33000)
- frag++;
+ hz = (float)machine_current->timings.processor_speed /
+ machine_current->timings.tstates_per_frame;
+ sound_framesiz = *freqptr / hz;
+ requested.samples = pow(2.0, floor(log2(sound_framesiz)));
- requested.samples = 1 << frag;
-
if( SDL_OpenAudio( &requested, NULL ) < 0 ) {
settings_current.sound = 0;
ui_error( UI_ERROR_ERROR, "Couldn't open sound device: %s",
SDL_GetError() );
return 1;
}
-
- /* Convert from 16-bit stereo samples to bytes plus some headroom */
- frag = 1 << (frag+3);
-
} else {
- *freqptr = received.freq;
*stereoptr = received.channels == 1 ? 0 : 1;
- frag = received.size;
}
- if( ( error = sfifo_init( &sound_fifo, 2 * frag + 1 ) ) ) {
+ hz = (float)machine_current->timings.processor_speed /
+ machine_current->timings.tstates_per_frame;
+ sound_framesiz = *freqptr / hz;
+ sound_framesiz <<= 1;
+
+ if( ( error = sfifo_init( &sound_fifo, NUM_FRAMES
+ * received.channels
+ * sound_framesiz + 1 ) ) ) {
ui_error( UI_ERROR_ERROR, "Problem initialising sound fifo: %s",
strerror ( error ) );
return 1;
}
- SDL_PauseAudio( 0 );
+ /* wait to run sound until we have some sound to play */
+ audio_output_started = 0;
return 0;
}
@@ -177,6 +174,11 @@
ui_error( UI_ERROR_ERROR, "Couldn't write sound fifo: %s\n",
strerror( i ) );
}
+
+ if( !audio_output_started ) {
+ SDL_PauseAudio( 0 );
+ audio_output_started = 1;
+ }
}
/* Write len samples from fifo into stream */
Modified: vendor/fuse/current/sound.c
===================================================================
--- vendor/fuse/current/sound.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/sound.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,7 +1,7 @@
/* sound.c: Sound support
Copyright (c) 2000-2005 Russell Marks, Matan Ziv-Av, Philip Kendall
- $Id: sound.c,v 1.49.2.1 2007/02/04 06:35:04 fredm Exp $
+ $Id: sound.c,v 1.49.2.2 2007/03/06 11:36:23 fredm Exp $
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
@@ -278,7 +278,12 @@
if(sound_enabled)
{
if(sound_buf)
+ {
free(sound_buf);
+ sound_buf=NULL;
+ free(tape_buf);
+ tape_buf=NULL;
+ }
sound_lowlevel_end();
sound_enabled=0;
}
Modified: vendor/fuse/current/ui/gtk/gtkui.c
===================================================================
--- vendor/fuse/current/ui/gtk/gtkui.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/ui/gtk/gtkui.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,7 +1,7 @@
/* gtkui.c: GTK+ routines for dealing with the user interface
Copyright (c) 2000-2005 Philip Kendall, Russell Marks
- $Id: gtkui.c,v 1.162 2007/02/02 16:21:59 pak21 Exp $
+ $Id: gtkui.c,v 1.162.2.1 2007/03/03 21:02:01 pak21 Exp $
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,11 +187,17 @@
if( settings_current.aspect_hint ) {
hints |= GDK_HINT_ASPECT;
- geometry.min_aspect = geometry.max_aspect =
- ((float)DISPLAY_ASPECT_WIDTH)/DISPLAY_SCREEN_HEIGHT;
+ if( settings_current.strict_aspect_hint ) {
+ geometry.min_aspect = geometry.max_aspect =
+ (float)DISPLAY_ASPECT_WIDTH / DISPLAY_SCREEN_HEIGHT;
+ } else {
+ geometry.min_aspect = 1.2;
+ geometry.max_aspect = 1.5;
+ }
}
- gtk_window_set_geometry_hints( GTK_WINDOW(gtkui_window), gtkui_drawing_area,
+ gtk_window_set_geometry_hints( GTK_WINDOW(gtkui_window),
+ GTK_WIDGET(gtkui_drawing_area),
&geometry, hints );
if( gtkdisplay_init() ) return 1;
Modified: vendor/fuse/current/ui.c
===================================================================
--- vendor/fuse/current/ui.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/ui.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,7 +1,7 @@
/* ui.c: User interface routines, but those which are independent of any UI
Copyright (c) 2002 Philip Kendall
- $Id: ui.c,v 1.26 2007/02/02 16:21:52 pak21 Exp $
+ $Id: ui.c,v 1.26.2.1 2007/03/04 12:27:24 pak21 Exp $
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
@@ -144,8 +144,8 @@
/* Possibly we'll end up handling _more_ than one mouse interface... */
switch( button ) {
- case 1: if( ui_mouse_grabbed ) kempmouse_update( 0, 0, 0, down ); break;
- case 3: if( ui_mouse_grabbed ) kempmouse_update( 0, 0, 1, down ); break;
+ case 1: if( ui_mouse_grabbed ) kempmouse_update( 0, 0, 1, down ); break;
+ case 3: if( ui_mouse_grabbed ) kempmouse_update( 0, 0, 0, down ); break;
case 2:
if( ui_mouse_present && settings_current.kempston_mouse
&& !down && !mouse_grab_suspended )
Modified: vendor/fuse/current/utils.c
===================================================================
--- vendor/fuse/current/utils.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/utils.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -1,7 +1,7 @@
/* utils.c: some useful helper functions
Copyright (c) 1999-2005 Philip Kendall
- $Id: utils.c,v 1.59 2007/02/02 16:21:52 pak21 Exp $
+ $Id: utils.c,v 1.59.2.1 2007/02/17 17:12:29 pak21 Exp $
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
@@ -153,7 +153,7 @@
break;
case LIBSPECTRUM_CLASS_MICRODRIVE:
- if1_mdr_insert( filename, 0 );
+ if1_mdr_insert( filename, -1 );
break;
case LIBSPECTRUM_CLASS_CARTRIDGE_TIMEX:
Modified: vendor/fuse/current/widget/filesel.c
===================================================================
--- vendor/fuse/current/widget/filesel.c 2007-03-10 11:54:28 UTC (rev 308)
+++ vendor/fuse/current/widget/filesel.c 2007-03-10 12:02:05 UTC (rev 309)
@@ -2,7 +2,7 @@
Copyright (c) 2001-2005 Matan Ziv-Av, Philip Kendall, Russell Marks,
Marek Januszewski
- $Id: filesel.c,v 1.34 2007/02/02 16:22:00 pak21 Exp $
+ $Id: filesel.c,v 1.34.2.1 2007/02/17 16:40:36 pak21 Exp $
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
@@ -520,26 +520,33 @@
break;
case INPUT_KEY_Tab:
- if( is_saving )
- {
+ if( is_saving ) {
widget_text_t text_data;
text_data.title = title;
text_data.allow = WIDGET_INPUT_ASCII;
text_data.text[0] = 0;
- if( widget_do( WIDGET_TYPE_TEXT, &text_data )
- || !widget_text_text || !*widget_text_text )
+ if( widget_do( WIDGET_TYPE_TEXT, &text_data ) ||
+ !widget_text_text || !*widget_text_text )
break;
- /* Get current dir name and allocate space for the leafname */
- fn = widget_getcwd();
- if( fn )
- fn = realloc( fn, strlen( fn ) + strlen( widget_text_text ) + 2 );
- if( !fn ) {
- widget_end_widget( WIDGET_FINISHED_CANCEL );
- return;
+ if( *widget_text_text != '/' ) { /* relative name */
+ /* Get current dir name and allocate space for the leafname */
+ fn = widget_getcwd();
+ if( fn )
+ fn = realloc( fn, strlen( fn ) + strlen( widget_text_text ) + 2 );
+ if( !fn ) {
+ widget_end_widget( WIDGET_FINISHED_CANCEL );
+ return;
+ }
+ /* Append the leafname and return it */
+ strcat( fn, "/" );
+ strcat( fn, widget_text_text );
+ } else { /* absolute name */
+ fn = strdup( widget_text_text );
+ if( !fn ) {
+ widget_end_widget( WIDGET_FINISHED_CANCEL );
+ return;
+ }
}
- /* Append the leafname and return it */
- strcat( fn, "/" );
- strcat( fn, widget_text_text );
widget_filesel_name = fn;
if( exit_all_widgets ) {
widget_end_all( WIDGET_FINISHED_OK );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|