Thread: [Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx: [447] vendor/fuse-emulator/current/fuse
Brought to you by:
fredm
|
From: <fr...@us...> - 2007-08-06 01:17:06
|
Revision: 447
http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=447&view=rev
Author: fredm
Date: 2007-08-05 18:17:08 -0700 (Sun, 05 Aug 2007)
Log Message:
-----------
To prepare to load . into vendor/fuse-emulator/current, perform 2
renames.
* vendor/fuse-emulator/current/fuse/timer/timer.c: Renamed from
vendor/fuse-emulator/current/fuse/timer.c.
* vendor/fuse-emulator/current/fuse/timer/timer.h: Renamed from
vendor/fuse-emulator/current/fuse/timer.h.
Added Paths:
-----------
vendor/fuse-emulator/current/fuse/timer/
vendor/fuse-emulator/current/fuse/timer/timer.c
vendor/fuse-emulator/current/fuse/timer/timer.h
Removed Paths:
-------------
vendor/fuse-emulator/current/fuse/timer.c
vendor/fuse-emulator/current/fuse/timer.h
Copied: vendor/fuse-emulator/current/fuse/timer/timer.c (from rev 446, vendor/fuse-emulator/current/fuse/timer.c)
===================================================================
--- vendor/fuse-emulator/current/fuse/timer/timer.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/timer/timer.c 2007-08-06 01:17:08 UTC (rev 447)
@@ -0,0 +1,334 @@
+/* timer.c: Speed routines for Fuse
+ Copyright (c) 1999-2004 Philip Kendall, Marek Januszewski, Fredrick Meunier
+
+ $Id: timer.c 3043 2007-07-04 14:28:49Z zubzero $
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Author contact information:
+
+ E-mail: phi...@sh...
+
+*/
+
+#include <config.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "fuse.h"
+#include "event.h"
+#include "settings.h"
+#include "sound.h"
+#include "sound/lowlevel.h"
+#include "tape.h"
+#include "timer.h"
+#include "ui/ui.h"
+#include "ula.h"
+
+static void timer_add_time_difference( timer_type *a, long msec );
+static int timer_frame_callback_sound( libspectrum_dword last_tstates );
+
+/*
+ * Routines for estimating emulation speed
+ */
+
+/* The actual time at the end of each of the last 10 emulated seconds */
+static timer_type stored_times[10];
+
+/* Which is the next entry in 'stored_times' that we will update */
+static size_t next_stored_time;
+
+/* The number of frames until we next update 'stored_times' */
+static int frames_until_update;
+
+/* The number of time samples we have for estimating speed */
+static int samples;
+
+float current_speed = 100.0;
+
+static timer_type start_time;
+
+static const int TEN_MS = 10;
+
+int
+timer_estimate_speed( void )
+{
+ timer_type current_time;
+ float difference;
+ int error;
+
+ if( frames_until_update-- ) return 0;
+
+ error = timer_get_real_time( ¤t_time ); if( error ) return error;
+
+ if( samples < 10 ) {
+
+ /* If we don't have enough data, assume we're running at the desired
+ speed :-) */
+ current_speed = settings_current.emulation_speed;
+
+ } else {
+
+ difference =
+ timer_get_time_difference( ¤t_time,
+ &stored_times[ next_stored_time ] );
+ current_speed = 100 * ( 10.0 / difference );
+
+ }
+
+ ui_statusbar_update_speed( current_speed );
+
+ stored_times[ next_stored_time ] = current_time;
+
+ next_stored_time = ( next_stored_time + 1 ) % 10;
+ frames_until_update =
+ ( machine_current->timings.processor_speed /
+ machine_current->timings.tstates_per_frame ) - 1;
+
+ samples++;
+
+ return 0;
+}
+
+#ifdef UI_SDL
+
+int
+timer_get_real_time( timer_type *real_time )
+{
+ *real_time = SDL_GetTicks();
+
+ return 0;
+}
+
+float
+timer_get_time_difference( timer_type *a, timer_type *b )
+{
+ return ( (long)*a - (long)*b ) / 1000.0;
+}
+
+static void
+timer_add_time_difference( timer_type *a, long msec )
+{
+ *a += msec;
+}
+
+void
+timer_sleep_ms( int ms )
+{
+ SDL_Delay( ms );
+}
+
+#elif defined(WIN32) /* #ifdef UI_SDL */
+
+int
+timer_get_real_time( timer_type *real_time )
+{
+ *real_time = GetTickCount();
+
+ return 0;
+}
+
+float
+timer_get_time_difference( timer_type *a, timer_type *b )
+{
+ return ( (long)*a - (long)*b ) / 1000.0;
+}
+
+static void
+timer_add_time_difference( timer_type *a, long msec )
+{
+ *a += msec;
+}
+
+void
+timer_sleep_ms( int ms )
+{
+ Sleep( ms );
+}
+
+#else /* #ifdef UI_SDL */
+
+int
+timer_get_real_time( timer_type *real_time )
+{
+ int error;
+
+ error = gettimeofday( real_time, NULL );
+ if( error ) {
+ ui_error( UI_ERROR_ERROR, "error getting time: %s", strerror( errno ) );
+ return 1;
+ }
+
+ return 0;
+}
+
+float
+timer_get_time_difference( timer_type *a, timer_type *b )
+{
+ return ( a->tv_sec - b->tv_sec ) + ( a->tv_usec - b->tv_usec ) / 1000000.0;
+}
+
+static void
+timer_add_time_difference( timer_type *a, long msec )
+{
+ a->tv_usec += msec * 1000;
+ if( a->tv_usec >= 1000000 ) {
+ a->tv_usec -= 1000000;
+ a->tv_sec += 1;
+ } else if( a->tv_usec < 0 ) {
+ a->tv_usec += 1000000;
+ a->tv_sec -= 1;
+ }
+}
+
+void
+timer_sleep_ms( int ms )
+{
+ usleep( ms * 1000 );
+}
+
+#endif /* #ifdef UI_SDL */
+
+int
+timer_estimate_reset( void )
+{
+ int error = timer_get_real_time( &start_time ); if( error ) return error;
+ samples = 0;
+ next_stored_time = 0;
+ frames_until_update = 0;
+
+ return 0;
+}
+
+int
+timer_init( void )
+{
+ int error = timer_get_real_time( &start_time ); if( error ) return error;
+
+ error = event_add( 0, EVENT_TYPE_TIMER );
+ if( error ) return error;
+
+ return 0;
+}
+
+int
+timer_end( void )
+{
+ return event_remove_type( EVENT_TYPE_TIMER );
+}
+
+#if defined SOUND_SDL || defined SOUND_COREAUDIO
+
+/* Callback-style sound based timer */
+#include "sound/sfifo.h"
+
+extern sfifo_t sound_fifo;
+
+static int
+timer_frame_callback_sound( libspectrum_dword last_tstates )
+{
+ for(;;) {
+
+ /* Sleep while fifo is full */
+ if( sfifo_space( &sound_fifo ) < sound_framesiz ) {
+ timer_sleep_ms( TEN_MS );
+ } else {
+ break;
+ }
+
+ }
+
+ if( event_add( last_tstates + machine_current->timings.tstates_per_frame,
+ EVENT_TYPE_TIMER ) )
+ return 1;
+
+ return 0;
+}
+
+#else /* #if defined SOUND_SDL || defined SOUND_COREAUDIO */
+
+/* Blocking socket-style sound based timer */
+static int
+timer_frame_callback_sound( libspectrum_dword last_tstates )
+{
+ if( event_add( last_tstates + machine_current->timings.tstates_per_frame,
+ EVENT_TYPE_TIMER ) )
+ return 1;
+
+ return 0;
+}
+
+#endif /* #if defined SOUND_SDL || defined SOUND_COREAUDIO */
+
+int
+timer_frame( libspectrum_dword last_tstates )
+{
+ int error;
+ timer_type current_time;
+ float difference;
+ float speed = ( settings_current.emulation_speed < 1 ?
+ 100 :
+ settings_current.emulation_speed ) / 100.0;
+ long tstates;
+
+ if( sound_enabled )
+ return timer_frame_callback_sound( last_tstates );
+
+ /* If we're fastloading, just schedule another check in a frame's time
+ and do nothing else */
+ if( settings_current.fastload && tape_is_playing() ) {
+
+ libspectrum_dword next_check_time =
+ last_tstates + machine_current->timings.tstates_per_frame;
+
+ if( event_add( next_check_time, EVENT_TYPE_TIMER ) )
+ return 1;
+
+ } else {
+
+ while( 1 ) {
+
+ error = timer_get_real_time( ¤t_time ); if( error ) return 1;
+
+ difference = timer_get_time_difference( ¤t_time, &start_time );
+
+ /* Sleep while we are still 10ms ahead */
+ if( difference < 0 ) {
+ timer_sleep_ms( TEN_MS );
+ } else {
+ break;
+ }
+
+ }
+
+ error = timer_get_real_time( ¤t_time ); if( error ) return 1;
+
+ difference = timer_get_time_difference( ¤t_time, &start_time );
+
+ tstates = ( ( difference + TEN_MS / 1000.0 ) *
+ machine_current->timings.processor_speed
+ ) * speed + 0.5;
+
+ if( event_add( last_tstates + tstates, EVENT_TYPE_TIMER ) ) return 1;
+
+ start_time = current_time;
+ timer_add_time_difference( &start_time, TEN_MS );
+
+ }
+
+ return 0;
+}
Copied: vendor/fuse-emulator/current/fuse/timer/timer.h (from rev 446, vendor/fuse-emulator/current/fuse/timer.h)
===================================================================
--- vendor/fuse-emulator/current/fuse/timer/timer.h (rev 0)
+++ vendor/fuse-emulator/current/fuse/timer/timer.h 2007-08-06 01:17:08 UTC (rev 447)
@@ -0,0 +1,62 @@
+/* timer.h: Speed routines for Fuse
+ Copyright (c) 1999-2004 Philip Kendall
+
+ $Id: timer.h 2889 2007-05-26 17:45:08Z zubzero $
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Author contact information:
+
+ E-mail: phi...@sh...
+
+*/
+
+#ifndef FUSE_TIMER_H
+#define FUSE_TIMER_H
+
+#ifdef UI_SDL
+
+#include "SDL.h"
+
+typedef Uint32 timer_type;
+
+#elif defined(WIN32) /* #ifdef UI_SDL */
+
+#include <windows.h>
+
+typedef DWORD timer_type;
+
+#else /* #ifdef UI_SDL */
+
+#include <sys/time.h>
+#include <time.h>
+
+typedef struct timeval timer_type;
+
+#endif /* #ifdef UI_SDL */
+
+int timer_estimate_reset( void );
+int timer_estimate_speed( void );
+int timer_get_real_time( timer_type *real_time );
+float timer_get_time_difference( timer_type *a, timer_type *b );
+
+int timer_init(void);
+void timer_sleep_ms( int ms );
+int timer_frame( libspectrum_dword last_tstates );
+int timer_end(void);
+
+extern float current_speed;
+
+#endif /* #ifndef FUSE_TIMER_H */
Deleted: vendor/fuse-emulator/current/fuse/timer.c
===================================================================
--- vendor/fuse-emulator/current/fuse/timer.c 2007-08-06 01:11:59 UTC (rev 446)
+++ vendor/fuse-emulator/current/fuse/timer.c 2007-08-06 01:17:08 UTC (rev 447)
@@ -1,334 +0,0 @@
-/* timer.c: Speed routines for Fuse
- Copyright (c) 1999-2004 Philip Kendall, Marek Januszewski, Fredrick Meunier
-
- $Id: timer.c 3043 2007-07-04 14:28:49Z zubzero $
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Author contact information:
-
- E-mail: phi...@sh...
-
-*/
-
-#include <config.h>
-
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "fuse.h"
-#include "event.h"
-#include "settings.h"
-#include "sound.h"
-#include "sound/lowlevel.h"
-#include "tape.h"
-#include "timer.h"
-#include "ui/ui.h"
-#include "ula.h"
-
-static void timer_add_time_difference( timer_type *a, long msec );
-static int timer_frame_callback_sound( libspectrum_dword last_tstates );
-
-/*
- * Routines for estimating emulation speed
- */
-
-/* The actual time at the end of each of the last 10 emulated seconds */
-static timer_type stored_times[10];
-
-/* Which is the next entry in 'stored_times' that we will update */
-static size_t next_stored_time;
-
-/* The number of frames until we next update 'stored_times' */
-static int frames_until_update;
-
-/* The number of time samples we have for estimating speed */
-static int samples;
-
-float current_speed = 100.0;
-
-static timer_type start_time;
-
-static const int TEN_MS = 10;
-
-int
-timer_estimate_speed( void )
-{
- timer_type current_time;
- float difference;
- int error;
-
- if( frames_until_update-- ) return 0;
-
- error = timer_get_real_time( ¤t_time ); if( error ) return error;
-
- if( samples < 10 ) {
-
- /* If we don't have enough data, assume we're running at the desired
- speed :-) */
- current_speed = settings_current.emulation_speed;
-
- } else {
-
- difference =
- timer_get_time_difference( ¤t_time,
- &stored_times[ next_stored_time ] );
- current_speed = 100 * ( 10.0 / difference );
-
- }
-
- ui_statusbar_update_speed( current_speed );
-
- stored_times[ next_stored_time ] = current_time;
-
- next_stored_time = ( next_stored_time + 1 ) % 10;
- frames_until_update =
- ( machine_current->timings.processor_speed /
- machine_current->timings.tstates_per_frame ) - 1;
-
- samples++;
-
- return 0;
-}
-
-#ifdef UI_SDL
-
-int
-timer_get_real_time( timer_type *real_time )
-{
- *real_time = SDL_GetTicks();
-
- return 0;
-}
-
-float
-timer_get_time_difference( timer_type *a, timer_type *b )
-{
- return ( (long)*a - (long)*b ) / 1000.0;
-}
-
-static void
-timer_add_time_difference( timer_type *a, long msec )
-{
- *a += msec;
-}
-
-void
-timer_sleep_ms( int ms )
-{
- SDL_Delay( ms );
-}
-
-#elif defined(WIN32) /* #ifdef UI_SDL */
-
-int
-timer_get_real_time( timer_type *real_time )
-{
- *real_time = GetTickCount();
-
- return 0;
-}
-
-float
-timer_get_time_difference( timer_type *a, timer_type *b )
-{
- return ( (long)*a - (long)*b ) / 1000.0;
-}
-
-static void
-timer_add_time_difference( timer_type *a, long msec )
-{
- *a += msec;
-}
-
-void
-timer_sleep_ms( int ms )
-{
- Sleep( ms );
-}
-
-#else /* #ifdef UI_SDL */
-
-int
-timer_get_real_time( timer_type *real_time )
-{
- int error;
-
- error = gettimeofday( real_time, NULL );
- if( error ) {
- ui_error( UI_ERROR_ERROR, "error getting time: %s", strerror( errno ) );
- return 1;
- }
-
- return 0;
-}
-
-float
-timer_get_time_difference( timer_type *a, timer_type *b )
-{
- return ( a->tv_sec - b->tv_sec ) + ( a->tv_usec - b->tv_usec ) / 1000000.0;
-}
-
-static void
-timer_add_time_difference( timer_type *a, long msec )
-{
- a->tv_usec += msec * 1000;
- if( a->tv_usec >= 1000000 ) {
- a->tv_usec -= 1000000;
- a->tv_sec += 1;
- } else if( a->tv_usec < 0 ) {
- a->tv_usec += 1000000;
- a->tv_sec -= 1;
- }
-}
-
-void
-timer_sleep_ms( int ms )
-{
- usleep( ms * 1000 );
-}
-
-#endif /* #ifdef UI_SDL */
-
-int
-timer_estimate_reset( void )
-{
- int error = timer_get_real_time( &start_time ); if( error ) return error;
- samples = 0;
- next_stored_time = 0;
- frames_until_update = 0;
-
- return 0;
-}
-
-int
-timer_init( void )
-{
- int error = timer_get_real_time( &start_time ); if( error ) return error;
-
- error = event_add( 0, EVENT_TYPE_TIMER );
- if( error ) return error;
-
- return 0;
-}
-
-int
-timer_end( void )
-{
- return event_remove_type( EVENT_TYPE_TIMER );
-}
-
-#if defined SOUND_SDL || defined SOUND_COREAUDIO
-
-/* Callback-style sound based timer */
-#include "sound/sfifo.h"
-
-extern sfifo_t sound_fifo;
-
-static int
-timer_frame_callback_sound( libspectrum_dword last_tstates )
-{
- for(;;) {
-
- /* Sleep while fifo is full */
- if( sfifo_space( &sound_fifo ) < sound_framesiz ) {
- timer_sleep_ms( TEN_MS );
- } else {
- break;
- }
-
- }
-
- if( event_add( last_tstates + machine_current->timings.tstates_per_frame,
- EVENT_TYPE_TIMER ) )
- return 1;
-
- return 0;
-}
-
-#else /* #if defined SOUND_SDL || defined SOUND_COREAUDIO */
-
-/* Blocking socket-style sound based timer */
-static int
-timer_frame_callback_sound( libspectrum_dword last_tstates )
-{
- if( event_add( last_tstates + machine_current->timings.tstates_per_frame,
- EVENT_TYPE_TIMER ) )
- return 1;
-
- return 0;
-}
-
-#endif /* #if defined SOUND_SDL || defined SOUND_COREAUDIO */
-
-int
-timer_frame( libspectrum_dword last_tstates )
-{
- int error;
- timer_type current_time;
- float difference;
- float speed = ( settings_current.emulation_speed < 1 ?
- 100 :
- settings_current.emulation_speed ) / 100.0;
- long tstates;
-
- if( sound_enabled )
- return timer_frame_callback_sound( last_tstates );
-
- /* If we're fastloading, just schedule another check in a frame's time
- and do nothing else */
- if( settings_current.fastload && tape_is_playing() ) {
-
- libspectrum_dword next_check_time =
- last_tstates + machine_current->timings.tstates_per_frame;
-
- if( event_add( next_check_time, EVENT_TYPE_TIMER ) )
- return 1;
-
- } else {
-
- while( 1 ) {
-
- error = timer_get_real_time( ¤t_time ); if( error ) return 1;
-
- difference = timer_get_time_difference( ¤t_time, &start_time );
-
- /* Sleep while we are still 10ms ahead */
- if( difference < 0 ) {
- timer_sleep_ms( TEN_MS );
- } else {
- break;
- }
-
- }
-
- error = timer_get_real_time( ¤t_time ); if( error ) return 1;
-
- difference = timer_get_time_difference( ¤t_time, &start_time );
-
- tstates = ( ( difference + TEN_MS / 1000.0 ) *
- machine_current->timings.processor_speed
- ) * speed + 0.5;
-
- if( event_add( last_tstates + tstates, EVENT_TYPE_TIMER ) ) return 1;
-
- start_time = current_time;
- timer_add_time_difference( &start_time, TEN_MS );
-
- }
-
- return 0;
-}
Deleted: vendor/fuse-emulator/current/fuse/timer.h
===================================================================
--- vendor/fuse-emulator/current/fuse/timer.h 2007-08-06 01:11:59 UTC (rev 446)
+++ vendor/fuse-emulator/current/fuse/timer.h 2007-08-06 01:17:08 UTC (rev 447)
@@ -1,62 +0,0 @@
-/* timer.h: Speed routines for Fuse
- Copyright (c) 1999-2004 Philip Kendall
-
- $Id: timer.h 2889 2007-05-26 17:45:08Z zubzero $
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
- Author contact information:
-
- E-mail: phi...@sh...
-
-*/
-
-#ifndef FUSE_TIMER_H
-#define FUSE_TIMER_H
-
-#ifdef UI_SDL
-
-#include "SDL.h"
-
-typedef Uint32 timer_type;
-
-#elif defined(WIN32) /* #ifdef UI_SDL */
-
-#include <windows.h>
-
-typedef DWORD timer_type;
-
-#else /* #ifdef UI_SDL */
-
-#include <sys/time.h>
-#include <time.h>
-
-typedef struct timeval timer_type;
-
-#endif /* #ifdef UI_SDL */
-
-int timer_estimate_reset( void );
-int timer_estimate_speed( void );
-int timer_get_real_time( timer_type *real_time );
-float timer_get_time_difference( timer_type *a, timer_type *b );
-
-int timer_init(void);
-void timer_sleep_ms( int ms );
-int timer_frame( libspectrum_dword last_tstates );
-int timer_end(void);
-
-extern float current_speed;
-
-#endif /* #ifndef FUSE_TIMER_H */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2007-08-06 01:17:47
|
Revision: 448
http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=448&view=rev
Author: fredm
Date: 2007-08-05 18:17:48 -0700 (Sun, 05 Aug 2007)
Log Message:
-----------
Load . into vendor/fuse-emulator/current.
Modified Paths:
--------------
vendor/fuse-emulator/current/fuse/Makefile.am
vendor/fuse-emulator/current/fuse/compat/Makefile.am
vendor/fuse-emulator/current/fuse/compat/dirname.c
vendor/fuse-emulator/current/fuse/compat/getopt.c
vendor/fuse-emulator/current/fuse/compat/getopt1.c
vendor/fuse-emulator/current/fuse/compat/mkstemp.c
vendor/fuse-emulator/current/fuse/compat.h
vendor/fuse-emulator/current/fuse/configure.in
vendor/fuse-emulator/current/fuse/event.c
vendor/fuse-emulator/current/fuse/fuse.c
vendor/fuse-emulator/current/fuse/hacking/ChangeLog
vendor/fuse-emulator/current/fuse/machines/tc2048.c
vendor/fuse-emulator/current/fuse/menu_data.pl
vendor/fuse-emulator/current/fuse/printer.c
vendor/fuse-emulator/current/fuse/rzx.c
vendor/fuse-emulator/current/fuse/settings.pl
vendor/fuse-emulator/current/fuse/sound/Makefile.am
vendor/fuse-emulator/current/fuse/sound/alsasound.c
vendor/fuse-emulator/current/fuse/sound/aosound.c
vendor/fuse-emulator/current/fuse/sound/coreaudiosound.c
vendor/fuse-emulator/current/fuse/sound/dxsound.c
vendor/fuse-emulator/current/fuse/sound/hpsound.c
vendor/fuse-emulator/current/fuse/sound/nullsound.c
vendor/fuse-emulator/current/fuse/sound/osssound.c
vendor/fuse-emulator/current/fuse/sound/sdlsound.c
vendor/fuse-emulator/current/fuse/sound/sfifo.c
vendor/fuse-emulator/current/fuse/sound/sunsound.c
vendor/fuse-emulator/current/fuse/sound.c
vendor/fuse-emulator/current/fuse/spectrum.c
vendor/fuse-emulator/current/fuse/tape.c
vendor/fuse-emulator/current/fuse/tape.h
vendor/fuse-emulator/current/fuse/timer/timer.c
vendor/fuse-emulator/current/fuse/timer/timer.h
vendor/fuse-emulator/current/fuse/trdos.c
vendor/fuse-emulator/current/fuse/ui/gtk/debugger.c
vendor/fuse-emulator/current/fuse/ui/gtk/gtkjoystick.c
vendor/fuse-emulator/current/fuse/ui/gtk/gtkmouse.c
vendor/fuse-emulator/current/fuse/ui/gtk/gtkui.c
vendor/fuse-emulator/current/fuse/ui/gtk/pokefinder.c
vendor/fuse-emulator/current/fuse/ui/gtk/stock.c
vendor/fuse-emulator/current/fuse/ula.c
vendor/fuse-emulator/current/fuse/utils.c
vendor/fuse-emulator/current/fuse/widget/widget.c
vendor/fuse-emulator/current/fuse/z80/coretest.c
Added Paths:
-----------
vendor/fuse-emulator/current/fuse/compat/amiga/
vendor/fuse-emulator/current/fuse/compat/amiga/Makefile.am
vendor/fuse-emulator/current/fuse/compat/amiga/paths.c
vendor/fuse-emulator/current/fuse/compat/morphos/
vendor/fuse-emulator/current/fuse/compat/morphos/Makefile.am
vendor/fuse-emulator/current/fuse/compat/morphos/osname.c
vendor/fuse-emulator/current/fuse/compat/unix/
vendor/fuse-emulator/current/fuse/compat/unix/Makefile.am
vendor/fuse-emulator/current/fuse/compat/unix/osname.c
vendor/fuse-emulator/current/fuse/compat/unix/paths.c
vendor/fuse-emulator/current/fuse/compat/win32/
vendor/fuse-emulator/current/fuse/compat/win32/Makefile.am
vendor/fuse-emulator/current/fuse/compat/win32/osname.c
vendor/fuse-emulator/current/fuse/compat/win32/paths.c
vendor/fuse-emulator/current/fuse/timer/Makefile.am
vendor/fuse-emulator/current/fuse/timer/sdl.c
vendor/fuse-emulator/current/fuse/timer/unix.c
vendor/fuse-emulator/current/fuse/timer/win32.c
Removed Paths:
-------------
vendor/fuse-emulator/current/fuse/sound/lowlevel.h
Modified: vendor/fuse-emulator/current/fuse/Makefile.am
===================================================================
--- vendor/fuse-emulator/current/fuse/Makefile.am 2007-08-06 01:17:08 UTC (rev 447)
+++ vendor/fuse-emulator/current/fuse/Makefile.am 2007-08-06 01:17:48 UTC (rev 448)
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
## Copyright (c) 1999-2004 Philip Kendall
-## $Id: Makefile.am 3007 2007-06-17 18:50:48Z zubzero $
+## $Id: Makefile.am 3091 2007-08-04 16:44:45Z 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 @@
pokefinder \
roms \
sound \
+ timer \
ui \
@WIDGET@ \
z80
@@ -87,7 +88,6 @@
sound.c \
spectrum.c \
tape.c \
- timer.c \
trdos.c \
ui.c \
uidisplay.c \
@@ -107,19 +107,18 @@
sound/libsound.a \
ui/scaler/libscaler.a \
debugger/libdebugger.a \
+timer/libtimer.a \
z80/libz80.a \
@DSKLIBS@ \
@LIBSPEC_LIBS@ \
@GLIB_LIBS@ \
@PNG_LIBS@ \
-@ASOUND_LIBS@ \
-@AO_LIBS@ \
+@SOUND_LIBS@ \
@SAMPLERATE_LIBS@ \
-@DIRECTSOUND_LIBS@ \
-@COREAUDIO_LIBS@ \
@X_LIBS@ \
@XML_LIBS@ \
compat/libcompat.a \
+compat/unix/libcompatos.a \
@WINDRES_OBJ@
fuse_DEPENDENCIES = @UI_LIBS@ \
@@ -173,7 +172,6 @@
sound.h \
spectrum.h \
tape.h \
- timer.h \
trdos.h \
utils.h \
joystick.h \
Modified: vendor/fuse-emulator/current/fuse/compat/Makefile.am
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/Makefile.am 2007-08-06 01:17:08 UTC (rev 447)
+++ vendor/fuse-emulator/current/fuse/compat/Makefile.am 2007-08-06 01:17:48 UTC (rev 448)
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
-## Copyright (c) 2003 Philip Kendall
+## Copyright (c) 2003-2007 Philip Kendall
-## $Id: Makefile.am 2889 2007-05-26 17:45:08Z zubzero $
+## $Id: Makefile.am 3091 2007-08-04 16:44:45Z 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
@@ -23,13 +23,25 @@
AUTOMAKE_OPTIONS = foreign
+SUBDIRS = @COMPAT_OSNAME@
+
+DIST_SUBDIRS = amiga \
+ morphos \
+ unix \
+ win32
+
noinst_LIBRARIES = libcompat.a
-libcompat_a_SOURCES = dirname.c \
- getopt.c \
- getopt1.c \
- mkstemp.c
+libcompat_a_SOURCES =
+EXTRA_libcompat_a_SOURCES = dirname.c \
+ getopt.c \
+ getopt1.c \
+ mkstemp.c
+
+libcompat_a_LIBADD = $(COMPAT_LIBADD)
+libcompat_a_DEPENDENCIES = $(COMPAT_LIBADD)
+
INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
noinst_HEADERS = getopt.h
Added: vendor/fuse-emulator/current/fuse/compat/amiga/Makefile.am
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/amiga/Makefile.am (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/amiga/Makefile.am 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,31 @@
+## Process this file with automake to produce Makefile.in
+## Copyright (c) 2007 Philip Kendall
+
+## $Id: Makefile.am 3092 2007-08-04 19:20:58Z 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...
+
+AUTOMAKE_OPTIONS = foreign
+
+noinst_LIBRARIES = libcompatos.a
+
+libcompatos_a_SOURCES = ../unix/osname.c \
+ paths.c
+
+INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
Added: vendor/fuse-emulator/current/fuse/compat/amiga/paths.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/amiga/paths.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/amiga/paths.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,40 @@
+/* paths.c: Path-related compatability routines
+ Copyright (c) 1999-2007 Philip Kendall
+
+ $Id: paths.c 3092 2007-08-04 19:20:58Z 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 "compat.h"
+
+const char*
+compat_get_temp_path( void )
+{
+ return "T:";
+}
+
+const char*
+compat_get_home_path( void )
+{
+ return "PROGDIR:settings";
+}
Modified: vendor/fuse-emulator/current/fuse/compat/dirname.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/dirname.c 2007-08-06 01:17:08 UTC (rev 447)
+++ vendor/fuse-emulator/current/fuse/compat/dirname.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -26,8 +26,6 @@
#include <config.h>
-#ifndef HAVE_DIRNAME
-
#include <string.h>
#include "fuse.h"
@@ -99,5 +97,3 @@
return path;
}
-
-#endif /* #ifndef HAVE_DIRNAME */
Modified: vendor/fuse-emulator/current/fuse/compat/getopt.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/getopt.c 2007-08-06 01:17:08 UTC (rev 447)
+++ vendor/fuse-emulator/current/fuse/compat/getopt.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -34,8 +34,6 @@
# include <config.h>
#endif
-#if !defined HAVE_GETOPT_LONG && !defined AMIGA && !defined __MORPHOS__
-
#if !defined __STDC__ || !__STDC__
/* This is a separate conditional since some stdc systems
reject `defined (const)'. */
@@ -1280,5 +1278,3 @@
}
#endif /* TEST */
-
-#endif /* #ifndef HAVE_GETOPT_LONG */
Modified: vendor/fuse-emulator/current/fuse/compat/getopt1.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/getopt1.c 2007-08-06 01:17:08 UTC (rev 447)
+++ vendor/fuse-emulator/current/fuse/compat/getopt1.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -24,8 +24,6 @@
#include <config.h>
#endif
-#if !defined HAVE_GETOPT_LONG && !defined AMIGA && !defined __MORPHOS__
-
#ifdef _LIBC
# include <getopt.h>
#else
@@ -198,5 +196,3 @@
}
#endif /* TEST */
-
-#endif /* #ifndef HAVE_GETOPT_LONG */
Modified: vendor/fuse-emulator/current/fuse/compat/mkstemp.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/mkstemp.c 2007-08-06 01:17:08 UTC (rev 447)
+++ vendor/fuse-emulator/current/fuse/compat/mkstemp.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -20,8 +20,6 @@
#include <config.h>
-#ifndef HAVE_MKSTEMP
-
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -109,5 +107,3 @@
errno = EEXIST;
return -1;
}
-
-#endif /* #ifdef HAVE_MKSTEMP */
Added: vendor/fuse-emulator/current/fuse/compat/morphos/Makefile.am
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/morphos/Makefile.am (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/morphos/Makefile.am 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,31 @@
+## Process this file with automake to produce Makefile.in
+## Copyright (c) 2007 Philip Kendall
+
+## $Id: Makefile.am 3092 2007-08-04 19:20:58Z 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...
+
+AUTOMAKE_OPTIONS = foreign
+
+noinst_LIBRARIES = libcompatos.a
+
+libcompatos_a_SOURCES = osname.c \
+ ../amiga/paths.c
+
+INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
Added: vendor/fuse-emulator/current/fuse/compat/morphos/osname.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/morphos/osname.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/morphos/osname.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,34 @@
+/* osname.c: Get a representation of the OS we're running on
+ Copyright (c) 1999-2007 Philip Kendall
+
+ $Id: osname.c 3091 2007-08-04 16:44:45Z 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 <stdlib.h>
+
+int compat_osname( char *buffer, size_t length )
+{
+ snprintf( buffer, length, "%s %s %s", "MorphOS", "Pegasos", "1.4.4" );
+}
Added: vendor/fuse-emulator/current/fuse/compat/unix/Makefile.am
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/unix/Makefile.am (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/unix/Makefile.am 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,31 @@
+## Process this file with automake to produce Makefile.in
+## Copyright (c) 2007 Philip Kendall
+
+## $Id: Makefile.am 3092 2007-08-04 19:20:58Z 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...
+
+AUTOMAKE_OPTIONS = foreign
+
+noinst_LIBRARIES = libcompatos.a
+
+libcompatos_a_SOURCES = osname.c \
+ paths.c
+
+INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
Added: vendor/fuse-emulator/current/fuse/compat/unix/osname.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/unix/osname.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/unix/osname.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,50 @@
+/* osname.c: Get a representation of the OS we're running on
+ Copyright (c) 1999-2007 Philip Kendall
+
+ $Id: osname.c 3094 2007-08-05 14:20: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
+ 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 <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/utsname.h>
+
+#include "ui/ui.h"
+
+int compat_osname( char *buffer, size_t length )
+{
+ struct utsname osname;
+ int error;
+
+ error = uname( &osname );
+ if( error ) {
+ ui_error( UI_ERROR_ERROR, "error getting system information: %s",
+ strerror( errno ) );
+ return 1;
+ }
+
+ snprintf( buffer, length, "%s %s %s", osname.sysname, osname.machine,
+ osname.release );
+ return 0;
+}
Added: vendor/fuse-emulator/current/fuse/compat/unix/paths.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/unix/paths.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/unix/paths.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,48 @@
+/* paths.c: Path-related compatability routines
+ Copyright (c) 1999-2007 Philip Kendall
+
+ $Id: paths.c 3092 2007-08-04 19:20:58Z 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 <stdlib.h>
+
+#include "compat.h"
+
+const char*
+compat_get_temp_path( void )
+{
+ const char *dir;
+
+ /* Use TMPDIR if specified, if not /tmp */
+ dir = getenv( "TMPDIR" ); if( dir ) return dir;
+ return "/tmp";
+}
+
+const char*
+compat_get_home_path( void )
+{
+ const char *dir;
+ dir = getenv( "HOME" ); if( dir ) return dir;
+ return ".";
+}
Added: vendor/fuse-emulator/current/fuse/compat/win32/Makefile.am
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/win32/Makefile.am (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/win32/Makefile.am 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,31 @@
+## Process this file with automake to produce Makefile.in
+## Copyright (c) 2007 Philip Kendall
+
+## $Id: Makefile.am 3092 2007-08-04 19:20:58Z 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...
+
+AUTOMAKE_OPTIONS = foreign
+
+noinst_LIBRARIES = libcompatos.a
+
+libcompatos_a_SOURCES = osname.c \
+ paths.c
+
+INCLUDES = @GLIB_CFLAGS@ @GTK_CFLAGS@ @LIBSPEC_CFLAGS@
Added: vendor/fuse-emulator/current/fuse/compat/win32/osname.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/win32/osname.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/win32/osname.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,56 @@
+/* osname.c: Get a representation of the OS we're running on
+ Copyright (c) 1999-2007 Philip Kendall
+
+ $Id: osname.c 3091 2007-08-04 16:44:45Z 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 <windows.h>
+
+int compat_osname( char *osname, size_t length )
+{
+ OSVERSIONINFO buf;
+ char *windows_name;
+
+ buf.dwOSVersionInfoSize = sizeof( buf );
+ sys_error = GetVersionEx( &buf );
+ if( sys_error == 0 ) {
+ ui_error( UI_ERROR_ERROR, "error getting system information." );
+ return 1;
+ }
+
+ switch( buf.dwPlatformId ) {
+ case VER_PLATFORM_WIN32_NT: windows_name = "NT"; break;
+ case VER_PLATFORM_WIN32_WINDOWS: windows_name = "95/98"; break;
+ case VER_PLATFORM_WIN32s: windows_name = "3.1"; break;
+ default: windows_name = "unknown"; break;
+ }
+
+ snprintf( osname, length,
+ "gcrypt: %s\nlibspectrum: %s\nuname: Windows %s %d.%d build %d %s",
+ gcrypt_version, libspectrum_version(),
+ windows_name, buf.dwMajorVersion, buf.dwMinorVersion,
+ buf.dwBuildNumber, buf.szCSDVersion );
+
+ return 0;
+}
Added: vendor/fuse-emulator/current/fuse/compat/win32/paths.c
===================================================================
--- vendor/fuse-emulator/current/fuse/compat/win32/paths.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/compat/win32/paths.c 2007-08-06 01:17:48 UTC (rev 448)
@@ -0,0 +1,52 @@
+/* paths.c: Path-related compatability routines
+ Copyright (c) 1999-2007 Philip Kendall
+
+ $Id: paths.c 3092 2007-08-04 19:20:58Z 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 <stdlib.h>
+
+#include "compat.h"
+
+const char*
+compat_get_temp_path( void )
+{
+ const char *dir;
+
+ /* Something close to this algorithm specified at
+ http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/gettemppath.asp
+ */
+ dir = getenv( "TMP" ); if( dir ) return dir;
+ dir = getenv( "TEMP" ); if( dir ) return dir;
+ return ".";
+}
+
+const char*
+compat_get_home_path( void )
+{
+ const char *dir;
+ dir = getenv( "USERPROFILE" ); if( dir ) return dir;
+ dir = getenv( "WINDIR" ); if( dir ) return dir;
+ return ".";
+}
Modified: vendor/fuse-emulator/current/fuse/compat.h
===================================================================
--- vendor/fuse-emulator/current/fuse/compat.h 2007-08-06 01:17:08 UTC (rev 447)
+++ vendor/fuse-emulator/current/fuse/compat.h 2007-08-06 01:17:48 UTC (rev 448)
@@ -1,7 +1,7 @@
/* compat.h: various compatibility bits
Copyright (c) 2003 Philip Kendall
- $Id: compat.h 3039 2007-07-03 12:17:27Z fredm $
+ $Id: compat.h 3092 2007-08-04 19:20:58Z pak21 $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,6 +26,8 @@
#ifndef FUSE_COMPAT_H
#define FUSE_COMPAT_H
+#include <stdlib.h>
+
/* Remove the gcc-specific incantations if we're not using gcc */
#ifdef __GNUC__
@@ -70,4 +72,8 @@
#define FUSE_DIR_SEP_STR "/"
#endif
+int compat_osname( char *buffer, size_t length );
+const char* compat_get_temp_path( void );
+const char* compat_get_home_path( void );
+
#endif /* #ifndef FUSE_COMPAT_H */
Modified: vendor/fuse-emulator/current/fuse/configure.in
===================================================================
--- vendor/fuse-emulator/current/fuse/configure.in 2007-08-06 01:17:08 UTC (rev 447)
+++ vendor/fuse-emulator/current/fuse/configure.in 2007-08-06 01:17:48 UTC (rev 448)
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-dnl $Id: configure.in 3078 2007-07-27 10:49:51Z pak21 $
+dnl $Id: configure.in 3093 2007-08-04 20:51:34Z pak21 $
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
@@ -351,11 +351,12 @@
plus3disk=yes)
AC_MSG_RESULT($plus3disk)
if test "$plus3disk" = yes; then
- AC_CHECK_HEADERS(765.h, DSKLIBS="$DSKLIBS -l765"; lib765=yes,
+ AC_CHECK_HEADERS(765.h, DSKLIBS="$DSKLIBS -l765" lib765=yes,
AC_MSG_WARN(765.h not found - +3 disk support disabled))
fi
dnl Do we want LibDsk support?
+AC_MSG_CHECKING(whether libdsk is available)
AC_ARG_WITH(libdsk,
[ --without-libdsk disable LibDsk support],
if test "$withval" = no; then libdsk=no; else libdsk=yes; fi,
@@ -396,12 +397,11 @@
AC_CHECK_LIB( asound, snd_pcm_hw_params_set_period_size_near,
[AC_CHECK_HEADER(
alsa/asoundlib.h,
- [AC_DEFINE([USE_LIBASOUND], 1, [Defined if we're going to be using the installed libasound]) ASOUND_LIBS='-lasound'],
+ [alsa_available=yes],
[AC_MSG_WARN(alsa/asoundlib.h not found - no ALSA output)]
)],
[AC_MSG_WARN(snd_pcm_hw_params_set_period_size_near not found - no ALSA output)]
)
- AC_SUBST(ASOUND_LIBS)
fi
dnl Check if a version of libao which supplies ao_open_live is available
@@ -415,21 +415,19 @@
AC_CHECK_LIB( ao, ao_open_live,
[AC_CHECK_HEADER(
ao/ao.h,
- [AC_DEFINE([USE_LIBAO], 1, [Defined if we're going to be using the installed libao]) AO_LIBS='-lao'],
+ [ao_available=yes],
[AC_MSG_WARN(ao/ao.h not found - no libao sound output)]
)],
[AC_MSG_WARN(ao_open_live not found - no libao sound output)]
)
- AC_SUBST(AO_LIBS)
fi
dnl Check if DirectSound is available
AC_CHECK_HEADER(
dsound.h,
- [AC_DEFINE([USE_DIRECTSOUND], 1, [Defined if we're going to be using DirectSound]) DIRECTSOUND_LIBS='-ldsound -lole32 -ldxguid'],
+ [dxsound_available=yes],
[AC_MSG_WARN(dsound.h not found - no DirectSound output)]
)
-AC_SUBST(DIRECTSOUND_LIBS)
PKG_CHECK_MODULES(SAMPLERATE, samplerate >= 0.1.0,
AC_DEFINE([HAVE_SAMPLERATE],1,[Define to 1 if you have libsamplerate.]),
@@ -440,11 +438,56 @@
dnl Check if CoreAudio is available
AC_CHECK_HEADER(
CoreAudio/AudioHardware.h,
- [AC_DEFINE([USE_COREAUDIO], 1, [Defined if we're going to be using CoreAudio]) COREAUDIO_LIBS='-framework CoreAudio -framework AudioUnit -framework CoreServices'],
+ [coreaudio_available=yes],
[AC_MSG_WARN(CoreAudio/AudioHardware.h not found - no CoreAudio sound output)]
)
-AC_SUBST(COREAUDIO_LIBS)
+dnl
+dnl Decide which sound routines to use
+dnl
+
+AC_MSG_CHECKING(which sound routines to use)
+if test "$dxsound_available" = yes; then
+ SOUND_LIBADD='dxsound.$(OBJEXT)' SOUND_LIBS='-ldsound -lole32 -ldxguid'
+ AC_MSG_RESULT(DirectX)
+elif test "$UI" = sdl; then
+ SOUND_LIBADD='sdlsound.$(OBJEXT)' SOUND_LIBS='' sound_fifo=yes
+ AC_MSG_RESULT(SDL)
+elif test "$alsa_available" = yes; then
+ SOUND_LIBADD='alsasound.$(OBJEXT)' SOUND_LIBS='-lasound'
+ AC_MSG_RESULT(ALSA)
+elif test "$ao_available" = yes; then
+ SOUND_LIBADD='aosound.$(OBJEXT)' SOUND_LIBS='-lao'
+ AC_MSG_RESULT(libao)
+elif test "$ac_cv_header_dsound_h" = yes; then
+ # Later selection between these two
+ SOUND_LIBADD='sunsound.$(OBJEXT) hpsound.$(OBJEXT)' SOUND_LIBS=''
+ AC_MSG_RESULT(Solaris or HP/UX)
+elif test "$ac_cv_header_sys_soundcard_h" = yes; then
+ SOUND_LIBADD='osssound.$(OBJEXT)' SOUND_LIBS=''
+ AC_MSG_RESULT(OSS)
+elif test "$ac_cv_header_sys_audioio_h" = yes; then
+ dnl OpenBSD
+ SOUND_LIBADD='sunsound.$(OBJEXT)' SOUND_LIBS=''
+ ...
[truncated message content] |
|
From: <fr...@us...> - 2008-05-07 12:25:37
|
Revision: 528
http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=528&view=rev
Author: fredm
Date: 2008-05-07 05:25:42 -0700 (Wed, 07 May 2008)
Log Message:
-----------
To prepare to load . into vendor/fuse-emulator/current, perform 20
renames.
* vendor/fuse-emulator/current/fuse/ui/widget/fuse.font.sbf: Renamed
from vendor/fuse-emulator/current/fuse/widget/fuse.font.sbf.
* vendor/fuse-emulator/current/fuse/ui/widget/debugger.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/debugger.c.
* vendor/fuse-emulator/current/fuse/ui/widget/browse.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/browse.c.
* vendor/fuse-emulator/current/fuse/ui/widget/error.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/error.c.
* vendor/fuse-emulator/current/fuse/ui/widget/filesel.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/filesel.c.
* vendor/fuse-emulator/current/fuse/ui/widget/widget.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/widget.c.
* vendor/fuse-emulator/current/fuse/ui/widget/widget.h: Renamed from
vendor/fuse-emulator/current/fuse/widget/widget.h.
* vendor/fuse-emulator/current/fuse/ui/widget/select.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/select.c.
* vendor/fuse-emulator/current/fuse/ui/widget/widget_internals.h:
Renamed from
vendor/fuse-emulator/current/fuse/widget/widget_internals.h.
* vendor/fuse-emulator/current/fuse/ui/widget/Makefile.am: Renamed from
vendor/fuse-emulator/current/fuse/widget/Makefile.am.
* vendor/fuse-emulator/current/fuse/ui/widget/picture.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/picture.c.
* vendor/fuse-emulator/current/fuse/ui/widget/query.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/query.c.
* vendor/fuse-emulator/current/fuse/ui/widget/menu.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/menu.c.
* vendor/fuse-emulator/current/fuse/ui/widget/memory.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/memory.c.
* vendor/fuse-emulator/current/fuse/ui/widget/mkfusefont.pl: Renamed
from vendor/fuse-emulator/current/fuse/widget/mkfusefont.pl.
* vendor/fuse-emulator/current/fuse/ui/widget/options-header.pl:
Renamed from
vendor/fuse-emulator/current/fuse/widget/options-header.pl.
* vendor/fuse-emulator/current/fuse/ui/widget/options.pl: Renamed from
vendor/fuse-emulator/current/fuse/widget/options.pl.
* vendor/fuse-emulator/current/fuse/ui/widget/pokefinder.c: Renamed
from vendor/fuse-emulator/current/fuse/widget/pokefinder.c.
* vendor/fuse-emulator/current/fuse/ui/widget/text.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/text.c.
* vendor/fuse-emulator/current/fuse/ui/widget/roms.c: Renamed from
vendor/fuse-emulator/current/fuse/widget/roms.c.
Added Paths:
-----------
vendor/fuse-emulator/current/fuse/ui/widget/
vendor/fuse-emulator/current/fuse/ui/widget/Makefile.am
vendor/fuse-emulator/current/fuse/ui/widget/browse.c
vendor/fuse-emulator/current/fuse/ui/widget/debugger.c
vendor/fuse-emulator/current/fuse/ui/widget/error.c
vendor/fuse-emulator/current/fuse/ui/widget/filesel.c
vendor/fuse-emulator/current/fuse/ui/widget/fuse.font.sbf
vendor/fuse-emulator/current/fuse/ui/widget/memory.c
vendor/fuse-emulator/current/fuse/ui/widget/menu.c
vendor/fuse-emulator/current/fuse/ui/widget/mkfusefont.pl
vendor/fuse-emulator/current/fuse/ui/widget/options-header.pl
vendor/fuse-emulator/current/fuse/ui/widget/options.pl
vendor/fuse-emulator/current/fuse/ui/widget/picture.c
vendor/fuse-emulator/current/fuse/ui/widget/pokefinder.c
vendor/fuse-emulator/current/fuse/ui/widget/query.c
vendor/fuse-emulator/current/fuse/ui/widget/roms.c
vendor/fuse-emulator/current/fuse/ui/widget/select.c
vendor/fuse-emulator/current/fuse/ui/widget/text.c
vendor/fuse-emulator/current/fuse/ui/widget/widget.c
vendor/fuse-emulator/current/fuse/ui/widget/widget.h
vendor/fuse-emulator/current/fuse/ui/widget/widget_internals.h
Removed Paths:
-------------
vendor/fuse-emulator/current/fuse/widget/Makefile.am
vendor/fuse-emulator/current/fuse/widget/browse.c
vendor/fuse-emulator/current/fuse/widget/debugger.c
vendor/fuse-emulator/current/fuse/widget/error.c
vendor/fuse-emulator/current/fuse/widget/filesel.c
vendor/fuse-emulator/current/fuse/widget/fuse.font.sbf
vendor/fuse-emulator/current/fuse/widget/memory.c
vendor/fuse-emulator/current/fuse/widget/menu.c
vendor/fuse-emulator/current/fuse/widget/mkfusefont.pl
vendor/fuse-emulator/current/fuse/widget/options-header.pl
vendor/fuse-emulator/current/fuse/widget/options.pl
vendor/fuse-emulator/current/fuse/widget/picture.c
vendor/fuse-emulator/current/fuse/widget/pokefinder.c
vendor/fuse-emulator/current/fuse/widget/query.c
vendor/fuse-emulator/current/fuse/widget/roms.c
vendor/fuse-emulator/current/fuse/widget/select.c
vendor/fuse-emulator/current/fuse/widget/text.c
vendor/fuse-emulator/current/fuse/widget/widget.c
vendor/fuse-emulator/current/fuse/widget/widget.h
vendor/fuse-emulator/current/fuse/widget/widget_internals.h
Copied: vendor/fuse-emulator/current/fuse/ui/widget/Makefile.am (from rev 527, vendor/fuse-emulator/current/fuse/widget/Makefile.am)
===================================================================
--- vendor/fuse-emulator/current/fuse/ui/widget/Makefile.am (rev 0)
+++ vendor/fuse-emulator/current/fuse/ui/widget/Makefile.am 2008-05-07 12:25:42 UTC (rev 528)
@@ -0,0 +1,77 @@
+## Process this file with automake to produce Makefile.in
+## Copyright (c) 2001,2002 Philip Kendall
+
+## $Id: Makefile.am 3151 2007-09-05 15:41:46Z zubzero $
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License along
+## with this program; if not, write to the Free Software Foundation, Inc.,
+## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+##
+## Author contact information:
+##
+## E-mail: phi...@sh...
+
+AUTOMAKE_OPTIONS = foreign
+
+AM_CPPFLAGS = -I$(srcdir)/..
+
+noinst_LIBRARIES = libwidget.a
+
+libwidget_a_SOURCES = \
+ browse.c \
+ debugger.c \
+ error.c \
+ filesel.c \
+ memory.c \
+ menu.c \
+ menu_data.c \
+ options.c \
+ picture.c \
+ pokefinder.c \
+ query.c \
+ roms.c \
+ select.c \
+ text.c \
+ widget.c
+
+INCLUDES = @GTK_CFLAGS@ @GLIB_CFLAGS@ @LIBSPEC_CFLAGS@
+
+BUILT_SOURCES = menu_data.c \
+ options.c \
+ options.h \
+ fuse.font
+
+menu_data.c: $(srcdir)/../perl/cpp-perl.pl $(srcdir)/../menu_data.dat $(srcdir)/../menu_data.pl ../config.h
+ @PERL@ $(srcdir)/../perl/cpp-perl.pl ../config.h $(srcdir)/../menu_data.dat | @PERL@ -I$(srcdir)/../perl $(srcdir)/../menu_data.pl widget > $@.tmp && mv $@.tmp $@
+
+options.c: $(srcdir)/../perl/cpp-perl.pl ../config.h $(srcdir)/options.pl $(srcdir)/../ui/options.dat $(srcdir)/../perl/Fuse.pm $(srcdir)/../perl/Fuse/Dialog.pm
+ @PERL@ $(srcdir)/../perl/cpp-perl.pl ../config.h $(srcdir)/../ui/options.dat | @PERL@ -I$(srcdir)/../perl $(srcdir)/options.pl - > $@.tmp && mv $@.tmp $@
+
+options.h: $(srcdir)/../perl/cpp-perl.pl ../config.h $(srcdir)/options-header.pl $(srcdir)/../ui/options.dat $(srcdir)/../perl/Fuse.pm $(srcdir)/../perl/Fuse/Dialog.pm
+ @PERL@ $(srcdir)/../perl/cpp-perl.pl ../config.h $(srcdir)/../ui/options.dat | @PERL@ -I$(srcdir)/../perl $(srcdir)/options-header.pl - > $@.tmp && mv $@.tmp $@
+
+fuse.font: $(srcdir)/mkfusefont.pl $(srcdir)/fuse.font.sbf
+ @PERL@ $(srcdir)/mkfusefont.pl $(srcdir)/fuse.font.sbf > $@.tmp && mv $@.tmp $@
+
+noinst_HEADERS = widget.h widget_internals.h \
+ options.h options.pl options-header.pl
+
+pkgdata_DATA = fuse.font
+
+EXTRA_DIST = mkfusefont.pl \
+ fuse.font.sbf
+
+CLEANFILES = menu_data.c \
+ options.c \
+ options.h \
+ fuse.font
Copied: vendor/fuse-emulator/current/fuse/ui/widget/browse.c (from rev 527, vendor/fuse-emulator/current/fuse/widget/browse.c)
===================================================================
--- vendor/fuse-emulator/current/fuse/ui/widget/browse.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/ui/widget/browse.c 2008-05-07 12:25:42 UTC (rev 528)
@@ -0,0 +1,226 @@
+/* browse.c: tape browser widget
+ Copyright (c) 2002-2004 Philip Kendall
+
+ $Id: browse.c 3461 2008-01-03 13:42:54Z 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 <stdlib.h>
+
+#ifdef HAVE_LIB_GLIB
+#include <glib.h>
+#else /* #ifdef HAVE_LIB_GLIB */
+#include <libspectrum.h>
+#endif /* #ifdef HAVE_LIB_GLIB */
+
+#include "fuse.h"
+#include "tape.h"
+#include "widget_internals.h"
+
+/* The descriptions of the blocks */
+static GSList *blocks;
+
+/* How many blocks we have in total */
+size_t block_count;
+
+/* Which block is shown on the top line of the widget */
+static int top_line;
+
+/* Which block is currently highlighted */
+static int highlight;
+
+static void show_blocks( void );
+static void add_block_description( libspectrum_tape_block *block,
+ void *user_data );
+static void free_description( gpointer data, gpointer user_data );
+
+int
+widget_browse_draw( void *data GCC_UNUSED )
+{
+ int error;
+
+ blocks = NULL; block_count = 0;
+ error = tape_foreach( add_block_description, &blocks );
+ if( error ) return error;
+
+ widget_dialog_with_border( 1, 2, 30, 20 );
+
+ widget_print_title( 16, WIDGET_COLOUR_FOREGROUND, "Browse Tape" );
+ widget_display_lines( 2, 1 );
+
+ highlight = tape_get_current_block();
+ top_line = highlight - 8; if( top_line < 0 ) top_line = 0;
+
+ show_blocks();
+
+ return 0;
+}
+
+static void
+add_block_description( libspectrum_tape_block *block, void *user_data )
+{
+ GSList **ptr = user_data;
+
+ char *buffer;
+
+ buffer = malloc( 30 ); if( !buffer ) return;
+ libspectrum_tape_block_description( buffer, 30, block );
+
+ (*ptr) = g_slist_append( *ptr, buffer );
+
+ block_count++;
+}
+
+static void
+show_blocks( void )
+{
+ size_t i; char buffer[64];
+ GSList *ptr;
+ int numpos = g_slist_length( blocks );
+
+ if( numpos < 10 ) {
+ numpos = 24;
+ } else if( numpos < 100 ) {
+ numpos = 32;
+ } else {
+ numpos = 40;
+ }
+
+ widget_rectangle( 2*8, 4*8, 28*8, 18*8, WIDGET_COLOUR_BACKGROUND );
+
+ for( i = 0, ptr = g_slist_nth( blocks, top_line );
+ i < 18 && ptr;
+ i++, ptr = ptr->next ) {
+
+ int colour = ( top_line + i == highlight )
+ ? WIDGET_COLOUR_BACKGROUND : WIDGET_COLOUR_FOREGROUND;
+
+ if( top_line + i == highlight )
+ widget_rectangle( 16, i*8+32, 28*8, 1*8, WIDGET_COLOUR_FOREGROUND );
+
+ sprintf( buffer, "%lu", (unsigned long)( top_line + i + 1 ) );
+ widget_printstring_right( numpos, i*8+32, colour, buffer );
+ snprintf( buffer, sizeof( buffer ), ": %s", (char *)ptr->data );
+ widget_printstring( numpos + 1, i*8+32, colour, buffer );
+ }
+
+ widget_display_lines( 4, 18 );
+}
+
+void
+widget_browse_keyhandler( input_key key )
+{
+ switch( key ) {
+
+#if 0
+ case INPUT_KEY_Resize: /* Fake keypress used on window resize */
+ widget_browse_draw( NULL );
+ break;
+#endif
+
+ case INPUT_KEY_Escape:
+ widget_end_widget( WIDGET_FINISHED_CANCEL );
+ return;
+
+ case INPUT_KEY_Down:
+ case INPUT_KEY_6:
+ case INPUT_KEY_j:
+ if( highlight < block_count - 1 ) {
+ highlight++;
+ if( highlight >= top_line + 18 ) top_line += 18;
+ show_blocks();
+ }
+ break;
+
+ case INPUT_KEY_Up:
+ case INPUT_KEY_7:
+ case INPUT_KEY_k:
+ if( highlight > 0 ) {
+ highlight--;
+ if( highlight < top_line )
+ {
+ top_line -= 18;
+ if( top_line < 0 ) top_line = 0;
+ }
+ show_blocks();
+ }
+ break;
+
+ case INPUT_KEY_Page_Up:
+ highlight -= 18; if( highlight < 0 ) highlight = 0;
+ top_line -= 18; if( top_line < 0 ) top_line = 0;
+ show_blocks();
+ break;
+
+ case INPUT_KEY_Page_Down:
+ highlight += 18;
+ if( highlight >= block_count ) highlight = block_count - 1;
+ top_line += 18;
+ if( top_line >= block_count ) {
+ top_line = block_count - 18;
+ if( top_line < 0 ) top_line = 0;
+ }
+ show_blocks();
+ break;
+
+ case INPUT_KEY_Home:
+ highlight = top_line = 0;
+ show_blocks();
+ break;
+
+ case INPUT_KEY_End:
+ highlight = block_count - 1;
+ top_line = block_count - 18; if( top_line < 0 ) top_line = 0;
+ show_blocks();
+ break;
+
+ case INPUT_KEY_Return:
+ widget_end_widget( WIDGET_FINISHED_OK );
+ return;
+
+ default: /* Keep gcc happy */
+ break;
+
+ }
+}
+
+int
+widget_browse_finish( widget_finish_state finished )
+{
+ g_slist_foreach( blocks, free_description, NULL );
+ g_slist_free( blocks );
+
+ if( finished == WIDGET_FINISHED_OK ) {
+ if( highlight != -1 ) tape_select_block( highlight );
+ widget_end_all( WIDGET_FINISHED_OK );
+ }
+
+ return 0;
+}
+
+static void
+free_description( gpointer data, gpointer user_data )
+{
+ free( data );
+}
Copied: vendor/fuse-emulator/current/fuse/ui/widget/debugger.c (from rev 527, vendor/fuse-emulator/current/fuse/widget/debugger.c)
===================================================================
--- vendor/fuse-emulator/current/fuse/ui/widget/debugger.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/ui/widget/debugger.c 2008-05-07 12:25:42 UTC (rev 528)
@@ -0,0 +1,547 @@
+/* debugger.c: The debugger widget
+ Copyright (c) 2002-2004 Philip Kendall, Darren Salt
+
+ $Id: debugger.c 3115 2007-08-19 02:49:14Z fredm $
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+ Author contact information:
+
+ E-mail: phi...@sh...
+
+*/
+
+#include <config.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include <libspectrum.h>
+
+#include "display.h"
+#include "keyboard.h"
+#include "machine.h"
+#include "scld.h"
+#include "ui/uidisplay.h"
+#include "ula.h"
+#include "widget.h"
+#include "debugger/debugger.h"
+#include "widget_internals.h"
+#include "z80/z80.h"
+#include "z80/z80_macros.h"
+#include "zxcf.h"
+
+static enum {
+ DB_REGISTERS, DB_BYTES, DB_TEXT, DB_DISASM, DB_BREAKPT
+} display = DB_REGISTERS;
+
+struct {
+ libspectrum_word value;
+ size_t page;
+ char x, width, column;
+} db_editv = {
+ 0, 0, 255, 0
+};
+
+static libspectrum_word debugger_memaddr;
+static int breakpt_no = 0, breakpt_show = 0;
+
+/* Various data displays */
+static void display_registers( void );
+static void display_bytes( void );
+static void display_text( void );
+static void display_disasm( void );
+static void display_breakpts( void );
+
+/* Scrolling for the data displays */
+static void scroll( int step );
+
+#define LC(X) ( (X)*8 - DISPLAY_BORDER_ASPECT_WIDTH )
+#define LR(Y) ( (Y)*8 - DISPLAY_BORDER_HEIGHT )
+
+static inline const char *format_8_bit( void )
+{
+ return debugger_output_base == 10 ? "%-3d" : "%02X";
+}
+
+static inline const char *format_16_bit( void )
+{
+ return debugger_output_base == 10 ? "%-5d" : "%04X";
+}
+
+int ui_debugger_activate( void )
+{
+ return widget_do( WIDGET_TYPE_DEBUGGER, NULL );
+}
+
+int ui_debugger_deactivate( int interruptible GCC_UNUSED )
+{
+ /* Refresh the Spectrum's display, including the border */
+ display_refresh_all();
+ return widget_end_all( WIDGET_FINISHED_OK );
+}
+
+int ui_debugger_update( void )
+{
+ return widget_debugger_draw( NULL );
+}
+
+int ui_debugger_disassemble( libspectrum_word addr )
+{
+ debugger_memaddr = addr;
+ return 0;
+}
+
+int widget_debugger_draw( void *data )
+{
+ static const char state[][8] = {
+ "Running", "Halted", "Stepped", "Breakpt"
+ };
+ int x;
+ char pbuf[8];
+
+ widget_rectangle( LC(0), LR(0), 40 * 8, 11 * 8 + 4, 1 );
+ widget_rectangle( LC(0), LR(11) + 2, 320, 1, 7 );
+
+ switch ( display ) {
+ case DB_REGISTERS: display_registers(); break;
+ case DB_BYTES: display_bytes(); break;
+ case DB_TEXT: display_text(); break;
+ case DB_DISASM: display_disasm(); break;
+ case DB_BREAKPT: display_breakpts(); break;
+ }
+
+ widget_printstring( LC(0), LR(9) - 4, 6, state[debugger_mode] );
+ widget_printstring( LC(10), LR(9) - 4, 6,
+ "\012S\011ingle step \012C\011ontinue Co\012m\011mand" );
+
+ x = LC(-1);
+ if( display != DB_REGISTERS )
+ x = widget_printstring( x + 8, LR(10), 7, "\012R\011egs" );
+ if( display != DB_BYTES )
+ x = widget_printstring( x + 8, LR(10), 7, "\012B\011ytes" );
+ if( display != DB_TEXT )
+ x = widget_printstring( x + 8, LR(10), 7, "\012T\011ext" );
+ if( display != DB_DISASM )
+ x = widget_printstring( x + 8, LR(10), 7, "\012D\011isasm" );
+ if( display != DB_BREAKPT )
+ x = widget_printstring( x + 8, LR(10), 7, "Brea\012k\011pts" );
+
+ widget_printstring_right( LC(25) + 4, LR(10), 5, "PC" );
+ sprintf( pbuf, "%04X", PC );
+ widget_printstring_fixed( LC(26) / 8, LR(10) / 8, 7, pbuf );
+
+ widget_printstring_right( LR(35) + 4, LR(10), 5, "Bas\012e\011" );
+ sprintf( pbuf, "%d", debugger_output_base );
+ widget_printstring( LR(36), LR(10), 7, pbuf );
+
+ widget_display_lines( LR(0) / 8, 12 );
+
+ return 0;
+}
+
+
+void widget_debugger_keyhandler( input_key key )
+{
+ /* Display mode */
+ switch ( key ) {
+ case INPUT_KEY_Escape: /* Close widget */
+ widget_end_widget( WIDGET_FINISHED_CANCEL );
+ debugger_run();
+ break;
+
+ case INPUT_KEY_c:
+ case INPUT_KEY_Return: /* Close widget */
+ widget_end_all( WIDGET_FINISHED_OK );
+ debugger_run();
+ break;
+
+ case INPUT_KEY_s: /* Single step & reopen widget */
+ debugger_mode = DEBUGGER_MODE_HALTED;
+ widget_end_all( WIDGET_FINISHED_OK );
+ break;
+
+ case INPUT_KEY_r: /* Display the registers */
+ display = DB_REGISTERS;
+ widget_debugger_draw( NULL );
+ break;
+
+ case INPUT_KEY_b: /* Display a memory dump (bytes) */
+ display = DB_BYTES;
+ widget_debugger_draw( NULL );
+ break;
+
+ case INPUT_KEY_t: /* Display a memory dump (text) */
+ display = DB_TEXT;
+ widget_debugger_draw( NULL );
+ break;
+
+ case INPUT_KEY_d: /* Display a disassembly */
+ display = DB_DISASM;
+ widget_debugger_draw( NULL );
+ break;
+
+ case INPUT_KEY_k: /* Display the breakpoints */
+ display = DB_BREAKPT;
+ widget_debugger_draw( NULL );
+ break;
+
+ case INPUT_KEY_e: /* Switch base */
+ debugger_output_base = 26 - debugger_output_base; /* 10 or 16 */
+ widget_debugger_draw( NULL );
+ break;
+
+ case INPUT_KEY_m: /* Enter a command */
+ {
+ widget_text_t text_data;
+
+ text_data.title = "Debugger command";
+ text_data.allow = WIDGET_INPUT_ASCII;
+ text_data.text[0] = 0;
+ if( !widget_do( WIDGET_TYPE_TEXT, &text_data ) )
+ debugger_command_evaluate( widget_text_text );
+ }
+ break;
+
+ case INPUT_KEY_Up: /* Back one line */
+ scroll( -1 );
+ break;
+
+ case INPUT_KEY_Down: /* Back one instruction or four lines */
+ scroll( 1 );
+ break;
+
+ case INPUT_KEY_Page_Up: /* Back eight lines */
+ scroll( -8 );
+ break;
+
+ case INPUT_KEY_Page_Down: /* Forward eight lines */
+ scroll( 8 );
+ break;
+
+ case INPUT_KEY_Home: /* To start of memory */
+ debugger_memaddr = 0;
+ scroll( 0 );
+ break;
+
+ case INPUT_KEY_End: /* To end of RAM */
+ debugger_memaddr = 0;
+ scroll( -8 );
+ break;
+
+ default:;
+ }
+}
+
+static void show_register0( int x, int y, const char *label, int value )
+{
+ char pbuf[8];
+
+ sprintf( pbuf, "%d", value );
+ widget_printstring_right( x - 4, y, 5, label );
+ widget_printstring_fixed( x / 8, y / 8, 7, pbuf );
+}
+
+static void show_register1( int x, int y, const char *label, int value )
+{
+ char pbuf[8];
+
+ sprintf( pbuf, format_8_bit(), value );
+ widget_printstring_right( x - 4, y, 5, label );
+ widget_printstring_fixed( x / 8, y / 8, 7, pbuf );
+}
+
+static void show_register2( int x, int y, const char *label, int value )
+{
+ char pbuf[8];
+
+ sprintf( pbuf, format_16_bit(), value );
+ widget_printstring_right( x - 4, y, 5, label );
+ widget_printstring_fixed( x / 8, y / 8, 7, pbuf );
+}
+
+static void display_registers( void )
+{
+ char pbuf[16];
+ int i, capabilities;
+
+ show_register2( LC(3), LR(0), "AF", AF );
+ show_register2( LC(12), LR(0), "AF'", AF_ );
+ show_register2( LC(20), LR(0), "SP", SP );
+ show_register2( LC(29), LR(0), "PC", PC );
+ show_register1( LC(36), LR(0), "R", ( R & 0x7F ) | ( R7 & 0x80 ) );
+
+ show_register2( LC(3), LR(1), "BC", BC );
+ show_register2( LC(12), LR(1), "BC'", BC_ );
+ show_register2( LC(20), LR(1), "IX", IX );
+ show_register2( LC(29), LR(1), "IY", IY );
+ show_register1( LC(36), LR(1), "I", I );
+
+ show_register2( LC(3), LR(2), "DE", DE );
+ show_register2( LC(12), LR(2), "DE'", DE_ );
+ show_register0( LC(20), LR(2), "IM", IM );
+ show_register0( LC(29), LR(2), "IFF1", IFF1 );
+ show_register0( LC(36), LR(2), "IFF2", IFF2 );
+
+ show_register2( LC(3), LR(3), "HL", HL );
+ show_register2( LC(12), LR(3), "HL'", HL_ );
+ widget_printstring_fixed( LC(20) / 8, LR(3) / 8, 5, "SZ5H3PNC" );
+ show_register1( LC(36), LR(3), "ULA", ula_last_byte() );
+
+ sprintf( pbuf, "%d", tstates );
+ widget_printstring_right( LC(12) - 4, LR(4), 5, "Tstates" );
+ widget_printstring_fixed( LC(12) / 8, LR(4) / 8, 7, pbuf );
+ for( i = 0; i < 8; ++i )
+ pbuf[i] = '0' + ( F >> i & 1 );
+ pbuf[8] = 0;
+ widget_printstring_fixed( LC(20) / 8, LR(4) / 8, 7, pbuf );
+
+ capabilities = libspectrum_machine_capabilities( machine_current->machine );
+
+ if( capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_AY )
+ show_register1( LC(37), LR(4), "AY",
+ machine_current->ay.current_register );
+
+ if( capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_128_MEMORY )
+ show_register1( LC(6), LR(5), "128Mem",
+ machine_current->ram.last_byte );
+
+ if( capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_128_MEMORY )
+ show_register1( LC(15), LR(5), "+3Mem",
+ machine_current->ram.last_byte2 );
+
+ if( capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_VIDEO ||
+ capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_MEMORY ||
+ capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_SE_MEMORY )
+ show_register1( LC(24), LR(5), "TmxDec", scld_last_dec.byte );
+
+ if( capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_MEMORY ||
+ capabilities & LIBSPECTRUM_MACHINE_CAPABILITY_SE_MEMORY )
+ show_register1( LC(33), LR(5), "TmxHSR", scld_last_hsr );
+
+ if( settings_current.zxcf_active )
+ show_register1( LC(6), LR(5), "ZXCF", zxcf_last_memctl() );
+
+ for( i = 0; i < 8; ++i ) {
+ int x = LC(2 + 10 * ( i & 3) ), y = LR(i < 4 ? 6 : 7);
+
+ sprintf( pbuf, "P%X", i );
+ widget_printstring_right( x, y, 5, pbuf );
+ snprintf( pbuf, sizeof( pbuf ), "%s %d",
+ memory_bank_name( &memory_map_read[i] ),
+ memory_map_read[i].page_num );
+ x = widget_printstring( x + 4, y, 7, pbuf ) + 4;
+ if( memory_map_read[i].writable )
+ x = widget_printstring( x, y, 4, "w" );
+ if( memory_map_read[i].contended )
+ x = widget_printstring( x, y, 4, "c" );
+ }
+}
+
+
+static void display_bytes( void )
+{
+ int x, y;
+ char pbuf[36];
+
+ for( y = 0; y < 8; ++y ) {
+ libspectrum_word addr = debugger_memaddr + y * 8;
+
+ sprintf( pbuf, format_16_bit(), addr );
+ widget_printstring_fixed( LC(1) / 8, LR(y) / 8, 7, pbuf );
+ widget_printstring( LC(6), LR(y), 5, ":" );
+
+ for( x = 0; x < 8; ++x ) {
+ sprintf( pbuf + x * 4, format_8_bit(),
+ readbyte_internal( addr + x ) );
+ if( x < 7 )
+ strcat( pbuf, " " );
+ }
+ widget_printstring_fixed( LC(7) / 8, LR(y) / 8, 7, pbuf );
+ }
+}
+
+
+static void display_text( void )
+{
+ int x, y;
+ char pbuf[8];
+
+ for( y = 0; y < 8; ++y ) {
+ libspectrum_word addr = debugger_memaddr + y * 32;
+
+ sprintf( pbuf, format_16_bit(), addr );
+ widget_printstring_fixed( LC(1) / 8, LR(y) / 8, 7, pbuf );
+ widget_printstring( LC(6), LR(y), 5, ":" );
+
+ for( x = 0; x < 32; ++x )
+ widget_printchar_fixed( LC(x + 8) / 8, LR(y) / 8, 7,
+ readbyte_internal( addr + x ) );
+ }
+}
+
+
+static void display_disasm( void )
+{
+ int y;
+ char pbuf[40];
+ libspectrum_word addr = debugger_memaddr;
+
+ for( y = 0; y < 8; ++y ) {
+ size_t length;
+ char *spc;
+
+ sprintf( pbuf, format_16_bit(), addr );
+ widget_printstring_fixed( LC(1) / 8, LR(y) / 8, 7, pbuf );
+ widget_printstring( LC(6), LR(y), 5, ":" );
+
+ debugger_disassemble( pbuf, sizeof( pbuf ), &length, addr );
+ addr += length;
+ spc = strchr( pbuf, ' ' );
+ if( spc )
+ *spc = 0;
+ widget_printstring( LC(8), LR(y), 7, pbuf );
+ if( spc ) {
+ spc += 1 + strspn( spc + 1, " " );
+ widget_printstring( LC(12) + 4, LR(y), 7, spc );
+ }
+ }
+}
+
+
+static void display_breakpts( void )
+{
+ GSList *ptr;
+ int i = -breakpt_show;
+ char pbuf[80], fmt[20];
+
+ if( i )
+ widget_up_arrow( LC(0), LR(0), 7 );
+
+ for( ptr = debugger_breakpoints; i < 8 && ptr; ptr = ptr->next, ++i ) {
+ const debugger_breakpoint *bp = ptr->data;
+
+ if( i < 0 )
+ continue;
+
+ sprintf( pbuf, "%lu", ( unsigned long )bp->id );
+ widget_printstring( LC(1), LR(i), 5, pbuf );
+ widget_printstring( LC(6), LR(i), 7,
+ debugger_breakpoint_type_abbr[bp->type] );
+
+ switch ( bp->type ) {
+ case DEBUGGER_BREAKPOINT_TYPE_EXECUTE:
+ case DEBUGGER_BREAKPOINT_TYPE_READ:
+ case DEBUGGER_BREAKPOINT_TYPE_WRITE:
+ if( bp->value.address.page == -1 )
+ sprintf( pbuf, format_16_bit(), bp->value.address.offset );
+ else {
+ debugger_breakpoint_decode_page( pbuf, sizeof( pbuf ) - 12,
+ bp->value.address.page );
+ if( pbuf[0] == '[' )
+ sprintf( pbuf, "?%d", bp->value.address.page );
+ strcat( pbuf, ":" );
+ sprintf( pbuf + strlen( pbuf ), format_16_bit(),
+ bp->value.address.offset );
+ }
+ break;
+
+ case DEBUGGER_BREAKPOINT_TYPE_PORT_READ:
+ case DEBUGGER_BREAKPOINT_TYPE_PORT_WRITE:
+ sprintf( fmt, "%s:%s", format_16_bit(), format_16_bit() );
+ sprintf( pbuf, fmt, bp->value.port.mask, bp->value.port.port );
+ break;
+
+ case DEBUGGER_BREAKPOINT_TYPE_TIME:
+ sprintf( pbuf, "%5d", bp->value.tstates );
+ break;
+ }
+ widget_printstring( LC(10), LR(i), 6, pbuf );
+
+ sprintf( pbuf, "%lu", ( unsigned long )bp->ignore );
+ widget_printstring( LC(18) + 4, LR(i), 7, pbuf );
+
+ sprintf( pbuf, "%s", debugger_breakpoint_life_abbr[bp->life] );
+ widget_printstring( LC(23), LR(i), 7, pbuf );
+
+ if( bp->condition ) {
+ debugger_expression_deparse( pbuf, sizeof( pbuf ), bp->condition );
+ widget_printstring( LC(28) + 4, LR(i), 6, pbuf );
+ }
+ }
+
+ if( !i )
+ widget_printstring( LC(1), LR(0), 5, "(No breakpoints)" );
+ else if( ptr )
+ widget_down_arrow( LC(0), LC(7), 7 );
+}
+
+
+static void scroll( int step )
+{
+ switch ( display ) {
+ case DB_BYTES:
+ debugger_memaddr += 8 * step;
+ break;
+
+ case DB_TEXT:
+ debugger_memaddr += 32 * step;
+ break;
+
+ case DB_DISASM:
+ if( step > 0 )
+ for( ; step; --step ) {
+ size_t length;
+
+ debugger_disassemble( NULL, 0, &length, debugger_memaddr );
+ debugger_memaddr += length;
+ } else
+ for( ; step; ++step ) {
+ /* For details, see ui/gtk/debugger.c:move_disassembly() */
+ size_t i, longest = 1;
+
+ for( i = 1; i <= 8; ++i ) {
+ size_t length;
+
+ debugger_disassemble( NULL, 0, &length, debugger_memaddr );
+ if( length == i )
+ longest = i;
+ }
+ debugger_memaddr -= longest;
+ }
+ break;
+
+ case DB_BREAKPT:
+ {
+ int length = g_slist_length( debugger_breakpoints );
+
+ breakpt_no += step;
+ if( breakpt_no >= length )
+ breakpt_no = length - 1;
+ if( breakpt_no < 0 )
+ breakpt_no = 0;
+ if( breakpt_no < breakpt_show )
+ breakpt_show = breakpt_no;
+ else if( breakpt_no > breakpt_show + 7 )
+ breakpt_show = breakpt_no - 7;
+ }
+ break;
+
+ default:
+ return;
+ }
+
+ widget_debugger_draw( NULL );
+}
Copied: vendor/fuse-emulator/current/fuse/ui/widget/error.c (from rev 527, vendor/fuse-emulator/current/fuse/widget/error.c)
===================================================================
--- vendor/fuse-emulator/current/fuse/ui/widget/error.c (rev 0)
+++ vendor/fuse-emulator/current/fuse/ui/widget/error.c...
[truncated message content] |