Thread: [Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx: [241] branches/fusegl/fuse
Brought to you by:
fredm
|
From: <fr...@us...> - 2006-12-04 11:39:09
|
Revision: 241
http://svn.sourceforge.net/fuse-for-macosx/?rev=241&view=rev
Author: fredm
Date: 2006-12-04 03:39:09 -0800 (Mon, 04 Dec 2006)
Log Message:
-----------
Move to having a clear function to call to run a frame worth of emulation.
Modified Paths:
--------------
branches/fusegl/fuse/event.c
branches/fusegl/fuse/event.h
branches/fusegl/fuse/fuse.cpp
Modified: branches/fusegl/fuse/event.c
===================================================================
--- branches/fusegl/fuse/event.c 2006-11-26 11:24:42 UTC (rev 240)
+++ branches/fusegl/fuse/event.c 2006-12-04 11:39:09 UTC (rev 241)
@@ -53,6 +53,9 @@
/* When will the next event happen? */
libspectrum_dword event_next_event;
+/* We are at the end of a frame */
+int event_frame_end;
+
/* The actual list of events */
static GSList* event_list;
@@ -80,6 +83,7 @@
event_list=NULL;
event_free=NULL;
event_next_event=event_no_events;
+ event_frame_end=0;
return 0;
}
@@ -120,6 +124,34 @@
: a->type - b->type;
}
+/* Do a frame end event */
+void
+event_do_frame_end(void)
+{
+ if( rzx_playback ) event_force_events();
+ rzx_frame();
+ psg_frame();
+ spectrum_frame();
+ z80_interrupt();
+ ui_joystick_poll();
+ timer_estimate_speed();
+ debugger_add_time_events();
+ ui_event();
+ ui_error_frame();
+ event_frame_end=0;
+}
+
+/* Do a single frame */
+void
+event_do_frame(void)
+{
+ while( !event_frame_end ) {
+ z80_do_opcodes();
+ event_do_events();
+ }
+ event_do_frame_end();
+}
+
/* Do all events which have passed */
int event_do_events(void)
{
@@ -146,16 +178,7 @@
break;
case EVENT_TYPE_FRAME:
- if( rzx_playback ) event_force_events();
- rzx_frame();
- psg_frame();
- spectrum_frame();
- z80_interrupt();
- ui_joystick_poll();
- timer_estimate_speed();
- debugger_add_time_events();
- ui_event();
- ui_error_frame();
+ event_frame_end = 1;
break;
case EVENT_TYPE_INTERRUPT:
Modified: branches/fusegl/fuse/event.h
===================================================================
--- branches/fusegl/fuse/event.h 2006-11-26 11:24:42 UTC (rev 240)
+++ branches/fusegl/fuse/event.h 2006-12-04 11:39:09 UTC (rev 241)
@@ -60,6 +60,9 @@
/* When will the next event happen? */
extern libspectrum_dword event_next_event;
+/* We are at the end of a frame */
+extern int event_frame_end;
+
/* Set up the event list */
int event_init(void);
@@ -69,6 +72,12 @@
/* Do all events which have passed */
int event_do_events(void);
+/* Do a frame end event */
+void event_do_frame_end(void);
+
+/* Do a single frame */
+void event_do_frame(void);
+
/* Called at end of frame to reduce T-state count of all entries */
int event_frame( libspectrum_dword tstates_per_frame );
Modified: branches/fusegl/fuse/fuse.cpp
===================================================================
--- branches/fusegl/fuse/fuse.cpp 2006-11-26 11:24:42 UTC (rev 240)
+++ branches/fusegl/fuse/fuse.cpp 2006-12-04 11:39:09 UTC (rev 241)
@@ -150,8 +150,7 @@
settings_current.show_version ) return 0;
while( !fuse_exiting ) {
- z80_do_opcodes();
- event_do_events();
+ event_do_frame();
}
fuse_end();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2006-12-19 06:40:18
|
Revision: 252
http://svn.sourceforge.net/fuse-for-macosx/?rev=252&view=rev
Author: fredm
Date: 2006-12-18 22:40:16 -0800 (Mon, 18 Dec 2006)
Log Message:
-----------
Inital rough cut of native Cocoa UI, only screen done yet, still need to do
input, sound and lots of tidying.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/compat.h
branches/fusegl/fuse/fuse.cpp
branches/fusegl/fuse/fuse.h
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/FuseMenus.h
branches/fusegl/fuse/fusepb/FuseMenus.m
branches/fusegl/fuse/fusepb/Info-Fuse.plist
branches/fusegl/fuse/fusepb/config.h
branches/fusegl/fuse/fusepb/content_arrays/SDLJoysticks.m
branches/fusegl/fuse/fusepb/controllers/FuseController.m
branches/fusegl/fuse/fusepb/controllers/JoystickConfigurationController.m
branches/fusegl/fuse/fusepb/controllers/PreferencesController.m
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/info.nib
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
branches/fusegl/fuse/machine.c
branches/fusegl/fuse/menu.h
Added Paths:
-----------
branches/fusegl/fuse/fusepb/main.h
branches/fusegl/fuse/fusepb/main.mm
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/
branches/fusegl/fuse/fusepb/views/
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/ui/cocoa/
branches/fusegl/fuse/ui/cocoa/cocoadisplay.c
branches/fusegl/fuse/ui/cocoa/cocoadisplay.h
branches/fusegl/fuse/ui/cocoa/cocoajoystick.c
branches/fusegl/fuse/ui/cocoa/cocoaui.c
branches/fusegl/fuse/ui/cocoa/cocoaui.h
branches/fusegl/fuse/ui/cocoa/keysyms.c
Removed Paths:
-------------
branches/fusegl/fuse/fusepb/keysyms.c
branches/fusegl/fuse/fusepb/nibs/SDLMain.nib/
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2006-12-17 13:51:06 UTC (rev 251)
+++ branches/fusegl/fuse/TODO 2006-12-19 06:40:16 UTC (rev 252)
@@ -1,3 +1,16 @@
TODO
+X Move Fuse to have a loop that runs a single frame at a time (will be callback
+ in threaded Cocoa GL UI)
+X Switch to Cocoa run loop for Fuse
+X Add GL renderer
+* Add native CoreAudio sound processing (removes SDL sound dependency from Fuse)
+* Add native keyboard processing (removes SDL keyboard input dependency from
+ Fuse)
+* Fix menus, preferences etc.
+* Fix scalers
+* Add native joystick processing (removes SDL joystick input dependency from
+ Fuse)
+* Add native mouse processing (removes SDL mouse input dependency from Fuse)
+
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/compat.h
===================================================================
--- branches/fusegl/fuse/compat.h 2006-12-17 13:51:06 UTC (rev 251)
+++ branches/fusegl/fuse/compat.h 2006-12-19 06:40:16 UTC (rev 252)
@@ -59,7 +59,7 @@
#endif /* #ifndef HAVE_GETOPT_LONG */
#ifndef HAVE_MKSTEMP
-int mkstemp( char *template );
+int mkstemp( char *tmpl );
#endif /* #ifndef HAVE_MKSTEMP */
#endif /* #ifndef FUSE_COMPAT_H */
Modified: branches/fusegl/fuse/fuse.cpp
===================================================================
--- branches/fusegl/fuse/fuse.cpp 2006-12-17 13:51:06 UTC (rev 251)
+++ branches/fusegl/fuse/fuse.cpp 2006-12-19 06:40:16 UTC (rev 252)
@@ -83,7 +83,7 @@
}
/* What name were we called under? */
-char *fuse_progname;
+const char *fuse_progname;
/* Which directory were we started in? */
char fuse_directory[ PATH_MAX ];
@@ -125,8 +125,6 @@
} start_files_t;
-static int fuse_init(int argc, char **argv);
-
static int creator_init( void );
static void fuse_show_copyright(void);
static void fuse_show_version( void );
@@ -137,9 +135,7 @@
start_files_t *start_files );
static int do_start_files( start_files_t *start_files );
-static int fuse_end(void);
-
-int main(int argc, char **argv)
+int old_main(int argc, char **argv)
{
if(fuse_init(argc,argv)) {
fprintf(stderr,"%s: error initialising -- giving up!\n", fuse_progname);
@@ -159,7 +155,7 @@
}
-static int fuse_init(int argc, char **argv)
+int fuse_init(int argc, char **argv)
{
int error, first_arg;
char *start_scaler;
@@ -753,7 +749,7 @@
}
/* Tidy-up function called at end of emulation */
-static int fuse_end(void)
+int fuse_end(void)
{
/* Must happen before memory is deallocated as we read the character
set from memory for the text output */
Modified: branches/fusegl/fuse/fuse.h
===================================================================
--- branches/fusegl/fuse/fuse.h 2006-12-17 13:51:06 UTC (rev 251)
+++ branches/fusegl/fuse/fuse.h 2006-12-19 06:40:16 UTC (rev 252)
@@ -34,7 +34,7 @@
#include "compat.h"
-extern char *fuse_progname; /* argv[0] */
+extern const char *fuse_progname; /* argv[0] */
extern char fuse_directory[ PATH_MAX ]; /* The directory we started in */
extern int fuse_exiting; /* Shall we exit now? */
@@ -48,6 +48,11 @@
void fuse_abort( void ) GCC_NORETURN; /* Emergency shutdown */
+int fuse_init(int argc, char **argv);
+
+int fuse_end(void); /* Tidy-up function called at end of
+ emulation */
+
extern int fuse_sound_in_use; /* Are we trying to produce sound? */
extern libspectrum_creator *fuse_creator; /* Creator information for file
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-17 13:51:06 UTC (rev 251)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-19 06:40:16 UTC (rev 252)
@@ -21,13 +21,9 @@
B61F459F09121DF100C8096C /* tape_scorpion.szx in CopyFiles */ = {isa = PBXBuildFile; fileRef = B650C40A0765988200DE7E81 /* tape_scorpion.szx */; };
B61F45A209121DF100C8096C /* spectrum.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = F541C04303963A9F01C2A5B9 /* spectrum.framework */; };
B61F45A309121DF100C8096C /* 765.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = F541C0750396490901C2A5B9 /* 765.framework */; };
- B61F45A409121DF100C8096C /* SDL.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = F50F65A003B2355701A804BA /* SDL.framework */; };
B61F45A609121DF100C8096C /* gcrypt.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B6BA1A8B04E4F3290017354F /* gcrypt.framework */; };
B61F45A709121DF100C8096C /* libbz2.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B6202BD105BD43D800A1EA8F /* libbz2.framework */; };
- B61F45A909121DF100C8096C /* SDLMain.h in Headers */ = {isa = PBXBuildFile; fileRef = F55985400389209A01A804BA /* SDLMain.h */; };
B61F45AA09121DF100C8096C /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = F5598598038921C501A804BA /* config.h */; };
- B61F45AB09121DF100C8096C /* sdldisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = F55985A40389221501A804BA /* sdldisplay.h */; };
- B61F45AC09121DF100C8096C /* sdlkeyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F55985A60389221501A804BA /* sdlkeyboard.h */; };
B61F45AD09121DF100C8096C /* ui.h in Headers */ = {isa = PBXBuildFile; fileRef = F55985AD0389222701A804BA /* ui.h */; };
B61F45AE09121DF100C8096C /* uidisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = F55985AE0389222701A804BA /* uidisplay.h */; };
B61F45AF09121DF100C8096C /* z80_macros.h in Headers */ = {isa = PBXBuildFile; fileRef = F55985B10389224001A804BA /* z80_macros.h */; };
@@ -61,9 +57,7 @@
B61F45CB09121DF100C8096C /* debugger.h in Headers */ = {isa = PBXBuildFile; fileRef = B68CB2C503DD920300A804BA /* debugger.h */; };
B61F45CC09121DF100C8096C /* DebuggerController.h in Headers */ = {isa = PBXBuildFile; fileRef = B632C6AE03E5368700A864FD /* DebuggerController.h */; };
B61F45CD09121DF100C8096C /* FuseMenus.h in Headers */ = {isa = PBXBuildFile; fileRef = B66EA7830401075300A864FD /* FuseMenus.h */; };
- B61F45CE09121DF100C8096C /* sdlscreenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = B68D5B20041E085000A864FD /* sdlscreenshot.h */; };
B61F45CF09121DF100C8096C /* scaler_internals.h in Headers */ = {isa = PBXBuildFile; fileRef = B60A6A3A042BEECE00D41533 /* scaler_internals.h */; };
- B61F45D009121DF100C8096C /* sdljoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = B6030027043363C900A864FD /* sdljoystick.h */; };
B61F45D109121DF100C8096C /* dck.h in Headers */ = {isa = PBXBuildFile; fileRef = B65E4C610445DB7D00A864FD /* dck.h */; };
B61F45D209121DF100C8096C /* psg.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CA304D049CEC410037E9F2 /* psg.h */; };
B61F45D309121DF100C8096C /* compat.h in Headers */ = {isa = PBXBuildFile; fileRef = B6871C9D04AF7BEF00C24D83 /* compat.h */; };
@@ -74,7 +68,6 @@
B61F45D809121DF100C8096C /* pokefinder.h in Headers */ = {isa = PBXBuildFile; fileRef = B64586D3059BC04A00934482 /* pokefinder.h */; };
B61F45D909121DF100C8096C /* PokeFinderController.h in Headers */ = {isa = PBXBuildFile; fileRef = B62F3BCE059F5BF300A7009A /* PokeFinderController.h */; };
B61F45DA09121DF100C8096C /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = B6FD5C7A05A4F5B600A6C4FC /* utils.h */; };
- B61F45DB09121DF100C8096C /* sdlui.h in Headers */ = {isa = PBXBuildFile; fileRef = B627DAA705ACDF4E00609956 /* sdlui.h */; };
B61F45DC09121DF100C8096C /* MemoryBrowserController.h in Headers */ = {isa = PBXBuildFile; fileRef = B6D2989105B061CB00C2AA14 /* MemoryBrowserController.h */; };
B61F45DD09121DF100C8096C /* periph.h in Headers */ = {isa = PBXBuildFile; fileRef = B6C57E0105ECA05B0056F1D0 /* periph.h */; };
B61F45DE09121DF100C8096C /* breakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B66050ED0606AAF500247454 /* breakpoint.h */; };
@@ -117,7 +110,7 @@
B61F460709121DF100C8096C /* Preferences.nib in Resources */ = {isa = PBXBuildFile; fileRef = B6BA6F0207B1E04200E44C8D /* Preferences.nib */; };
B61F460809121DF100C8096C /* Rollback.nib in Resources */ = {isa = PBXBuildFile; fileRef = B600ADA3077237920030FD05 /* Rollback.nib */; };
B61F460909121DF100C8096C /* SaveBinary.nib in Resources */ = {isa = PBXBuildFile; fileRef = B6F74F9A04B85B4F0059D51C /* SaveBinary.nib */; };
- B61F460A09121DF100C8096C /* SDLMain.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5598546038920E401A804BA /* SDLMain.nib */; };
+ B61F460A09121DF100C8096C /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5598546038920E401A804BA /* MainMenu.nib */; };
B61F460B09121DF100C8096C /* TapeBrowser.nib in Resources */ = {isa = PBXBuildFile; fileRef = F59B5587039F8DB601A804BA /* TapeBrowser.nib */; };
B61F460C09121DF100C8096C /* 48.rom in Resources */ = {isa = PBXBuildFile; fileRef = F559854C0389212301A804BA /* 48.rom */; };
B61F460D09121DF100C8096C /* 128-0.rom in Resources */ = {isa = PBXBuildFile; fileRef = F559854D0389212301A804BA /* 128-0.rom */; };
@@ -184,7 +177,6 @@
B61F464D09121DF100C8096C /* timer.c in Sources */ = {isa = PBXBuildFile; fileRef = F55986350389237101A804BA /* timer.c */; };
B61F464E09121DF100C8096C /* ui.c in Sources */ = {isa = PBXBuildFile; fileRef = F559863B0389238101A804BA /* ui.c */; };
B61F464F09121DF100C8096C /* uidisplay.c in Sources */ = {isa = PBXBuildFile; fileRef = F559863C0389238101A804BA /* uidisplay.c */; };
- B61F465009121DF100C8096C /* error.m in Sources */ = {isa = PBXBuildFile; fileRef = F5F8763503995372011FA3A4 /* error.m */; };
B61F465109121DF100C8096C /* FuseController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5F876380399540D011FA3A4 /* FuseController.m */; };
B61F465209121DF100C8096C /* TapeBrowserController.m in Sources */ = {isa = PBXBuildFile; fileRef = F59B5590039FD8F901A804BA /* TapeBrowserController.m */; };
B61F465309121DF100C8096C /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = F536B56503A0C275011517A0 /* utils.c */; };
@@ -199,28 +191,22 @@
B61F465C09121DF100C8096C /* debugger.c in Sources */ = {isa = PBXBuildFile; fileRef = B68CB2C403DD920300A804BA /* debugger.c */; };
B61F465D09121DF100C8096C /* disassemble.c in Sources */ = {isa = PBXBuildFile; fileRef = B68CB2C603DD920300A804BA /* disassemble.c */; };
B61F465E09121DF100C8096C /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = B68CB2CC03DD923C00A804BA /* memory.c */; };
- B61F465F09121DF100C8096C /* sdlkeyboard.c in Sources */ = {isa = PBXBuildFile; fileRef = B6586D8503E744C000A804BA /* sdlkeyboard.c */; };
B61F466009121DF100C8096C /* DebuggerController.m in Sources */ = {isa = PBXBuildFile; fileRef = B632C6AF03E5368700A864FD /* DebuggerController.m */; };
- B61F466109121DF100C8096C /* sdldisplay.c in Sources */ = {isa = PBXBuildFile; fileRef = B6F4396C03E9645500A864FD /* sdldisplay.c */; };
B61F466209121DF100C8096C /* FuseMenus.m in Sources */ = {isa = PBXBuildFile; fileRef = B66EA7840401075300A864FD /* FuseMenus.m */; };
B61F466309121DF100C8096C /* scaler.c in Sources */ = {isa = PBXBuildFile; fileRef = B63ABD8D042F175200A864FD /* scaler.c */; };
B61F466409121DF100C8096C /* tc2068.c in Sources */ = {isa = PBXBuildFile; fileRef = B6FEA44F0444C3370013916D /* tc2068.c */; };
B61F466509121DF100C8096C /* dck.c in Sources */ = {isa = PBXBuildFile; fileRef = B65E4C600445DB7D00A864FD /* dck.c */; };
- B61F466609121DF100C8096C /* keysyms.c in Sources */ = {isa = PBXBuildFile; fileRef = B61D4512048F8F5800FEA4F1 /* keysyms.c */; };
B61F466709121DF100C8096C /* psg.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CA304C049CEC410037E9F2 /* psg.c */; };
B61F466809121DF100C8096C /* LoadBinaryController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6F74F9704B855D40059D51C /* LoadBinaryController.m */; };
B61F466909121DF100C8096C /* SaveBinaryController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6F74F9D04B85B660059D51C /* SaveBinaryController.m */; };
- B61F466A09121DF100C8096C /* sdljoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6C691B504C20A09005EE041 /* sdljoystick.c */; };
B61F466B09121DF100C8096C /* joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6C691B704C20A42005EE041 /* joystick.c */; };
B61F466C09121DF100C8096C /* expression.c in Sources */ = {isa = PBXBuildFile; fileRef = B604635E04C5F37B00C225C9 /* expression.c */; };
B61F466D09121DF100C8096C /* NumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A7F0EA04C9A11D001025EB /* NumberFormatter.m */; };
B61F466E09121DF100C8096C /* pokefinder.c in Sources */ = {isa = PBXBuildFile; fileRef = B64586D2059BC04A00934482 /* pokefinder.c */; };
B61F466F09121DF100C8096C /* machine.c in Sources */ = {isa = PBXBuildFile; fileRef = B60B11F7059BC7E70048B64B /* machine.c */; };
B61F467009121DF100C8096C /* PokeFinderController.m in Sources */ = {isa = PBXBuildFile; fileRef = B62F3BCF059F5BF300A7009A /* PokeFinderController.m */; };
- B61F467109121DF100C8096C /* sdlui.c in Sources */ = {isa = PBXBuildFile; fileRef = B627DAA605ACDF4E00609956 /* sdlui.c */; };
B61F467209121DF100C8096C /* MemoryBrowserController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6D2989205B061CB00C2AA14 /* MemoryBrowserController.m */; };
B61F467309121DF100C8096C /* periph.c in Sources */ = {isa = PBXBuildFile; fileRef = B6C57E0005ECA05B0056F1D0 /* periph.c */; };
- B61F467409121DF100C8096C /* SDLMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = B6C57E0605ECC4160056F1D0 /* SDLMain.mm */; };
B61F467509121DF100C8096C /* scalers16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6C57E3F05ECC9260056F1D0 /* scalers16.cpp */; };
B61F467609121DF100C8096C /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B65163AB05F4A11E001903BE /* hq2x.cpp */; };
B61F467709121DF100C8096C /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B61EF5B905FED7930081DF70 /* hq3x.cpp */; };
@@ -253,13 +239,11 @@
B61F469209121DF100C8096C /* VolumeSliderToPrefTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = B66D6C9708115FC200FAE6F3 /* VolumeSliderToPrefTransformer.m */; };
B61F469309121DF100C8096C /* profile.c in Sources */ = {isa = PBXBuildFile; fileRef = B6E811F0084B5117008CF718 /* profile.c */; };
B61F469409121DF100C8096C /* ide.c in Sources */ = {isa = PBXBuildFile; fileRef = B6E811F4084B5148008CF718 /* ide.c */; };
- B61F469509121DF100C8096C /* sdlscreenshot.m in Sources */ = {isa = PBXBuildFile; fileRef = B619FC69090E649700344F94 /* sdlscreenshot.m */; };
B61F469A09121DF100C8096C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
B61F469B09121DF100C8096C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97325FDCFA39411CA2CEA /* Foundation.framework */; };
B61F469C09121DF100C8096C /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97324FDCFA39411CA2CEA /* AppKit.framework */; };
B61F469D09121DF100C8096C /* spectrum.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F541C04303963A9F01C2A5B9 /* spectrum.framework */; };
B61F469E09121DF100C8096C /* 765.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F541C0750396490901C2A5B9 /* 765.framework */; };
- B61F469F09121DF100C8096C /* SDL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F50F65A003B2355701A804BA /* SDL.framework */; };
B61F46A109121DF100C8096C /* gcrypt.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6BA1A8B04E4F3290017354F /* gcrypt.framework */; };
B61F46A209121DF100C8096C /* libbz2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6202BD105BD43D800A1EA8F /* libbz2.framework */; };
B61F46A409121DF100C8096C /* FuseImporter.mdimporter in CopyFiles */ = {isa = PBXBuildFile; fileRef = B64FEA96084F8EC300879389 /* FuseImporter.mdimporter */; };
@@ -280,6 +264,15 @@
B650987109366CA2003AF1BF /* szx.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650987009366CA2003AF1BF /* szx.icns */; };
B6825549091817F30014B5EE /* divide.c in Sources */ = {isa = PBXBuildFile; fileRef = B6825547091817F30014B5EE /* divide.c */; };
B682554A091817F30014B5EE /* divide.h in Headers */ = {isa = PBXBuildFile; fileRef = B6825548091817F30014B5EE /* divide.h */; };
+ B6CE7F400B2830A300EB65B3 /* cocoadisplay.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */; };
+ B6CE7F410B2830A300EB65B3 /* cocoadisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */; };
+ B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */; };
+ B6CE7F430B2830A300EB65B3 /* cocoaui.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3D0B2830A300EB65B3 /* cocoaui.c */; };
+ B6CE7F440B2830A300EB65B3 /* cocoaui.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */; };
+ B6CE7F450B2830A300EB65B3 /* keysyms.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3F0B2830A300EB65B3 /* keysyms.c */; };
+ B6CE7F520B283A0700EB65B3 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F510B283A0700EB65B3 /* main.mm */; };
+ B6CE7FCD0B28FBD600EB65B3 /* DisplayOpenGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7FCB0B28FBD600EB65B3 /* DisplayOpenGLView.h */; };
+ B6CE7FCE0B28FBD600EB65B3 /* DisplayOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7FCC0B28FBD600EB65B3 /* DisplayOpenGLView.m */; };
B6F047F60952A6D6006D8005 /* tape_se.szx in CopyFiles */ = {isa = PBXBuildFile; fileRef = B6F047F20952A6BA006D8005 /* tape_se.szx */; };
B6F047F70952A6D6006D8005 /* tape_ts2068.szx in CopyFiles */ = {isa = PBXBuildFile; fileRef = B6F047F30952A6BA006D8005 /* tape_ts2068.szx */; };
B6F047F80952A6E3006D8005 /* tape_plus3e.szx in CopyFiles */ = {isa = PBXBuildFile; fileRef = B6F047F00952A69A006D8005 /* tape_plus3e.szx */; };
@@ -325,7 +318,6 @@
files = (
B61F45A209121DF100C8096C /* spectrum.framework in CopyFiles */,
B61F45A309121DF100C8096C /* 765.framework in CopyFiles */,
- B61F45A409121DF100C8096C /* SDL.framework in CopyFiles */,
B61F45A609121DF100C8096C /* gcrypt.framework in CopyFiles */,
B61F45A709121DF100C8096C /* libbz2.framework in CopyFiles */,
);
@@ -353,7 +345,6 @@
B601847A065A586900B0BE59 /* zxatasp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = zxatasp.h; path = ../zxatasp.h; sourceTree = SOURCE_ROOT; };
B601847B065A586900B0BE59 /* zxcf.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = zxcf.c; path = ../zxcf.c; sourceTree = SOURCE_ROOT; };
B601847C065A586900B0BE59 /* zxcf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = zxcf.h; path = ../zxcf.h; sourceTree = SOURCE_ROOT; };
- B6030027043363C900A864FD /* sdljoystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sdljoystick.h; path = ../ui/sdl/sdljoystick.h; sourceTree = "<group>"; };
B604635E04C5F37B00C225C9 /* expression.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = expression.c; path = ../debugger/expression.c; sourceTree = SOURCE_ROOT; };
B60A6A3A042BEECE00D41533 /* scaler_internals.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = scaler_internals.h; path = ../ui/scaler/scaler_internals.h; sourceTree = SOURCE_ROOT; };
B60B11F7059BC7E70048B64B /* machine.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = machine.c; path = ../machine.c; sourceTree = SOURCE_ROOT; };
@@ -361,16 +352,12 @@
B611190306A1FA12006D2711 /* JoystickConfigurationController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = JoystickConfigurationController.m; path = controllers/JoystickConfigurationController.m; sourceTree = SOURCE_ROOT; };
B611196806A1FBB6006D2711 /* JoystickConfiguration.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = JoystickConfiguration.nib; path = nibs/JoystickConfiguration.nib; sourceTree = "<group>"; };
B619FC2E090D9BC200344F94 /* SavePanelAccessoryView.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SavePanelAccessoryView.nib; path = nibs/SavePanelAccessoryView.nib; sourceTree = "<group>"; };
- B619FC69090E649700344F94 /* sdlscreenshot.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = sdlscreenshot.m; sourceTree = SOURCE_ROOT; };
- B61D4512048F8F5800FEA4F1 /* keysyms.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = keysyms.c; sourceTree = SOURCE_ROOT; };
B61EF5B905FED7930081DF70 /* hq3x.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = hq3x.cpp; path = scaler/hq3x.cpp; sourceTree = SOURCE_ROOT; };
B61F46A909121DF100C8096C /* Info-Fuse.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Info-Fuse.plist"; sourceTree = "<group>"; };
B61F46AA09121DF200C8096C /* Fuse.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Fuse.app; sourceTree = BUILT_PRODUCTS_DIR; };
B6202BD105BD43D800A1EA8F /* libbz2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libbz2.framework; path = ../../bzip2/build/Deployment/libbz2.framework; sourceTree = SOURCE_ROOT; };
B621A11E062E92FB00F63DBC /* if2.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = if2.c; path = ../if2.c; sourceTree = SOURCE_ROOT; };
B621A11F062E92FB00F63DBC /* if2.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = if2.h; path = ../if2.h; sourceTree = SOURCE_ROOT; };
- B627DAA605ACDF4E00609956 /* sdlui.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sdlui.c; path = ../ui/sdl/sdlui.c; sourceTree = SOURCE_ROOT; };
- B627DAA705ACDF4E00609956 /* sdlui.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = sdlui.h; sourceTree = SOURCE_ROOT; };
B62E1BC303E298B200A80002 /* Debugger.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Debugger.nib; path = nibs/Debugger.nib; sourceTree = SOURCE_ROOT; };
B62F3BB4059F5B5900A7009A /* PokeFinder.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = PokeFinder.nib; path = nibs/PokeFinder.nib; sourceTree = "<group>"; };
B62F3BCE059F5BF300A7009A /* PokeFinderController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PokeFinderController.h; path = controllers/PokeFinderController.h; sourceTree = "<group>"; };
@@ -421,7 +408,6 @@
B650F73E07E7CD3F00E4F3AF /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PreferencesController.h; path = controllers/PreferencesController.h; sourceTree = SOURCE_ROOT; };
B650F73F07E7CD3F00E4F3AF /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PreferencesController.m; path = controllers/PreferencesController.m; sourceTree = SOURCE_ROOT; };
B65163AB05F4A11E001903BE /* hq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = hq2x.cpp; path = scaler/hq2x.cpp; sourceTree = SOURCE_ROOT; };
- B6586D8503E744C000A804BA /* sdlkeyboard.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sdlkeyboard.c; path = ../ui/sdl/sdlkeyboard.c; sourceTree = SOURCE_ROOT; };
B65E4C600445DB7D00A864FD /* dck.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dck.c; path = ../dck.c; sourceTree = SOURCE_ROOT; };
B65E4C610445DB7D00A864FD /* dck.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dck.h; path = ../dck.h; sourceTree = SOURCE_ROOT; };
B66050EC0606AAF500247454 /* breakpoint.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = breakpoint.c; path = ../debugger/breakpoint.c; sourceTree = SOURCE_ROOT; };
@@ -462,7 +448,6 @@
B68CB2C503DD920300A804BA /* debugger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = debugger.h; path = ../debugger/debugger.h; sourceTree = "<group>"; };
B68CB2C603DD920300A804BA /* disassemble.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = disassemble.c; path = ../debugger/disassemble.c; sourceTree = "<group>"; };
B68CB2CC03DD923C00A804BA /* memory.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = memory.c; sourceTree = "<group>"; };
- B68D5B20041E085000A864FD /* sdlscreenshot.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = sdlscreenshot.h; sourceTree = SOURCE_ROOT; };
B6A7F0E904C9A11D001025EB /* NumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberFormatter.h; sourceTree = "<group>"; };
B6A7F0EA04C9A11D001025EB /* NumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NumberFormatter.m; sourceTree = "<group>"; };
B6AA8A3C03D2FC1C00FED55D /* trdos.rom */ = {isa = PBXFileReference; lastKnownFileType = file; name = trdos.rom; path = ../roms/trdos.rom; sourceTree = SOURCE_ROOT; };
@@ -485,9 +470,7 @@
B6C3479F044B091100E1BBA7 /* ts2068.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ts2068.png; path = resources/ts2068.png; sourceTree = SOURCE_ROOT; };
B6C57E0005ECA05B0056F1D0 /* periph.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = periph.c; path = ../periph.c; sourceTree = SOURCE_ROOT; };
B6C57E0105ECA05B0056F1D0 /* periph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = periph.h; path = ../periph.h; sourceTree = SOURCE_ROOT; };
- B6C57E0605ECC4160056F1D0 /* SDLMain.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SDLMain.mm; sourceTree = SOURCE_ROOT; };
B6C57E3F05ECC9260056F1D0 /* scalers16.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = scalers16.cpp; path = scaler/scalers16.cpp; sourceTree = SOURCE_ROOT; };
- B6C691B504C20A09005EE041 /* sdljoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sdljoystick.c; path = ../ui/sdl/sdljoystick.c; sourceTree = SOURCE_ROOT; };
B6C691B704C20A42005EE041 /* joystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = joystick.c; path = ../joystick.c; sourceTree = SOURCE_ROOT; };
B6C740D90810BB0500AB170C /* Joysticks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Joysticks.h; path = content_arrays/Joysticks.h; sourceTree = SOURCE_ROOT; };
B6C740DA0810BB0500AB170C /* Joysticks.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = Joysticks.m; path = content_arrays/Joysticks.m; sourceTree = SOURCE_ROOT; };
@@ -503,6 +486,15 @@
B6CC82FF0800E408006EFFB9 /* CAMachines.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CAMachines.h; path = content_arrays/CAMachines.h; sourceTree = SOURCE_ROOT; };
B6CC83000800E408006EFFB9 /* CAMachines.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CAMachines.m; path = content_arrays/CAMachines.m; sourceTree = SOURCE_ROOT; };
B6CD0B9E06069F4A00847338 /* fuse.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKn...
[truncated message content] |
|
From: <fr...@us...> - 2006-12-20 01:44:56
|
Revision: 257
http://svn.sourceforge.net/fuse-for-macosx/?rev=257&view=rev
Author: fredm
Date: 2006-12-19 17:44:56 -0800 (Tue, 19 Dec 2006)
Log Message:
-----------
Enable native keyboard handling.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
Added Paths:
-----------
branches/fusegl/fuse/ui/cocoa/keysyms.m
Removed Paths:
-------------
branches/fusegl/fuse/ui/cocoa/keysyms.c
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2006-12-19 11:28:44 UTC (rev 256)
+++ branches/fusegl/fuse/TODO 2006-12-20 01:44:56 UTC (rev 257)
@@ -4,9 +4,9 @@
in threaded Cocoa GL UI)
X Switch to Cocoa run loop for Fuse
X Add GL renderer
+X Add native keyboard processing (removes SDL keyboard input dependency from
+ Fuse)
* Add native CoreAudio sound processing (removes SDL sound dependency from Fuse)
-* Add native keyboard processing (removes SDL keyboard input dependency from
- Fuse)
* Fix menus, preferences etc.
* Fix scalers
* Add native joystick processing (removes SDL joystick input dependency from
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-19 11:28:44 UTC (rev 256)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-20 01:44:56 UTC (rev 257)
@@ -269,10 +269,10 @@
B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */; };
B6CE7F430B2830A300EB65B3 /* cocoaui.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3D0B2830A300EB65B3 /* cocoaui.c */; };
B6CE7F440B2830A300EB65B3 /* cocoaui.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */; };
- B6CE7F450B2830A300EB65B3 /* keysyms.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3F0B2830A300EB65B3 /* keysyms.c */; };
B6CE7F520B283A0700EB65B3 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F510B283A0700EB65B3 /* main.mm */; };
B6CE7FCD0B28FBD600EB65B3 /* DisplayOpenGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7FCB0B28FBD600EB65B3 /* DisplayOpenGLView.h */; };
B6CE7FCE0B28FBD600EB65B3 /* DisplayOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7FCC0B28FBD600EB65B3 /* DisplayOpenGLView.m */; };
+ B6E0252C0B38AFE500E23A0F /* keysyms.m in Sources */ = {isa = PBXBuildFile; fileRef = B6E0252B0B38AFE500E23A0F /* keysyms.m */; };
B6F047F60952A6D6006D8005 /* tape_se.szx in CopyFiles */ = {isa = PBXBuildFile; fileRef = B6F047F20952A6BA006D8005 /* tape_se.szx */; };
B6F047F70952A6D6006D8005 /* tape_ts2068.szx in CopyFiles */ = {isa = PBXBuildFile; fileRef = B6F047F30952A6BA006D8005 /* tape_ts2068.szx */; };
B6F047F80952A6E3006D8005 /* tape_plus3e.szx in CopyFiles */ = {isa = PBXBuildFile; fileRef = B6F047F00952A69A006D8005 /* tape_plus3e.szx */; };
@@ -491,13 +491,13 @@
B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cocoajoystick.c; sourceTree = "<group>"; };
B6CE7F3D0B2830A300EB65B3 /* cocoaui.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cocoaui.c; sourceTree = "<group>"; };
B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cocoaui.h; sourceTree = "<group>"; };
- B6CE7F3F0B2830A300EB65B3 /* keysyms.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = keysyms.c; sourceTree = "<group>"; };
B6CE7F510B283A0700EB65B3 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
B6CE7FCB0B28FBD600EB65B3 /* DisplayOpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DisplayOpenGLView.h; sourceTree = "<group>"; };
B6CE7FCC0B28FBD600EB65B3 /* DisplayOpenGLView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = DisplayOpenGLView.m; sourceTree = "<group>"; };
B6D2989105B061CB00C2AA14 /* MemoryBrowserController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MemoryBrowserController.h; path = controllers/MemoryBrowserController.h; sourceTree = "<group>"; };
B6D2989205B061CB00C2AA14 /* MemoryBrowserController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MemoryBrowserController.m; path = controllers/MemoryBrowserController.m; sourceTree = "<group>"; };
B6D2993105B06AD200C2AA14 /* MemoryBrowser.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = MemoryBrowser.nib; path = nibs/MemoryBrowser.nib; sourceTree = "<group>"; };
+ B6E0252B0B38AFE500E23A0F /* keysyms.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = keysyms.m; sourceTree = "<group>"; };
B6E093F40607EEDC008B5DEC /* 256s-0.rom */ = {isa = PBXFileReference; lastKnownFileType = file; name = "256s-0.rom"; path = "../roms/256s-0.rom"; sourceTree = SOURCE_ROOT; };
B6E093F50607EEDC008B5DEC /* 256s-1.rom */ = {isa = PBXFileReference; lastKnownFileType = file; name = "256s-1.rom"; path = "../roms/256s-1.rom"; sourceTree = SOURCE_ROOT; };
B6E093F60607EEDC008B5DEC /* 256s-2.rom */ = {isa = PBXFileReference; lastKnownFileType = file; name = "256s-2.rom"; path = "../roms/256s-2.rom"; sourceTree = SOURCE_ROOT; };
@@ -892,7 +892,7 @@
B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */,
B6CE7F3D0B2830A300EB65B3 /* cocoaui.c */,
B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */,
- B6CE7F3F0B2830A300EB65B3 /* keysyms.c */,
+ B6E0252B0B38AFE500E23A0F /* keysyms.m */,
);
path = cocoa;
sourceTree = "<group>";
@@ -1439,9 +1439,9 @@
B6CE7F400B2830A300EB65B3 /* cocoadisplay.c in Sources */,
B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */,
B6CE7F430B2830A300EB65B3 /* cocoaui.c in Sources */,
- B6CE7F450B2830A300EB65B3 /* keysyms.c in Sources */,
B6CE7F520B283A0700EB65B3 /* main.mm in Sources */,
B6CE7FCE0B28FBD600EB65B3 /* DisplayOpenGLView.m in Sources */,
+ B6E0252C0B38AFE500E23A0F /* keysyms.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2006-12-19 11:28:44 UTC (rev 256)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2006-12-20 01:44:56 UTC (rev 257)
@@ -30,6 +30,9 @@
#include <OpenGL/glext.h>
#include <OpenGL/glu.h>
+#include <libspectrum.h>
+
+#include "input.h"
#include "ui/cocoa/cocoadisplay.h"
@interface DisplayOpenGLView : NSOpenGLView
@@ -40,8 +43,11 @@
Cocoa_Texture screenTex; /* Screen texture */
BOOL screenTexInitialised;
+
+ GHashTable *unicode_keysyms_hash;
}
+(DisplayOpenGLView *) instance;
++(void) initialize;
-(void) createTexture:(Cocoa_Texture*)newScreen;
-(void) destroyTexture;
@@ -50,6 +56,15 @@
-(id) initWithFrame:(NSRect)frameRect;
-(void) awakeFromNib;
-+(void) initialize;
+-(void) initKeyboard;
+-(void) flagsChanged:(NSEvent *)theEvent;
+-(void) keyChange:(NSEvent *)theEvent type:(input_event_type)type;
+-(void) keyDown:(NSEvent *)theEvent;
+-(void) keyUp:(NSEvent *)theEvent;
+
+- (BOOL) acceptsFirstResponder;
+- (BOOL) becomeFirstResponder;
+- (BOOL) resignFirstResponder;
+
@end
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-19 11:28:44 UTC (rev 256)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-20 01:44:56 UTC (rev 257)
@@ -33,7 +33,24 @@
#include "event.h"
#include "fuse.h"
#include "fusepb/main.h"
+#include "keyboard.h"
+extern keysyms_map_t unicode_keysyms_map[];
+
+static int cocoakeyboard_caps_shift_pressed = 0;
+static int cocoakeyboard_symbol_shift_pressed = 0;
+static input_key unicode_keysym = INPUT_KEY_NONE;
+
+static input_key
+other_keysyms_remap( libspectrum_dword ui_keysym, GHashTable *hash )
+{
+ const input_key *ptr;
+
+ ptr = g_hash_table_lookup( hash, &ui_keysym );
+
+ return ptr ? *ptr : INPUT_KEY_NONE;
+}
+
@implementation DisplayOpenGLView
static DisplayOpenGLView *instance = nil;
@@ -43,6 +60,44 @@
return instance;
}
++(void) initialize
+{
+ ScalerNameToIdTransformer *sNToITransformer;
+ MachineScalerIsEnabled *machineScalerIsEnabled;
+ MachineNameToIdTransformer *mToITransformer;
+ VolumeSliderToPrefTransformer *vsToPTransformer;
+
+ sNToITransformer = [[[ScalerNameToIdTransformer alloc] init] autorelease];
+
+ [NSValueTransformer setValueTransformer:sNToITransformer
+ forName:@"ScalerNameToIdTransformer"];
+
+ machineScalerIsEnabled = [[MachineScalerIsEnabled
+ machineScalerIsEnabledWithInt:1]
+ autorelease];
+
+ [NSValueTransformer setValueTransformer:machineScalerIsEnabled
+ forName:@"MachineTimexIsEnabled"];
+
+ machineScalerIsEnabled = [[MachineScalerIsEnabled
+ machineScalerIsEnabledWithInt:0]
+ autorelease];
+
+ [NSValueTransformer setValueTransformer:machineScalerIsEnabled
+ forName:@"MachineTimexIsDisabled"];
+
+ mToITransformer = [[[MachineNameToIdTransformer alloc] init] autorelease];
+
+ [NSValueTransformer setValueTransformer:mToITransformer
+ forName:@"MachineNameToIdTransformer"];
+
+ vsToPTransformer = [[[VolumeSliderToPrefTransformer alloc] init] autorelease];
+
+ [NSValueTransformer setValueTransformer:vsToPTransformer
+ forName:@"VolumeSliderToPrefTransformer"];
+
+}
+
- (id) initWithFrame:(NSRect)frameRect
{
// Init pixel format attribs
@@ -91,44 +146,8 @@
if( fuse_init( ac, av ) ) {
fprintf( stderr, "%s: error initialising -- giving up!\n", fuse_progname );
}
-}
-+(void) initialize
-{
- ScalerNameToIdTransformer *sNToITransformer;
- MachineScalerIsEnabled *machineScalerIsEnabled;
- MachineNameToIdTransformer *mToITransformer;
- VolumeSliderToPrefTransformer *vsToPTransformer;
-
- sNToITransformer = [[[ScalerNameToIdTransformer alloc] init] autorelease];
-
- [NSValueTransformer setValueTransformer:sNToITransformer
- forName:@"ScalerNameToIdTransformer"];
-
- machineScalerIsEnabled = [[MachineScalerIsEnabled
- machineScalerIsEnabledWithInt:1]
- autorelease];
-
- [NSValueTransformer setValueTransformer:machineScalerIsEnabled
- forName:@"MachineTimexIsEnabled"];
-
- machineScalerIsEnabled = [[MachineScalerIsEnabled
- machineScalerIsEnabledWithInt:0]
- autorelease];
-
- [NSValueTransformer setValueTransformer:machineScalerIsEnabled
- forName:@"MachineTimexIsDisabled"];
-
- mToITransformer = [[[MachineNameToIdTransformer alloc] init] autorelease];
-
- [NSValueTransformer setValueTransformer:mToITransformer
- forName:@"MachineNameToIdTransformer"];
-
- vsToPTransformer = [[[VolumeSliderToPrefTransformer alloc] init] autorelease];
-
- [NSValueTransformer setValueTransformer:vsToPTransformer
- forName:@"VolumeSliderToPrefTransformer"];
-
+ [self initKeyboard];
}
- (void)drawRect:(NSRect)aRect
@@ -290,4 +309,120 @@
{
}
+-(void) initKeyboard
+{
+ keysyms_map_t *ptr3;
+
+ unicode_keysyms_hash = g_hash_table_new( g_int_hash, g_int_equal );
+
+ for( ptr3 = (keysyms_map_t *)unicode_keysyms_map; ptr3->ui; ptr3++ )
+ g_hash_table_insert( unicode_keysyms_hash, &( ptr3->ui ),
+ &( ptr3->fuse ) );
+}
+
+-(void) flagsChanged:(NSEvent *)theEvent
+{
+ static BOOL optDown = NO;
+ static BOOL ctrlDown = NO;
+ static BOOL shiftDown = NO;
+ int flags = [theEvent modifierFlags];
+ BOOL optDownNew = (flags & NSAlternateKeyMask) ? YES : NO;
+ BOOL ctrlDownNew = (flags & NSControlKeyMask) ? YES : NO;
+ BOOL shiftDownNew = ( flags & NSShiftKeyMask ) ? YES : NO;
+
+ if( optDown != optDownNew ) {
+ input_event_t fuse_event;
+ fuse_event.types.key.spectrum_key = INPUT_KEY_Alt_L;
+ if( optDownNew == YES )
+ fuse_event.type = INPUT_EVENT_KEYPRESS;
+ else
+ fuse_event.type = INPUT_EVENT_KEYRELEASE;
+ input_event( &fuse_event );
+ }
+
+ if( ctrlDown != ctrlDownNew ) {
+ input_event_t fuse_event;
+ fuse_event.types.key.spectrum_key = INPUT_KEY_Control_L;
+ if( ctrlDownNew == YES )
+ fuse_event.type = INPUT_EVENT_KEYPRESS;
+ else
+ fuse_event.type = INPUT_EVENT_KEYRELEASE;
+ input_event( &fuse_event );
+ }
+
+ if( shiftDown != shiftDownNew ) {
+ input_event_t fuse_event;
+ fuse_event.types.key.spectrum_key = INPUT_KEY_Shift_L;
+ if( shiftDownNew == YES )
+ fuse_event.type = INPUT_EVENT_KEYPRESS;
+ else
+ fuse_event.type = INPUT_EVENT_KEYRELEASE;
+ input_event( &fuse_event );
+ }
+
+ optDown = optDownNew;
+ ctrlDown = ctrlDownNew;
+ shiftDown = shiftDownNew;
+}
+
+-(void) keyChange:(NSEvent *)theEvent type:(input_event_type)type
+{
+ unsigned short keyCode = [theEvent keyCode];
+ NSString *characters = [theEvent charactersIgnoringModifiers];
+ if ([characters length]) {
+ input_key fuse_keysym;
+ input_event_t fuse_event;
+
+ fuse_keysym = keysyms_remap( keyCode );
+ if( fuse_keysym == INPUT_KEY_NONE ) {
+ fuse_keysym = other_keysyms_remap( [characters characterAtIndex:0],
+ unicode_keysyms_hash );
+ if( fuse_keysym != INPUT_KEY_NONE ) {
+ unicode_keysym = fuse_keysym;
+ /* record current values of caps and symbol shift. We will temoprarily
+ * override these for the duration of the unicoded simulated keypresses
+ */
+ if( ( cocoakeyboard_caps_shift_pressed = keyboard_state( KEYBOARD_Caps ) ) )
+ {
+ keyboard_release( KEYBOARD_Caps );
+ }
+ if( ( cocoakeyboard_symbol_shift_pressed =
+ keyboard_state( KEYBOARD_Symbol ) ) ) {
+ keyboard_release( KEYBOARD_Symbol );
+ }
+ }
+ }
+
+ fuse_event.type = type;
+ fuse_event.types.key.spectrum_key = fuse_keysym;
+
+ input_event( &fuse_event );
+ }
+}
+
+-(void) keyDown:(NSEvent *)theEvent
+{
+ [self keyChange:theEvent type:INPUT_EVENT_KEYPRESS];
+}
+
+-(void) keyUp:(NSEvent *)theEvent
+{
+ [self keyChange:theEvent type:INPUT_EVENT_KEYRELEASE];
+}
+
+- (BOOL)acceptsFirstResponder
+{
+ return YES;
+}
+
+- (BOOL)becomeFirstResponder
+{
+ return YES;
+}
+
+- (BOOL)resignFirstResponder
+{
+ return YES;
+}
+
@end
Deleted: branches/fusegl/fuse/ui/cocoa/keysyms.c
===================================================================
--- branches/fusegl/fuse/ui/cocoa/keysyms.c 2006-12-19 11:28:44 UTC (rev 256)
+++ branches/fusegl/fuse/ui/cocoa/keysyms.c 2006-12-20 01:44:56 UTC (rev 257)
@@ -1,172 +0,0 @@
-/* keysyms.c: UI keysym to Fuse input layer keysym mappings
- Copyright (c) 2000-2005 Philip Kendall, Matan Ziv-Av, Russell Marks,
- Fredrick Meunier, Catalin Mihaila
-
- 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., 49 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Author contact information:
-
- E-mail: pak...@sr...
- Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England
-
-*/
-
-/* This file is autogenerated from keysyms.dat by keysyms.pl.
- Do not edit unless you know what you're doing! */
-
-#include <config.h>
-
-#include "input.h"
-#include "keyboard.h"
-
-/* Map ADC keyboard scancode to Fuse input layer keysym for Spectrum
- virtual keyboard */
-const keysyms_map_t keysyms_map[] = {
-
- { 18, INPUT_KEY_1 },
- { 19, INPUT_KEY_2 },
- { 20, INPUT_KEY_3 },
- { 21, INPUT_KEY_4 },
- { 23, INPUT_KEY_5 },
- { 22, INPUT_KEY_6 },
- { 26, INPUT_KEY_7 },
- { 28, INPUT_KEY_8 },
- { 25, INPUT_KEY_9 },
- { 29, INPUT_KEY_0 },
- { 12, INPUT_KEY_q },
- { 13, INPUT_KEY_w },
- { 14, INPUT_KEY_e },
- { 15, INPUT_KEY_r },
- { 17, INPUT_KEY_t },
- { 16, INPUT_KEY_y },
- { 32, INPUT_KEY_u },
- { 34, INPUT_KEY_i },
- { 31, INPUT_KEY_o },
- { 35, INPUT_KEY_p },
- { 0, INPUT_KEY_a },
- { 1, INPUT_KEY_s },
- { 2, INPUT_KEY_d },
- { 3, INPUT_KEY_f },
- { 5, INPUT_KEY_g },
- { 4, INPUT_KEY_h },
- { 38, INPUT_KEY_j },
- { 40, INPUT_KEY_k },
- { 37, INPUT_KEY_l },
- { 6, INPUT_KEY_z },
- { 7, INPUT_KEY_x },
- { 8, INPUT_KEY_c },
- { 9, INPUT_KEY_v },
- { 11, INPUT_KEY_b },
- { 45, INPUT_KEY_n },
- { 46, INPUT_KEY_m },
-
- { 0xff, 0 } /* End marker: DO NOT MOVE! */
-
-};
-
-/* Map things with no reasonable Unicode value (modifiers etc.) from SDL sym
- to Fuse input layer keysym */
-const keysyms_map_t modifier_keysyms_map[] = {
-#if 0
- { SDLK_ESCAPE, INPUT_KEY_Escape },
- { SDLK_F1, INPUT_KEY_F1 },
- { SDLK_F2, INPUT_KEY_F2 },
- { SDLK_F3, INPUT_KEY_F3 },
- { SDLK_F4, INPUT_KEY_F4 },
- { SDLK_F5, INPUT_KEY_F5 },
- { SDLK_F6, INPUT_KEY_F6 },
- { SDLK_F7, INPUT_KEY_F7 },
- { SDLK_F8, INPUT_KEY_F8 },
- { SDLK_F9, INPUT_KEY_F9 },
- { SDLK_F10, INPUT_KEY_F10 },
- { SDLK_F11, INPUT_KEY_F11 },
- { SDLK_F12, INPUT_KEY_F12 },
- { SDLK_BACKSPACE, INPUT_KEY_BackSpace },
- { SDLK_TAB, INPUT_KEY_Tab },
- //{ SDLK_CAPSLOCK, INPUT_KEY_Caps_Lock },
- { SDLK_RETURN, INPUT_KEY_Return },
- { SDLK_LSHIFT, INPUT_KEY_Shift_L },
- { SDLK_RSHIFT, INPUT_KEY_Shift_R },
- { SDLK_LCTRL, INPUT_KEY_Control_L },
- { SDLK_LALT, INPUT_KEY_Alt_L },
- { SDLK_LSUPER, INPUT_KEY_Super_L },
- { SDLK_SPACE, INPUT_KEY_space },
- { SDLK_RSUPER, INPUT_KEY_Super_R },
- { SDLK_RALT, INPUT_KEY_Alt_R },
- { SDLK_RCTRL, INPUT_KEY_Control_R },
- { SDLK_MENU, INPUT_KEY_Mode_switch },
- { SDLK_LEFT, INPUT_KEY_Left },
- { SDLK_DOWN, INPUT_KEY_Down },
- { SDLK_UP, INPUT_KEY_Up },
- { SDLK_RIGHT, INPUT_KEY_Right },
- { SDLK_PAGEUP, INPUT_KEY_Page_Up },
- { SDLK_PAGEDOWN, INPUT_KEY_Page_Down },
- { SDLK_HOME, INPUT_KEY_Home },
- { SDLK_END, INPUT_KEY_End },
- { SDLK_KP1, INPUT_KEY_1 },
- { SDLK_KP2, INPUT_KEY_2 },
- { SDLK_KP3, INPUT_KEY_3 },
- { SDLK_KP4, INPUT_KEY_4 },
- { SDLK_KP5, INPUT_KEY_5 },
- { SDLK_KP6, INPUT_KEY_6 },
- { SDLK_KP7, INPUT_KEY_7 },
- { SDLK_KP8, INPUT_KEY_8 },
- { SDLK_KP9, INPUT_KEY_9 },
- { SDLK_KP0, INPUT_KEY_0 },
- { SDLK_KP_PERIOD, INPUT_KEY_period },
- { SDLK_KP_DIVIDE, INPUT_KEY_slash },
- { SDLK_KP_MULTIPLY, INPUT_KEY_star },
- { SDLK_KP_MINUS, INPUT_KEY_minus },
- { SDLK_KP_PLUS, INPUT_KEY_plus },
- { SDLK_KP_ENTER, INPUT_KEY_Return },
- { SDLK_KP_EQUALS, INPUT_KEY_equal },
-#endif
- { 0, 0 } /* End marker: DO NOT MOVE! */
-
-};
-
-/* Map low byte of UCS-2(?) Unicode to Fuse input layer keysym for
- non-extended mode Spectrum symbols present on keyboards */
-// Need to have identified these before processing shift et al.
-const keysyms_map_t unicode_keysyms_map[] = {
-
- { '-', INPUT_KEY_minus },
- { '_', INPUT_KEY_underscore },
- { '=', INPUT_KEY_equal },
- { '+', INPUT_KEY_plus },
- { ';', INPUT_KEY_semicolon },
- { ':', INPUT_KEY_colon },
- { '\'', INPUT_KEY_apostrophe },
- { '"', INPUT_KEY_quotedbl },
- { '#', INPUT_KEY_numbersign },
- { ',', INPUT_KEY_comma },
- { '<', INPUT_KEY_less },
- { '.', INPUT_KEY_period },
- { '>', INPUT_KEY_greater },
- { '/', INPUT_KEY_slash },
- { '?', INPUT_KEY_question },
- { '!', INPUT_KEY_exclamation },
- { '@', INPUT_KEY_at },
- { '$', INPUT_KEY_dollar },
- { '%', INPUT_KEY_percent },
- { '&', INPUT_KEY_ampersand },
- { '(', INPUT_KEY_lbracket },
- { ')', INPUT_KEY_rbracket },
- { '^', INPUT_KEY_carat },
- { '*', INPUT_KEY_star },
-
- { 0, 0 } /* End marker: DO NOT MOVE! */
-
-};
Copied: branches/fusegl/fuse/ui/cocoa/keysyms.m (from rev 253, branches/fusegl/fuse/ui/cocoa/keysyms.c)
===================================================================
--- branches/fusegl/fuse/ui/cocoa/keysyms.m (rev 0)
+++ branches/fusegl/fuse/ui/cocoa/keysyms.m 2006-12-20 01:44:56 UTC (rev 257)
@@ -0,0 +1,157 @@
+/* keysyms.c: UI keysym to Fuse input layer keysym mappings
+ Copyright (c) 2000-2005 Philip Kendall, Matan Ziv-Av, Russell Marks,
+ Fredrick Meunier, Catalin Mihaila
+
+ 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., 49 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Author contact information:
+
+ E-mail: pak...@sr...
+ Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England
+
+*/
+
+/* This file is autogenerated from keysyms.dat by keysyms.pl.
+ Do not edit unless you know what you're doing! */
+
+#import <AppKit/NSEvent.h>
+
+#include <config.h>
+
+#include "input.h"
+#include "keyboard.h"
+
+/* Map ADC keyboard scancode to Fuse input layer keysym for Spectrum
+ virtual keyboard */
+const keysyms_map_t keysyms_map[] = {
+
+ { 53, INPUT_KEY_Escape },
+ { 48, INPUT_KEY_Tab },
+ { 36, INPUT_KEY_Return },
+ /* Start keypad */
+ { 83, INPUT_KEY_1 },
+ { 84, INPUT_KEY_2 },
+ { 85, INPUT_KEY_3 },
+ { 86, INPUT_KEY_4 },
+ { 87, INPUT_KEY_5 },
+ { 88, INPUT_KEY_6 },
+ { 89, INPUT_KEY_7 },
+ { 91, INPUT_KEY_8 },
+ { 92, INPUT_KEY_9 },
+ { 82, INPUT_KEY_0 },
+ { 65, INPUT_KEY_period },
+ { 75, INPUT_KEY_slash },
+ { 67, INPUT_KEY_star },
+ { 78, INPUT_KEY_minus },
+ { 69, INPUT_KEY_plus },
+ { 76, INPUT_KEY_Return },
+ { 81, INPUT_KEY_equal },
+ /* End keypad */
+ { 18, INPUT_KEY_1 },
+ { 19, INPUT_KEY_2 },
+ { 20, INPUT_KEY_3 },
+ { 21, INPUT_KEY_4 },
+ { 23, INPUT_KEY_5 },
+ { 22, INPUT_KEY_6 },
+ { 26, INPUT_KEY_7 },
+ { 28, INPUT_KEY_8 },
+ { 25, INPUT_KEY_9 },
+ { 29, INPUT_KEY_0 },
+ { 12, INPUT_KEY_q },
+ { 13, INPUT_KEY_w },
+ { 14, INPUT_KEY_e },
+ { 15, INPUT_KEY_r },
+ { 17, INPUT_KEY_t },
+ { 16, INPUT_KEY_y },
+ { 32, INPUT_KEY_u },
+ { 34, INPUT_KEY_i },
+ { 31, INPUT_KEY_o },
+ { 35, INPUT_KEY_p },
+ { 0, INPUT_KEY_a },
+ { 1, INPUT_KEY_s },
+ { 2, INPUT_KEY_d },
+ { 3, INPUT_KEY_f },
+ { 5, INPUT_KEY_g },
+ { 4, INPUT_KEY_h },
+ { 38, INPUT_KEY_j },
+ { 40, INPUT_KEY_k },
+ { 37, INPUT_KEY_l },
+ { 6, INPUT_KEY_z },
+ { 7, INPUT_KEY_x },
+ { 8, INPUT_KEY_c },
+ { 9, INPUT_KEY_v },
+ { 11, INPUT_KEY_b },
+ { 45, INPUT_KEY_n },
+ { 46, INPUT_KEY_m },
+ { 49, INPUT_KEY_space },
+
+ { 0xff, 0 } /* End marker: DO NOT MOVE! */
+
+};
+
+/* Map low byte of UCS-2(?) Unicode to Fuse input layer keysym for
+ non-extended mode Spectrum symbols present on keyboards */
+const keysyms_map_t unicode_keysyms_map[] = {
+
+ { NSUpArrowFunctionKey, INPUT_KEY_Up },
+ { NSDownArrowFunctionKey, INPUT_KEY_Down },
+ { NSLeftArrowFunctionKey, INPUT_KEY_Left },
+ { NSRightArrowFunctionKey, INPUT_KEY_Right },
+ { NSF1FunctionKey, INPUT_KEY_F1 },
+ { NSF2FunctionKey, INPUT_KEY_F2 },
+ { NSF3FunctionKey, INPUT_KEY_F3 },
+ { NSF4FunctionKey, INPUT_KEY_F4 },
+ { NSF5FunctionKey, INPUT_KEY_F5 },
+ { NSF6FunctionKey, INPUT_KEY_F6 },
+ { NSF7FunctionKey, INPUT_KEY_F7 },
+ { NSF8FunctionKey, INPUT_KEY_F8 },
+ { NSF9FunctionKey, INPUT_KEY_F9 },
+ { NSF10FunctionKey, INPUT_KEY_F10 },
+ { NSF11FunctionKey, INPUT_KEY_F11 },
+ { NSF12FunctionKey, INPUT_KEY_F12 },
+ { NSDeleteFunctionKey, INPUT_KEY_BackSpace },
+ { NSHomeFunctionKey, INPUT_KEY_Home },
+ { NSEndFunctionKey, INPUT_KEY_End },
+ { NSPageUpFunctionKey, INPUT_KEY_Page_Up },
+ { NSPageDownFunctionKey, INPUT_KEY_Page_Down },
+ { NSMenuFunctionKey, INPUT_KEY_Mode_switch },
+ { '-', INPUT_KEY_minus },
+ { '_', INPUT_KEY_underscore },
+ { '=', INPUT_KEY_equal },
+ { '+', INPUT_KEY_plus },
+ { ';', INPUT_KEY_semicolon },
+ { ':', INPUT_KEY_colon },
+ { '\'', INPUT_KEY_apostrophe },
+ { '"', INPUT_KEY_quotedbl },
+ { '#', INPUT_KEY_numbersign },
+ { ',', INPUT_KEY_comma },
+ { '<', INPUT_KEY_less },
+ { '.', INPUT_KEY_period },
+ { '>', INPUT_KEY_greater },
+ { '/', INPUT_KEY_slash },
+ { '?', INPUT_KEY_question },
+ { '!', INPUT_KEY_exclamation },
+ { '@', INPUT_KEY_at },
+ { '$', INPUT_KEY_dollar },
+ { '%', INPUT_KEY_percent },
+ { '&', INPUT_KEY_ampersand },
+ { '(', INPUT_KEY_lbracket },
+ { ')', INPUT_KEY_rbracket },
+ { '^', INPUT_KEY_carat },
+ { '*', INPUT_KEY_star },
+
+ { 0, 0 } /* End marker: DO NOT MOVE! */
+
+};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2006-12-20 07:41:00
|
Revision: 258
http://svn.sourceforge.net/fuse-for-macosx/?rev=258&view=rev
Author: fredm
Date: 2006-12-19 23:40:59 -0800 (Tue, 19 Dec 2006)
Log Message:
-----------
Add support for backspace key.
Modified Paths:
--------------
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/ui/cocoa/keysyms.m
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2006-12-20 01:44:56 UTC (rev 257)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2006-12-20 07:40:59 UTC (rev 258)
@@ -45,6 +45,10 @@
BOOL screenTexInitialised;
GHashTable *unicode_keysyms_hash;
+
+ BOOL optDown;
+ BOOL ctrlDown;
+ BOOL shiftDown;
}
+(DisplayOpenGLView *) instance;
+(void) initialize;
@@ -63,8 +67,8 @@
-(void) keyDown:(NSEvent *)theEvent;
-(void) keyUp:(NSEvent *)theEvent;
-- (BOOL) acceptsFirstResponder;
-- (BOOL) becomeFirstResponder;
-- (BOOL) resignFirstResponder;
+-(BOOL) acceptsFirstResponder;
+-(BOOL) becomeFirstResponder;
+-(BOOL) resignFirstResponder;
@end
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-20 01:44:56 UTC (rev 257)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-20 07:40:59 UTC (rev 258)
@@ -135,6 +135,10 @@
screenTexInitialised = NO;
+ optDown = NO;
+ ctrlDown = NO;
+ shiftDown = NO;
+
return self;
}
@@ -322,9 +326,6 @@
-(void) flagsChanged:(NSEvent *)theEvent
{
- static BOOL optDown = NO;
- static BOOL ctrlDown = NO;
- static BOOL shiftDown = NO;
int flags = [theEvent modifierFlags];
BOOL optDownNew = (flags & NSAlternateKeyMask) ? YES : NO;
BOOL ctrlDownNew = (flags & NSControlKeyMask) ? YES : NO;
@@ -410,17 +411,17 @@
[self keyChange:theEvent type:INPUT_EVENT_KEYRELEASE];
}
-- (BOOL)acceptsFirstResponder
+-(BOOL) acceptsFirstResponder
{
return YES;
}
-- (BOOL)becomeFirstResponder
+-(BOOL) becomeFirstResponder
{
return YES;
}
-- (BOOL)resignFirstResponder
+-(BOOL) resignFirstResponder
{
return YES;
}
Modified: branches/fusegl/fuse/ui/cocoa/keysyms.m
===================================================================
--- branches/fusegl/fuse/ui/cocoa/keysyms.m 2006-12-20 01:44:56 UTC (rev 257)
+++ branches/fusegl/fuse/ui/cocoa/keysyms.m 2006-12-20 07:40:59 UTC (rev 258)
@@ -1,4 +1,4 @@
-/* keysyms.c: UI keysym to Fuse input layer keysym mappings
+/* keysyms.m: UI keysym to Fuse input layer keysym mappings
Copyright (c) 2000-2005 Philip Kendall, Matan Ziv-Av, Russell Marks,
Fredrick Meunier, Catalin Mihaila
@@ -23,9 +23,6 @@
*/
-/* This file is autogenerated from keysyms.dat by keysyms.pl.
- Do not edit unless you know what you're doing! */
-
#import <AppKit/NSEvent.h>
#include <config.h>
@@ -40,6 +37,7 @@
{ 53, INPUT_KEY_Escape },
{ 48, INPUT_KEY_Tab },
{ 36, INPUT_KEY_Return },
+ { 51, INPUT_KEY_BackSpace },
/* Start keypad */
{ 83, INPUT_KEY_1 },
{ 84, INPUT_KEY_2 },
@@ -101,7 +99,7 @@
};
-/* Map low byte of UCS-2(?) Unicode to Fuse input layer keysym for
+/* Map UCS-2(?) Unicode to Fuse input layer keysym for
non-extended mode Spectrum symbols present on keyboards */
const keysyms_map_t unicode_keysyms_map[] = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2006-12-23 01:32:27
|
Revision: 260
http://svn.sourceforge.net/fuse-for-macosx/?rev=260&view=rev
Author: fredm
Date: 2006-12-22 17:32:26 -0800 (Fri, 22 Dec 2006)
Log Message:
-----------
Add CoreAudio sound driver - still getting lots of clicking from bad
syncronisation between drawing and sound threads.
Modified Paths:
--------------
branches/fusegl/fuse/Makefile.am
branches/fusegl/fuse/configure.in
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/config.h
branches/fusegl/fuse/sound/Makefile.am
branches/fusegl/fuse/sound/lowlevel.h
branches/fusegl/fuse/sound/sdlsound.c
branches/fusegl/fuse/sound/sfifo.c
branches/fusegl/fuse/timer.c
Added Paths:
-----------
branches/fusegl/fuse/sound/coreaudiosound.c
Modified: branches/fusegl/fuse/Makefile.am
===================================================================
--- branches/fusegl/fuse/Makefile.am 2006-12-20 08:57:32 UTC (rev 259)
+++ branches/fusegl/fuse/Makefile.am 2006-12-23 01:32:26 UTC (rev 260)
@@ -107,6 +107,7 @@
@GLIB_LIBS@ \
@PNG_LIBS@ \
@AO_LIBS@ \
+@COREAUDIO_LIBS@ \
@X_LIBS@ \
@XML_LIBS@ \
compat/libcompat.a
Modified: branches/fusegl/fuse/configure.in
===================================================================
--- branches/fusegl/fuse/configure.in 2006-12-20 08:57:32 UTC (rev 259)
+++ branches/fusegl/fuse/configure.in 2006-12-23 01:32:26 UTC (rev 260)
@@ -398,8 +398,7 @@
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 instal
-ed libao]) AO_LIBS='-lao'],
+ [AC_DEFINE([USE_LIBAO], 1, [Defined if we're going to be using the installed libao]) AO_LIBS='-lao'],
[AC_MSG_WARN(ao/ao.h not found - no libao sound output)]
)],
[AC_MSG_WARN(ao_open_live not found - no libao sound output)]
@@ -407,6 +406,15 @@
AC_SUBST(AO_LIBS)
fi
+dnl Check if a version of libao which supplies ao_open_live is available
+ CoreAudio/AudioHardware.h
+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'],
+ [AC_MSG_WARN(CoreAudio/AudioHardware.h not found - no CoreAudio sound output)]
+)
+AC_SUBST(COREAUDIO_LIBS)
+
dnl Are we supplying the ROMs or relying on another package?
AC_MSG_CHECKING(where to find the Spectrum ROM images)
AC_ARG_WITH(roms-dir,
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-20 08:57:32 UTC (rev 259)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-23 01:32:26 UTC (rev 260)
@@ -226,7 +226,6 @@
B61F468509121DF100C8096C /* kempmouse.c in Sources */ = {isa = PBXBuildFile; fileRef = B68C17DC06C8C0DC004981AE /* kempmouse.c */; };
B61F468609121DF100C8096C /* if1.c in Sources */ = {isa = PBXBuildFile; fileRef = B6C8B723076D2B1A0007B7B5 /* if1.c */; };
B61F468709121DF100C8096C /* RollbackController.m in Sources */ = {isa = PBXBuildFile; fileRef = B63F994A077182B4004D6DFA /* RollbackController.m */; };
- B61F468809121DF100C8096C /* sdlsound.c in Sources */ = {isa = PBXBuildFile; fileRef = B6F06092078FB36500CD5D95 /* sdlsound.c */; };
B61F468909121DF100C8096C /* ts2068.c in Sources */ = {isa = PBXBuildFile; fileRef = B6F060A5078FB55400CD5D95 /* ts2068.c */; };
B61F468A09121DF100C8096C /* sfifo.c in Sources */ = {isa = PBXBuildFile; fileRef = B6F06100078FC2C900CD5D95 /* sfifo.c */; };
B61F468B09121DF100C8096C /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = B650F73F07E7CD3F00E4F3AF /* PreferencesController.m */; };
@@ -264,6 +263,7 @@
B650987109366CA2003AF1BF /* szx.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650987009366CA2003AF1BF /* szx.icns */; };
B6825549091817F30014B5EE /* divide.c in Sources */ = {isa = PBXBuildFile; fileRef = B6825547091817F30014B5EE /* divide.c */; };
B682554A091817F30014B5EE /* divide.h in Headers */ = {isa = PBXBuildFile; fileRef = B6825548091817F30014B5EE /* divide.h */; };
+ B6A6F0960B3C108C000B88E9 /* coreaudiosound.c in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */; };
B6CE7F400B2830A300EB65B3 /* cocoadisplay.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */; };
B6CE7F410B2830A300EB65B3 /* cocoadisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */; };
B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */; };
@@ -448,6 +448,7 @@
B68CB2C503DD920300A804BA /* debugger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = debugger.h; path = ../debugger/debugger.h; sourceTree = "<group>"; };
B68CB2C603DD920300A804BA /* disassemble.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = disassemble.c; path = ../debugger/disassemble.c; sourceTree = "<group>"; };
B68CB2CC03DD923C00A804BA /* memory.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = memory.c; sourceTree = "<group>"; };
+ B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = coreaudiosound.c; path = sound/coreaudiosound.c; sourceTree = "<group>"; };
B6A7F0E904C9A11D001025EB /* NumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberFormatter.h; sourceTree = "<group>"; };
B6A7F0EA04C9A11D001025EB /* NumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NumberFormatter.m; sourceTree = "<group>"; };
B6AA8A3C03D2FC1C00FED55D /* trdos.rom */ = {isa = PBXFileReference; lastKnownFileType = file; name = trdos.rom; path = ../roms/trdos.rom; sourceTree = SOURCE_ROOT; };
@@ -517,7 +518,6 @@
B6F048160952B5EC006D8005 /* snp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = snp.icns; path = resources/snp.icns; sourceTree = SOURCE_ROOT; };
B6F048170952B5EC006D8005 /* sp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = sp.icns; path = resources/sp.icns; sourceTree = SOURCE_ROOT; };
B6F0481A0952B5FD006D8005 /* zxs.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = zxs.icns; path = resources/zxs.icns; sourceTree = SOURCE_ROOT; };
- B6F06092078FB36500CD5D95 /* sdlsound.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sdlsound.c; path = ../sound/sdlsound.c; sourceTree = SOURCE_ROOT; };
B6F060A5078FB55400CD5D95 /* ts2068.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = ts2068.c; path = ../machines/ts2068.c; sourceTree = SOURCE_ROOT; };
B6F060AB078FB63A00CD5D95 /* tc2068.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = tc2068.h; path = ../machines/tc2068.h; sourceTree = SOURCE_ROOT; };
B6F06100078FC2C900CD5D95 /* sfifo.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = sfifo.c; path = ../sound/sfifo.c; sourceTree = SOURCE_ROOT; };
@@ -819,9 +819,9 @@
B678E3E20608FAA600678A33 /* sound */ = {
isa = PBXGroup;
children = (
+ B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */,
B6F06100078FC2C900CD5D95 /* sfifo.c */,
B6F06101078FC2C900CD5D95 /* sfifo.h */,
- B6F06092078FB36500CD5D95 /* sdlsound.c */,
);
name = sound;
sourceTree = "<group>";
@@ -1418,7 +1418,6 @@
B61F468509121DF100C8096C /* kempmouse.c in Sources */,
B61F468609121DF100C8096C /* if1.c in Sources */,
B61F468709121DF100C8096C /* RollbackController.m in Sources */,
- B61F468809121DF100C8096C /* sdlsound.c in Sources */,
B61F468909121DF100C8096C /* ts2068.c in Sources */,
B61F468A09121DF100C8096C /* sfifo.c in Sources */,
B61F468B09121DF100C8096C /* PreferencesController.m in Sources */,
@@ -1442,6 +1441,7 @@
B6CE7F520B283A0700EB65B3 /* main.mm in Sources */,
B6CE7FCE0B28FBD600EB65B3 /* DisplayOpenGLView.m in Sources */,
B6E0252C0B38AFE500E23A0F /* keysyms.m in Sources */,
+ B6A6F0960B3C108C000B88E9 /* coreaudiosound.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: branches/fusegl/fuse/fusepb/config.h
===================================================================
--- branches/fusegl/fuse/fusepb/config.h 2006-12-20 08:57:32 UTC (rev 259)
+++ branches/fusegl/fuse/fusepb/config.h 2006-12-23 01:32:26 UTC (rev 260)
@@ -63,6 +63,9 @@
/* Defined if Xlib UI in use */
/* #undef UI_X */
+/* Defined if we're going to be using CoreAudio */
+#define USE_COREAUDIO 1
+
/* Defined if we're using hardware joysticks */
#define USE_JOYSTICK 1
Modified: branches/fusegl/fuse/sound/Makefile.am
===================================================================
--- branches/fusegl/fuse/sound/Makefile.am 2006-12-20 08:57:32 UTC (rev 259)
+++ branches/fusegl/fuse/sound/Makefile.am 2006-12-23 01:32:26 UTC (rev 260)
@@ -30,6 +30,7 @@
libsound_a_SOURCES = dxsound.c \
aosound.c \
+ coreaudiosound.c \
hpsound.c \
nullsound.c \
osssound.c \
Added: branches/fusegl/fuse/sound/coreaudiosound.c
===================================================================
--- branches/fusegl/fuse/sound/coreaudiosound.c (rev 0)
+++ branches/fusegl/fuse/sound/coreaudiosound.c 2006-12-23 01:32:26 UTC (rev 260)
@@ -0,0 +1,275 @@
+/* coreaudiosound.c: Mac OS X CoreAudio sound I/O
+ Copyright (c) 2006 Fredrick Meunier
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+#include <config.h>
+
+#include "lowlevel.h"
+
+#ifdef SOUND_COREAUDIO
+
+#include <errno.h>
+#include <unistd.h>
+#include <CoreAudio/AudioHardware.h>
+#include <AudioUnit/AudioUnit.h>
+
+#include "event.h"
+#include "sfifo.h"
+#include "sound.h"
+#include "ui/ui.h"
+
+sfifo_t sound_fifo;
+
+static
+OSStatus coreaudiowrite( void *inRefCon,
+ AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList *ioData );
+
+/* info about the format used for writing to output unit */
+static AudioStreamBasicDescription deviceFormat;
+
+/* converts from Fuse format (signed 16 bit ints) to CoreAudio format (floats)
+ */
+static AudioUnit gOutputUnit;
+
+int
+sound_lowlevel_init( const char *dev, int *freqptr, int *stereoptr )
+{
+ OSStatus err = kAudioHardwareNoError;
+ UInt32 count;
+ AudioDeviceID device = kAudioDeviceUnknown; /* the default device */
+ UInt32 deviceBufferSize; /* bufferSize returned by
+ kAudioDevicePropertyBufferSize */
+ int error;
+
+ /* get the default output device for the HAL */
+ count = sizeof( device );
+ err = AudioHardwareGetProperty( kAudioHardwarePropertyDefaultOutputDevice,
+ &count, (void *)&device );
+ if ( err != kAudioHardwareNoError ) {
+ ui_error( UI_ERROR_ERROR,
+ "get kAudioHardwarePropertyDefaultOutputDevice error %ld",
+ err );
+ return 1;
+ }
+
+ /* get the buffersize that the default device uses for IO */
+ count = sizeof( deviceBufferSize );
+ err = AudioDeviceGetProperty( device, 0, false, kAudioDevicePropertyBufferSize,
+ &count, &deviceBufferSize );
+ if( err != kAudioHardwareNoError ) {
+ ui_error( UI_ERROR_ERROR, "get kAudioDevicePropertyBufferSize error %ld",
+ err );
+ return 1;
+ }
+
+ /* get a description of the data format used by the default device */
+ count = sizeof( deviceFormat );
+ err = AudioDeviceGetProperty( device, 0, false,
+ kAudioDevicePropertyStreamFormat, &count,
+ &deviceFormat );
+ if( err != kAudioHardwareNoError ) {
+ ui_error( UI_ERROR_ERROR,
+ "get kAudioDevicePropertyStreamFormat error %ld", err );
+ return 1;
+ }
+
+ *freqptr = deviceFormat.mSampleRate;
+
+ deviceFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger
+#ifdef WORDS_BIGENDIAN
+ | kLinearPCMFormatFlagIsBigEndian
+#endif /* #ifdef WORDS_BIGENDIAN */
+ | kLinearPCMFormatFlagIsPacked
+ | kAudioFormatFlagIsNonInterleaved;
+ deviceFormat.mBytesPerPacket = 2;
+ deviceFormat.mFramesPerPacket = 1;
+ deviceFormat.mBytesPerFrame = 2;
+ deviceFormat.mBitsPerChannel = 16;
+ deviceFormat.mChannelsPerFrame = *stereoptr ? 2 : 1;
+
+ /* Open the default output unit */
+ ComponentDescription desc;
+ desc.componentType = kAudioUnitType_Output;
+ desc.componentSubType = kAudioUnitSubType_DefaultOutput;
+ desc.componentManufacturer = kAudioUnitManufacturer_Apple;
+ desc.componentFlags = 0;
+ desc.componentFlagsMask = 0;
+
+ Component comp = FindNextComponent( NULL, &desc );
+ if( comp == NULL ) {
+ ui_error( UI_ERROR_ERROR, "FindNextComponent" );
+ return 1;
+ }
+
+ err = OpenAComponent( comp, &gOutputUnit );
+ if( comp == NULL ) {
+ ui_error( UI_ERROR_ERROR, "OpenAComponent=%ld", err );
+ return 1;
+ }
+
+ /* Set up a callback function to generate output to the output unit */
+ AURenderCallbackStruct input;
+ input.inputProc = coreaudiowrite;
+ input.inputProcRefCon = NULL;
+
+ err = AudioUnitSetProperty( gOutputUnit,
+ kAudioUnitProperty_SetRenderCallback,
+ kAudioUnitScope_Input,
+ 0,
+ &input,
+ sizeof( input ) );
+ if( err ) {
+ ui_error( UI_ERROR_ERROR, "AudioUnitSetProperty-CB=%ld", err );
+ return 1;
+ }
+
+ err = AudioUnitSetProperty( gOutputUnit,
+ kAudioUnitProperty_StreamFormat,
+ kAudioUnitScope_Input,
+ 0,
+ &deviceFormat,
+ sizeof( AudioStreamBasicDescription ) );
+ if( err ) {
+ ui_error( UI_ERROR_ERROR, "AudioUnitSetProperty-SF=%4.4s, %ld", (char*)&err, err );
+ return 1;
+ }
+
+ err = AudioUnitInitialize( gOutputUnit );
+ if( err ) {
+ ui_error( UI_ERROR_ERROR, "AudioUnitInitialize=%ld", err );
+ return 1;
+ }
+
+ if( ( error = sfifo_init( &sound_fifo, 2 * deviceFormat.mChannelsPerFrame
+ * deviceBufferSize + 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;
+ }
+
+ return 0;
+}
+
+void
+sound_lowlevel_end( void )
+{
+ OSStatus err;
+
+ verify_noerr( AudioOutputUnitStop( gOutputUnit ) );
+
+ err = AudioUnitUninitialize( gOutputUnit );
+ if( err ) {
+ printf( "AudioUnitUninitialize=%ld", err );
+ }
+
+ CloseComponent( gOutputUnit );
+
+ sfifo_flush( &sound_fifo );
+ sfifo_close( &sound_fifo );
+}
+
+/* Copy data to fifo */
+void
+sound_lowlevel_frame( libspectrum_signed_word *data, int len )
+{
+ int i = 0;
+
+ /* Convert to bytes */
+ libspectrum_signed_byte* bytes = (libspectrum_signed_byte*)data;
+ len <<= 1;
+
+ while( len ) {
+ if( ( i = sfifo_write( &sound_fifo, bytes, len ) ) < 0 ) {
+ break;
+ } else if( !i ) {
+ usleep( 10000 );
+ }
+ bytes += i;
+ len -= i;
+ }
+ if( i < 0 ) {
+ ui_error( UI_ERROR_ERROR, "Couldn't write sound fifo: %s",
+ strerror( i ) );
+ }
+}
+
+/* This is the audio processing callback. */
+OSStatus coreaudiowrite( void *inRefCon,
+ AudioUnitRenderActionFlags *ioActionFlags,
+ const AudioTimeStamp *inTimeStamp,
+ UInt32 inBusNumber,
+ UInt32 inNumberFrames,
+ AudioBufferList *ioData )
+{
+ int f;
+ int len = deviceFormat.mBytesPerFrame * inNumberFrames;
+
+ uint8_t* out_l = ioData->mBuffers[0].mData;
+ uint8_t* out_r = deviceFormat.mChannelsPerFrame > 1 ?
+ ioData->mBuffers[1].mData : 0;
+
+ if( out_r ) {
+ /* Deinterleave the left and right stereo channels into their approptiate
+ buffers */
+ while( sfifo_used( &sound_fifo ) && len ) {
+ f = sfifo_read( &sound_fifo, out_l, deviceFormat.mBytesPerFrame );
+ out_l += deviceFormat.mBytesPerFrame;
+ f = sfifo_read( &sound_fifo, out_r, deviceFormat.mBytesPerFrame );
+ out_r += deviceFormat.mBytesPerFrame;
+ len -= deviceFormat.mBytesPerFrame;
+ }
+
+ /* If we ran out of sound, make do with silence :( */
+ if( len ) {
+ for( f=0; f<len; f++ ) {
+ *out_l++ = 0;
+ *out_r++ = 0;
+ }
+ }
+ } else {
+ /* Read input_size bytes from fifo into sound stream */
+ while( ( f = sfifo_read( &sound_fifo, out_l, len ) ) > 0 ) {
+ out_l += f;
+ len -= f;
+ }
+
+ /* If we ran out of sound, make do with silence :( */
+ if( f < 0 ) {
+ for( f=0; f<len; f++ ) {
+ *out_l++ = 0;
+ }
+ }
+ }
+
+ return noErr;
+}
+
+#endif /* #ifdef SOUND_COREAUDIO */
Modified: branches/fusegl/fuse/sound/lowlevel.h
===================================================================
--- branches/fusegl/fuse/sound/lowlevel.h 2006-12-20 08:57:32 UTC (rev 259)
+++ branches/fusegl/fuse/sound/lowlevel.h 2006-12-23 01:32:26 UTC (rev 260)
@@ -68,6 +68,11 @@
#define HAVE_SOUND
#define SOUND_DX
+#elif defined USE_COREAUDIO /* #if defined UI_SDL */
+
+#define HAVE_SOUND
+#define SOUND_COREAUDIO
+
#endif /* #if defined UI_SDL */
#endif /* #ifndef FUSE_SOUND_LOWLEVEL_H */
Modified: branches/fusegl/fuse/sound/sdlsound.c
===================================================================
--- branches/fusegl/fuse/sound/sdlsound.c 2006-12-20 08:57:32 UTC (rev 259)
+++ branches/fusegl/fuse/sound/sdlsound.c 2006-12-23 01:32:26 UTC (rev 260)
@@ -150,6 +150,7 @@
SDL_LockAudio();
SDL_CloseAudio();
SDL_QuitSubSystem( SDL_INIT_AUDIO );
+ sfifo_flush( &sound_fifo );
sfifo_close( &sound_fifo );
}
Modified: branches/fusegl/fuse/sound/sfifo.c
===================================================================
--- branches/fusegl/fuse/sound/sfifo.c 2006-12-20 08:57:32 UTC (rev 259)
+++ branches/fusegl/fuse/sound/sfifo.c 2006-12-23 01:32:26 UTC (rev 260)
@@ -18,7 +18,7 @@
#include "lowlevel.h"
-#ifdef SOUND_SDL
+#if defined SOUND_SDL || defined SOUND_COREAUDIO
#ifdef __KERNEL__
# include <linux/string.h>
Modified: branches/fusegl/fuse/timer.c
===================================================================
--- branches/fusegl/fuse/timer.c 2006-12-20 08:57:32 UTC (rev 259)
+++ branches/fusegl/fuse/timer.c 2006-12-23 01:32:26 UTC (rev 260)
@@ -228,7 +228,7 @@
return event_remove_type( EVENT_TYPE_TIMER );
}
-#ifdef UI_SDL
+#if defined UI_SDL || defined USE_COREAUDIO
/* Callback-style sound based timer */
#include "sound/sfifo.h"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2006-12-23 11:00:03
|
Revision: 261
http://svn.sourceforge.net/fuse-for-macosx/?rev=261&view=rev
Author: fredm
Date: 2006-12-23 03:00:00 -0800 (Sat, 23 Dec 2006)
Log Message:
-----------
Add CoreAudio sound driver, sort out various timing issues so we can run at 50
or 60 Hz and also at other than 100% speeds.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/event.c
branches/fusegl/fuse/event.h
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/FuseMenus.h
branches/fusegl/fuse/fusepb/FuseMenus.m
branches/fusegl/fuse/fusepb/controllers/FuseController.h
branches/fusegl/fuse/fusepb/controllers/FuseController.m
branches/fusegl/fuse/fusepb/controllers/PreferencesController.m
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/info.nib
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/machine.c
branches/fusegl/fuse/sound/coreaudiosound.c
Added Paths:
-----------
branches/fusegl/fuse/ui/cocoa/cocoaui.m
Removed Paths:
-------------
branches/fusegl/fuse/ui/cocoa/cocoaui.c
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/TODO 2006-12-23 11:00:00 UTC (rev 261)
@@ -6,7 +6,7 @@
X Add GL renderer
X Add native keyboard processing (removes SDL keyboard input dependency from
Fuse)
-* Add native CoreAudio sound processing (removes SDL sound dependency from Fuse)
+X Add native CoreAudio sound processing (removes SDL sound dependency from Fuse)
* Fix menus, preferences etc.
* Fix scalers
* Add native joystick processing (removes SDL joystick input dependency from
Modified: branches/fusegl/fuse/event.c
===================================================================
--- branches/fusegl/fuse/event.c 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/event.c 2006-12-23 11:00:00 UTC (rev 261)
@@ -56,6 +56,9 @@
/* We are at the end of a frame */
int event_frame_end;
+/* We've had a timer event */
+int event_timer;
+
/* The actual list of events */
static GSList* event_list;
@@ -84,6 +87,7 @@
event_free=NULL;
event_next_event=event_no_events;
event_frame_end=0;
+ event_timer=0;
return 0;
}
@@ -152,6 +156,25 @@
event_do_frame_end();
}
+/* Run until target_tstates */
+void
+event_do_timer( libspectrum_dword target_tstates )
+{
+ if( event_add( target_tstates + tstates, EVENT_TYPE_TIMER ) ) {
+ /* Some sort of dire error */
+ return;
+ }
+ event_timer=0;
+ while( !event_timer ) {
+ z80_do_opcodes();
+ event_do_events();
+ if( event_frame_end ) {
+ event_do_frame_end();
+ }
+ }
+ event_timer=0;
+}
+
/* Do all events which have passed */
int event_do_events(void)
{
@@ -174,7 +197,7 @@
case EVENT_TYPE_EDGE: tape_next_edge( ptr->tstates ); break;
case EVENT_TYPE_TIMER:
- timer_frame( ptr->tstates );
+ event_timer = 1;
break;
case EVENT_TYPE_FRAME:
Modified: branches/fusegl/fuse/event.h
===================================================================
--- branches/fusegl/fuse/event.h 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/event.h 2006-12-23 11:00:00 UTC (rev 261)
@@ -78,6 +78,9 @@
/* Do a single frame */
void event_do_frame(void);
+/* Run until the next timer event */
+void event_do_timer( libspectrum_dword target_tstates );
+
/* Called at end of frame to reduce T-state count of all entries */
int event_frame( libspectrum_dword tstates_per_frame );
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-23 11:00:00 UTC (rev 261)
@@ -264,10 +264,10 @@
B6825549091817F30014B5EE /* divide.c in Sources */ = {isa = PBXBuildFile; fileRef = B6825547091817F30014B5EE /* divide.c */; };
B682554A091817F30014B5EE /* divide.h in Headers */ = {isa = PBXBuildFile; fileRef = B6825548091817F30014B5EE /* divide.h */; };
B6A6F0960B3C108C000B88E9 /* coreaudiosound.c in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */; };
+ B6A6F0DA0B3D141B000B88E9 /* cocoaui.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F0D90B3D141B000B88E9 /* cocoaui.m */; };
B6CE7F400B2830A300EB65B3 /* cocoadisplay.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */; };
B6CE7F410B2830A300EB65B3 /* cocoadisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */; };
B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */; };
- B6CE7F430B2830A300EB65B3 /* cocoaui.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3D0B2830A300EB65B3 /* cocoaui.c */; };
B6CE7F440B2830A300EB65B3 /* cocoaui.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */; };
B6CE7F520B283A0700EB65B3 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F510B283A0700EB65B3 /* main.mm */; };
B6CE7FCD0B28FBD600EB65B3 /* DisplayOpenGLView.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7FCB0B28FBD600EB65B3 /* DisplayOpenGLView.h */; };
@@ -449,6 +449,7 @@
B68CB2C603DD920300A804BA /* disassemble.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = disassemble.c; path = ../debugger/disassemble.c; sourceTree = "<group>"; };
B68CB2CC03DD923C00A804BA /* memory.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = memory.c; sourceTree = "<group>"; };
B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = coreaudiosound.c; path = sound/coreaudiosound.c; sourceTree = "<group>"; };
+ B6A6F0D90B3D141B000B88E9 /* cocoaui.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoaui.m; sourceTree = "<group>"; };
B6A7F0E904C9A11D001025EB /* NumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberFormatter.h; sourceTree = "<group>"; };
B6A7F0EA04C9A11D001025EB /* NumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NumberFormatter.m; sourceTree = "<group>"; };
B6AA8A3C03D2FC1C00FED55D /* trdos.rom */ = {isa = PBXFileReference; lastKnownFileType = file; name = trdos.rom; path = ../roms/trdos.rom; sourceTree = SOURCE_ROOT; };
@@ -490,7 +491,6 @@
B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cocoadisplay.c; sourceTree = "<group>"; };
B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cocoadisplay.h; sourceTree = "<group>"; };
B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cocoajoystick.c; sourceTree = "<group>"; };
- B6CE7F3D0B2830A300EB65B3 /* cocoaui.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cocoaui.c; sourceTree = "<group>"; };
B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cocoaui.h; sourceTree = "<group>"; };
B6CE7F510B283A0700EB65B3 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
B6CE7FCB0B28FBD600EB65B3 /* DisplayOpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DisplayOpenGLView.h; sourceTree = "<group>"; };
@@ -890,8 +890,8 @@
B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */,
B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */,
B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */,
- B6CE7F3D0B2830A300EB65B3 /* cocoaui.c */,
B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */,
+ B6A6F0D90B3D141B000B88E9 /* cocoaui.m */,
B6E0252B0B38AFE500E23A0F /* keysyms.m */,
);
path = cocoa;
@@ -1437,11 +1437,11 @@
B6403FD80A7E4B1A00E00B11 /* loader.c in Sources */,
B6CE7F400B2830A300EB65B3 /* cocoadisplay.c in Sources */,
B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */,
- B6CE7F430B2830A300EB65B3 /* cocoaui.c in Sources */,
B6CE7F520B283A0700EB65B3 /* main.mm in Sources */,
B6CE7FCE0B28FBD600EB65B3 /* DisplayOpenGLView.m in Sources */,
B6E0252C0B38AFE500E23A0F /* keysyms.m in Sources */,
B6A6F0960B3C108C000B88E9 /* coreaudiosound.c in Sources */,
+ B6A6F0DA0B3D141B000B88E9 /* cocoaui.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: branches/fusegl/fuse/fusepb/FuseMenus.h
===================================================================
--- branches/fusegl/fuse/fusepb/FuseMenus.h 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/FuseMenus.h 2006-12-23 11:00:00 UTC (rev 261)
@@ -32,6 +32,7 @@
void CreateTexture(Cocoa_Texture*);
void DestroyTexture(void);
+void SetEmulationHz(float);
void Hide(void);
void Open(void);
Modified: branches/fusegl/fuse/fusepb/FuseMenus.m
===================================================================
--- branches/fusegl/fuse/fusepb/FuseMenus.m 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/FuseMenus.m 2006-12-23 11:00:00 UTC (rev 261)
@@ -56,6 +56,11 @@
[[DisplayOpenGLView instance] destroyTexture];
}
+void SetEmulationHz( float hz )
+{
+ [[DisplayOpenGLView instance] setEmulationHz:hz];
+}
+
void Hide(void)
{
[NSApp hide:[FuseController singleton]];
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.h
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.h 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.h 2006-12-23 11:00:00 UTC (rev 261)
@@ -55,6 +55,7 @@
IBOutlet NSMenuItem *zxcf;
IBOutlet NSMenuItem *tapePlay;
IBOutlet NSMenu *recentSnaps;
+ IBOutlet NSWindow *window;
IBOutlet id savePanelAccessoryView;
IBOutlet NSPopUpButton* saveFileType;
@@ -144,6 +145,7 @@
- (void)ui_menu_activate_media_ide_simple8bit:(int)active;
- (void)ui_menu_activate_media_ide_zxatasp:(int)active;
- (void)ui_menu_activate_media_ide_zxcf:(int)active;
+- (int)ui_statusbar_update_speed:(float)speed;
- (void)openFile:(char *)filename;
- (void)openRecent:(id)sender;
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.m 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.m 2006-12-23 11:00:00 UTC (rev 261)
@@ -1023,6 +1023,11 @@
[if1 setEnabled:active == 0 ? NO : YES];
}
+- (int)ui_statusbar_update_speed:(float)speed
+{
+ [window setTitle:[NSString stringWithFormat:@"Fuse - %3.0f%%", speed]];
+}
+
- (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem
{
switch( [menuItem tag] ) {
Modified: branches/fusegl/fuse/fusepb/controllers/PreferencesController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/PreferencesController.m 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/controllers/PreferencesController.m 2006-12-23 11:00:00 UTC (rev 261)
@@ -29,6 +29,7 @@
#include <string.h>
#import "FuseController.h"
+#import "DisplayOpenGLView.h"
#import "JoystickConfigurationController.h"
#import "PreferencesController.h"
#import "CAMachines.h"
@@ -40,6 +41,7 @@
#include "printer.h"
#include "settings.h"
#include "settings_cocoa.h"
+#include "sound.h"
#include "machine.h"
#include "ui.h"
#include "ui/scaler/scaler.h"
@@ -120,6 +122,10 @@
[machineRoms release];
fuse_emulation_unpause();
+
+ /* If we've enabled sound we want to put some data in the buffers before
+ too long to avoid glitches */
+ if( sound_enabled ) [[DisplayOpenGLView instance] updateEmulationForTimeDelta:0];
}
- (IBAction)chooseFile:(id)sender
Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib
===================================================================
--- branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2006-12-23 11:00:00 UTC (rev 261)
@@ -77,6 +77,7 @@
savePanelAccessoryView = id;
simple8Bit = NSMenuItem;
tapePlay = NSMenuItem;
+ window = NSWindow;
zxatasp = NSMenuItem;
zxcf = NSMenuItem;
};
Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/info.nib
===================================================================
--- branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/info.nib 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/info.nib 2006-12-23 11:00:00 UTC (rev 261)
@@ -13,8 +13,8 @@
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
+ <integer>29</integer>
<integer>877</integer>
- <integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>8L2127</string>
Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
===================================================================
(Binary files differ)
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2006-12-23 11:00:00 UTC (rev 261)
@@ -51,6 +51,8 @@
int cocoakeyboard_caps_shift_pressed;
int cocoakeyboard_symbol_shift_pressed;
input_key unicode_keysym;
+
+ CFAbsoluteTime time;
}
+(DisplayOpenGLView *) instance;
+(void) initialize;
@@ -59,6 +61,7 @@
-(void) destroyTexture;
-(void) updateEmulationForTimeDelta:(CFAbsoluteTime)deltaTime;
+-(void) setEmulationHz:(float)hz;
-(id) initWithFrame:(NSRect)frameRect;
-(void) awakeFromNib;
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-23 11:00:00 UTC (rev 261)
@@ -32,14 +32,22 @@
#include "fuse.h"
#include "fusepb/main.h"
#include "keyboard.h"
+#include "settings.h"
+#include "sound.h"
extern keysyms_map_t unicode_keysyms_map[];
+#include <CoreAudio/AudioHardware.h>
+#include "sound/sfifo.h"
+
+extern sfifo_t sound_fifo;
+extern AudioStreamBasicDescription deviceFormat;
+
@implementation DisplayOpenGLView
static DisplayOpenGLView *instance = nil;
-+ (DisplayOpenGLView *) instance
++(DisplayOpenGLView *) instance
{
return instance;
}
@@ -82,9 +90,9 @@
}
-- (id) initWithFrame:(NSRect)frameRect
+-(id) initWithFrame:(NSRect)frameRect
{
- // Init pixel format attribs
+ /* Init pixel format attribs */
NSOpenGLPixelFormatAttribute attrs[] = {
NSOpenGLPFAAccelerated,
NSOpenGLPFANoRecovery,
@@ -92,7 +100,7 @@
0
};
- // Get pixel format from OpenGL
+ /* Get pixel format from OpenGL */
NSOpenGLPixelFormat* pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
if (!pixFmt) {
NSLog(@"No pixel format -- exiting");
@@ -109,9 +117,9 @@
[[self openGLContext] makeCurrentContext];
- timer = [[NSTimer scheduledTimerWithTimeInterval: (1.0f / 50.0f) target: self selector:@selector(drawRect:) userInfo:self repeats:true] retain];
+ timer = nil;
- // Setup some basic OpenGL stuff
+ /* Setup some basic OpenGL stuff */
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
@@ -132,30 +140,36 @@
-(void) awakeFromNib
{
- // FIXME: Do all the stuff that SDLMain.mm used
- // to do command line wise, drag-n-drop etc. here?
- // FIXME: Don't really like the argc, argv stuff being here...
+ /* FIXME: Do all the stuff that SDLMain.mm used
+ * to do command line wise, drag-n-drop etc. here?
+ */
+ /* FIXME: Don't really like the argc, argv stuff being here... */
if( fuse_init( ac, av ) ) {
fprintf( stderr, "%s: error initialising -- giving up!\n", fuse_progname );
}
[self initKeyboard];
+
+ time = CFAbsoluteTimeGetCurrent(); /* set emulation time start time */
}
-- (void)drawRect:(NSRect)aRect
+-(void) drawRect:(NSRect)aRect
{
- // update emulation
- [self updateEmulationForTimeDelta:0];
+ CFTimeInterval nowTime = CFAbsoluteTimeGetCurrent();
+ CFTimeInterval deltaTime = nowTime - time;
+ if (deltaTime <= 1.0) { /* skip pauses */
+ [self updateEmulationForTimeDelta:deltaTime];
+ }
+ time = nowTime;
if( NO == screenTexInitialised ) return;
- // Need to draw texture to screen here
+ /* Need to draw texture to screen here */
memcpy(screenTex.pixels, screen.pixels, screenTex.pitch*screenTex.height);
- // Make this context current
[[self openGLContext] makeCurrentContext];
- // Bind, update and draw new image
+ /* Bind, update and draw new image */
glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 1);
glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, screenTex.width,
@@ -178,14 +192,15 @@
glEnd();
+ /* FIXME: Probably still need to glFlush() in fullscreen mode */
//glFlush();
- // Swap buffer to screen
+ /* Swap buffer to screen */
[[self openGLContext] flushBuffer];
}
-// moved or resized
-- (void)update
+/* moved or resized */
+-(void) update
{
NSRect rect;
@@ -207,8 +222,8 @@
[self setNeedsDisplay:true];
}
-// scrolled, moved or resized
-- (void)reshape
+/* scrolled, moved or resized */
+-(void) reshape
{
NSRect rect;
@@ -235,7 +250,7 @@
GLuint i;
if( screenTexInitialised == NO) return;
- // May want to have a double buffered texture later
+ /* FIXME: May want to have a double buffered texture later */
for(i = 0; i < 1; i++) {
GLint dt = i+1;
glDeleteTextures(1, &dt);
@@ -259,7 +274,7 @@
[[self openGLContext] makeCurrentContext];
[[self openGLContext] update];
- // May want to have a double buffered texture later
+ /* FIXME: May want to have a double buffered texture later */
for(i = 0; i < 1; i++)
{
glDisable(GL_TEXTURE_2D);
@@ -285,22 +300,43 @@
screenTexInitialised = YES;
}
-// given a delta time in seconds, update overall emulation state
-- (void) updateEmulationForTimeDelta:(CFAbsoluteTime)deltaTime
+/* given a delta time in seconds, update overall emulation state */
+-(void) updateEmulationForTimeDelta:(CFAbsoluteTime)deltaTime
{
-// Note: will be called 50 or 60 times/frame - if running at non 100% speed will
-// want to run a fraction of the normal time
- event_do_frame();
+ if( sound_enabled ) {
+ /* emulate until fifo is full */
+ while( sfifo_space( &sound_fifo ) >= (sound_stereo+1) * 2 * sound_framesiz ) {
+ event_do_frame();
+ }
+ } else {
+ float speed = ( settings_current.emulation_speed < 1 ?
+ 100.0 :
+ settings_current.emulation_speed ) / 100.0;
+ libspectrum_dword time_tstates = deltaTime *
+ machine_current->timings.processor_speed *
+ speed + 0.5;
+ event_do_timer( time_tstates );
+ }
}
-- (void)mouseDragged:(NSEvent *)theEvent
+-(void) setEmulationHz:(float)hz
{
+ [timer invalidate];
+ [timer release];
+
+ timer = [[NSTimer scheduledTimerWithTimeInterval: (1.0f / hz)
+ target:self selector:@selector(drawRect:)
+ userInfo:self repeats:true] retain];
}
-- (void)mouseDown:(NSEvent *)theEvent
+-(void) mouseDragged:(NSEvent *)theEvent
{
}
+-(void) mouseDown:(NSEvent *)theEvent
+{
+}
+
-(void) initKeyboard
{
keysyms_map_t *ptr3;
Modified: branches/fusegl/fuse/machine.c
===================================================================
--- branches/fusegl/fuse/machine.c 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/machine.c 2006-12-23 11:00:00 UTC (rev 261)
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
+#include "FuseMenus.h"
#include "divide.h"
#include "event.h"
#include "fuse.h"
@@ -253,7 +254,6 @@
/* Reset the event stack */
event_reset();
- if( event_add( 0, EVENT_TYPE_TIMER ) ) return 1;
if( event_add( machine->timings.tstates_per_frame, EVENT_TYPE_FRAME ) )
return 1;
@@ -395,6 +395,10 @@
error = machine_current->memory_map(); if( error ) return error;
+ /* Select 50 or 60 Hz emulation timer */
+ SetEmulationHz( (float)machine_current->timings.processor_speed /
+ machine_current->timings.tstates_per_frame );
+
/* Set up the contention array */
for( i = 0; i < machine_current->timings.tstates_per_frame; i++ )
ula_contention[ i ] = machine_current->ram.contend_delay( i );
Modified: branches/fusegl/fuse/sound/coreaudiosound.c
===================================================================
--- branches/fusegl/fuse/sound/coreaudiosound.c 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/sound/coreaudiosound.c 2006-12-23 11:00:00 UTC (rev 261)
@@ -30,11 +30,15 @@
#include "event.h"
#include "sfifo.h"
+#include "settings.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,
@@ -44,7 +48,7 @@
AudioBufferList *ioData );
/* info about the format used for writing to output unit */
-static AudioStreamBasicDescription deviceFormat;
+AudioStreamBasicDescription deviceFormat;
/* converts from Fuse format (signed 16 bit ints) to CoreAudio format (floats)
*/
@@ -159,8 +163,14 @@
return 1;
}
- if( ( error = sfifo_init( &sound_fifo, 2 * deviceFormat.mChannelsPerFrame
- * deviceBufferSize + 1 ) ) ) {
+ float hz = (float)machine_current->timings.processor_speed /
+ machine_current->timings.tstates_per_frame;
+
+ int sound_framesiz = settings_current.sound_freq / 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;
Deleted: branches/fusegl/fuse/ui/cocoa/cocoaui.c
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoaui.c 2006-12-23 01:32:26 UTC (rev 260)
+++ branches/fusegl/fuse/ui/cocoa/cocoaui.c 2006-12-23 11:00:00 UTC (rev 261)
@@ -1,97 +0,0 @@
-/* cocoaui.c: Routines for dealing with the Mac OS X user interface
- Copyright (c) 2006 Fredrick Meunier
-
- $Id: sdlui.c,v 1.11 2005/06/06 14:24:05 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
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Author contact information:
-
- E-mail: pak...@sr...
- Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England
-
-*/
-
-#include <config.h>
-
-#include <stdio.h>
-
-#include "display.h"
-#include "fuse.h"
-#include "ui/ui.h"
-#include "ui/uidisplay.h"
-#include "pokefinder/pokefinder.h"
-#include "settings.h"
-#include "cocoaui.h"
-#include "tape.h"
-#include "ui/scaler/scaler.h"
-
-int
-ui_init( int *argc, char ***argv )
-{
- int error;
-
- return 0;
-}
-
-int
-ui_event( void )
-{
- return 0;
-}
-
-int
-ui_end( void )
-{
- int error;
-
- return 0;
-}
-
-int
-ui_statusbar_update_speed( float speed )
-{
- char buffer[15];
- const char fuse[] = "Fuse";
-
- snprintf( buffer, 15, "%s - %3.0f%%", fuse, speed );
-
- return 0;
-}
-
-int
-ui_mouse_grab( int startup )
-{
- return 0;
-}
-
-int
-ui_mouse_release( int suspend )
-{
- return 0;
-}
-
-/* Called on machine selection */
-int
-ui_widgets_reset( void )
-{
- pokefinder_clear();
- return 0;
-}
-
-void
-cocoaui_quit( void )
-{
-}
Copied: branches/fusegl/fuse/ui/cocoa/cocoaui.m (from rev 258, branches/fusegl/fuse/ui/cocoa/cocoaui.c)
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoaui.m (rev 0)
+++ branches/fusegl/fuse/ui/cocoa/cocoaui.m 2006-12-23 11:00:00 UTC (rev 261)
@@ -0,0 +1,94 @@
+/* cocoaui.c: Routines for dealing with the Mac OS X user interface
+ Copyright (c) 2006 Fredrick Meunier
+
+ $Id: sdlui.c,v 1.11 2005/06/06 14:24:05 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
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Author contact information:
+
+ E-mail: pak...@sr...
+ Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England
+
+*/
+
+#include <config.h>
+
+#include <stdio.h>
+
+#import "FuseController.h"
+
+#include "display.h"
+#include "fuse.h"
+#include "ui/ui.h"
+#include "ui/uidisplay.h"
+#include "pokefinder/pokefinder.h"
+#include "settings.h"
+#include "cocoaui.h"
+#include "tape.h"
+#include "ui/scaler/scaler.h"
+
+int
+ui_init( int *argc, char ***argv )
+{
+ int error;
+
+ return 0;
+}
+
+int
+ui_event( void )
+{
+ return 0;
+}
+
+int
+ui_end( void )
+{
+ int error;
+
+ return 0;
+}
+
+int
+ui_statusbar_update_speed( float speed )
+{
+ return [[FuseController singleton] ui_statusbar_update_speed:speed];
+}
+
+int
+ui_mouse_grab( int startup )
+{
+ return 0;
+}
+
+int
+ui_mouse_release( int suspend )
+{
+ return 0;
+}
+
+/* Called on machine selection */
+int
+ui_widgets_reset( void )
+{
+ pokefinder_clear();
+ return 0;
+}
+
+void
+cocoaui_quit( void )
+{
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2006-12-24 13:35:52
|
Revision: 262
http://svn.sourceforge.net/fuse-for-macosx/?rev=262&view=rev
Author: fredm
Date: 2006-12-24 05:35:50 -0800 (Sun, 24 Dec 2006)
Log Message:
-----------
Enable screenshot support, get project building in deployment mode.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/content_arrays/SDLJoysticks.m
branches/fusegl/fuse/fusepb/controllers/FuseController.m
branches/fusegl/fuse/fusepb/thumbnail.h
branches/fusegl/fuse/fusepb/thumbnail.m
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/ui/cocoa/cocoadisplay.c
branches/fusegl/fuse/ui/cocoa/cocoadisplay.h
Added Paths:
-----------
branches/fusegl/fuse/ui/cocoa/cocoaerror.m
branches/fusegl/fuse/ui/cocoa/cocoascreenshot.h
branches/fusegl/fuse/ui/cocoa/cocoascreenshot.m
Removed Paths:
-------------
branches/fusegl/fuse/fusepb/error.m
branches/fusegl/fuse/fusepb/sdlscreenshot.h
branches/fusegl/fuse/fusepb/sdlscreenshot.m
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/TODO 2006-12-24 13:35:50 UTC (rev 262)
@@ -12,5 +12,6 @@
* Add native joystick processing (removes SDL joystick input dependency from
Fuse)
* Add native mouse processing (removes SDL mouse input dependency from Fuse)
+* Restore fullscreen support
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2006-12-24 13:35:50 UTC (rev 262)
@@ -265,6 +265,12 @@
B682554A091817F30014B5EE /* divide.h in Headers */ = {isa = PBXBuildFile; fileRef = B6825548091817F30014B5EE /* divide.h */; };
B6A6F0960B3C108C000B88E9 /* coreaudiosound.c in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */; };
B6A6F0DA0B3D141B000B88E9 /* cocoaui.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F0D90B3D141B000B88E9 /* cocoaui.m */; };
+ B6A6F0EE0B3D5F9E000B88E9 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6A6F0ED0B3D5F9E000B88E9 /* CoreAudio.framework */; };
+ B6A6F0F30B3D602F000B88E9 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6A6F0F20B3D602F000B88E9 /* AudioUnit.framework */; };
+ B6A6F1060B3D60D0000B88E9 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F520C8BC038D022E01A804BA /* OpenGL.framework */; };
+ B6A6F10E0B3D6360000B88E9 /* cocoaerror.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F10D0B3D6360000B88E9 /* cocoaerror.m */; };
+ B6A6F11F0B3EA737000B88E9 /* cocoascreenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = B6A6F11D0B3EA737000B88E9 /* cocoascreenshot.h */; };
+ B6A6F1200B3EA737000B88E9 /* cocoascreenshot.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F11E0B3EA737000B88E9 /* cocoascreenshot.m */; };
B6CE7F400B2830A300EB65B3 /* cocoadisplay.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */; };
B6CE7F410B2830A300EB65B3 /* cocoadisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */; };
B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */; };
@@ -450,6 +456,11 @@
B68CB2CC03DD923C00A804BA /* memory.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = memory.c; sourceTree = "<group>"; };
B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = coreaudiosound.c; path = sound/coreaudiosound.c; sourceTree = "<group>"; };
B6A6F0D90B3D141B000B88E9 /* cocoaui.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoaui.m; sourceTree = "<group>"; };
+ B6A6F0ED0B3D5F9E000B88E9 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = ../../../../../../../../System/Library/Frameworks/CoreAudio.framework; sourceTree = "<group>"; };
+ B6A6F0F20B3D602F000B88E9 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = ../../../../../../../../System/Library/Frameworks/AudioUnit.framework; sourceTree = "<group>"; };
+ B6A6F10D0B3D6360000B88E9 /* cocoaerror.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoaerror.m; sourceTree = "<group>"; };
+ B6A6F11D0B3EA737000B88E9 /* cocoascreenshot.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cocoascreenshot.h; sourceTree = "<group>"; };
+ B6A6F11E0B3EA737000B88E9 /* cocoascreenshot.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoascreenshot.m; sourceTree = "<group>"; };
B6A7F0E904C9A11D001025EB /* NumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberFormatter.h; sourceTree = "<group>"; };
B6A7F0EA04C9A11D001025EB /* NumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NumberFormatter.m; sourceTree = "<group>"; };
B6AA8A3C03D2FC1C00FED55D /* trdos.rom */ = {isa = PBXFileReference; lastKnownFileType = file; name = trdos.rom; path = ../roms/trdos.rom; sourceTree = SOURCE_ROOT; };
@@ -626,6 +637,9 @@
B61F46A109121DF100C8096C /* gcrypt.framework in Frameworks */,
B61F46A209121DF100C8096C /* libbz2.framework in Frameworks */,
B64E2A170A6534A3006863D9 /* Carbon.framework in Frameworks */,
+ B6A6F0EE0B3D5F9E000B88E9 /* CoreAudio.framework in Frameworks */,
+ B6A6F0F30B3D602F000B88E9 /* AudioUnit.framework in Frameworks */,
+ B6A6F1060B3D60D0000B88E9 /* OpenGL.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -652,6 +666,8 @@
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
+ B6A6F0F20B3D602F000B88E9 /* AudioUnit.framework */,
+ B6A6F0ED0B3D5F9E000B88E9 /* CoreAudio.framework */,
B64E2A160A6534A3006863D9 /* Carbon.framework */,
B6202BD105BD43D800A1EA8F /* libbz2.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
@@ -889,7 +905,10 @@
children = (
B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */,
B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */,
+ B6A6F10D0B3D6360000B88E9 /* cocoaerror.m */,
B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */,
+ B6A6F11D0B3EA737000B88E9 /* cocoascreenshot.h */,
+ B6A6F11E0B3EA737000B88E9 /* cocoascreenshot.m */,
B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */,
B6A6F0D90B3D141B000B88E9 /* cocoaui.m */,
B6E0252B0B38AFE500E23A0F /* keysyms.m */,
@@ -1207,6 +1226,7 @@
B6CE7F410B2830A300EB65B3 /* cocoadisplay.h in Headers */,
B6CE7F440B2830A300EB65B3 /* cocoaui.h in Headers */,
B6CE7FCD0B28FBD600EB65B3 /* DisplayOpenGLView.h in Headers */,
+ B6A6F11F0B3EA737000B88E9 /* cocoascreenshot.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1442,6 +1462,8 @@
B6E0252C0B38AFE500E23A0F /* keysyms.m in Sources */,
B6A6F0960B3C108C000B88E9 /* coreaudiosound.c in Sources */,
B6A6F0DA0B3D141B000B88E9 /* cocoaui.m in Sources */,
+ B6A6F10E0B3D6360000B88E9 /* cocoaerror.m in Sources */,
+ B6A6F1200B3EA737000B88E9 /* cocoascreenshot.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: branches/fusegl/fuse/fusepb/content_arrays/SDLJoysticks.m
===================================================================
--- branches/fusegl/fuse/fusepb/content_arrays/SDLJoysticks.m 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/fusepb/content_arrays/SDLJoysticks.m 2006-12-24 13:35:50 UTC (rev 262)
@@ -44,7 +44,7 @@
joysticks = [NSMutableArray arrayWithCapacity:joysticks_supported+1];
[joysticks addObject:[SDLJoystick joystickWithName:@"None" andType:0]];
-
+#if 0
if( joysticks_supported > 0 ){
for( i=0; i<joysticks_supported; i++ ) {
[joysticks addObject:
@@ -54,6 +54,7 @@
];
}
}
+#endif
}
return joysticks;
}
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.m 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.m 2006-12-24 13:35:50 UTC (rev 262)
@@ -52,8 +52,8 @@
#include "psg.h"
#include "rzx.h"
#include "screenshot.h"
+#include "ui/cocoa/cocoascreenshot.h"
#if 0
-#include "sdlscreenshot.h"
#include "sdlui.h"
#include "sdldisplay.h"
#endif
@@ -1026,6 +1026,8 @@
- (int)ui_statusbar_update_speed:(float)speed
{
[window setTitle:[NSString stringWithFormat:@"Fuse - %3.0f%%", speed]];
+
+ return 0;
}
- (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem
Deleted: branches/fusegl/fuse/fusepb/error.m
===================================================================
--- branches/fusegl/fuse/fusepb/error.m 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/fusepb/error.m 2006-12-24 13:35:50 UTC (rev 262)
@@ -1,87 +0,0 @@
-/* error.m: handle errors
- Copyright (c) 2002 Philip Kendall
- Copyright (c) 2002-2004 Fredrick Meunier
-
- $Id$
-
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Author contact information:
-
- E-mail: pak...@sr...
- Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England
-
-*/
-
-#include <config.h>
-
-#ifdef UI_SDL /* Use this iff we're using SDL */
-
-#import <Foundation/NSString.h>
-#import <AppKit/NSPanel.h>
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include "fuse.h"
-#include "ui/ui.h"
-#include "settings.h"
-
-#define MESSAGE_MAX_LENGTH 256
-
-int
-aqua_verror( ui_error_level severity, const char *message )
-{
- NSString *title;
-
- /* Set the appropriate title */
- switch( severity ) {
- case UI_ERROR_INFO:
- title = @"Fuse - Info";
- break;
- case UI_ERROR_ERROR:
- title = @"Fuse - Error";
- break;
- default:
- title = @"Fuse - (Unknown error)";
- break;
- }
-
- NSString *alertString = [NSString stringWithUTF8String:message];
-
- switch( severity ) {
- case UI_ERROR_INFO:
- NSRunAlertPanel(title, alertString, nil, nil, nil);
- break;
- case UI_ERROR_ERROR:
- default:
- NSRunCriticalAlertPanel(title, alertString, nil, nil, nil);
- break;
- }
-
- return 0;
-}
-
-int
-ui_error_specific( ui_error_level severity, const char *message )
-{
- if ( !settings_current.full_screen ) {
- return aqua_verror( severity, message );
- }
- return 0;
-}
-
-#endif /* #ifdef UI_SDL */
Deleted: branches/fusegl/fuse/fusepb/sdlscreenshot.h
===================================================================
--- branches/fusegl/fuse/fusepb/sdlscreenshot.h 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/fusepb/sdlscreenshot.h 2006-12-24 13:35:50 UTC (rev 262)
@@ -1,32 +0,0 @@
-/* sdlscreenshot.h: Routines for saving .bmp screenshots
- Copyright (c) 2003 Fredrick Meunier
-
- $Id$
-
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Author contact information:
-
- E-mail: pak...@sr...
- Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England
-
-*/
-
-#ifndef SDLSCREENSHOT_H
-#define SDLSCREENSHOT_H
-
-int screenshot_write( const char *filename );
-
-#endif /* #ifndef SDLSCREENSHOT_H */
Deleted: branches/fusegl/fuse/fusepb/sdlscreenshot.m
===================================================================
--- branches/fusegl/fuse/fusepb/sdlscreenshot.m 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/fusepb/sdlscreenshot.m 2006-12-24 13:35:50 UTC (rev 262)
@@ -1,111 +0,0 @@
-/* sdlscreenshot.m: Routines for handling external format screenshots
- Copyright (c) 2003,2005 Fredrick Meunier
- Copyright (C) 1997-2003 Sam Lantinga
-
- $Id$
-
- 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- Author contact information:
-
- E-mail: pak...@sr...
- Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England
-
-*/
-
-#include <config.h>
-
-#include <SDL.h>
-
-#include <Cocoa/Cocoa.h>
-
-#include "sdldisplay.h"
-#include "ui/ui.h"
-
-// Most of the following snaffled from SDL_QuartzWM.m in SDL-1.2.9
-int
-screenshot_write( const char *filename, scaler_type scaler )
-{
- size_t len = strlen(filename);
- const char* extension;
- NSBitmapImageRep *bits;
- SDL_Surface *mergedSurface;
- NSAutoreleasePool *pool;
- SDL_Rect rrect;
- NSBitmapImageFileType type = NSTIFFFileType;
-
- if( len < 4 ) {
- return 1;
- }
-
- extension = filename + len - 4;
-
- if( !strcmp( extension, ".png" ) ) {
- type = NSPNGFileType;
- } else if( !strcmp( extension, ".gif" ) ) {
- type = NSGIFFileType;
- } else if( !strcmp( extension, ".jpg" ) ) {
- type = NSJPEGFileType;
- } else if( !strcmp( extension, ".bmp" ) ) {
- type = NSBMPFileType;
- }
-
- pool = [ [ NSAutoreleasePool alloc ] init ];
- SDL_GetClipRect( sdldisplay_gc, &rrect );
-
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define BYTEORDER_DEPENDENT_RGBA_MASKS 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF
-#else
-#define BYTEORDER_DEPENDENT_RGBA_MASKS 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000
-#endif
- /* create an appropriate endian RGBA surface */
- mergedSurface = SDL_CreateRGBSurface( SDL_SWSURFACE|SDL_SRCALPHA,
- sdldisplay_gc->w, sdldisplay_gc->h, 32,
- BYTEORDER_DEPENDENT_RGBA_MASKS );
- if( mergedSurface==NULL ) {
- NSLog( @"Error creating surface for merge" );
- goto freePool;
- }
-
- if( mergedSurface->pitch !=
- mergedSurface->format->BytesPerPixel * mergedSurface->w ) {
- NSLog( @"merged surface has wrong format" );
- SDL_FreeSurface( mergedSurface );
- goto freePool;
- }
-
- if( SDL_BlitSurface( sdldisplay_gc,&rrect,mergedSurface,&rrect ) ) {
- NSLog( @"Error blitting to mergedSurface" );
- goto freePool;
- }
-
- bits = [ [ NSBitmapImageRep alloc]
- initWithBitmapDataPlanes:(unsigned char **)&mergedSurface->pixels
- pixelsWide:sdldisplay_gc->w pixelsHigh:sdldisplay_gc->h
- bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO
- colorSpaceName:NSDeviceRGBColorSpace
- bytesPerRow:sdldisplay_gc->w<<2 bitsPerPixel:32 ];
-
- NSData *data = [ bits representationUsingType:type properties:nil ];
- [ data writeToFile:[NSString stringWithUTF8String:filename] atomically:NO ];
-
- [ bits release ];
- SDL_FreeSurface( mergedSurface );
-
-freePool:
- [pool release];
-
- return 0;
-}
Modified: branches/fusegl/fuse/fusepb/thumbnail.h
===================================================================
--- branches/fusegl/fuse/fusepb/thumbnail.h 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/fusepb/thumbnail.h 2006-12-24 13:35:50 UTC (rev 262)
@@ -29,4 +29,8 @@
int add_screen_thumbnail_to( const char*filename );
+int get_rgb24_data( libspectrum_byte *rgb24_data, size_t stride,
+ size_t height, size_t width, size_t height_offset,
+ size_t width_offset );
+
#endif /* #ifndef THUMBNAIL_H */
Modified: branches/fusegl/fuse/fusepb/thumbnail.m
===================================================================
--- branches/fusegl/fuse/fusepb/thumbnail.m 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/fusepb/thumbnail.m 2006-12-24 13:35:50 UTC (rev 262)
@@ -37,15 +37,12 @@
#include "screenshot.h"
#include "scld.h"
#include "settings.h"
+#include "thumbnail.h"
#include "ui/scaler/scaler.h"
#include "ui/scaler/scaler_internals.h"
#include "ui/ui.h"
#include "utils.h"
-static int get_rgb24_data( libspectrum_byte *rgb24_data, size_t stride,
- size_t height, size_t width, size_t height_offset,
- size_t width_offset );
-
int
add_screen_thumbnail_to( const char*filename )
{
@@ -100,7 +97,7 @@
return 0;
}
-static int
+int
get_rgb24_data( libspectrum_byte *rgb24_data, size_t stride,
size_t height, size_t width, size_t height_offset,
size_t width_offset )
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-24 13:35:50 UTC (rev 262)
@@ -165,29 +165,29 @@
if( NO == screenTexInitialised ) return;
/* Need to draw texture to screen here */
- memcpy(screenTex.pixels, screen.pixels, screenTex.pitch*screenTex.height);
+ memcpy(screenTex.pixels, screen.pixels, screenTex.pitch*screenTex.full_height);
[[self openGLContext] makeCurrentContext];
/* Bind, update and draw new image */
glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 1);
- glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, screenTex.width,
- screenTex.height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, screenTex.full_width,
+ screenTex.full_height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
screenTex.pixels);
glBegin(GL_QUADS);
- glTexCoord2f((float)(screenTex.width-3), 1.0f);
+ glTexCoord2f((float)screenTex.image_width, (float)(screenTex.image_xoffset));
glVertex2f(1.0f, 1.0f);
- glTexCoord2f((float)(screenTex.width-3), (float)(screenTex.height-3));
+ glTexCoord2f((float)screenTex.image_width, (float)screenTex.image_height);
glVertex2f(1.0f, -1.0f);
- glTexCoord2f(1.0f, (float)(screenTex.height-3));
+ glTexCoord2f((float)screenTex.image_xoffset, (float)screenTex.image_height);
glVertex2f(-1.0f, -1.0f);
- glTexCoord2f(1.0f, 1.0f);
+ glTexCoord2f((float)screenTex.image_xoffset, (float)screenTex.image_yoffset);
glVertex2f(-1.0f, 1.0f);
glEnd();
@@ -262,14 +262,18 @@
{
GLint i;
- screenTex.width = newScreen->width;
- screenTex.height = newScreen->height;
- screenTex.pixels = calloc(screenTex.width*screenTex.height, sizeof(uint32_t));
+ screenTex.full_width = newScreen->full_width;
+ screenTex.full_height = newScreen->full_height;
+ screenTex.image_width = newScreen->image_width;
+ screenTex.image_height = newScreen->image_height;
+ screenTex.image_xoffset = newScreen->image_xoffset;
+ screenTex.image_yoffset = newScreen->image_yoffset;
+ screenTex.pixels = calloc(screenTex.full_width*screenTex.full_height, sizeof(uint32_t));
if( !screenTex.pixels ) {
fprintf( stderr, "%s: couldn't create screenTex.pixels\n", fuse_progname );
return;
}
- screenTex.pitch = screenTex.width * sizeof(uint32_t);
+ screenTex.pitch = screenTex.full_width * sizeof(uint32_t);
[[self openGLContext] makeCurrentContext];
[[self openGLContext] update];
@@ -281,7 +285,8 @@
glEnable(GL_TEXTURE_RECTANGLE_EXT);
glBindTexture(GL_TEXTURE_RECTANGLE_EXT, i+1);
- glTextureRangeAPPLE(GL_TEXTURE_RECTANGLE_EXT, screenTex.width*screenTex.pitch,
+ glTextureRangeAPPLE(GL_TEXTURE_RECTANGLE_EXT,
+ screenTex.full_width*screenTex.pitch,
screenTex.pixels );
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_STORAGE_HINT_APPLE,
@@ -293,8 +298,8 @@
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- glTexImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, screenTex.width,
- screenTex.height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ glTexImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, screenTex.full_width,
+ screenTex.full_height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
screenTex.pixels );
}
screenTexInitialised = YES;
Modified: branches/fusegl/fuse/ui/cocoa/cocoadisplay.c
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoadisplay.c 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/ui/cocoa/cocoadisplay.c 2006-12-24 13:35:50 UTC (rev 262)
@@ -78,20 +78,52 @@
static uint32_t bw_values[16];
+static void
+init_scalers( void )
+{
+ scaler_register_clear();
+
+ scaler_register( SCALER_NORMAL );
+ if( machine_current->timex ) {
+ scaler_register( SCALER_TIMEXTV );
+ } else {
+ scaler_register( SCALER_TV2X );
+ scaler_register( SCALER_2XSAI );
+ scaler_register( SCALER_SUPER2XSAI );
+ scaler_register( SCALER_SUPEREAGLE );
+ scaler_register( SCALER_ADVMAME2X );
+ scaler_register( SCALER_ADVMAME3X );
+ scaler_register( SCALER_DOTMATRIX );
+ scaler_register( SCALER_HQ2X );
+ scaler_register( SCALER_HQ3X );
+ }
+
+ if( scaler_is_supported( current_scaler ) ) {
+ scaler_select_scaler( current_scaler );
+ } else {
+ scaler_select_scaler( SCALER_NORMAL );
+ }
+}
+
static int
cocoadisplay_load_gfx_mode( void )
{
- screen.width = (image_width + 3);
- screen.height = image_height+3;
+ screen.image_width = image_width;
+ screen.image_height = image_height;
/* Need some extra bytes around when using 2xSaI */
- screen.pixels = calloc(screen.width*screen.height, sizeof(uint32_t));
+ screen.full_width = image_width+3;
+ screen.image_xoffset = 1;
+ screen.full_height = image_height+3;
+ screen.image_yoffset = 1;
+
+ screen.pixels = calloc(screen.full_width*screen.full_height, sizeof(uint32_t));
if( !screen.pixels ) {
fprintf( stderr, "%s: couldn't create screen.pixels\n", fuse_progname );
return 1;
}
- screen.pitch = screen.width * sizeof(uint32_t);
+ screen.pitch = screen.full_width * sizeof(uint32_t);
/* Create OpenGL textures for the image in DisplayOpenGLView */
CreateTexture(&screen);
@@ -135,6 +167,8 @@
image_width = width;
image_height = height;
+ init_scalers();
+
cocoadisplay_load_gfx_mode();
/* We can now output error messages to our output device */
@@ -172,8 +206,8 @@
if( machine_current->timex ) {
x <<= 1; y <<= 1;
dest_base = dest = (uint32_t*)( (uint8_t*)screen.pixels +
- (x+1) * sizeof(uint32_t) +
- (y+1) * screen.pitch);
+ (x+screen.image_xoffset) * sizeof(uint32_t) +
+ (y+screen.image_yoffset) * screen.pitch);
*(dest++) = palette_colour;
*(dest++) = palette_colour;
@@ -182,7 +216,8 @@
*(dest++) = palette_colour;
} else {
dest = (uint32_t*)( (uint8_t*)screen.pixels +
- (x+1) * sizeof(uint32_t) + (y+1) * screen.pitch );
+ (x+screen.image_xoffset) * sizeof(uint32_t) +
+ (y+screen.image_yoffset) * screen.pitch );
*dest = palette_colour;
}
@@ -207,7 +242,8 @@
x <<= 4; y <<= 1;
dest_base = (uint32_t*)( (uint8_t*)screen.pixels +
- (x+1) * sizeof(uint32_t) + (y+1) * screen.pitch );
+ (x+screen.image_xoffset) * sizeof(uint32_t) +
+ (y+screen.image_yoffset) * screen.pitch );
for( i=0; i<2; i++ ) {
dest = dest_base;
@@ -233,8 +269,9 @@
}
} else {
x <<= 3;
- dest = (uint32_t*)( (uint8_t*)screen.pixels + (x+1) * sizeof(uint32_t) +
- (y+1) * screen.pitch );
+ dest = (uint32_t*)( (uint8_t*)screen.pixels +
+ (x+screen.image_xoffset) * sizeof(uint32_t) +
+ (y+screen.image_yoffset) * screen.pitch );
*(dest++) = ( data & 0x80 ) ? palette_ink : palette_paper;
*(dest++) = ( data & 0x40 ) ? palette_ink : palette_paper;
@@ -260,8 +297,9 @@
uint32_t palette_paper = palette_values[ paper ];
x <<= 4; y <<= 1;
- dest_base = (uint32_t*)( (uint8_t*)screen.pixels + (x+1) * sizeof(uint32_t) +
- (y+1) * screen.pitch );
+ dest_base = (uint32_t*)( (uint8_t*)screen.pixels + (x+screen.image_xoffset) *
+ sizeof(uint32_t) + (y+screen.image_yoffset) *
+ screen.pitch );
for( i=0; i<2; i++ ) {
dest = dest_base;
Modified: branches/fusegl/fuse/ui/cocoa/cocoadisplay.h
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoadisplay.h 2006-12-23 11:00:00 UTC (rev 261)
+++ branches/fusegl/fuse/ui/cocoa/cocoadisplay.h 2006-12-24 13:35:50 UTC (rev 262)
@@ -31,8 +31,12 @@
typedef struct Cocoa_Texture {
void *pixels;
- int height;
- int width;
+ int full_height;
+ int full_width;
+ int image_height;
+ int image_width;
+ int image_xoffset;
+ int image_yoffset;
int pitch;
} Cocoa_Texture;
Copied: branches/fusegl/fuse/ui/cocoa/cocoaerror.m (from rev 261, branches/fusegl/fuse/fusepb/error.m)
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoaerror.m (rev 0)
+++ branches/fusegl/fuse/ui/cocoa/cocoaerror.m 2006-12-24 13:35:50 UTC (rev 262)
@@ -0,0 +1,81 @@
+/* cocoaerror.m: handle errors for Mac OS X Cocoa UI
+ Copyright (c) 2002 Philip Kendall
+ Copyright (c) 2002-2004 Fredrick Meunier
+
+ $Id$
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Author contact information:
+
+ E-mail: pak...@sr...
+ Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England
+
+*/
+
+#include <config.h>
+
+#import <Foundation/NSString.h>
+#import <AppKit/NSPanel.h>
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "fuse.h"
+#include "ui/ui.h"
+#include "settings.h"
+
+int
+aqua_verror( ui_error_level severity, const char *message )
+{
+ NSString *title;
+
+ /* Set the appropriate title */
+ switch( severity ) {
+ case UI_ERROR_INFO:
+ title = @"Fuse - Info";
+ break;
+ case UI_ERROR_ERROR:
+ title = @"Fuse - Error";
+ break;
+ default:
+ title = @"Fuse - (Unknown error)";
+ break;
+ }
+
+ NSString *alertString = [NSString stringWithUTF8String:message];
+
+ switch( severity ) {
+ case UI_ERROR_INFO:
+ NSRunAlertPanel(title, alertString, nil, nil, nil);
+ break;
+ case UI_ERROR_ERROR:
+ default:
+ NSRunCriticalAlertPanel(title, alertString, nil, nil, nil);
+ break;
+ }
+
+ return 0;
+}
+
+int
+ui_error_specific( ui_error_level severity, const char *message )
+{
+ if ( !settings_current.full_screen ) {
+ return aqua_verror( severity, message );
+ }
+ return 0;
+}
Copied: branches/fusegl/fuse/ui/cocoa/cocoascreenshot.h (from rev 261, branches/fusegl/fuse/fusepb/sdlscreenshot.h)
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoascreenshot.h (rev 0)
+++ branches/fusegl/fuse/ui/cocoa/cocoascreenshot.h 2006-12-24 13:35:50 UTC (rev 262)
@@ -0,0 +1,30 @@
+/* cocoascreenshot.h: Routines for saving .png etc. screenshots
+ Copyright (c) 2006 Fredrick Meunier
+
+ This program is free software; you can redistri...
[truncated message content] |
|
From: <fr...@us...> - 2006-12-26 06:31:13
|
Revision: 265
http://svn.sourceforge.net/fuse-for-macosx/?rev=265&view=rev
Author: fredm
Date: 2006-12-25 22:31:11 -0800 (Mon, 25 Dec 2006)
Log Message:
-----------
* Restore mouse support
* Enforce standard aspect ratio when window is resized
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/controllers/FuseController.h
branches/fusegl/fuse/fusepb/controllers/FuseController.m
branches/fusegl/fuse/fusepb/main.mm
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/info.nib
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/ui/cocoa/cocoaui.h
branches/fusegl/fuse/ui/cocoa/cocoaui.m
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2006-12-25 04:27:24 UTC (rev 264)
+++ branches/fusegl/fuse/TODO 2006-12-26 06:31:11 UTC (rev 265)
@@ -7,11 +7,15 @@
X Add native keyboard processing (removes SDL keyboard input dependency from
Fuse)
X Add native CoreAudio sound processing (removes SDL sound dependency from Fuse)
-* Fix menus, preferences etc.
-* Fix scalers
+X Fix menus, preferences etc.
+X Add native mouse processing (removes SDL mouse input dependency from Fuse)
+X Make it possible to constrain Speccy image to "correct" aspect ratio
* Add native joystick processing (removes SDL joystick input dependency from
Fuse)
-* Add native mouse processing (removes SDL mouse input dependency from Fuse)
* Restore fullscreen support
+* Fix scalers
+* Use sheets rather than modal dialogs
+* Run emulation in seperate thread to avoid sound glitches when menus are
+ selected
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.h
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.h 2006-12-25 04:27:24 UTC (rev 264)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.h 2006-12-26 06:31:11 UTC (rev 265)
@@ -161,4 +161,6 @@
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename;
+- (void)setAcceptsMouseMovedEvents:(BOOL)flag;
+
@end
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.m 2006-12-25 04:27:24 UTC (rev 264)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.m 2006-12-26 06:31:11 UTC (rev 265)
@@ -1406,6 +1406,11 @@
return YES;
}
+- (void)setAcceptsMouseMovedEvents:(BOOL)flag
+{
+ [window setAcceptsMouseMovedEvents:flag];
+}
+
@end
static char*
Modified: branches/fusegl/fuse/fusepb/main.mm
===================================================================
--- branches/fusegl/fuse/fusepb/main.mm 2006-12-25 04:27:24 UTC (rev 264)
+++ branches/fusegl/fuse/fusepb/main.mm 2006-12-26 06:31:11 UTC (rev 265)
@@ -45,14 +45,6 @@
int error = settings_defaults( &settings_current );
if( error ) return error;
-#if 0
- // FIXME: Do all the stuff that SDLMain.mm used
- // to do command line wise, drag-n-drop etc. here?
- if( fuse_init( argc, argv ) ) {
- fprintf( stderr, "%s: error initialising -- giving up!\n", fuse_progname );
- return 1;
- }
-#endif
/* This is passed if we are launched by double-clicking */
if ( argc >= 2 && strncmp( argv[1], "-psn", 4 ) == 0 ) {
Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/info.nib
===================================================================
--- branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/info.nib 2006-12-25 04:27:24 UTC (rev 264)
+++ branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/info.nib 2006-12-26 06:31:11 UTC (rev 265)
@@ -13,8 +13,8 @@
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
+ <integer>877</integer>
<integer>29</integer>
- <integer>877</integer>
</array>
<key>IBSystem Version</key>
<string>8L2127</string>
Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
===================================================================
(Binary files differ)
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2006-12-25 04:27:24 UTC (rev 264)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2006-12-26 06:31:11 UTC (rev 265)
@@ -66,6 +66,14 @@
-(id) initWithFrame:(NSRect)frameRect;
-(void) awakeFromNib;
+-(void) mouseMoved:(NSEvent *)theEvent;
+-(void) mouseDown:(NSEvent *)theEvent;
+-(void) mouseUp:(NSEvent *)theEvent;
+-(void) rightMouseDown:(NSEvent *)theEvent;
+-(void) rightMouseUp:(NSEvent *)theEvent;
+-(void) otherMouseDown:(NSEvent *)theEvent;
+-(void) otherMouseUp:(NSEvent *)theEvent;
+
-(void) initKeyboard;
-(void) modifierChange:(input_event_type)theType oldState:(BOOL)old newState:(BOOL)new;
-(void) flagsChanged:(NSEvent *)theEvent;
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-25 04:27:24 UTC (rev 264)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2006-12-26 06:31:11 UTC (rev 265)
@@ -140,9 +140,9 @@
-(void) awakeFromNib
{
- /* FIXME: Do all the stuff that SDLMain.mm used
- * to do command line wise, drag-n-drop etc. here?
- */
+ /* keep the window in the standard aspect ratio if the user resizes */
+ [[self window] setContentAspectRatio:NSMakeSize(4.0,3.0)];
+
/* FIXME: Don't really like the argc, argv stuff being here... */
if( fuse_init( ac, av ) ) {
fprintf( stderr, "%s: error initialising -- giving up!\n", fuse_progname );
@@ -334,14 +334,52 @@
userInfo:self repeats:true] retain];
}
--(void) mouseDragged:(NSEvent *)theEvent
+-(void) mouseMoved:(NSEvent *)theEvent
{
+ if( ui_mouse_grabbed ) {
+ int dx = [theEvent deltaX];
+ int dy = [theEvent deltaY];
+
+ if( dx < -128 ) dx = -128;
+ else if( dx > 128 ) dx = 128;
+
+ if( dy < -128 ) dy = -128;
+ else if( dy > 128 ) dy = 128;
+
+ ui_mouse_motion( dx, dy );
+ }
}
-(void) mouseDown:(NSEvent *)theEvent
{
+ ui_mouse_button( 1, 1 );
}
+-(void) mouseUp:(NSEvent *)theEvent
+{
+ ui_mouse_button( 1, 0 );
+}
+
+-(void) rightMouseDown:(NSEvent *)theEvent
+{
+ ui_mouse_button( 3, 1 );
+}
+
+-(void) rightMouseUp:(NSEvent *)theEvent
+{
+ ui_mouse_button( 3, 0 );
+}
+
+-(void) otherMouseDown:(NSEvent *)theEvent
+{
+ ui_mouse_button( 2, 1 );
+}
+
+-(void) otherMouseUp:(NSEvent *)theEvent
+{
+ ui_mouse_button( 2, 0 );
+}
+
-(void) initKeyboard
{
keysyms_map_t *ptr3;
@@ -420,6 +458,10 @@
}
fuse_event.type = type;
+ if( unicode_keysym == INPUT_KEY_NONE )
+ fuse_event.types.key.native_key = fuse_keysym;
+ else
+ fuse_event.types.key.native_key = unicode_keysym;
fuse_event.types.key.spectrum_key = fuse_keysym;
input_event( &fuse_event );
Modified: branches/fusegl/fuse/ui/cocoa/cocoaui.h
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoaui.h 2006-12-25 04:27:24 UTC (rev 264)
+++ branches/fusegl/fuse/ui/cocoa/cocoaui.h 2006-12-26 06:31:11 UTC (rev 265)
@@ -24,5 +24,4 @@
*/
-void cocoaui_quit( void );
int cocoaui_confirm( const char *message );
Modified: branches/fusegl/fuse/ui/cocoa/cocoaui.m
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoaui.m 2006-12-25 04:27:24 UTC (rev 264)
+++ branches/fusegl/fuse/ui/cocoa/cocoaui.m 2006-12-26 06:31:11 UTC (rev 265)
@@ -40,10 +40,13 @@
#include "tape.h"
#include "ui/scaler/scaler.h"
+/* Last position of the cursor before we hide it */
+static NSPoint position;
+
int
ui_init( int *argc, char ***argv )
{
- int error;
+ ui_mouse_present = 1;
return 0;
}
@@ -57,8 +60,6 @@
int
ui_end( void )
{
- int error;
-
return 0;
}
@@ -71,12 +72,32 @@
int
ui_mouse_grab( int startup )
{
- return 0;
+ if( startup ) return 0;
+
+ position = [NSEvent mouseLocation];
+
+ [NSCursor hide];
+
+ [[FuseController singleton] setAcceptsMouseMovedEvents:YES];
+
+ return 1;
}
int
-ui_mouse_release( int suspend )
+ui_mouse_release( int suspend GCC_UNUSED )
{
+ [[FuseController singleton] setAcceptsMouseMovedEvents:NO];
+
+ /* This seems to be the only API to put the cursor back where it was when
+ we hid it. The CGSetLocalEventsSuppressionInterval is a magic workaround
+ to prevent the cursor freezing for a couple of seconds following the
+ warp */
+ CGPoint pos; pos.x = position.x; pos.y = position.y;
+ CGSetLocalEventsSuppressionInterval(0.0);
+ CGWarpMouseCursorPosition(pos);
+
+ [NSCursor unhide];
+
return 0;
}
@@ -85,10 +106,6 @@
ui_widgets_reset( void )
{
pokefinder_clear();
+
return 0;
}
-
-void
-cocoaui_quit( void )
-{
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2007-01-01 07:13:02
|
Revision: 273
http://svn.sourceforge.net/fuse-for-macosx/?rev=273&view=rev
Author: fredm
Date: 2006-12-31 23:13:02 -0800 (Sun, 31 Dec 2006)
Log Message:
-----------
Restore fullscreen support.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-01-01 06:54:20 UTC (rev 272)
+++ branches/fusegl/fuse/TODO 2007-01-01 07:13:02 UTC (rev 273)
@@ -10,12 +10,15 @@
X Fix menus, preferences etc.
X Add native mouse processing (removes SDL mouse input dependency from Fuse)
X Make it possible to constrain Speccy image to "correct" aspect ratio
-* Add native joystick processing (removes SDL joystick input dependency from
- Fuse)
-* Restore fullscreen support
+X Restore fullscreen support
* Fix scalers
+* Add support for bilinear etc. OpenGL filters
+* Add option to snap window size to 1x, 2x, 3x
* Use sheets rather than modal dialogs
* Run emulation in seperate thread to avoid sound glitches when menus are
selected
+* Restore activity icons
+* Add native joystick processing (removes SDL joystick input dependency from
+ Fuse)
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib
===================================================================
--- branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2007-01-01 06:54:20 UTC (rev 272)
+++ branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2007-01-01 07:13:02 UTC (rev 273)
@@ -1,6 +1,11 @@
{
IBClasses = (
- {CLASS = DisplayOpenGLView; LANGUAGE = ObjC; SUPERCLASS = NSOpenGLView; },
+ {
+ ACTIONS = {fullscreen = id; };
+ CLASS = DisplayOpenGLView;
+ LANGUAGE = ObjC;
+ SUPERCLASS = NSOpenGLView;
+ },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {
Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
===================================================================
(Binary files differ)
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-01-01 06:54:20 UTC (rev 272)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-01-01 07:13:02 UTC (rev 273)
@@ -53,10 +53,19 @@
input_key unicode_keysym;
CFAbsoluteTime time;
+
+ NSWindow *fullscreenWindow;
+ NSWindow *windowedWindow;
+
+ float target_ratio;
}
+(DisplayOpenGLView *) instance;
+(void) initialize;
+-(IBAction) fullscreen:(id)sender;
+
+-(void) setViewPort:(NSRect)rect;
+
-(void) createTexture:(Cocoa_Texture*)newScreen;
-(void) destroyTexture;
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-01 06:54:20 UTC (rev 272)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-01 07:13:02 UTC (rev 273)
@@ -37,11 +37,9 @@
extern keysyms_map_t unicode_keysyms_map[];
-#include <CoreAudio/AudioHardware.h>
#include "sound/sfifo.h"
extern sfifo_t sound_fifo;
-extern AudioStreamBasicDescription deviceFormat;
@implementation DisplayOpenGLView
@@ -90,12 +88,43 @@
}
+-(IBAction) fullscreen:(id)sender
+{
+ if( settings_current.full_screen == 1 ) { // we need to go back to non-full screen
+ [fullscreenWindow close];
+ [windowedWindow setContentView: self];
+ [windowedWindow makeKeyAndOrderFront: self];
+ [windowedWindow makeFirstResponder: self];
+ settings_current.full_screen = 0;
+ } else { // settings_current.full_screen == 0
+ unsigned int windowStyle;
+ NSRect contentRect;
+
+ windowedWindow = [self window];
+ windowStyle = NSBorderlessWindowMask;
+ contentRect = [[NSScreen mainScreen] frame];
+ fullscreenWindow = [[NSWindow alloc] initWithContentRect:contentRect
+ styleMask: windowStyle
+ backing:NSBackingStoreBuffered
+ defer: NO];
+ if( fullscreenWindow != nil ) {
+ [fullscreenWindow setTitle: @"Fuse"];
+ [fullscreenWindow setReleasedWhenClosed: YES];
+ [fullscreenWindow setContentView: self];
+ [fullscreenWindow makeKeyAndOrderFront:self ];
+ [fullscreenWindow setLevel: NSScreenSaverWindowLevel - 1];
+ [fullscreenWindow makeFirstResponder:self];
+ settings_current.full_screen = 1;
+ }
+ }
+}
+
-(id) initWithFrame:(NSRect)frameRect
{
/* Init pixel format attribs */
NSOpenGLPixelFormatAttribute attrs[] = {
+ NSOpenGLPFANoRecovery,
NSOpenGLPFAAccelerated,
- NSOpenGLPFANoRecovery,
NSOpenGLPFADoubleBuffer,
0
};
@@ -115,6 +144,8 @@
instance = self;
}
+ [pixFmt release];
+
[[self openGLContext] makeCurrentContext];
timer = nil;
@@ -122,8 +153,8 @@
/* Setup some basic OpenGL stuff */
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
- glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ glColor4f(0.0f, 0.0f, 0.0f, 0.0f);
screenTexInitialised = NO;
@@ -135,6 +166,8 @@
cocoakeyboard_symbol_shift_pressed = 0;
unicode_keysym = INPUT_KEY_NONE;
+ target_ratio = 4.0f/3.0f;
+
return self;
}
@@ -169,6 +202,8 @@
[[self openGLContext] makeCurrentContext];
+ glClear(GL_COLOR_BUFFER_BIT);
+
/* Bind, update and draw new image */
glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 1);
@@ -199,6 +234,22 @@
[[self openGLContext] flushBuffer];
}
+/* want to keep image in the original aspect ratio in the face of window resizing */
+-(void) setViewPort:(NSRect)rect
+{
+ float bounds_ratio = rect.size.width/rect.size.height;
+
+ if( fabs(bounds_ratio - target_ratio) < 0.01f ) {
+ glViewport(0, 0, (int) rect.size.width, (int) rect.size.height);
+ } else if( bounds_ratio > target_ratio ) {
+ int x_offset = (rect.size.width - (rect.size.height * target_ratio))/2.0f;
+ glViewport(x_offset, 0, (int)(rect.size.height*target_ratio), (int) rect.size.height);
+ } else {
+ int y_offset = (rect.size.height - (rect.size.width / target_ratio))/2.0f;
+ glViewport(0, y_offset, (int) rect.size.width, (int) (rect.size.width/target_ratio));
+ }
+}
+
/* moved or resized */
-(void) update
{
@@ -211,11 +262,13 @@
rect = [self bounds];
- glViewport(0, 0, (int) rect.size.width, (int) rect.size.height);
+ [self setViewPort:rect];
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
+ gluOrtho2D(0, rect.size.width, 0, rect.size.height);
+
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@@ -234,7 +287,7 @@
rect = [self bounds];
- glViewport(0, 0, (int) rect.size.width, (int) rect.size.height);
+ [self setViewPort:rect];
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@@ -470,6 +523,17 @@
-(void) keyDown:(NSEvent *)theEvent
{
+ if( settings_current.full_screen ) {
+ unichar c = [[theEvent charactersIgnoringModifiers] characterAtIndex:0];
+ switch (c) {
+ // [Esc] exits fullScreen mode.
+ case 27:
+ [self fullscreen:nil];
+ return;
+ break;
+ }
+ }
+
[self keyChange:theEvent type:INPUT_EVENT_KEYPRESS];
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2007-01-01 12:33:47
|
Revision: 277
http://svn.sourceforge.net/fuse-for-macosx/?rev=277&view=rev
Author: fredm
Date: 2007-01-01 04:33:46 -0800 (Mon, 01 Jan 2007)
Log Message:
-----------
Enable scalers other than hq[23]x.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/display.c
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/ui/cocoa/cocoadisplay.c
branches/fusegl/fuse/ui/cocoa/cocoadisplay.h
branches/fusegl/fuse/ui/scaler/scaler.c
Added Paths:
-----------
branches/fusegl/fuse/fusepb/scaler/scalers32.cpp
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-01-01 07:53:04 UTC (rev 276)
+++ branches/fusegl/fuse/TODO 2007-01-01 12:33:46 UTC (rev 277)
@@ -20,5 +20,6 @@
* Restore activity icons
* Add native joystick processing (removes SDL joystick input dependency from
Fuse)
+* Fix screen updating during fastloading
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/display.c
===================================================================
--- branches/fusegl/fuse/display.c 2007-01-01 07:53:04 UTC (rev 276)
+++ branches/fusegl/fuse/display.c 2007-01-01 12:33:46 UTC (rev 277)
@@ -2,7 +2,7 @@
Copyright (c) 1999-2006 Philip Kendall, Thomas Harte, Witold Filipczyk
and Fredrick Meunier
- $Id: display.c,v 1.52 2006/07/31 13:33:27 fredm Exp $
+ $Id: display.c,v 1.57 2006/09/17 00:56:18 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
@@ -39,8 +39,6 @@
#include "screenshot.h"
#include "settings.h"
#include "spectrum.h"
-#include "tape.h"
-#include "timer.h"
#include "ui/ui.h"
#include "ui/uidisplay.h"
#include "scld.h"
@@ -144,8 +142,6 @@
static int border_changes_last = 0;
static struct border_change_t *border_changes = NULL;
-static timer_type last_frame_time;
-
struct border_change_t *
alloc_change(void)
{
@@ -226,8 +222,6 @@
display_last_border = scld_last_dec.name.hires ?
display_hires_border : display_lores_border;
- error = timer_get_real_time( &last_frame_time ); if( error ) return error;
-
return 0;
}
@@ -733,7 +727,7 @@
display_get_attr( int x, int y,
libspectrum_byte *ink, libspectrum_byte *paper )
{
- display_parse_attr( display_get_attr_byte( x, y ), ink, paper );
+ display_parse_attr( display_get_attr_byte( x, y ), ink, paper );
}
void
@@ -951,32 +945,14 @@
int
display_frame( void )
{
- timer_type current_time;
- float difference;
- int error;
-
- /* Copy all the critical region to display_image[] */
+ /* Copy all the critical region to the display */
copy_critical_region( DISPLAY_WIDTH_COLS, DISPLAY_HEIGHT - 1 );
critical_region_x = critical_region_y = 0;
- error = timer_get_real_time( ¤t_time ); if( error ) return error;
- difference = timer_get_time_difference( ¤t_time, &last_frame_time );
+ update_border();
+ update_dirty_rects();
+ update_ui_screen();
- /* don't bother updating the screen more than 25 times a second if we are
- fastloading a tape, or 50 times a second if we are running at more than 100%
- speed */
- if( ( !( settings_current.fastload && tape_is_playing() ) &&
- ( settings_current.emulation_speed == 100 || difference >= (1.0/50.0) ) ) ||
- ( settings_current.fastload && tape_is_playing() &&
- difference >= (1.0/25.0) ) ) {
-
- update_border();
- update_dirty_rects();
- update_ui_screen();
- last_frame_time = current_time;
-
- }
-
if( screenshot_movie_record == 1 ) {
snprintf( screenshot_movie_name, SCREENSHOT_MOVIE_FILE_MAX,
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-01-01 07:53:04 UTC (rev 276)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-01-01 12:33:46 UTC (rev 277)
@@ -78,8 +78,6 @@
B61F45E109121DF100C8096C /* machines.h in Headers */ = {isa = PBXBuildFile; fileRef = B6AD8FEC06221FD500C70D75 /* machines.h */; };
B61F45E209121DF100C8096C /* simpleide.h in Headers */ = {isa = PBXBuildFile; fileRef = B6AD90560622B59200C70D75 /* simpleide.h */; };
B61F45E309121DF100C8096C /* if2.h in Headers */ = {isa = PBXBuildFile; fileRef = B621A11F062E92FB00F63DBC /* if2.h */; };
- B61F45E409121DF100C8096C /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = B6C8696A06561155003000A6 /* hq2x.h */; };
- B61F45E509121DF100C8096C /* hq3x.h in Headers */ = {isa = PBXBuildFile; fileRef = B6C8696B06561155003000A6 /* hq3x.h */; };
B61F45E609121DF100C8096C /* intern.h in Headers */ = {isa = PBXBuildFile; fileRef = B6C86978065611B3003000A6 /* intern.h */; };
B61F45E709121DF100C8096C /* zxatasp.h in Headers */ = {isa = PBXBuildFile; fileRef = B601847A065A586900B0BE59 /* zxatasp.h */; };
B61F45E809121DF100C8096C /* zxcf.h in Headers */ = {isa = PBXBuildFile; fileRef = B601847C065A586900B0BE59 /* zxcf.h */; };
@@ -208,9 +206,6 @@
B61F467009121DF100C8096C /* PokeFinderController.m in Sources */ = {isa = PBXBuildFile; fileRef = B62F3BCF059F5BF300A7009A /* PokeFinderController.m */; };
B61F467209121DF100C8096C /* MemoryBrowserController.m in Sources */ = {isa = PBXBuildFile; fileRef = B6D2989205B061CB00C2AA14 /* MemoryBrowserController.m */; };
B61F467309121DF100C8096C /* periph.c in Sources */ = {isa = PBXBuildFile; fileRef = B6C57E0005ECA05B0056F1D0 /* periph.c */; };
- B61F467509121DF100C8096C /* scalers16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6C57E3F05ECC9260056F1D0 /* scalers16.cpp */; };
- B61F467609121DF100C8096C /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B65163AB05F4A11E001903BE /* hq2x.cpp */; };
- B61F467709121DF100C8096C /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B61EF5B905FED7930081DF70 /* hq3x.cpp */; };
B61F467809121DF100C8096C /* fuse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6CD0B9E06069F4A00847338 /* fuse.cpp */; };
B61F467909121DF100C8096C /* breakpoint.c in Sources */ = {isa = PBXBuildFile; fileRef = B66050EC0606AAF500247454 /* breakpoint.c */; };
B61F467A09121DF100C8096C /* scorpion.c in Sources */ = {isa = PBXBuildFile; fileRef = B66050F80606AB0B00247454 /* scorpion.c */; };
@@ -263,6 +258,7 @@
B650987109366CA2003AF1BF /* szx.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650987009366CA2003AF1BF /* szx.icns */; };
B6825549091817F30014B5EE /* divide.c in Sources */ = {isa = PBXBuildFile; fileRef = B6825547091817F30014B5EE /* divide.c */; };
B682554A091817F30014B5EE /* divide.h in Headers */ = {isa = PBXBuildFile; fileRef = B6825548091817F30014B5EE /* divide.h */; };
+ B6A24DF80B490F2100AD5B9D /* scalers32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6A24DF70B490F2100AD5B9D /* scalers32.cpp */; };
B6A6F0960B3C108C000B88E9 /* coreaudiosound.c in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */; };
B6A6F0DA0B3D141B000B88E9 /* cocoaui.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F0D90B3D141B000B88E9 /* cocoaui.m */; };
B6A6F0EE0B3D5F9E000B88E9 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6A6F0ED0B3D5F9E000B88E9 /* CoreAudio.framework */; };
@@ -360,7 +356,6 @@
B615BFE50B4261E50082D535 /* HIDJoysticks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = HIDJoysticks.h; path = content_arrays/HIDJoysticks.h; sourceTree = "<group>"; };
B615BFE60B4261E50082D535 /* HIDJoysticks.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = HIDJoysticks.m; path = content_arrays/HIDJoysticks.m; sourceTree = "<group>"; };
B619FC2E090D9BC200344F94 /* SavePanelAccessoryView.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = SavePanelAccessoryView.nib; path = nibs/SavePanelAccessoryView.nib; sourceTree = "<group>"; };
- B61EF5B905FED7930081DF70 /* hq3x.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = hq3x.cpp; path = scaler/hq3x.cpp; sourceTree = SOURCE_ROOT; };
B61F46A909121DF100C8096C /* Info-Fuse.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Info-Fuse.plist"; sourceTree = "<group>"; };
B61F46AA09121DF200C8096C /* Fuse.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Fuse.app; sourceTree = BUILT_PRODUCTS_DIR; };
B6202BD105BD43D800A1EA8F /* libbz2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = libbz2.framework; path = ../../bzip2/build/Deployment/libbz2.framework; sourceTree = SOURCE_ROOT; };
@@ -415,7 +410,6 @@
B650C40A0765988200DE7E81 /* tape_scorpion.szx */ = {isa = PBXFileReference; lastKnownFileType = file; name = tape_scorpion.szx; path = ../lib/compressed/tape_scorpion.szx; sourceTree = SOURCE_ROOT; };
B650F73E07E7CD3F00E4F3AF /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PreferencesController.h; path = controllers/PreferencesController.h; sourceTree = SOURCE_ROOT; };
B650F73F07E7CD3F00E4F3AF /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PreferencesController.m; path = controllers/PreferencesController.m; sourceTree = SOURCE_ROOT; };
- B65163AB05F4A11E001903BE /* hq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = hq2x.cpp; path = scaler/hq2x.cpp; sourceTree = SOURCE_ROOT; };
B65E4C600445DB7D00A864FD /* dck.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dck.c; path = ../dck.c; sourceTree = SOURCE_ROOT; };
B65E4C610445DB7D00A864FD /* dck.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dck.h; path = ../dck.h; sourceTree = SOURCE_ROOT; };
B66050EC0606AAF500247454 /* breakpoint.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = breakpoint.c; path = ../debugger/breakpoint.c; sourceTree = SOURCE_ROOT; };
@@ -456,6 +450,7 @@
B68CB2C503DD920300A804BA /* debugger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = debugger.h; path = ../debugger/debugger.h; sourceTree = "<group>"; };
B68CB2C603DD920300A804BA /* disassemble.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = disassemble.c; path = ../debugger/disassemble.c; sourceTree = "<group>"; };
B68CB2CC03DD923C00A804BA /* memory.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = memory.c; sourceTree = "<group>"; };
+ B6A24DF70B490F2100AD5B9D /* scalers32.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = scalers32.cpp; path = scaler/scalers32.cpp; sourceTree = SOURCE_ROOT; };
B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = coreaudiosound.c; path = sound/coreaudiosound.c; sourceTree = "<group>"; };
B6A6F0D90B3D141B000B88E9 /* cocoaui.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoaui.m; sourceTree = "<group>"; };
B6A6F0ED0B3D5F9E000B88E9 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = ../../../../../../../../System/Library/Frameworks/CoreAudio.framework; sourceTree = "<group>"; };
@@ -485,12 +480,9 @@
B6C3479F044B091100E1BBA7 /* ts2068.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ts2068.png; path = resources/ts2068.png; sourceTree = SOURCE_ROOT; };
B6C57E0005ECA05B0056F1D0 /* periph.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = periph.c; path = ../periph.c; sourceTree = SOURCE_ROOT; };
B6C57E0105ECA05B0056F1D0 /* periph.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = periph.h; path = ../periph.h; sourceTree = SOURCE_ROOT; };
- B6C57E3F05ECC9260056F1D0 /* scalers16.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = scalers16.cpp; path = scaler/scalers16.cpp; sourceTree = SOURCE_ROOT; };
B6C691B704C20A42005EE041 /* joystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = joystick.c; path = ../joystick.c; sourceTree = SOURCE_ROOT; };
B6C740D90810BB0500AB170C /* Joysticks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Joysticks.h; path = content_arrays/Joysticks.h; sourceTree = SOURCE_ROOT; };
B6C740DA0810BB0500AB170C /* Joysticks.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = Joysticks.m; path = content_arrays/Joysticks.m; sourceTree = SOURCE_ROOT; };
- B6C8696A06561155003000A6 /* hq2x.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hq2x.h; path = scaler/hq2x.h; sourceTree = SOURCE_ROOT; };
- B6C8696B06561155003000A6 /* hq3x.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hq3x.h; path = scaler/hq3x.h; sourceTree = SOURCE_ROOT; };
B6C86978065611B3003000A6 /* intern.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = intern.h; path = scaler/intern.h; sourceTree = SOURCE_ROOT; };
B6C8B723076D2B1A0007B7B5 /* if1.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = if1.c; path = ../if1.c; sourceTree = SOURCE_ROOT; };
B6C8B724076D2B1A0007B7B5 /* if1.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = if1.h; path = ../if1.h; sourceTree = SOURCE_ROOT; };
@@ -961,15 +953,11 @@
F541FB5C03B0B31601FF8235 /* scaler */ = {
isa = PBXGroup;
children = (
- B65163AB05F4A11E001903BE /* hq2x.cpp */,
- B6C8696A06561155003000A6 /* hq2x.h */,
- B61EF5B905FED7930081DF70 /* hq3x.cpp */,
- B6C8696B06561155003000A6 /* hq3x.h */,
B6C86978065611B3003000A6 /* intern.h */,
B63ABD8D042F175200A864FD /* scaler.c */,
F541FB5E03B0B33401FF8235 /* scaler.h */,
B60A6A3A042BEECE00D41533 /* scaler_internals.h */,
- B6C57E3F05ECC9260056F1D0 /* scalers16.cpp */,
+ B6A24DF70B490F2100AD5B9D /* scalers32.cpp */,
);
path = scaler;
sourceTree = "<group>";
@@ -1195,8 +1183,6 @@
B61F45E109121DF100C8096C /* machines.h in Headers */,
B61F45E209121DF100C8096C /* simpleide.h in Headers */,
B61F45E309121DF100C8096C /* if2.h in Headers */,
- B61F45E409121DF100C8096C /* hq2x.h in Headers */,
- B61F45E509121DF100C8096C /* hq3x.h in Headers */,
B61F45E609121DF100C8096C /* intern.h in Headers */,
B61F45E709121DF100C8096C /* zxatasp.h in Headers */,
B61F45E809121DF100C8096C /* zxcf.h in Headers */,
@@ -1419,9 +1405,6 @@
B61F467009121DF100C8096C /* PokeFinderController.m in Sources */,
B61F467209121DF100C8096C /* MemoryBrowserController.m in Sources */,
B61F467309121DF100C8096C /* periph.c in Sources */,
- B61F467509121DF100C8096C /* scalers16.cpp in Sources */,
- B61F467609121DF100C8096C /* hq2x.cpp in Sources */,
- B61F467709121DF100C8096C /* hq3x.cpp in Sources */,
B61F467809121DF100C8096C /* fuse.cpp in Sources */,
B61F467909121DF100C8096C /* breakpoint.c in Sources */,
B61F467A09121DF100C8096C /* scorpion.c in Sources */,
@@ -1464,6 +1447,7 @@
B6A6F10E0B3D6360000B88E9 /* cocoaerror.m in Sources */,
B6A6F1200B3EA737000B88E9 /* cocoascreenshot.m in Sources */,
B615BFE80B4261E50082D535 /* HIDJoysticks.m in Sources */,
+ B6A24DF80B490F2100AD5B9D /* scalers32.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Copied: branches/fusegl/fuse/fusepb/scaler/scalers32.cpp (from rev 271, branches/fusegl/fuse/fusepb/scaler/scalers16.cpp)
===================================================================
--- branches/fusegl/fuse/fusepb/scaler/scalers32.cpp (rev 0)
+++ branches/fusegl/fuse/fusepb/scaler/scalers32.cpp 2007-01-01 12:33:46 UTC (rev 277)
@@ -0,0 +1,28 @@
+/* scalers.cpp: the actual graphics scalers
+ * Copyright (C) 2003 Fredrick Meunier, Philip Kendall
+ *
+ * $Id: scalers16.cpp,v 1.1 2004/05/17 14:42:14 fred Exp $
+ *
+ * Originally taken from ScummVM - Scumm Interpreter
+ * Copyright (C) 2001 Ludvig Strigeus
+ * Copyright (C) 2001/2002 The ScummVM project
+ *
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#define SCALER_DATA_SIZE 4
+
+#include "ui/scaler/scalers.cpp"
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-01 07:53:04 UTC (rev 276)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-01 12:33:46 UTC (rev 277)
@@ -113,8 +113,8 @@
timer = nil;
/* Setup some basic OpenGL stuff */
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
+ glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glColor4f(0.0f, 0.0f, 0.0f, 0.0f);
@@ -160,38 +160,35 @@
if( NO == screenTexInitialised ) return;
/* Need to draw texture to screen here */
- memcpy(screenTex.pixels, screen.pixels, screenTex.pitch*screenTex.full_height);
+ memcpy( screenTex.pixels, screen->pixels, screenTex.pitch * screenTex.full_height );
[[self openGLContext] makeCurrentContext];
- glClear(GL_COLOR_BUFFER_BIT);
+ glClear( GL_COLOR_BUFFER_BIT );
/* Bind, update and draw new image */
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 1);
+ glBindTexture( GL_TEXTURE_RECTANGLE_EXT, 1 );
- glTexSubImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, screenTex.full_width,
- screenTex.full_height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
- screenTex.pixels);
+ glTexSubImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, screenTex.full_width,
+ screenTex.full_height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ screenTex.pixels );
- glBegin(GL_QUADS);
+ glBegin( GL_QUADS );
- glTexCoord2f((float)screenTex.image_width, (float)(screenTex.image_xoffset));
- glVertex2f(1.0f, 1.0f);
+ glTexCoord2f( (float)screenTex.image_width, (float)(screenTex.image_xoffset) );
+ glVertex2f( 1.0f, 1.0f );
- glTexCoord2f((float)screenTex.image_width, (float)screenTex.image_height);
- glVertex2f(1.0f, -1.0f);
+ glTexCoord2f( (float)screenTex.image_width, (float)screenTex.image_height );
+ glVertex2f( 1.0f, -1.0f );
- glTexCoord2f((float)screenTex.image_xoffset, (float)screenTex.image_height);
- glVertex2f(-1.0f, -1.0f);
+ glTexCoord2f( (float)screenTex.image_xoffset, (float)screenTex.image_height );
+ glVertex2f( -1.0f, -1.0f );
- glTexCoord2f((float)screenTex.image_xoffset, (float)screenTex.image_yoffset);
- glVertex2f(-1.0f, 1.0f);
+ glTexCoord2f( (float)screenTex.image_xoffset, (float)screenTex.image_yoffset );
+ glVertex2f( -1.0f, 1.0f );
glEnd();
- /* FIXME: Probably still need to glFlush() in fullscreen mode */
- //glFlush();
-
/* Swap buffer to screen */
[[self openGLContext] flushBuffer];
}
@@ -201,14 +198,14 @@
{
float bounds_ratio = rect.size.width/rect.size.height;
- if( fabs(bounds_ratio - target_ratio) < 0.01f ) {
- glViewport(0, 0, (int) rect.size.width, (int) rect.size.height);
+ if( fabs( bounds_ratio - target_ratio ) < 0.01f ) {
+ glViewport( 0, 0, (int) rect.size.width, (int) rect.size.height );
} else if( bounds_ratio > target_ratio ) {
- int x_offset = (rect.size.width - (rect.size.height * target_ratio))/2.0f;
- glViewport(x_offset, 0, (int)(rect.size.height*target_ratio), (int) rect.size.height);
+ int x_offset = ( rect.size.width - ( rect.size.height * target_ratio ) ) / 2.0f;
+ glViewport( x_offset, 0, (int)(rect.size.height*target_ratio), (int) rect.size.height );
} else {
- int y_offset = (rect.size.height - (rect.size.width / target_ratio))/2.0f;
- glViewport(0, y_offset, (int) rect.size.width, (int) (rect.size.width/target_ratio));
+ int y_offset = ( rect.size.height - ( rect.size.width / target_ratio ) ) / 2.0f;
+ glViewport( 0, y_offset, (int) rect.size.width, (int) ( rect.size.width / target_ratio ) );
}
}
@@ -226,15 +223,15 @@
[self setViewPort:rect];
- glMatrixMode(GL_PROJECTION);
+ glMatrixMode( GL_PROJECTION );
glLoadIdentity();
- gluOrtho2D(0, rect.size.width, 0, rect.size.height);
+ gluOrtho2D( 0, rect.size.width, 0, rect.size.height );
- glMatrixMode(GL_MODELVIEW);
+ glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
- [self setNeedsDisplay:true];
+ [self setNeedsDisplay:YES];
}
/* scrolled, moved or resized */
@@ -251,13 +248,13 @@
[self setViewPort:rect];
- glMatrixMode(GL_PROJECTION);
+ glMatrixMode( GL_PROJECTION );
glLoadIdentity();
- glMatrixMode(GL_MODELVIEW);
+ glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
- [self setNeedsDisplay:true];
+ [self setNeedsDisplay:YES];
}
-(void) destroyTexture
@@ -283,7 +280,7 @@
screenTex.image_height = newScreen->image_height;
screenTex.image_xoffset = newScreen->image_xoffset;
screenTex.image_yoffset = newScreen->image_yoffset;
- screenTex.pixels = calloc(screenTex.full_width*screenTex.full_height, sizeof(uint32_t));
+ screenTex.pixels = calloc( screenTex.full_width * screenTex.full_height, sizeof(uint32_t) );
if( !screenTex.pixels ) {
fprintf( stderr, "%s: couldn't create screenTex.pixels\n", fuse_progname );
return;
@@ -296,22 +293,23 @@
/* FIXME: May want to have a double buffered texture later */
for(i = 0; i < 1; i++)
{
- glDisable(GL_TEXTURE_2D);
- glEnable(GL_TEXTURE_RECTANGLE_EXT);
- glBindTexture(GL_TEXTURE_RECTANGLE_EXT, i+1);
+ glDisable( GL_TEXTURE_2D );
+ glEnable( GL_TEXTURE_RECTANGLE_EXT );
+ glBindTexture( GL_TEXTURE_RECTANGLE_EXT, i+1 );
- glTextureRangeAPPLE(GL_TEXTURE_RECTANGLE_EXT,
- screenTex.full_width*screenTex.pitch,
- screenTex.pixels );
+ glTextureRangeAPPLE( GL_TEXTURE_RECTANGLE_EXT,
+ screenTex.full_width * screenTex.pitch,
+ screenTex.pixels );
- glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_STORAGE_HINT_APPLE,
- GL_STORAGE_CACHED_APPLE);
- glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE );
- glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_STORAGE_HINT_APPLE,
+ GL_STORAGE_CACHED_APPLE );
+ glPixelStorei( GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE );
+ /* FIXME: Want GL_NEAREST for exact pixel ratios, GL_LINEAR otherwise */
+ glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
+ glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+ glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
glTexImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, screenTex.full_width,
screenTex.full_height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
Modified: branches/fusegl/fuse/ui/cocoa/cocoadisplay.c
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoadisplay.c 2007-01-01 07:53:04 UTC (rev 276)
+++ branches/fusegl/fuse/ui/cocoa/cocoadisplay.c 2007-01-01 12:33:46 UTC (rev 277)
@@ -50,12 +50,18 @@
#include "ui/uidisplay.h"
#include "utils.h"
+/* The current size of the display (in units of DISPLAY_SCREEN_*) */
+static float display_current_size = 1.0f;
+
static int image_width;
static int image_height;
/* Screen texture */
-Cocoa_Texture screen;
+Cocoa_Texture* screen = NULL;
+Cocoa_Texture unscaled_screen;
+Cocoa_Texture scaled_screen;
+
static uint32_t colour_values[] = {
/* AARRGGBB */
0x00000000,
@@ -94,8 +100,10 @@
scaler_register( SCALER_ADVMAME2X );
scaler_register( SCALER_ADVMAME3X );
scaler_register( SCALER_DOTMATRIX );
+#if 0
scaler_register( SCALER_HQ2X );
scaler_register( SCALER_HQ3X );
+#endif
}
if( scaler_is_supported( current_scaler ) ) {
@@ -106,27 +114,51 @@
}
static int
-cocoadisplay_load_gfx_mode( void )
+cocoadisplay_allocate_screen( Cocoa_Texture* screen, int height, int width,
+ float scaling_factor )
{
- screen.image_width = image_width;
- screen.image_height = image_height;
+ screen->image_width = image_width * display_current_size;
+ screen->image_height = image_height * display_current_size;
/* Need some extra bytes around when using 2xSaI */
- screen.full_width = image_width+3;
- screen.image_xoffset = 1;
- screen.full_height = image_height+3;
- screen.image_yoffset = 1;
+ screen->full_width = screen->image_width+3;
+ screen->image_xoffset = 1;
+ screen->full_height = screen->image_height+3;
+ screen->image_yoffset = 1;
- screen.pixels = calloc(screen.full_width*screen.full_height, sizeof(uint32_t));
- if( !screen.pixels ) {
+ screen->pixels = calloc( screen->full_width*screen->full_height, sizeof(uint32_t) );
+ if( !screen->pixels ) {
fprintf( stderr, "%s: couldn't create screen.pixels\n", fuse_progname );
return 1;
}
- screen.pitch = screen.full_width * sizeof(uint32_t);
+ screen->pitch = screen->full_width * sizeof(uint32_t);
+ return 0;
+}
+
+static int
+cocoadisplay_load_gfx_mode( void )
+{
+ int error;
+
+ display_current_size = scaler_get_scaling_factor( current_scaler );
+
+ error = cocoadisplay_allocate_screen( &unscaled_screen, image_height, image_width, 1.0f );
+ if( error ) return error;
+
+ screen = &unscaled_screen;
+
+ if( current_scaler != SCALER_NORMAL ) {
+ error = cocoadisplay_allocate_screen( &scaled_screen, image_height,
+ image_width, display_current_size );
+ if( error ) return error;
+
+ screen = &scaled_screen;
+ }
+
/* Create OpenGL textures for the image in DisplayOpenGLView */
- CreateTexture(&screen);
+ CreateTexture( screen );
/* Redraw the entire screen... */
display_refresh_all();
@@ -159,7 +191,7 @@
uidisplay_init( int width, int height )
{
int error;
- error = cocoadisplay_allocate_colours( sizeof(colour_values)/sizeof(uint32_t),
+ error = cocoadisplay_allocate_colours( sizeof(colour_values) / sizeof(uint32_t),
colour_values, bw_values );
scaler_select_scaler( SCALER_NORMAL );
@@ -169,6 +201,9 @@
init_scalers();
+ if ( scaler_select_scaler( current_scaler ) )
+ scaler_select_scaler( SCALER_NORMAL );
+
cocoadisplay_load_gfx_mode();
/* We can now output error messages to our output device */
@@ -183,9 +218,9 @@
fuse_emulation_pause();
/* Free the old surface */
- if( screen.pixels ) {
- free( screen.pixels );
- screen.pixels=NULL;
+ if( unscaled_screen.pixels ) {
+ free( unscaled_screen.pixels );
+ unscaled_screen.pixels=NULL;
}
/* Setup the new GFX mode */
@@ -205,19 +240,19 @@
if( machine_current->timex ) {
x <<= 1; y <<= 1;
- dest_base = dest = (uint32_t*)( (uint8_t*)screen.pixels +
- (x+screen.image_xoffset) * sizeof(uint32_t) +
- (y+screen.image_yoffset) * screen.pitch);
+ dest_base = dest = (uint32_t*)( (uint8_t*)unscaled_screen.pixels +
+ (x+unscaled_screen.image_xoffset) * sizeof(uint32_t) +
+ (y+unscaled_screen.image_yoffset) * unscaled_screen.pitch );
*(dest++) = palette_colour;
*(dest++) = palette_colour;
- dest = (uint32_t*)( (uint8_t*)dest_base + screen.pitch );
+ dest = (uint32_t*)( (uint8_t*)dest_base + unscaled_screen.pitch );
*(dest++) = palette_colour;
*(dest++) = palette_colour;
} else {
- dest = (uint32_t*)( (uint8_t*)screen.pixels +
- (x+screen.image_xoffset) * sizeof(uint32_t) +
- (y+screen.image_yoffset) * screen.pitch );
+ dest = (uint32_t*)( (uint8_t*)unscaled_screen.pixels +
+ (x+unscaled_screen.image_xoffset) * sizeof(uint32_t) +
+ (y+unscaled_screen.image_yoffset) * unscaled_screen.pitch );
*dest = palette_colour;
}
@@ -241,9 +276,9 @@
x <<= 4; y <<= 1;
- dest_base = (uint32_t*)( (uint8_t*)screen.p...
[truncated message content] |
|
From: <fr...@us...> - 2007-01-02 10:11:46
|
Revision: 278
http://svn.sourceforge.net/fuse-for-macosx/?rev=278&view=rev
Author: fredm
Date: 2007-01-02 02:11:45 -0800 (Tue, 02 Jan 2007)
Log Message:
-----------
Switch to using 16 bit textures. Re-enable hq[23]x scalers.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/ui/cocoa/cocoadisplay.c
branches/fusegl/fuse/ui/scaler/scaler.c
Removed Paths:
-------------
branches/fusegl/fuse/fusepb/scaler/scalers32.cpp
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-01-01 12:33:46 UTC (rev 277)
+++ branches/fusegl/fuse/TODO 2007-01-02 10:11:45 UTC (rev 278)
@@ -11,15 +11,18 @@
X Add native mouse processing (removes SDL mouse input dependency from Fuse)
X Make it possible to constrain Speccy image to "correct" aspect ratio
X Restore fullscreen support
-* Fix scalers
+X Fix scalers
* Add support for bilinear etc. OpenGL filters
-* Add option to snap window size to 1x, 2x, 3x
+* Add option to snap window size to 1x, 2x, 3x GL_NEAREST filter
+* Grab mouse in fullscreen mode
* Use sheets rather than modal dialogs
* Run emulation in seperate thread to avoid sound glitches when menus are
- selected
+ selected or window is minimised
* Restore activity icons
* Add native joystick processing (removes SDL joystick input dependency from
Fuse)
* Fix screen updating during fastloading
+* Put in latest hq[23]x filters (HQ2x_555 from ScummVM should do the trick)
+* Make border display optional
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-01-01 12:33:46 UTC (rev 277)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-01-02 10:11:45 UTC (rev 278)
@@ -258,7 +258,11 @@
B650987109366CA2003AF1BF /* szx.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650987009366CA2003AF1BF /* szx.icns */; };
B6825549091817F30014B5EE /* divide.c in Sources */ = {isa = PBXBuildFile; fileRef = B6825547091817F30014B5EE /* divide.c */; };
B682554A091817F30014B5EE /* divide.h in Headers */ = {isa = PBXBuildFile; fileRef = B6825548091817F30014B5EE /* divide.h */; };
- B6A24DF80B490F2100AD5B9D /* scalers32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6A24DF70B490F2100AD5B9D /* scalers32.cpp */; };
+ B6A24E330B49C67D00AD5B9D /* scalers16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6A24E320B49C67D00AD5B9D /* scalers16.cpp */; };
+ B6A24E3B0B49C78700AD5B9D /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6A24E370B49C78700AD5B9D /* hq2x.cpp */; };
+ B6A24E3C0B49C78700AD5B9D /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = B6A24E380B49C78700AD5B9D /* hq2x.h */; };
+ B6A24E3D0B49C78700AD5B9D /* hq3x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6A24E390B49C78700AD5B9D /* hq3x.cpp */; };
+ B6A24E3E0B49C78700AD5B9D /* hq3x.h in Headers */ = {isa = PBXBuildFile; fileRef = B6A24E3A0B49C78700AD5B9D /* hq3x.h */; };
B6A6F0960B3C108C000B88E9 /* coreaudiosound.c in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */; };
B6A6F0DA0B3D141B000B88E9 /* cocoaui.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F0D90B3D141B000B88E9 /* cocoaui.m */; };
B6A6F0EE0B3D5F9E000B88E9 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6A6F0ED0B3D5F9E000B88E9 /* CoreAudio.framework */; };
@@ -450,11 +454,15 @@
B68CB2C503DD920300A804BA /* debugger.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = debugger.h; path = ../debugger/debugger.h; sourceTree = "<group>"; };
B68CB2C603DD920300A804BA /* disassemble.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = disassemble.c; path = ../debugger/disassemble.c; sourceTree = "<group>"; };
B68CB2CC03DD923C00A804BA /* memory.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = memory.c; sourceTree = "<group>"; };
- B6A24DF70B490F2100AD5B9D /* scalers32.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = scalers32.cpp; path = scaler/scalers32.cpp; sourceTree = SOURCE_ROOT; };
+ B6A24E320B49C67D00AD5B9D /* scalers16.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = scalers16.cpp; path = scaler/scalers16.cpp; sourceTree = SOURCE_ROOT; };
+ B6A24E370B49C78700AD5B9D /* hq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = hq2x.cpp; path = scaler/hq2x.cpp; sourceTree = SOURCE_ROOT; };
+ B6A24E380B49C78700AD5B9D /* hq2x.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hq2x.h; path = scaler/hq2x.h; sourceTree = SOURCE_ROOT; };
+ B6A24E390B49C78700AD5B9D /* hq3x.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = hq3x.cpp; path = scaler/hq3x.cpp; sourceTree = SOURCE_ROOT; };
+ B6A24E3A0B49C78700AD5B9D /* hq3x.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hq3x.h; path = scaler/hq3x.h; sourceTree = SOURCE_ROOT; };
B6A6F0950B3C108C000B88E9 /* coreaudiosound.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = coreaudiosound.c; path = sound/coreaudiosound.c; sourceTree = "<group>"; };
B6A6F0D90B3D141B000B88E9 /* cocoaui.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoaui.m; sourceTree = "<group>"; };
- B6A6F0ED0B3D5F9E000B88E9 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = ../../../../../../../../System/Library/Frameworks/CoreAudio.framework; sourceTree = "<group>"; };
- B6A6F0F20B3D602F000B88E9 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = ../../../../../../../../System/Library/Frameworks/AudioUnit.framework; sourceTree = "<group>"; };
+ B6A6F0ED0B3D5F9E000B88E9 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
+ B6A6F0F20B3D602F000B88E9 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
B6A6F10D0B3D6360000B88E9 /* cocoaerror.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoaerror.m; sourceTree = "<group>"; };
B6A6F11D0B3EA737000B88E9 /* cocoascreenshot.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cocoascreenshot.h; sourceTree = "<group>"; };
B6A6F11E0B3EA737000B88E9 /* cocoascreenshot.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoascreenshot.m; sourceTree = "<group>"; };
@@ -953,11 +961,15 @@
F541FB5C03B0B31601FF8235 /* scaler */ = {
isa = PBXGroup;
children = (
+ B6A24E370B49C78700AD5B9D /* hq2x.cpp */,
+ B6A24E380B49C78700AD5B9D /* hq2x.h */,
+ B6A24E390B49C78700AD5B9D /* hq3x.cpp */,
+ B6A24E3A0B49C78700AD5B9D /* hq3x.h */,
B6C86978065611B3003000A6 /* intern.h */,
B63ABD8D042F175200A864FD /* scaler.c */,
F541FB5E03B0B33401FF8235 /* scaler.h */,
B60A6A3A042BEECE00D41533 /* scaler_internals.h */,
- B6A24DF70B490F2100AD5B9D /* scalers32.cpp */,
+ B6A24E320B49C67D00AD5B9D /* scalers16.cpp */,
);
path = scaler;
sourceTree = "<group>";
@@ -1213,6 +1225,8 @@
B6CE7FCD0B28FBD600EB65B3 /* DisplayOpenGLView.h in Headers */,
B6A6F11F0B3EA737000B88E9 /* cocoascreenshot.h in Headers */,
B615BFE70B4261E50082D535 /* HIDJoysticks.h in Headers */,
+ B6A24E3C0B49C78700AD5B9D /* hq2x.h in Headers */,
+ B6A24E3E0B49C78700AD5B9D /* hq3x.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1447,7 +1461,9 @@
B6A6F10E0B3D6360000B88E9 /* cocoaerror.m in Sources */,
B6A6F1200B3EA737000B88E9 /* cocoascreenshot.m in Sources */,
B615BFE80B4261E50082D535 /* HIDJoysticks.m in Sources */,
- B6A24DF80B490F2100AD5B9D /* scalers32.cpp in Sources */,
+ B6A24E330B49C67D00AD5B9D /* scalers16.cpp in Sources */,
+ B6A24E3B0B49C78700AD5B9D /* hq2x.cpp in Sources */,
+ B6A24E3D0B49C78700AD5B9D /* hq3x.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Deleted: branches/fusegl/fuse/fusepb/scaler/scalers32.cpp
===================================================================
--- branches/fusegl/fuse/fusepb/scaler/scalers32.cpp 2007-01-01 12:33:46 UTC (rev 277)
+++ branches/fusegl/fuse/fusepb/scaler/scalers32.cpp 2007-01-02 10:11:45 UTC (rev 278)
@@ -1,28 +0,0 @@
-/* scalers.cpp: the actual graphics scalers
- * Copyright (C) 2003 Fredrick Meunier, Philip Kendall
- *
- * $Id: scalers16.cpp,v 1.1 2004/05/17 14:42:14 fred Exp $
- *
- * Originally taken from ScummVM - Scumm Interpreter
- * Copyright (C) 2001 Ludvig Strigeus
- * Copyright (C) 2001/2002 The ScummVM project
- *
- * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- */
-
-#define SCALER_DATA_SIZE 4
-
-#include "ui/scaler/scalers.cpp"
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-01 12:33:46 UTC (rev 277)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-02 10:11:45 UTC (rev 278)
@@ -170,7 +170,7 @@
glBindTexture( GL_TEXTURE_RECTANGLE_EXT, 1 );
glTexSubImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, screenTex.full_width,
- screenTex.full_height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ screenTex.full_height, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
screenTex.pixels );
glBegin( GL_QUADS );
@@ -280,12 +280,12 @@
screenTex.image_height = newScreen->image_height;
screenTex.image_xoffset = newScreen->image_xoffset;
screenTex.image_yoffset = newScreen->image_yoffset;
- screenTex.pixels = calloc( screenTex.full_width * screenTex.full_height, sizeof(uint32_t) );
+ screenTex.pixels = calloc( screenTex.full_width * screenTex.full_height, sizeof(uint16_t) );
if( !screenTex.pixels ) {
fprintf( stderr, "%s: couldn't create screenTex.pixels\n", fuse_progname );
return;
}
- screenTex.pitch = screenTex.full_width * sizeof(uint32_t);
+ screenTex.pitch = screenTex.full_width * sizeof(uint16_t);
[[self openGLContext] makeCurrentContext];
[[self openGLContext] update];
@@ -312,7 +312,7 @@
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
glTexImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, screenTex.full_width,
- screenTex.full_height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
+ screenTex.full_height, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
screenTex.pixels );
}
screenTexInitialised = YES;
Modified: branches/fusegl/fuse/ui/cocoa/cocoadisplay.c
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoadisplay.c 2007-01-01 12:33:46 UTC (rev 277)
+++ branches/fusegl/fuse/ui/cocoa/cocoadisplay.c 2007-01-02 10:11:45 UTC (rev 278)
@@ -59,30 +59,33 @@
/* Screen texture */
Cocoa_Texture* screen = NULL;
+/* Screen texture in native size */
Cocoa_Texture unscaled_screen;
+
+/* Screen texture after scaling (only if a transforming scaler is in place) */
Cocoa_Texture scaled_screen;
-static uint32_t colour_values[] = {
-/* AARRGGBB */
- 0x00000000,
- 0x000000c0,
- 0x00c00000,
- 0x00c000c0,
- 0x0000c000,
- 0x0000c0c0,
- 0x00c0c000,
- 0x00c0c0c0,
- 0x00000000,
- 0x000000ff,
- 0x00ff0000,
- 0x00ff00ff,
- 0x0000ff00,
- 0x0000ffff,
- 0x00ffff00,
- 0x00ffffff
+/* Colours are in 1A 5R 5G 5B format */
+static uint16_t colour_values[] = {
+ 0x0000,
+ 0x0017,
+ 0x5c00,
+ 0x5c17,
+ 0x02e0,
+ 0x02f7,
+ 0x5ee0,
+ 0x5ef7,
+ 0x0000,
+ 0x001f,
+ 0x7c00,
+ 0x7c1f,
+ 0x03e0,
+ 0x03ff,
+ 0x7fe0,
+ 0x7fff
};
-static uint32_t bw_values[16];
+static uint16_t bw_values[16];
static void
init_scalers( void )
@@ -100,10 +103,8 @@
scaler_register( SCALER_ADVMAME2X );
scaler_register( SCALER_ADVMAME3X );
scaler_register( SCALER_DOTMATRIX );
-#if 0
scaler_register( SCALER_HQ2X );
scaler_register( SCALER_HQ3X );
-#endif
}
if( scaler_is_supported( current_scaler ) ) {
@@ -111,10 +112,12 @@
} else {
scaler_select_scaler( SCALER_NORMAL );
}
+
+ scaler_select_bitformat( 555 );
}
static int
-cocoadisplay_allocate_screen( Cocoa_Texture* screen, int height, int width,
+allocate_screen( Cocoa_Texture* screen, int height, int width,
float scaling_factor )
{
screen->image_width = image_width * display_current_size;
@@ -126,17 +129,26 @@
screen->full_height = screen->image_height+3;
screen->image_yoffset = 1;
- screen->pixels = calloc( screen->full_width*screen->full_height, sizeof(uint32_t) );
+ screen->pixels = calloc( screen->full_width*screen->full_height, sizeof(uint16_t) );
if( !screen->pixels ) {
fprintf( stderr, "%s: couldn't create screen.pixels\n", fuse_progname );
return 1;
}
- screen->pitch = screen->full_width * sizeof(uint32_t);
+ screen->pitch = screen->full_width * sizeof(uint16_t);
return 0;
}
+static void
+free_screen( Cocoa_Texture* screen )
+{
+ if( screen->pixels ) {
+ free( screen->pixels );
+ screen->pixels=NULL;
+ }
+}
+
static int
cocoadisplay_load_gfx_mode( void )
{
@@ -144,14 +156,14 @@
display_current_size = scaler_get_scaling_factor( current_scaler );
- error = cocoadisplay_allocate_screen( &unscaled_screen, image_height, image_width, 1.0f );
+ error = allocate_screen( &unscaled_screen, image_height, image_width, 1.0f );
if( error ) return error;
screen = &unscaled_screen;
if( current_scaler != SCALER_NORMAL ) {
- error = cocoadisplay_allocate_screen( &scaled_screen, image_height,
- image_width, display_current_size );
+ error = allocate_screen( &scaled_screen, image_height, image_width,
+ display_current_size );
if( error ) return error;
screen = &scaled_screen;
@@ -167,21 +179,21 @@
}
static int
-cocoadisplay_allocate_colours( int numColours, uint32_t *colour_values,
- uint32_t *bw_values )
+cocoadisplay_allocate_colours( int numColours, uint16_t *colour_values,
+ uint16_t *bw_values )
{
int i;
uint8_t red, green, blue, grey;
for( i = 0; i < numColours; i++ ) {
- red = (colour_values[i] >> 16) & 0xff;
- green = (colour_values[i] >> 8) & 0xff;
- blue = colour_values[i] & 0xff;
+ red = (colour_values[i] >> 10) & 0x1f;
+ green = (colour_values[i] >> 5) & 0x1f;
+ blue = colour_values[i] & 0x1f;
/* Addition of 0.5 is to avoid rounding errors */
grey = ( 0.299 * red + 0.587 * green + 0.114 * blue ) + 0.5;
- bw_values[i] = (grey << 16) | (grey << 8) | grey;
+ bw_values[i] = (grey << 10) | (grey << 5) | grey;
}
return 0;
@@ -191,11 +203,9 @@
uidisplay_init( int width, int height )
{
int error;
- error = cocoadisplay_allocate_colours( sizeof(colour_values) / sizeof(uint32_t),
+ error = cocoadisplay_allocate_colours( sizeof(colour_values) / sizeof(uint16_t),
colour_values, bw_values );
- scaler_select_scaler( SCALER_NORMAL );
-
image_width = width;
image_height = height;
@@ -217,11 +227,9 @@
{
fuse_emulation_pause();
- /* Free the old surface */
- if( unscaled_screen.pixels ) {
- free( unscaled_screen.pixels );
- unscaled_screen.pixels=NULL;
- }
+ /* Free the old surfaces */
+ free_screen( &unscaled_screen );
+ free_screen( &scaled_screen );
/* Setup the new GFX mode */
cocoadisplay_load_gfx_mode();
@@ -233,25 +241,25 @@
void
uidisplay_putpixel( int x, int y, int colour )
{
- uint32_t *dest_base, *dest;
- uint32_t *palette_values = settings_current.bw_tv ? bw_values : colour_values;
+ uint16_t *dest_base, *dest;
+ uint16_t *palette_values = settings_current.bw_tv ? bw_values : colour_values;
- uint32_t palette_colour = palette_values[ colour ];
+ uint16_t palette_colour = palette_values[ colour ];
if( machine_current->timex ) {
x <<= 1; y <<= 1;
- dest_base = dest = (uint32_t*)( (uint8_t*)unscaled_screen.pixels +
- (x+unscaled_screen.image_xoffset) * sizeof(uint32_t) +
+ dest_base = dest = (uint16_t*)( (uint8_t*)unscaled_screen.pixels +
+ (x+unscaled_screen.image_xoffset) * sizeof(uint16_t) +
(y+unscaled_screen.image_yoffset) * unscaled_screen.pitch );
*(dest++) = palette_colour;
*(dest++) = palette_colour;
- dest = (uint32_t*)( (uint8_t*)dest_base + unscaled_screen.pitch );
+ dest = (uint16_t*)( (uint8_t*)dest_base + unscaled_screen.pitch );
*(dest++) = palette_colour;
*(dest++) = palette_colour;
} else {
- dest = (uint32_t*)( (uint8_t*)unscaled_screen.pixels +
- (x+unscaled_screen.image_xoffset) * sizeof(uint32_t) +
+ dest = (uint16_t*)( (uint8_t*)unscaled_screen.pixels +
+ (x+unscaled_screen.image_xoffset) * sizeof(uint16_t) +
(y+unscaled_screen.image_yoffset) * unscaled_screen.pitch );
*dest = palette_colour;
@@ -264,20 +272,20 @@
uidisplay_plot8( int x, int y, libspectrum_byte data,
libspectrum_byte ink, libspectrum_byte paper )
{
- uint32_t *dest;
- uint32_t *palette_values = settings_current.bw_tv ? bw_values : colour_values;
+ uint16_t *dest;
+ uint16_t *palette_values = settings_current.bw_tv ? bw_values : colour_values;
- uint32_t palette_ink = palette_values[ ink ];
- uint32_t palette_paper = palette_values[ paper ];
+ uint16_t palette_ink = palette_values[ ink ];
+ uint16_t palette_paper = palette_values[ paper ];
if( machine_current->timex ) {
int i;
- uint32_t *dest_base;
+ uint16_t *dest_base;
x <<= 4; y <<= 1;
- dest_base = (uint32_t*)( (uint8_t*)unscaled_screen.pixels +
- (x+unscaled_screen.image_xoffset) * sizeof(uint32_t) +
+ dest_base = (uint16_t*)( (uint8_t*)unscaled_screen.pixels +
+ (x+unscaled_screen.image_xoffset) * sizeof(uint16_t) +
(y+unscaled_screen.image_yoffset) * unscaled_screen.pitch );
for( i=0; i<2; i++ ) {
@@ -300,12 +308,12 @@
*(dest++) = ( data & 0x01 ) ? palette_ink : palette_paper;
*dest = ( data & 0x01 ) ? palette_ink : palette_paper;
- dest_base = (uint32_t*)( (uint8_t*)dest_base + unscaled_screen.pitch );
+ dest_base = (uint16_t*)( (uint8_t*)dest_base + unscaled_screen.pitch );
}
} else {
x <<= 3;
- dest = (uint32_t*)( (uint8_t*)unscaled_screen.pixels +
- (x+unscaled_screen.image_xoffset) * sizeof(uint32_t) +
+ dest = (uint16_t*)( (uint8_t*)unscaled_screen.pixels +
+ (x+unscaled_screen.image_xoffset) * sizeof(uint16_t) +
(y+unscaled_screen.image_yoffset) * unscaled_screen.pitch );
*(dest++) = ( data & 0x80 ) ? palette_ink : palette_paper;
@@ -325,15 +333,15 @@
uidisplay_plot16( int x, int y, libspectrum_word data,
libspectrum_byte ink, libspectrum_byte paper )
{
- uint32_t *dest_base, *dest;
+ uint16_t *dest_base, *dest;
int i;
- uint32_t *palette_values = settings_current.bw_tv ? bw_values : colour_values;
- uint32_t palette_ink = palette_values[ ink ];
- uint32_t palette_paper = palette_values[ paper ];
+ uint16_t *palette_values = settings_current.bw_tv ? bw_values : colour_values;
+ uint16_t palette_ink = palette_values[ ink ];
+ uint16_t palette_paper = palette_values[ paper ];
x <<= 4; y <<= 1;
- dest_base = (uint32_t*)( (uint8_t*)unscaled_screen.pixels + (x+unscaled_screen.image_xoffset) *
- sizeof(uint32_t) + (y+unscaled_screen.image_yoffset) *
+ dest_base = (uint16_t*)( (uint8_t*)unscaled_screen.pixels + (x+unscaled_screen.image_xoffset) *
+ sizeof(uint16_t) + (y+unscaled_screen.image_yoffset) *
unscaled_screen.pitch );
for( i=0; i<2; i++ ) {
@@ -356,7 +364,7 @@
*(dest++) = ( data & 0x0002 ) ? palette_ink : palette_paper;
*dest = ( data & 0x0001 ) ? palette_ink : palette_paper;
- dest_base = (uint32_t*)( (uint8_t*)dest_base + unscaled_screen.pitch );
+ dest_base = (uint16_t*)( (uint8_t*)dest_base + unscaled_screen.pitch );
}
}
@@ -382,9 +390,9 @@
scaled_y = display_current_size * y;
/* Create scaled image */
- scaler_proc32( unscaled_screen.pixels + ( y + 1 ) * unscaled_screen.pitch + sizeof(uint32_t) * ( x + 1 ),
+ scaler_proc16( unscaled_screen.pixels + ( y + 1 ) * unscaled_screen.pitch + sizeof(uint16_t) * ( x + 1 ),
unscaled_screen.pitch,
- scaled_screen.pixels + scaled_y * scaled_screen.pitch + sizeof(uint32_t) * scaled_x,
+ scaled_screen.pixels + scaled_y * scaled_screen.pitch + sizeof(uint16_t) * scaled_x,
scaled_screen.pitch, width, height );
}
@@ -395,15 +403,8 @@
DestroyTexture();
}
- if( unscaled_screen.pixels ) {
- free( unscaled_screen.pixels );
- unscaled_screen.pixels=NULL;
- }
+ free_screen( &unscaled_screen );
+ free_screen( &scaled_screen );
- if( scaled_screen.pixels ) {
- free( scaled_screen.pixels );
- scaled_screen.pixels=NULL;
- }
-
return 0;
}
Modified: branches/fusegl/fuse/ui/scaler/scaler.c
===================================================================
--- branches/fusegl/fuse/ui/scaler/scaler.c 2007-01-01 12:33:46 UTC (rev 277)
+++ branches/fusegl/fuse/ui/scaler/scaler.c 2007-01-02 10:11:45 UTC (rev 278)
@@ -69,39 +69,37 @@
static struct scaler_info available_scalers[] = {
{ "Timex Half (smoothed)", "half", SCALER_FLAGS_NONE, SCALE_FACTOR_HALF,
- NULL, scaler_Half_32, NULL },
+ scaler_Half_16, NULL, NULL },
{ "Timex Half (skipping)", "halfskip", SCALER_FLAGS_NONE, SCALE_FACTOR_HALF,
- NULL, scaler_HalfSkip_32, NULL },
+ scaler_HalfSkip_16, NULL, NULL },
{ "Normal", "normal", SCALER_FLAGS_NONE, SCALE_FACTOR_ONE,
- NULL, scaler_Normal1x_32, NULL },
+ scaler_Normal1x_16, NULL, NULL },
{ "Double size", "2x", SCALER_FLAGS_NONE, SCALE_FACTOR_TWO,
- NULL, scaler_Normal2x_32, NULL },
+ scaler_Normal2x_16, NULL, NULL },
{ "Triple size", "3x", SCALER_FLAGS_NONE, SCALE_FACTOR_THREE,
- NULL, scaler_Normal3x_32, NULL },
+ scaler_Normal3x_16, NULL, NULL },
{ "2xSaI", "2xsai", SCALER_FLAGS_EXPAND, SCALE_FACTOR_TWO,
- NULL, scaler_2xSaI_32, expand_sai },
+ scaler_2xSaI_16, NULL, expand_sai },
{ "Super 2xSaI", "super2xsai", SCALER_FLAGS_EXPAND, SCALE_FACTOR_TWO,
- NULL, scaler_Super2xSaI_32, expand_sai },
+ scaler_Super2xSaI_16, NULL, expand_sai },
{ "SuperEagle", "supereagle", SCALER_FLAGS_EXPAND, SCALE_FACTOR_TWO,
- NULL, scaler_SuperEagle_32, expand_sai },
+ scaler_SuperEagle_16, NULL, expand_sai },
{ "AdvMAME 2x", "advmame2x", SCALER_FLAGS_EXPAND, SCALE_FACTOR_TWO,
- NULL, scaler_AdvMame2x_32, expand_1 },
+ scaler_AdvMame2x_16, NULL, expand_1 },
{ "AdvMAME 3x", "advmame3x", SCALER_FLAGS_EXPAND, SCALE_FACTOR_THREE,
- NULL, scaler_AdvMame3x_32, expand_1 },
+ scaler_AdvMame3x_16, NULL, expand_1 },
{ "TV 2x", "tv2x", SCALER_FLAGS_NONE, SCALE_FACTOR_TWO,
- NULL, scaler_TV2x_32, NULL },
+ scaler_TV2x_16, NULL, NULL },
{ "Timex TV", "timextv", SCALER_FLAGS_NONE, SCALE_FACTOR_ONE,
- NULL, scaler_TimexTV_32, NULL },
+ scaler_TimexTV_16, NULL, NULL },
{ "Dot Matrix", "dotmatrix", SCALER_FLAGS_EXPAND, SCALE_FACTOR_TWO,
- NULL, scaler_DotMatrix_32, expand_dotmatrix },
+ scaler_DotMatrix_16, NULL, expand_dotmatrix },
{ "Timex 1.5x", "timex15x", SCALER_FLAGS_NONE, SCALE_FACTOR_ONE_HALF,
- NULL, scaler_Timex1_5x_32, NULL },
-#if 0
+ scaler_Timex1_5x_16, NULL, NULL },
{ "HQ 2x", "hq2x", SCALER_FLAGS_EXPAND, SCALE_FACTOR_TWO,
scaler_HQ2x_16, NULL, expand_1 },
{ "HQ 3x", "hq3x", SCALER_FLAGS_EXPAND, SCALE_FACTOR_THREE,
scaler_HQ3x_16, NULL, expand_1 },
-#endif
};
scaler_type current_scaler = SCALER_NUM;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2007-01-02 12:58:10
|
Revision: 282
http://svn.sourceforge.net/fuse-for-macosx/?rev=282&view=rev
Author: fredm
Date: 2007-01-02 04:58:11 -0800 (Tue, 02 Jan 2007)
Log Message:
-----------
Add zoom for common screensizes and ratios.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib
branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-01-02 12:44:43 UTC (rev 281)
+++ branches/fusegl/fuse/TODO 2007-01-02 12:58:11 UTC (rev 282)
@@ -13,7 +13,7 @@
X Restore fullscreen support
X Fix scalers
X Add support for bilinear etc. OpenGL filters
-* Add option to snap window size to 1x, 2x, 3x GL_NEAREST filter
+X Add option to snap window size to 1x, 2x, 3x
* Grab mouse in fullscreen mode
* Use sheets rather than modal dialogs
* Run emulation in seperate thread to avoid sound glitches when menus are
Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib
===================================================================
--- branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2007-01-02 12:44:43 UTC (rev 281)
+++ branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/classes.nib 2007-01-02 12:58:11 UTC (rev 282)
@@ -1,7 +1,7 @@
{
IBClasses = (
{
- ACTIONS = {fullscreen = id; };
+ ACTIONS = {fullscreen = id; zoom = id; };
CLASS = DisplayOpenGLView;
LANGUAGE = ObjC;
SUPERCLASS = NSOpenGLView;
Modified: branches/fusegl/fuse/fusepb/nibs/MainMenu.nib/keyedobjects.nib
===================================================================
(Binary files differ)
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-01-02 12:44:43 UTC (rev 281)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-01-02 12:58:11 UTC (rev 282)
@@ -58,6 +58,7 @@
+(DisplayOpenGLView *) instance;
-(IBAction) fullscreen:(id)sender;
+-(IBAction) zoom:(id)sender;
-(void) setViewPort:(NSRect)rect;
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-02 12:44:43 UTC (rev 281)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-02 12:58:11 UTC (rev 282)
@@ -81,6 +81,32 @@
}
}
+-(IBAction) zoom:(id)sender
+{
+ NSSize size;
+
+ switch( [sender tag] ) {
+ case 1: /* 320x240 */
+ size.width = 320;
+ size.height = 240;
+ break;
+ case 2: /* 640x480 */
+ size.width = 640;
+ size.height = 480;
+ break;
+ case 3: /* 960x720 */
+ size.width = 960;
+ size.height = 720;
+ break;
+ case 0:
+ default: /* Actual size */
+ size.width = screenTex.image_width;
+ size.height = screenTex.image_height;
+ }
+
+ [[self window] setContentSize:size];
+}
+
-(id) initWithFrame:(NSRect)frameRect
{
/* Init pixel format attribs */
@@ -226,8 +252,6 @@
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
- gluOrtho2D( 0, rect.size.width, 0, rect.size.height );
-
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2007-01-02 13:11:36
|
Revision: 283
http://svn.sourceforge.net/fuse-for-macosx/?rev=283&view=rev
Author: fredm
Date: 2007-01-02 05:11:37 -0800 (Tue, 02 Jan 2007)
Log Message:
-----------
Grab mouse in fullscreen mode (and release when going back to windowed)
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-01-02 12:58:11 UTC (rev 282)
+++ branches/fusegl/fuse/TODO 2007-01-02 13:11:37 UTC (rev 283)
@@ -14,7 +14,7 @@
X Fix scalers
X Add support for bilinear etc. OpenGL filters
X Add option to snap window size to 1x, 2x, 3x
-* Grab mouse in fullscreen mode
+X Grab mouse in fullscreen mode
* Use sheets rather than modal dialogs
* Run emulation in seperate thread to avoid sound glitches when menus are
selected or window is minimised
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-02 12:58:11 UTC (rev 282)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-02 13:11:37 UTC (rev 283)
@@ -58,6 +58,7 @@
[windowedWindow makeKeyAndOrderFront: self];
[windowedWindow makeFirstResponder: self];
settings_current.full_screen = 0;
+ if( ui_mouse_grabbed ) ui_mouse_grabbed = ui_mouse_release( 0 );
} else { // settings_current.full_screen == 0
unsigned int windowStyle;
NSRect contentRect;
@@ -77,6 +78,7 @@
[fullscreenWindow setLevel: NSScreenSaverWindowLevel - 1];
[fullscreenWindow makeFirstResponder:self];
settings_current.full_screen = 1;
+ if( !ui_mouse_grabbed ) ui_mouse_grabbed = ui_mouse_grab( 0 );
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2007-01-02 12:25:50
|
Revision: 280
http://svn.sourceforge.net/fuse-for-macosx/?rev=280&view=rev
Author: fredm
Date: 2007-01-02 04:25:42 -0800 (Tue, 02 Jan 2007)
Log Message:
-----------
Add support for setting bilinear filtering in preferences, delete obsolete
scalers.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/controllers/PreferencesController.m
branches/fusegl/fuse/fusepb/nibs/Preferences.nib/keyedobjects.nib
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/settings.dat
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-01-02 12:20:15 UTC (rev 279)
+++ branches/fusegl/fuse/TODO 2007-01-02 12:25:42 UTC (rev 280)
@@ -12,7 +12,7 @@
X Make it possible to constrain Speccy image to "correct" aspect ratio
X Restore fullscreen support
X Fix scalers
-* Add support for bilinear etc. OpenGL filters
+X Add support for bilinear etc. OpenGL filters
* Add option to snap window size to 1x, 2x, 3x GL_NEAREST filter
* Grab mouse in fullscreen mode
* Use sheets rather than modal dialogs
@@ -24,5 +24,6 @@
* Fix screen updating during fastloading
* Put in latest hq[23]x filters (HQ2x_555 from ScummVM should do the trick)
* Make border display optional
+* Quit keyhandling when command key is pressed
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/fusepb/controllers/PreferencesController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/PreferencesController.m 2007-01-02 12:20:15 UTC (rev 279)
+++ branches/fusegl/fuse/fusepb/controllers/PreferencesController.m 2007-01-02 12:25:42 UTC (rev 280)
@@ -142,6 +142,8 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
+ int old_bilinear = settings_current.bilinear_filter;
+
/* Values in shared defaults have been updated, pass them onto Fuse */
read_config_file( &settings_current );
@@ -152,8 +154,9 @@
// B&W TV status may have changed
display_refresh_all();
- if( ( current_scaler != scaler_get_type(settings_current.start_scaler_mode) )
- && !scaler_select_id(settings_current.start_scaler_mode) ) {
+ if( ( ( current_scaler != scaler_get_type(settings_current.start_scaler_mode) )
+ && !scaler_select_id(settings_current.start_scaler_mode) ) ||
+ old_bilinear != settings_current.bilinear_filter ) {
uidisplay_hotswap_gfx_mode();
}
Modified: branches/fusegl/fuse/fusepb/nibs/Preferences.nib/keyedobjects.nib
===================================================================
--- branches/fusegl/fuse/fusepb/nibs/Preferences.nib/keyedobjects.nib 2007-01-02 12:20:15 UTC (rev 279)
+++ branches/fusegl/fuse/fusepb/nibs/Preferences.nib/keyedobjects.nib 2007-01-02 12:25:42 UTC (rev 280)
@@ -11,32 +11,32 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>1487</integer>
+ <integer>1502</integer>
</dict>
<key>NSAccessibilityConnectors</key>
<dict>
<key>CF$UID</key>
- <integer>1484</integer>
+ <integer>1499</integer>
</dict>
<key>NSAccessibilityOidsKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1485</integer>
+ <integer>1500</integer>
</dict>
<key>NSAccessibilityOidsValues</key>
<dict>
<key>CF$UID</key>
- <integer>1486</integer>
+ <integer>1501</integer>
</dict>
<key>NSClassesKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1197</integer>
+ <integer>1217</integer>
</dict>
<key>NSClassesValues</key>
<dict>
<key>CF$UID</key>
- <integer>1198</integer>
+ <integer>1218</integer>
</dict>
<key>NSConnections</key>
<dict>
@@ -56,34 +56,34 @@
<key>NSNamesKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1138</integer>
+ <integer>1158</integer>
</dict>
<key>NSNamesValues</key>
<dict>
<key>CF$UID</key>
- <integer>1139</integer>
+ <integer>1159</integer>
</dict>
<key>NSNextOid</key>
- <integer>991</integer>
+ <integer>1058</integer>
<key>NSObjectsKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1131</integer>
+ <integer>1151</integer>
</dict>
<key>NSObjectsValues</key>
<dict>
<key>CF$UID</key>
- <integer>1137</integer>
+ <integer>1157</integer>
</dict>
<key>NSOidsKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1199</integer>
+ <integer>1219</integer>
</dict>
<key>NSOidsValues</key>
<dict>
<key>CF$UID</key>
- <integer>1200</integer>
+ <integer>1220</integer>
</dict>
<key>NSRoot</key>
<dict>
@@ -142,7 +142,7 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>75</integer>
+ <integer>85</integer>
</dict>
<key>NS.objects</key>
<array>
@@ -160,118 +160,110 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>805</integer>
+ <integer>806</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>812</integer>
+ <integer>816</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>813</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
<integer>817</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>820</integer>
+ <integer>821</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>823</integer>
+ <integer>824</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>826</integer>
+ <integer>827</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>829</integer>
+ <integer>830</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>832</integer>
+ <integer>833</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>835</integer>
+ <integer>836</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>838</integer>
+ <integer>839</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>841</integer>
+ <integer>842</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>844</integer>
+ <integer>845</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>847</integer>
+ <integer>848</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>850</integer>
+ <integer>851</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>853</integer>
+ <integer>854</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>856</integer>
+ <integer>857</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>859</integer>
+ <integer>860</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>862</integer>
+ <integer>863</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>865</integer>
+ <integer>866</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>868</integer>
+ <integer>869</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>871</integer>
+ <integer>872</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>874</integer>
+ <integer>875</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>877</integer>
+ <integer>878</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>880</integer>
+ <integer>881</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>888</integer>
+ <integer>884</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>895</integer>
+ <integer>892</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>897</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
<integer>899</integer>
</dict>
<dict>
@@ -280,126 +272,122 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>904</integer>
+ <integer>903</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>906</integer>
+ <integer>905</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>908</integer>
+ <integer>914</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>910</integer>
+ <integer>917</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>912</integer>
+ <integer>921</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>914</integer>
+ <integer>937</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>916</integer>
+ <integer>941</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>918</integer>
+ <integer>945</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>924</integer>
+ <integer>950</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>927</integer>
+ <integer>953</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>928</integer>
+ <integer>956</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>930</integer>
+ <integer>959</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>939</integer>
+ <integer>965</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>942</integer>
+ <integer>968</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>946</integer>
+ <integer>971</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>962</integer>
+ <integer>975</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>966</integer>
+ <integer>977</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>970</integer>
+ <integer>979</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>974</integer>
+ <integer>981</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>977</integer>
+ <integer>983</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>980</integer>
+ <integer>985</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>983</integer>
+ <integer>986</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>989</integer>
+ <integer>987</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>992</integer>
+ <integer>988</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>995</integer>
+ <integer>990</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>999</integer>
+ <integer>993</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1001</integer>
+ <integer>996</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1003</integer>
+ <integer>999</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1005</integer>
+ <integer>1002</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1007</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
<integer>1009</integer>
</dict>
<dict>
@@ -416,18 +404,22 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>1014</integer>
+ <integer>1015</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1017</integer>
+ <integer>1016</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1020</integer>
+ <integer>1019</integer>
</dict>
<dict>
<key>CF$UID</key>
+ <integer>1022</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
<integer>1023</integer>
</dict>
<dict>
@@ -436,31 +428,31 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>1033</integer>
+ <integer>1031</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1034</integer>
+ <integer>1032</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1035</integer>
+ <integer>1033</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1036</integer>
+ <integer>1034</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1039</integer>
+ <integer>1037</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1040</integer>
+ <integer>1038</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1043</integer>
+ <integer>1041</integer>
</dict>
<dict>
<key>CF$UID</key>
@@ -468,59 +460,55 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>1047</integer>
- </dict>
- <dict>
- <key>CF$UID</key>
<integer>1050</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1055</integer>
+ <integer>1056</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1056</integer>
+ <integer>1061</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1057</integer>
+ <integer>1065</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1058</integer>
+ <integer>1069</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1061</integer>
+ <integer>1071</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1062</integer>
+ <integer>1072</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1065</integer>
+ <integer>1075</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1070</integer>
+ <integer>1078</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1074</integer>
+ <integer>1082</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1079</integer>
+ <integer>1084</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1084</integer>
+ <integer>1086</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1088</integer>
+ <integer>1089</integer>
</dict>
<dict>
<key>CF$UID</key>
@@ -532,15 +520,15 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>1095</integer>
+ <integer>1096</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1098</integer>
+ <integer>1099</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1101</integer>
+ <integer>1102</integer>
</dict>
<dict>
<key>CF$UID</key>
@@ -548,40 +536,48 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>1107</integer>
+ <integer>1108</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1109</integer>
+ <integer>1112</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1112</integer>
+ <integer>1114</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1115</integer>
+ <integer>1116</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1117</integer>
+ <integer>1118</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1119</integer>
+ <integer>1120</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1122</integer>
+ <integer>1124</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1125</integer>
+ <integer>1131</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1128</integer>
+ <integer>1136</integer>
</dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>1141</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>1146</integer>
+ </dict>
</array>
</dict>
<dict>
@@ -641,12 +637,12 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>118</integer>
+ <integer>114</integer>
</dict>
<key>NSFrame</key>
<dict>
<key>CF$UID</key>
- <integer>308</integer>
+ <integer>220</integer>
</dict>
<key>NSNextResponder</key>
<dict>
@@ -656,7 +652,7 @@
<key>NSSubviews</key>
<dict>
<key>CF$UID</key>
- <integer>207</integer>
+ <integer>119</integer>
</dict>
</dict>
<string>{{18, 103}, {105, 18}}</string>
@@ -1076,7 +1072,7 @@
<key>NSLabel</key>
<dict>
<key>CF$UID</key>
- <integer>804</integer>
+ <integer>805</integer>
</dict>
<key>NSSource</key>
<dict>
@@ -1088,22 +1084,22 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>803</integer>
+ <integer>804</integer>
</dict>
<key>NSMaxSize</key>
<dict>
<key>CF$UID</key>
- <integer>802</integer>
+ <integer>803</integer>
</dict>
<key>NSMinSize</key>
<dict>
<key>CF$UID</key>
- <integer>801</integer>
+ <integer>802</integer>
</dict>
<key>NSScreenRect</key>
<dict>
<key>CF$UID</key>
- <integer>800</integer>
+ <integer>801</integer>
</dict>
<key>NSViewClass</key>
<dict>
@@ -1163,12 +1159,12 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>118</integer>
+ <integer>114</integer>
</dict>
<key>NSFrame</key>
<dict>
<key>CF$UID</key>
- <integer>799</integer>
+ <integer>800</integer>
</dict>
<key>NSNextResponder</key>
<dict>
@@ -1185,7 +1181,7 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>75</integer>
+ <integer>85</integer>
</dict>
<key>NS.objects</key>
<array>
@@ -1195,11 +1191,11 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>761</integer>
+ <integer>762</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>794</integer>
+ <integer>795</integer>
</dict>
</array>
</dict>
@@ -1207,7 +1203,7 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>760</integer>
+ <integer>761</integer>
</dict>
<key>NSAllowTruncatedLabels</key>
<true/>
@@ -1221,7 +1217,7 @@
<key>NSFrame</key>
<dict>
<key>CF$UID</key>
- <integer>203</integer>
+ <integer>115</integer>
</dict>
<key>NSNextResponder</key>
<dict>
@@ -1231,7 +1227,7 @@
<key>NSSelectedTabViewItem</key>
<dict>
<key>CF$UID</key>
- <integer>540</integer>
+ <integer>759</integer>
</dict>
<key>NSSubviews</key>
<dict>
@@ -1246,7 +1242,7 @@
<key>NSTabViewItems</key>
<dict>
<key>CF$UID</key>
- <integer>204</integer>
+ <integer>116</integer>
</dict>
<key>NSTvFlags</key>
<integer>4</integer>
@@ -1255,7 +1251,7 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>75</integer>
+ <integer>85</integer>
</dict>
<key>NS.objects</key>
<array>
@@ -1269,12 +1265,12 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>118</integer>
+ <integer>114</integer>
</dict>
<key>NSFrame</key>
<dict>
<key>CF$UID</key>
- <integer>202</integer>
+ <integer>113</integer>
</dict>
<key>NSNextResponder</key>
<dict>
@@ -1296,7 +1292,7 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>75</integer>
+ <integer>85</integer>
</dict>
<key>NS.objects</key>
<array>
@@ -1306,493 +1302,219 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>129</integer>
+ <integer>109</integer>
</dict>
- <dict>
- <key>CF$UID</key>
- <integer>172</integer>
- </dict>
</array>
</dict>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>128</integer>
+ <integer>108</integer>
</dict>
- <key>NSBorderType</key>
- <integer>3</integer>
- <key>NSBoxType</key>
- <integer>0</integer>
- <key>NSContentView</key>
+ <key>NSBackgroundColor</key>
<dict>
<key>CF$UID</key>
- <integer>54</integer>
+ <integer>103</integer>
</dict>
- <key>NSFrame</key>
+ <key>NSCellBackgroundColor</key>
<dict>
<key>CF$UID</key>
- <integer>119</integer>
+ <integer>107</integer>
</dict>
- <key>NSNextResponder</key>
+ <key>NSCellClass</key>
<dict>
<key>CF$UID</key>
- <integer>50</integer>
+ <integer>88</integer>
</dict>
- <key>NSOffsets</key>
+ <key>NSCellSize</key>
<dict>
<key>CF$UID</key>
- <integer>120</integer>
+ <integer>86</integer>
</dict>
- <key>NSSubviews</key>
+ <key>NSCells</key>
<dict>
<key>CF$UID</key>
- <integer>53</integer>
+ <integer>54</integer>
</dict>
- <key>NSSuperview</key>
+ <key>NSEnabled</key>
+ <true/>
+ <key>NSFont</key>
<dict>
<key>CF$UID</key>
- <integer>50</integer>
+ <integer>15</integer>
</dict>
- <key>NSTitleCell</key>
+ <key>NSFrame</key>
<dict>
<key>CF$UID</key>
- <integer>121</integer>
+ <integer>53</integer>
</dict>
- <key>NSTitlePosition</key>
- <integer>2</integer>
- <key>NSTransparent</key>
- <false/>
- </dict>
- <dict>
- <key>$class</key>
+ <key>NSIntercellSpacing</key>
<dict>
<key>CF$UID</key>
- <integer>75</integer>
+ <integer>87</integer>
</dict>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>54</integer>
- </dict>
- </array>
- </dict>
- <dict>
- <key>$class</key>
+ <key>NSMatrixFlags</key>
+ <integer>1143472128</integer>
+ <key>NSNextResponder</key>
<dict>
<key>CF$UID</key>
- <integer>118</integer>
+ <integer>50</integer>
</dict>
- <key>NSFrame</key>
+ <key>NSNumCols</key>
+ <integer>2</integer>
+ <key>NSNumRows</key>
+ <integer>6</integer>
+ <key>NSProtoCell</key>
<dict>
<key>CF$UID</key>
- <integer>117</integer>
+ <integer>89</integer>
</dict>
- <key>NSNextResponder</key>
+ <key>NSSelectedCell</key>
<dict>
<key>CF$UID</key>
- <integer>52</integer>
+ <integer>61</integer>
</dict>
- <key>NSSubviews</key>
- <dict>
- <key>CF$UID</key>
- <integer>55</integer>
- </dict>
+ <key>NSSelectedRow</key>
+ <integer>1</integer>
<key>NSSuperview</key>
<dict>
<key>CF$UID</key>
- <integer>52</integer>
+ <integer>50</integer>
</dict>
+ <key>NSvFlags</key>
+ <integer>256</integer>
</dict>
+ <string>{{18, 162}, {288, 118}}</string>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>75</integer>
+ <integer>85</integer>
</dict>
<key>NS.objects</key>
<array>
<dict>
<key>CF$UID</key>
- <integer>56</integer>
+ <integer>55</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>79</integer>
+ <integer>59</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>94</integer>
+ <integer>61</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>108</integer>
+ <integer>63</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>112</integer>
+ <integer>65</integer>
</dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>67</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>69</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>71</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>73</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>75</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>77</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>79</integer>
+ </dict>
</array>
</dict>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>78</integer>
+ <integer>22</integer>
</dict>
- <key>NSCell</key>
- <dict>
- <key>CF$UID</key>
- <integer>58</integer>
- </dict>
- <key>NSEnabled</key>
- <true/>
- <key>NSFrame</key>
- <dict>
- <key>CF$UID</key>
- <integer>57</integer>
- </dict>
- <key>NSNextResponder</key>
- <dict>
- <key>CF$UID</key>
- <integer>54</integer>
- </dict>
- <key>NSSuperview</key>
- <dict>
- <key>CF$UID</key>
- <integer>54</integer>
- </dict>
- <key>NSvFlags</key>
- <integer>256</integer>
- </dict>
- <string>{{144, 44}, {249, 26}}</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>77</integer>
- </dict>
<key>NSAlternateContents</key>
<dict>
<key>CF$UID</key>
- <integer>60</integer>
+ <integer>21</integer>
</dict>
<key>NSAlternateImage</key>
<dict>
<key>CF$UID</key>
- <integer>59</integer>
+ <integer>57</integer>
</dict>
- <key>NSAltersState</key>
- <true/>
- <key>NSArrowPosition</key>
- <integer>1</integer>
<key>NSButtonFlags</key>
- <integer>109199615</integer>
+ <integer>1211912703</integer>
<key>NSButtonFlags2</key>
- <integer>1</integer>
+ <integer>0</integer>
<key>NSCellFlags</key>
- <integer>-2076049856</integer>
+ <integer>-2080244224</integer>
<key>NSCellFlags2</key>
- <integer>134218752</integer>
- <key>NSControlView</key>
+ <integer>0</integer>
+ <key>NSContents</key>
<dict>
<key>CF$UID</key>
<integer>56</integer>
</dict>
- <key>NSKeyEquivalent</key>
+ <key>NSControlView</key>
<dict>
<key>CF$UID</key>
- <integer>61</integer>
+ <integer>52</integer>
</dict>
- <key>NSMenu</key>
+ <key>NSKeyEquivalent</key>
<dict>
<key>CF$UID</key>
- <integer>63</integer>
+ <integer>21</integer>
</dict>
- <key>NSMenuItem</key>
- <dict>
- <key>CF$UID</key>
- <integer>62</integer>
- </dict>
<key>NSPeriodicDelay</key>
- <integer>400</integer>
+ <integer>200</integer>
<key>NSPeriodicInterval</key>
- <integer>75</integer>
- <key>NSPreferredEdge</key>
- <integer>3</integer>
+ <integer>25</integer>
<key>NSSupport</key>
<dict>
<key>CF$UID</key>
<integer>15</integer>
</dict>
- <key>NSUsesItemFromMenu</key>
- <true/>
+ <key>NSTag</key>
+ <integer>2</integer>
</dict>
+ <string>Normal size</string>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>17</integer>
+ <integer>20</integer>
</dict>
- <key>NSName</key>
+ <key>NSImageName</key>
<dict>
<key>CF$UID</key>
- <integer>16</integer>
- </dict>
- <key>NSSize</key>
- <real>13</real>
- <key>NSfFlags</key>
- <integer>16</integer>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>45</integer>
- </dict>
- <key>NS.string</key>
- <string></string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>45</integer>
- </dict>
- <key>NS.string</key>
- <string></string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>72</integer>
- </dict>
- <key>NSAction</key>
- <dict>
- <key>CF$UID</key>
- <integer>71</integer>
- </dict>
- <key>NSKeyEquiv</key>
- <dict>
- <key>CF$UID</key>
- <integer>21</integer>
- </dict>
- <key>NSKeyEquivModMask</key>
- <integer>1048576</integer>
- <key>NSMenu</key>
- <dict>
- <key>CF$UID</key>
- <integer>63</integer>
- </dict>
- <key>NSMixedImage</key>
- <dict>
- <key>CF$UID</key>
- <integer>69</integer>
- </dict>
- <key>NSMnemonicLoc</key>
- <integer>2147483647</integer>
- <key>NSOnImage</key>
- <dict>
- <key>CF$UID</key>
- <integer>65</integer>
- </dict>
- <key>NSState</key>
- <integer>1</integer>
- <key>NSTarget</key>
- <dict>
- <key>CF$UID</key>
<integer>58</integer>
</dict>
- <key>NSTitle</key>
- <dict>
- <key>CF$UID</key>
- <integer>64</integer>
- </dict>
</dict>
+ <string>NSRadioButton</string>
<dict>
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>76</integer>
+ <integer>22</integer>
</dict>
- <key>NSMenuItems</key>
- <dict>
- <key>CF$UID</key>
- <integer>74</integer>
- </dict>
- <key>NSTitle</key>
- <dict>
- <key>CF$UID</key>
- <integer>73</integer>
- </dict>
- </dict>
- <string>Item1</string>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>68</integer>
- </dict>
- <key>NSClassName</key>
- <dict>
- <key>CF$UID</key>
- <integer>66</integer>
- </dict>
- <key>NSResourceName</key>
- <dict>
- <key>CF$UID</key>
- <integer>67</integer>
- </dict>
- </dict>
- <string>NSImage</string>
- <string>NSMenuCheckmark</string>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSCustomResource</string>
- <string>%NSCustomResource</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>NSCustomResource</string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>68</integer>
- </dict>
- <key>NSClassName</key>
- <dict>
- <key>CF$UID</key>
- <integer>66</integer>
- </dict>
- <key>NSResourceName</key>
- <dict>
- <key>CF$UID</key>
- <integer>70</integer>
- </dict>
- </dict>
- <string>NSMenuMixedState</string>
- <string>_popUpItemAction:</string>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSMenuItem</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>NSMenuItem</string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>45</integer>
- </dict>
- <key>NS.string</key>
- <string>OtherViews</string>
- </dict>
- <dict>
- <key>$class</key>
- <dict>
- <key>CF$UID</key>
- <integer>75</integer>
- </dict>
- <key>NS.objects</key>
- <array>
- <dict>
- <key>CF$UID</key>
- <integer>62</integer>
- </dict>
- </array>
- </dict>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSMutableArray</string>
- <string>NSArray</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>NSMutableArray</string>
- </dict>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSMenu</string>
- <string>NSObject</string>
- </array>
- <key>$classname</key>
- <string>NSMenu</string>
- </dict>
- <dict>
- <key>$classes</key>
- <array>
- <string>NSPopUpButtonCell</string>
- <string>NSMenuItemCell</string>
- <string>NSButtonCell</string>
- <string>%NSButtonCell</string>
- <string>NSA...
[truncated message content] |
|
From: <fr...@us...> - 2007-01-10 10:49:58
|
Revision: 289
http://svn.sourceforge.net/fuse-for-macosx/?rev=289&view=rev
Author: fredm
Date: 2007-01-10 02:49:57 -0800 (Wed, 10 Jan 2007)
Log Message:
-----------
Merge in revisions 220:288 from the trunk branch.
Modified Paths:
--------------
branches/fusegl/fuse/debugger/breakpoint.c
branches/fusegl/fuse/display.h
branches/fusegl/fuse/event.c
branches/fusegl/fuse/fuse.cpp
branches/fusegl/fuse/fuse.h
branches/fusegl/fuse/fusepb/English.lproj/InfoPlist.strings
branches/fusegl/fuse/fusepb/Info-Fuse.plist
branches/fusegl/fuse/fusepb/controllers/FuseController.m
branches/fusegl/fuse/fusepb/controllers/PreferencesController.h
branches/fusegl/fuse/fusepb/controllers/PreferencesController.m
branches/fusegl/fuse/fusepb/nibs/Preferences.nib/classes.nib
branches/fusegl/fuse/fusepb/nibs/Preferences.nib/info.nib
branches/fusegl/fuse/fusepb/nibs/Preferences.nib/keyedobjects.nib
branches/fusegl/fuse/fusepb/resources/Fuse Help/Fuse Help idx
branches/fusegl/fuse/fusepb/resources/Fuse Help/html/emulation.html
branches/fusegl/fuse/fusepb/resources/Fuse Help/html/mappings.html
branches/fusegl/fuse/fusepb/resources/Fuse Help/html/menus.html
branches/fusegl/fuse/fusepb/resources/Fuse Help/html/tocstart.html
branches/fusegl/fuse/fusepb/settings-header.pl
branches/fusegl/fuse/hacking/ChangeLog
branches/fusegl/fuse/if1.c
branches/fusegl/fuse/if2.c
branches/fusegl/fuse/machine.c
branches/fusegl/fuse/machine.h
branches/fusegl/fuse/machines/pentagon.c
branches/fusegl/fuse/machines/scorpion.c
branches/fusegl/fuse/machines/spec128.c
branches/fusegl/fuse/machines/spec16.c
branches/fusegl/fuse/machines/spec48.c
branches/fusegl/fuse/machines/spec_se.c
branches/fusegl/fuse/machines/specplus2.c
branches/fusegl/fuse/machines/specplus2a.c
branches/fusegl/fuse/machines/specplus3.c
branches/fusegl/fuse/machines/specplus3e.c
branches/fusegl/fuse/machines/tc2048.c
branches/fusegl/fuse/machines/tc2068.c
branches/fusegl/fuse/machines/ts2068.c
branches/fusegl/fuse/man/fuse.1
branches/fusegl/fuse/memory.c
branches/fusegl/fuse/profile.c
branches/fusegl/fuse/scld.c
branches/fusegl/fuse/screenshot.c
branches/fusegl/fuse/screenshot.h
branches/fusegl/fuse/settings-header.pl
branches/fusegl/fuse/settings.dat
branches/fusegl/fuse/settings.pl
branches/fusegl/fuse/snapshot.c
branches/fusegl/fuse/sound/sdlsound.c
branches/fusegl/fuse/sound.c
branches/fusegl/fuse/sound.h
branches/fusegl/fuse/tape.c
branches/fusegl/fuse/ui/fb/fbdisplay.c
branches/fusegl/fuse/ui/ggi/ggidisplay.c
branches/fusegl/fuse/ui/gtk/gtkdisplay.c
branches/fusegl/fuse/ui/gtk/gtkui.c
branches/fusegl/fuse/ui/sdl/sdldisplay.c
branches/fusegl/fuse/ui/sdl/sdljoystick.c
branches/fusegl/fuse/ui/sdl/sdlkeyboard.c
branches/fusegl/fuse/ui/svga/svgadisplay.c
branches/fusegl/fuse/ui/uidisplay.h
branches/fusegl/fuse/ui/win32/win32display.c
branches/fusegl/fuse/ui/xlib/xdisplay.c
branches/fusegl/fuse/uidisplay.c
branches/fusegl/fuse/widget/menu.c
branches/fusegl/fuse/widget/roms.c
branches/fusegl/fuse/widget/widget.c
Added Paths:
-----------
branches/fusegl/fuse/fusepb/resources/Fuse Help/Fuse Help.helpindex
branches/fusegl/fuse/fusepb/resources/Fuse Help/html/preferences.html
branches/fusegl/fuse/fusepb/settings_cocoa.h
Property Changed:
----------------
branches/fusegl/fuse/fusepb/
Modified: branches/fusegl/fuse/debugger/breakpoint.c
===================================================================
--- branches/fusegl/fuse/debugger/breakpoint.c 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/debugger/breakpoint.c 2007-01-10 10:49:57 UTC (rev 289)
@@ -1,7 +1,7 @@
/* breakpoint.c: a debugger breakpoint
Copyright (c) 2002-2004 Philip Kendall
- $Id: breakpoint.c,v 1.7 2004/06/16 14:46:34 pak21 Exp $
+ $Id: breakpoint.c,v 1.8 2006/12/15 20:50:47 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
@@ -440,11 +440,11 @@
found++;
+ free( ptr->data );
+
debugger_breakpoints = g_slist_remove( debugger_breakpoints, ptr->data );
if( debugger_mode == DEBUGGER_MODE_ACTIVE && !debugger_breakpoints )
debugger_mode = DEBUGGER_MODE_INACTIVE;
-
- free( ptr->data );
}
if( !found ) {
Modified: branches/fusegl/fuse/display.h
===================================================================
--- branches/fusegl/fuse/display.h 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/display.h 2007-01-10 10:49:57 UTC (rev 289)
@@ -1,7 +1,7 @@
/* display.h: Routines for printing the Spectrum's screen
Copyright (c) 1999-2006 Philip Kendall
- $Id: display.h,v 1.23 2006/07/31 13:33:27 fredm Exp $
+ $Id: display.h,v 1.26 2006/09/17 00:56:18 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
Modified: branches/fusegl/fuse/event.c
===================================================================
--- branches/fusegl/fuse/event.c 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/event.c 2007-01-10 10:49:57 UTC (rev 289)
@@ -1,7 +1,7 @@
/* event.c: Routines needed for dealing with the event list
Copyright (c) 2000-2004 Philip Kendall
- $Id: event.c,v 1.55 2006/08/06 10:41:52 pak21 Exp $
+ $Id: event.c,v 1.56 2006/09/03 14:12:22 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
Modified: branches/fusegl/fuse/fuse.cpp
===================================================================
--- branches/fusegl/fuse/fuse.cpp 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/fuse.cpp 2007-01-10 10:49:57 UTC (rev 289)
@@ -94,12 +94,6 @@
/* Is Spectrum emulation currently paused, and if so, how many times? */
int fuse_emulation_paused;
-/* Are we going to try and use the sound card; this differs from
- sound.c:sound_enabled in that this gives a desire, whereas sound_enabled
- is an actual state; when the Spectrum emulation is not running, this
- stores whether we try to reenable the sound card afterwards */
-int fuse_sound_in_use;
-
/* The creator information we'll store in file formats that support this */
libspectrum_creator *fuse_creator;
@@ -416,43 +410,6 @@
"--version Print version number and exit.\n\n" );
}
-/* Start sound output */
-void
-fuse_sound_enable(void)
-{
- /* No sound if fastloading in progress */
- if( settings_current.fastload && tape_is_playing() ) return;
-
- /* If we now want sound, enable it */
- if( settings_current.sound && settings_current.emulation_speed == 100 ) {
-
- sound_init( settings_current.sound_device );
- sound_ay_reset();
-
- /* If the sound code couldn't re-initialise, fall back to the
- signal based routines */
- if( !sound_enabled ) {
- /* Increment pause_count, report, decrement pause_count
- * (i.e. avoid the effects of fuse_emulation_{,un}pause).
- * Otherwise, we may be recursively reporting this error. */
- fuse_emulation_paused++;
- fuse_emulation_paused--;
- settings_current.sound = fuse_sound_in_use = 0;
-
- }
- fuse_sound_in_use = sound_enabled;
- } else if( fuse_sound_in_use ) {
- fuse_sound_in_use = 0;
- }
-}
-
-/* Stop sound output */
-void
-fuse_sound_disable(void)
-{
- if( sound_enabled ) sound_end();
-}
-
/* Stop all activities associated with actual Spectrum emulation */
int fuse_emulation_pause(void)
{
@@ -470,7 +427,7 @@
/* If we had sound enabled (and hence doing the speed regulation),
turn it off */
- if( sound_enabled ) sound_end();
+ sound_pause();
return 0;
}
@@ -484,11 +441,12 @@
decrement the pause count */
if( --fuse_emulation_paused ) return 0;
+ /* If we now want sound, enable it */
+ sound_unpause();
+
/* Restart speed estimation with no information */
error = timer_estimate_reset(); if( error ) return error;
- fuse_sound_enable();
-
return 0;
}
Modified: branches/fusegl/fuse/fuse.h
===================================================================
--- branches/fusegl/fuse/fuse.h 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/fuse.h 2007-01-10 10:49:57 UTC (rev 289)
@@ -43,9 +43,6 @@
int fuse_emulation_pause(void); /* Stop and start emulation */
int fuse_emulation_unpause(void);
-void fuse_sound_enable(); /* Start sound output */
-void fuse_sound_disable(); /* Stop sound output */
-
void fuse_abort( void ) GCC_NORETURN; /* Emergency shutdown */
int fuse_init(int argc, char **argv);
@@ -53,8 +50,6 @@
int fuse_end(void); /* Tidy-up function called at end of
emulation */
-extern int fuse_sound_in_use; /* Are we trying to produce sound? */
-
extern libspectrum_creator *fuse_creator; /* Creator information for file
formats which support this */
Property changes on: branches/fusegl/fuse/fusepb
___________________________________________________________________
Name: svn:ignore
- *~.nib
.DS_Store
.gdb_history
build
settings.h
settings.m
settings_cocoa.h
+ *~.nib
.DS_Store
.gdb_history
build
settings.h
settings.m
Modified: branches/fusegl/fuse/fusepb/English.lproj/InfoPlist.strings
===================================================================
(Binary files differ)
Modified: branches/fusegl/fuse/fusepb/Info-Fuse.plist
===================================================================
--- branches/fusegl/fuse/fusepb/Info-Fuse.plist 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/fusepb/Info-Fuse.plist 2007-01-10 10:49:57 UTC (rev 289)
@@ -361,11 +361,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>20060718</string>
+ <string>20070110</string>
<key>CFBundleSignature</key>
<string>FUSE</string>
<key>CFBundleVersion</key>
- <string>20060718</string>
+ <string>20070110</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.m 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.m 2007-01-10 10:49:57 UTC (rev 289)
@@ -584,7 +584,7 @@
free( snap ); free( recording ); fuse_emulation_unpause(); return;
}
- rzx_start_recording( recording, 0 );
+ rzx_start_recording( recording, settings_current.embed_snapshot );
free( recording );
@@ -1872,9 +1872,9 @@
fuse_emulation_pause();
NSString *m = [NSString stringWithUTF8String:message];
- result = NSRunAlertPanel(@"Confirm", m, @"Cancel", @"OK", nil);
+ result = NSRunAlertPanel(@"Confirm", m, @"OK", @"Cancel", nil);
- if( result != NSAlertDefaultReturn ) confirm = 1;
+ if( result == NSAlertDefaultReturn ) confirm = 1;
fuse_emulation_unpause();
Modified: branches/fusegl/fuse/fusepb/controllers/PreferencesController.h
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/PreferencesController.h 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/fusepb/controllers/PreferencesController.h 2007-01-10 10:49:57 UTC (rev 289)
@@ -34,6 +34,7 @@
IBOutlet NSFormCell *rom1Filename;
IBOutlet NSFormCell *rom2Filename;
IBOutlet NSFormCell *rom3Filename;
+ IBOutlet NSArrayController *machineRomsController;
IBOutlet NSMatrix *massStorageType;
JoystickConfigurationController *joystickConfigurationController;
@@ -52,6 +53,7 @@
- (NSArray *)joysticks;
- (NSArray *)sdlJoysticks;
- (IBAction)chooseROMFile:(id)sender;
+- (IBAction)resetROMFile:(id)sender;
- (IBAction)resetUserDefaults:(id)sender;
- (IBAction)massStorageTypeClicked:(id)sender;
- (void)setMassStorageType;
Modified: branches/fusegl/fuse/fusepb/controllers/PreferencesController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/PreferencesController.m 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/fusepb/controllers/PreferencesController.m 2007-01-10 10:49:57 UTC (rev 289)
@@ -163,6 +163,9 @@
settings_get_rom_array( &settings_current, machineRoms );
[machineRoms release];
+ fuse_joystick_end();
+ fuse_joystick_init();
+
fuse_emulation_unpause();
/* If we've enabled sound we want to put some data in the buffers before
@@ -235,36 +238,69 @@
{
char buffer[PATH_MAX+1];
int result;
- NSFormCell *currentField = nil;
NSOpenPanel *oPanel = [NSOpenPanel openPanel];
NSArray *romFileTypes = [NSArray arrayWithObjects:@"rom", @"ROM", nil];
NSString *romString;
result = [oPanel runModalForTypes:romFileTypes];
if (result == NSOKButton) {
+ NSString *key = NULL;
NSString *oFile = [oPanel filename];
[oFile getFileSystemRepresentation:buffer maxLength:PATH_MAX];
+ romString = [NSString stringWithUTF8String:buffer];
+
switch( [sender tag] ) {
case 0:
- currentField = rom0Filename;
+ key = @"rom0";
break;
case 1:
- currentField = rom1Filename;
+ key = @"rom1";
break;
case 2:
- currentField = rom2Filename;
+ key = @"rom2";
break;
case 3:
- currentField = rom3Filename;
+ key = @"rom3";
break;
}
- romString = [NSString stringWithUTF8String:buffer];
- [currentField setStringValue:romString];
+ // Update underlying model
+ [[machineRomsController selection] setValue:romString forKey:key];
}
}
+- (IBAction)resetROMFile:(id)sender
+{
+ NSString *romString;
+ NSString *source_key = nil;
+ NSString *dest_key = nil;
+
+ switch( [sender tag] ) {
+ case 0:
+ source_key = @"default_rom0";
+ dest_key = @"rom0";
+ break;
+ case 1:
+ source_key = @"default_rom1";
+ dest_key = @"rom1";
+ break;
+ case 2:
+ source_key = @"default_rom2";
+ dest_key = @"rom2";
+ break;
+ case 3:
+ source_key = @"default_rom3";
+ dest_key = @"rom3";
+ break;
+ }
+
+ romString = [[machineRomsController selection] valueForKey:source_key];
+
+ // Update underlying model
+ [[machineRomsController selection] setValue:romString forKey:dest_key];
+}
+
- (IBAction)resetUserDefaults:(id)sender
{
int error;
Modified: branches/fusegl/fuse/fusepb/nibs/Preferences.nib/classes.nib
===================================================================
--- branches/fusegl/fuse/fusepb/nibs/Preferences.nib/classes.nib 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/fusepb/nibs/Preferences.nib/classes.nib 2007-01-10 10:49:57 UTC (rev 289)
@@ -6,6 +6,7 @@
chooseFile = id;
chooseROMFile = id;
massStorageTypeClicked = id;
+ resetROMFile = id;
resetUserDefaults = id;
setup = id;
showWindow = id;
@@ -13,6 +14,7 @@
CLASS = PreferencesController;
LANGUAGE = ObjC;
OUTLETS = {
+ machineRomsController = NSArrayController;
massStorageType = NSMatrix;
rom0Filename = NSFormCell;
rom1Filename = NSFormCell;
Modified: branches/fusegl/fuse/fusepb/nibs/Preferences.nib/info.nib
===================================================================
--- branches/fusegl/fuse/fusepb/nibs/Preferences.nib/info.nib 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/fusepb/nibs/Preferences.nib/info.nib 2007-01-10 10:49:57 UTC (rev 289)
@@ -3,21 +3,28 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
- <string>100 79 356 240 0 0 1440 878 </string>
+ <string>112 18 356 240 0 0 1440 878 </string>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBGroupedObjects</key>
<dict>
- <key>1</key>
+ <key>3</key>
<array>
+ <string>122</string>
+ <string>127</string>
<string>121</string>
- <string>122</string>
<string>124</string>
- <string>127</string>
</array>
+ <key>4</key>
+ <array>
+ <string>993</string>
+ <string>995</string>
+ <string>992</string>
+ <string>994</string>
+ </array>
</dict>
<key>IBLastGroupID</key>
- <string>2</string>
+ <string>5</string>
<key>IBOldestOS</key>
<integer>3</integer>
<key>IBOpenObjects</key>
Modified: branches/fusegl/fuse/fusepb/nibs/Preferences.nib/keyedobjects.nib
===================================================================
--- branches/fusegl/fuse/fusepb/nibs/Preferences.nib/keyedobjects.nib 2007-01-09 21:02:14 UTC (rev 288)
+++ branches/fusegl/fuse/fusepb/nibs/Preferences.nib/keyedobjects.nib 2007-01-10 10:49:57 UTC (rev 289)
@@ -11,32 +11,32 @@
<key>$class</key>
<dict>
<key>CF$UID</key>
- <integer>1489</integer>
+ <integer>1524</integer>
</dict>
<key>NSAccessibilityConnectors</key>
<dict>
<key>CF$UID</key>
- <integer>1486</integer>
+ <integer>1521</integer>
</dict>
<key>NSAccessibilityOidsKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1487</integer>
+ <integer>1522</integer>
</dict>
<key>NSAccessibilityOidsValues</key>
<dict>
<key>CF$UID</key>
- <integer>1488</integer>
+ <integer>1523</integer>
</dict>
<key>NSClassesKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1203</integer>
+ <integer>1227</integer>
</dict>
<key>NSClassesValues</key>
<dict>
<key>CF$UID</key>
- <integer>1204</integer>
+ <integer>1228</integer>
</dict>
<key>NSConnections</key>
<dict>
@@ -56,34 +56,34 @@
<key>NSNamesKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1143</integer>
+ <integer>1163</integer>
</dict>
<key>NSNamesValues</key>
<dict>
<key>CF$UID</key>
- <integer>1144</integer>
+ <integer>1164</integer>
</dict>
<key>NSNextOid</key>
- <integer>1061</integer>
+ <integer>1067</integer>
<key>NSObjectsKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1136</integer>
+ <integer>1156</integer>
</dict>
<key>NSObjectsValues</key>
<dict>
<key>CF$UID</key>
- <integer>1142</integer>
+ <integer>1162</integer>
</dict>
<key>NSOidsKeys</key>
<dict>
<key>CF$UID</key>
- <integer>1205</integer>
+ <integer>1229</integer>
</dict>
<key>NSOidsValues</key>
<dict>
<key>CF$UID</key>
- <integer>1206</integer>
+ <integer>1230</integer>
</dict>
<key>NSRoot</key>
<dict>
@@ -160,387 +160,387 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>808</integer>
+ <integer>816</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>817</integer>
+ <integer>825</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>818</integer>
+ <integer>826</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>822</integer>
+ <integer>830</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>825</integer>
+ <integer>833</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>828</integer>
+ <integer>836</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>831</integer>
+ <integer>839</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>834</integer>
+ <integer>842</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>837</integer>
+ <integer>845</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>840</integer>
+ <integer>848</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>843</integer>
+ <integer>851</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>846</integer>
+ <integer>854</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>849</integer>
+ <integer>857</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>852</integer>
+ <integer>860</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>855</integer>
+ <integer>863</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>858</integer>
+ <integer>866</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>861</integer>
+ <integer>869</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>864</integer>
+ <integer>872</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>867</integer>
+ <integer>875</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>870</integer>
+ <integer>878</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>873</integer>
+ <integer>881</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>876</integer>
+ <integer>884</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>879</integer>
+ <integer>887</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>882</integer>
+ <integer>890</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>885</integer>
+ <integer>898</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>893</integer>
+ <integer>905</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>900</integer>
+ <integer>908</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>903</integer>
+ <integer>909</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>904</integer>
+ <integer>911</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>906</integer>
+ <integer>920</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>915</integer>
+ <integer>923</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>918</integer>
+ <integer>927</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>922</integer>
+ <integer>943</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>938</integer>
+ <integer>947</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>942</integer>
+ <integer>951</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>946</integer>
+ <integer>956</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>951</integer>
+ <integer>959</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>954</integer>
+ <integer>962</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>957</integer>
+ <integer>965</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>960</integer>
+ <integer>971</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>966</integer>
+ <integer>974</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>969</integer>
+ <integer>977</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>972</integer>
+ <integer>981</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>976</integer>
+ <integer>983</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>978</integer>
+ <integer>985</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>980</integer>
+ <integer>987</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>982</integer>
+ <integer>989</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>984</integer>
+ <integer>991</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>986</integer>
+ <integer>992</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>987</integer>
+ <integer>993</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>988</integer>
+ <integer>994</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>989</integer>
+ <integer>996</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>991</integer>
+ <integer>999</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>994</integer>
+ <integer>1002</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>997</integer>
+ <integer>1005</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1000</integer>
+ <integer>1008</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1003</integer>
+ <integer>1015</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1010</integer>
+ <integer>1016</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1011</integer>
+ <integer>1017</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1012</integer>
+ <integer>1018</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1013</integer>
+ <integer>1021</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1016</integer>
+ <integer>1022</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1017</integer>
+ <integer>1025</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1020</integer>
+ <integer>1028</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1023</integer>
+ <integer>1029</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1024</integer>
+ <integer>1032</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1027</integer>
+ <integer>1037</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1032</integer>
+ <integer>1038</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1033</integer>
+ <integer>1039</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1034</integer>
+ <integer>1040</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1035</integer>
+ <integer>1041</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1038</integer>
+ <integer>1046</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1039</integer>
+ <integer>1050</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1042</integer>
+ <integer>1056</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1047</integer>
+ <integer>1061</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1051</integer>
+ <integer>1065</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1057</integer>
+ <integer>1069</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1062</integer>
+ <integer>1071</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1066</integer>
+ <integer>1072</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1070</integer>
+ <integer>1075</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1072</integer>
+ <integer>1078</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1073</integer>
+ <integer>1082</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1076</integer>
+ <integer>1084</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1079</integer>
+ <integer>1086</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1083</integer>
+ <integer>1089</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1085</integer>
+ <integer>1092</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1087</integer>
+ <integer>1094</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1090</integer>
+ <integer>1096</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1093</integer>
+ <integer>1099</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1095</integer>
+ <integer>1102</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1097</integer>
+ <integer>1105</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1100</integer>
+ <integer>1108</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1103</integer>
+ <integer>1110</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1106</integer>
+ <integer>1112</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1109</integer>
+ <integer>1113</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1113</integer>
+ <integer>1114</integer>
</dict>
<dict>
<key>CF$UID</key>
@@ -564,20 +564,52 @@
</dict>
<dict>
<key>CF$UID</key>
- <integer>1125</integer>
+ <integer>1126</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1128</integer>
+ <integer>1129</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1130</integer>
+ <integer>1133</integer>
</dict>
<dict>
<key>CF$UID</key>
- <integer>1132</integer>
+ <integer>1135</integer>
</dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>1137</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>1140</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>1142</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>1144</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>1146</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>1148</integer>
+ </dict>
+ <dict>
+ <key>CF$UID</key>
+ <integer>1150</integer>
+ </dict>
+ <...
[truncated message content] |
|
From: <fr...@us...> - 2007-01-14 11:28:02
|
Revision: 293
http://svn.sourceforge.net/fuse-for-macosx/?rev=293&view=rev
Author: fredm
Date: 2007-01-14 03:27:54 -0800 (Sun, 14 Jan 2007)
Log Message:
-----------
* Vend FuseController and DisplayOpenGLView
* Move emulation to it's own object and vend it
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/FuseMenus.m
branches/fusegl/fuse/fusepb/controllers/FuseController.h
branches/fusegl/fuse/fusepb/controllers/FuseController.m
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
Added Paths:
-----------
branches/fusegl/fuse/fusepb/models/
branches/fusegl/fuse/fusepb/models/Emulator.h
branches/fusegl/fuse/fusepb/models/Emulator.m
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-01-10 12:01:12 UTC (rev 292)
+++ branches/fusegl/fuse/TODO 2007-01-14 11:27:54 UTC (rev 293)
@@ -15,6 +15,10 @@
X Add support for bilinear etc. OpenGL filters
X Add option to snap window size to 1x, 2x, 3x
X Grab mouse in fullscreen mode
+X Vend FuseController and DisplayOpenGLView
+X Move emulation to it's own object and vend it
+* Move emulation to it's own thread and call FuseController and DisplayOpenGLView
+ through their vended objects
* Use sheets rather than modal dialogs
* Run emulation in seperate thread to avoid sound glitches when menus are
selected or window is minimised
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-01-10 12:01:12 UTC (rev 292)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-01-14 11:27:54 UTC (rev 293)
@@ -271,6 +271,8 @@
B6A6F10E0B3D6360000B88E9 /* cocoaerror.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F10D0B3D6360000B88E9 /* cocoaerror.m */; };
B6A6F11F0B3EA737000B88E9 /* cocoascreenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = B6A6F11D0B3EA737000B88E9 /* cocoascreenshot.h */; };
B6A6F1200B3EA737000B88E9 /* cocoascreenshot.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F11E0B3EA737000B88E9 /* cocoascreenshot.m */; };
+ B6B076B20B59FE9A00D4F95C /* Emulator.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B076B00B59FE9A00D4F95C /* Emulator.h */; };
+ B6B076B30B59FE9A00D4F95C /* Emulator.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B076B10B59FE9A00D4F95C /* Emulator.m */; };
B6CE7F400B2830A300EB65B3 /* cocoadisplay.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */; };
B6CE7F410B2830A300EB65B3 /* cocoadisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */; };
B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */; };
@@ -482,6 +484,8 @@
B6AE204307704CFD00990F65 /* if1-1.rom */ = {isa = PBXFileReference; lastKnownFileType = file; name = "if1-1.rom"; path = "../roms/if1-1.rom"; sourceTree = SOURCE_ROOT; };
B6AE204407704CFD00990F65 /* if1-2.rom */ = {isa = PBXFileReference; lastKnownFileType = file; name = "if1-2.rom"; path = "../roms/if1-2.rom"; sourceTree = SOURCE_ROOT; };
B6AF242A04156EE700F48F48 /* blank.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = blank.icns; path = resources/blank.icns; sourceTree = SOURCE_ROOT; };
+ B6B076B00B59FE9A00D4F95C /* Emulator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Emulator.h; sourceTree = "<group>"; };
+ B6B076B10B59FE9A00D4F95C /* Emulator.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = Emulator.m; sourceTree = "<group>"; };
B6BA1A8B04E4F3290017354F /* gcrypt.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = gcrypt.framework; path = ../../libgcrypt/build/Deployment/gcrypt.framework; sourceTree = SOURCE_ROOT; };
B6BA1A9404E4F88F0017354F /* uijoystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = uijoystick.h; path = ../ui/uijoystick.h; sourceTree = SOURCE_ROOT; };
B6BA6F0207B1E04200E44C8D /* Preferences.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Preferences.nib; path = nibs/Preferences.nib; sourceTree = "<group>"; };
@@ -649,6 +653,7 @@
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
+ B6B076AB0B59FE7400D4F95C /* Models */,
B6CE7FCF0B28FBEC00EB65B3 /* Views */,
B6DD457908134943008E9F7E /* Content Arrays */,
B67F3C4E07ED34260045339F /* Transformers */,
@@ -900,6 +905,16 @@
name = machines;
sourceTree = "<group>";
};
+ B6B076AB0B59FE7400D4F95C /* Models */ = {
+ isa = PBXGroup;
+ children = (
+ B6B076B00B59FE9A00D4F95C /* Emulator.h */,
+ B6B076B10B59FE9A00D4F95C /* Emulator.m */,
+ );
+ name = Models;
+ path = models;
+ sourceTree = "<group>";
+ };
B6CE7E8A0B28027000EB65B3 /* cocoa */ = {
isa = PBXGroup;
children = (
@@ -1227,6 +1242,7 @@
B615BFE70B4261E50082D535 /* HIDJoysticks.h in Headers */,
B6A24E3C0B49C78700AD5B9D /* hq2x.h in Headers */,
B6A24E3E0B49C78700AD5B9D /* hq3x.h in Headers */,
+ B6B076B20B59FE9A00D4F95C /* Emulator.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1464,6 +1480,7 @@
B6A24E330B49C67D00AD5B9D /* scalers16.cpp in Sources */,
B6A24E3B0B49C78700AD5B9D /* hq2x.cpp in Sources */,
B6A24E3D0B49C78700AD5B9D /* hq3x.cpp in Sources */,
+ B6B076B30B59FE9A00D4F95C /* Emulator.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: branches/fusegl/fuse/fusepb/FuseMenus.m
===================================================================
--- branches/fusegl/fuse/fusepb/FuseMenus.m 2007-01-10 12:01:12 UTC (rev 292)
+++ branches/fusegl/fuse/fusepb/FuseMenus.m 2007-01-14 11:27:54 UTC (rev 293)
@@ -28,6 +28,7 @@
*/
#import "DisplayOpenGLView.h"
+#import "Emulator.h"
#import "FuseController.h"
#import "FuseMenus.h"
@@ -58,7 +59,7 @@
void SetEmulationHz( float hz )
{
- [[DisplayOpenGLView instance] setEmulationHz:hz];
+ [[Emulator instance] setEmulationHz:hz];
}
void Hide(void)
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.h
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.h 2007-01-10 12:01:12 UTC (rev 292)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.h 2007-01-14 11:27:54 UTC (rev 293)
@@ -128,6 +128,8 @@
- (IBAction)saveFileTypeClicked:(id)sender;
+- (id)installServer;
+
- savePanelAccessoryView;
- (NSPopUpButton*) saveFileType;
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.m 2007-01-10 12:01:12 UTC (rev 292)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.m 2007-01-14 11:27:54 UTC (rev 293)
@@ -141,6 +141,22 @@
return singleton ? singleton : [[self alloc] init];
}
+- (id)installServer
+{
+ NSConnection *theConnection;
+ theConnection = [NSConnection defaultConnection];
+ NSLog(@"Creating connection...");
+
+ [theConnection setRootObject:self];
+ if ([theConnection registerName:@"FuseControllerSvr"] == NO) {
+ NSLog(@"FuseController failed to register name\n");
+ }
+
+ [theConnection retain];
+ NSLog(@"done.\n");
+ return self;
+}
+
- (id)init
{
if ( singleton ) {
@@ -212,6 +228,8 @@
recentSnapFileNames = [NSMutableArray arrayWithCapacity:NUM_RECENT_ITEMS];
[recentSnapFileNames retain];
+
+ [self installServer];
}
return singleton;
Copied: branches/fusegl/fuse/fusepb/models/Emulator.h (from rev 292, branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h)
===================================================================
--- branches/fusegl/fuse/fusepb/models/Emulator.h (rev 0)
+++ branches/fusegl/fuse/fusepb/models/Emulator.h 2007-01-14 11:27:54 UTC (rev 293)
@@ -0,0 +1,75 @@
+/* Emulator.h: Implementation for the Emulator class
+ Copyright (c) 2006-2007 Fredrick Meunier
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Author contact information:
+
+ E-mail: fr...@sp...
+ Postal address: 3/66 Roslyn Gardens, Ruscutters Bay, NSW 2011, Australia
+
+*/
+
+#import <Cocoa/Cocoa.h>
+
+#include <libspectrum.h>
+
+#include "input.h"
+
+@interface Emulator : NSObject
+{
+ NSTimer* timer;
+
+ GHashTable *unicode_keysyms_hash;
+
+ BOOL optDown;
+ BOOL ctrlDown;
+ BOOL shiftDown;
+
+ int cocoakeyboard_caps_shift_pressed;
+ int cocoakeyboard_symbol_shift_pressed;
+ input_key unicode_keysym;
+
+ CFAbsoluteTime time;
+}
++(Emulator *) instance;
+
+- (id)installServer;
+
+-(void) updateEmulation:(NSTimer*)theTimer;
+-(void) updateEmulationForTimeDelta:(CFAbsoluteTime)deltaTime;
+-(void) setEmulationHz:(float)hz;
+
+/* FIXME: Could do with a setSettings? maybe we just update when paused? */
+/* probably means we need a pause and unpause method here */
+-(id) init;
+
+-(void) mouseMoved:(NSEvent *)theEvent;
+-(void) mouseDown:(NSEvent *)theEvent;
+-(void) mouseUp:(NSEvent *)theEvent;
+-(void) rightMouseDown:(NSEvent *)theEvent;
+-(void) rightMouseUp:(NSEvent *)theEvent;
+-(void) otherMouseDown:(NSEvent *)theEvent;
+-(void) otherMouseUp:(NSEvent *)theEvent;
+
+-(void) initKeyboard;
+-(void) modifierChange:(input_event_type)theType oldState:(BOOL)old newState:(BOOL)new;
+-(void) flagsChanged:(NSEvent *)theEvent;
+-(input_key) otherKeysymsRemap:(libspectrum_dword)ui_keysym inHash:(GHashTable*)hash;
+-(void) keyChange:(NSEvent *)theEvent type:(input_event_type)type;
+-(void) keyDown:(NSEvent *)theEvent;
+-(void) keyUp:(NSEvent *)theEvent;
+
+@end
Copied: branches/fusegl/fuse/fusepb/models/Emulator.m (from rev 292, branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m)
===================================================================
--- branches/fusegl/fuse/fusepb/models/Emulator.m (rev 0)
+++ branches/fusegl/fuse/fusepb/models/Emulator.m 2007-01-14 11:27:54 UTC (rev 293)
@@ -0,0 +1,281 @@
+/* Emulator.m: Implementation for the Emulator class
+ Copyright (c) 2006-2007 Fredrick Meunier
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ Author contact information:
+
+ E-mail: fr...@sp...
+ Postal address: 3/66 Roslyn Gardens, Ruscutters Bay, NSW 2011, Australia
+
+*/
+
+#import "DisplayOpenGLView.h"
+#import "Emulator.h"
+
+#include "event.h"
+#include "fuse.h"
+#include "fusepb/main.h"
+#include "keyboard.h"
+#include "machine.h"
+#include "settings.h"
+#include "sound.h"
+#include "ui/ui.h"
+
+extern keysyms_map_t unicode_keysyms_map[];
+
+#include "sound/sfifo.h"
+
+extern sfifo_t sound_fifo;
+
+@implementation Emulator
+
+static Emulator *instance = nil;
+
++(Emulator *) instance
+{
+ return instance;
+}
+
+- (id)installServer
+{
+ NSConnection *theConnection;
+ theConnection = [NSConnection defaultConnection];
+ NSLog(@"Creating connection...");
+
+ [theConnection setRootObject:self];
+ if ([theConnection registerName:@"EmulatorSvr"] == NO) {
+ NSLog(@"Emulator failed to register name\n");
+ }
+
+ [theConnection retain];
+ NSLog(@"done.\n");
+ return self;
+}
+
+-(id) init
+{
+ if ( instance ) {
+ [self dealloc];
+ self = instance;
+ } else {
+ self = [super init];
+ instance = self;
+
+ [self installServer];
+
+ [self initKeyboard];
+ }
+
+ timer = nil;
+
+ optDown = NO;
+ ctrlDown = NO;
+ shiftDown = NO;
+
+ cocoakeyboard_caps_shift_pressed = 0;
+ cocoakeyboard_symbol_shift_pressed = 0;
+ unicode_keysym = INPUT_KEY_NONE;
+
+ time = CFAbsoluteTimeGetCurrent(); /* set emulation time start time */
+
+ return self;
+}
+
+-(void) updateEmulation:(NSTimer*)theTimer
+{
+ CFTimeInterval nowTime = CFAbsoluteTimeGetCurrent();
+ CFTimeInterval deltaTime = nowTime - time;
+ if (deltaTime <= 1.0) { /* skip pauses */
+ [self updateEmulationForTimeDelta:deltaTime];
+ }
+ time = nowTime;
+ [[DisplayOpenGLView instance] setNeedsDisplay:YES];
+}
+
+/* given a delta time in seconds, update overall emulation state */
+-(void) updateEmulationForTimeDelta:(CFAbsoluteTime)deltaTime
+{
+ if( sound_enabled ) {
+ /* emulate until fifo is full */
+ while( sfifo_space( &sound_fifo ) >= (sound_stereo+1) * 2 * sound_framesiz ) {
+ event_do_frame();
+ }
+ } else {
+ float speed = ( settings_current.emulation_speed < 1 ?
+ 100.0 :
+ settings_current.emulation_speed ) / 100.0;
+ libspectrum_dword time_tstates = deltaTime *
+ machine_current->timings.processor_speed *
+ speed + 0.5;
+ event_do_timer( time_tstates );
+ }
+}
+
+-(void) setEmulationHz:(float)hz
+{
+ [timer invalidate];
+ [timer release];
+
+ timer = [[NSTimer scheduledTimerWithTimeInterval: (1.0f / hz)
+ target:self selector:@selector(updateEmulation:)
+ userInfo:self repeats:true] retain];
+}
+
+-(void) mouseMoved:(NSEvent *)theEvent
+{
+ if( ui_mouse_grabbed ) {
+ int dx = [theEvent deltaX];
+ int dy = [theEvent deltaY];
+
+ if( dx < -128 ) dx = -128;
+ else if( dx > 128 ) dx = 128;
+
+ if( dy < -128 ) dy = -128;
+ else if( dy > 128 ) dy = 128;
+
+ ui_mouse_motion( dx, dy );
+ }
+}
+
+-(void) mouseDown:(NSEvent *)theEvent
+{
+ ui_mouse_button( 1, 1 );
+}
+
+-(void) mouseUp:(NSEvent *)theEvent
+{
+ ui_mouse_button( 1, 0 );
+}
+
+-(void) rightMouseDown:(NSEvent *)theEvent
+{
+ ui_mouse_button( 3, 1 );
+}
+
+-(void) rightMouseUp:(NSEvent *)theEvent
+{
+ ui_mouse_button( 3, 0 );
+}
+
+-(void) otherMouseDown:(NSEvent *)theEvent
+{
+ ui_mouse_button( 2, 1 );
+}
+
+-(void) otherMouseUp:(NSEvent *)theEvent
+{
+ ui_mouse_button( 2, 0 );
+}
+
+-(void) initKeyboard
+{
+ keysyms_map_t *ptr3;
+
+ unicode_keysyms_hash = g_hash_table_new( g_int_hash, g_int_equal );
+
+ for( ptr3 = (keysyms_map_t *)unicode_keysyms_map; ptr3->ui; ptr3++ )
+ g_hash_table_insert( unicode_keysyms_hash, &( ptr3->ui ),
+ &( ptr3->fuse ) );
+}
+
+-(void) modifierChange:(input_event_type)theType oldState:(BOOL)old newState:(BOOL)new
+{
+ if( old != new ) {
+ input_event_t fuse_event;
+ fuse_event.types.key.spectrum_key = theType;
+ if( new == YES )
+ fuse_event.type = INPUT_EVENT_KEYPRESS;
+ else
+ fuse_event.type = INPUT_EVENT_KEYRELEASE;
+ input_event( &fuse_event );
+ }
+}
+
+-(void) flagsChanged:(NSEvent *)theEvent
+{
+ int flags = [theEvent modifierFlags];
+ BOOL optDownNew = (flags & NSAlternateKeyMask) ? YES : NO;
+ BOOL ctrlDownNew = (flags & NSControlKeyMask) ? YES : NO;
+ BOOL shiftDownNew = ( flags & NSShiftKeyMask ) ? YES : NO;
+
+ [self modifierChange:INPUT_KEY_Alt_L oldState:optDown newState:optDownNew];
+ [self modifierChange:INPUT_KEY_Control_L oldState:ctrlDown newState:ctrlDownNew];
+ [self modifierChange:INPUT_KEY_Shift_L oldState:shiftDown newState:shiftDownNew];
+
+ optDown = optDownNew;
+ ctrlDown = ctrlDownNew;
+ shiftDown = shiftDownNew;
+}
+
+-(input_key) otherKeysymsRemap:(libspectrum_dword)ui_keysym inHash:(GHashTable*)hash
+{
+ const input_key *ptr;
+
+ ptr = g_hash_table_lookup( hash, &ui_keysym );
+
+ return ptr ? *ptr : INPUT_KEY_NONE;
+}
+
+-(void) keyChange:(NSEvent *)theEvent type:(input_event_type)type
+{
+ unsigned short keyCode = [theEvent keyCode];
+ NSString *characters = [theEvent charactersIgnoringModifiers];
+ if ([characters length]) {
+ input_key fuse_keysym;
+ input_event_t fuse_event;
+
+ fuse_keysym = keysyms_remap( keyCode );
+ if( fuse_keysym == INPUT_KEY_NONE ) {
+ fuse_keysym = [self otherKeysymsRemap:[characters characterAtIndex:0]
+ inHash:unicode_keysyms_hash];
+ if( fuse_keysym != INPUT_KEY_NONE ) {
+ unicode_keysym = fuse_keysym;
+ /* record current values of caps and symbol shift. We will temoprarily
+ * override these for the duration of the unicoded simulated keypresses
+ */
+ if( ( cocoakeyboard_caps_shift_pressed = keyboard_state( KEYBOARD_Caps ) ) )
+ {
+ keyboard_release( KEYBOARD_Caps );
+ }
+ if( ( cocoakeyboard_symbol_shift_pressed =
+ keyboard_state( KEYBOARD_Symbol ) ) ) {
+ keyboard_release( KEYBOARD_Symbol );
+ }
+ }
+ }
+
+ fuse_event.type = type;
+ if( unicode_keysym == INPUT_KEY_NONE )
+ fuse_event.types.key.native_key = fuse_keysym;
+ else
+ fuse_event.types.key.native_key = unicode_keysym;
+ fuse_event.types.key.spectrum_key = fuse_keysym;
+
+ input_event( &fuse_event );
+ }
+}
+
+-(void) keyDown:(NSEvent *)theEvent
+{
+ [self keyChange:theEvent type:INPUT_EVENT_KEYPRESS];
+}
+
+-(void) keyUp:(NSEvent *)theEvent
+{
+ [self keyChange:theEvent type:INPUT_EVENT_KEYRELEASE];
+}
+
+@end
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-01-10 12:01:12 UTC (rev 292)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-01-14 11:27:54 UTC (rev 293)
@@ -1,5 +1,5 @@
/* DisplayOpenGLView.h: Implementation for the DisplayOpenGLView class
- Copyright (c) 2006 Fredrick Meunier
+ Copyright (c) 2006-2007 Fredrick Meunier
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
@@ -29,34 +29,26 @@
#include "input.h"
#include "ui/cocoa/cocoadisplay.h"
+@class Emulator;
+
@interface DisplayOpenGLView : NSOpenGLView
{
- NSTimer* timer;
-
/* Need texture size and dimensions and two backing textures */
Cocoa_Texture screenTex; /* Screen texture */
BOOL screenTexInitialised;
- GHashTable *unicode_keysyms_hash;
-
- BOOL optDown;
- BOOL ctrlDown;
- BOOL shiftDown;
-
- int cocoakeyboard_caps_shift_pressed;
- int cocoakeyboard_symbol_shift_pressed;
- input_key unicode_keysym;
-
- CFAbsoluteTime time;
-
NSWindow *fullscreenWindow;
NSWindow *windowedWindow;
float target_ratio;
+
+ Emulator *emulator;
}
+(DisplayOpenGLView *) instance;
+- (id)installServer;
+
-(IBAction) fullscreen:(id)sender;
-(IBAction) zoom:(id)sender;
@@ -65,9 +57,6 @@
-(void) createTexture:(Cocoa_Texture*)newScreen;
-(void) destroyTexture;
--(void) updateEmulationForTimeDelta:(CFAbsoluteTime)deltaTime;
--(void) setEmulationHz:(float)hz;
-
-(id) initWithFrame:(NSRect)frameRect;
-(void) awakeFromNib;
@@ -79,11 +68,7 @@
-(void) otherMouseDown:(NSEvent *)theEvent;
-(void) otherMouseUp:(NSEvent *)theEvent;
--(void) initKeyboard;
--(void) modifierChange:(input_event_type)theType oldState:(BOOL)old newState:(BOOL)new;
-(void) flagsChanged:(NSEvent *)theEvent;
--(input_key) otherKeysymsRemap:(libspectrum_dword)ui_keysym inHash:(GHashTable*)hash;
--(void) keyChange:(NSEvent *)theEvent type:(input_event_type)type;
-(void) keyDown:(NSEvent *)theEvent;
-(void) keyUp:(NSEvent *)theEvent;
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-10 12:01:12 UTC (rev 292)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-01-14 11:27:54 UTC (rev 293)
@@ -1,5 +1,5 @@
/* DisplayOpenGLView.m: Implementation for the DisplayOpenGLView class
- Copyright (c) 2006 Fredrick Meunier
+ Copyright (c) 2006-2007 Fredrick Meunier
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,24 +23,21 @@
*/
#import "DisplayOpenGLView.h"
+#import "Emulator.h"
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#include <OpenGL/glu.h>
+#if 0
#include "event.h"
+#include "keyboard.h"
+#include "sound.h"
+#endif
#include "fuse.h"
#include "fusepb/main.h"
-#include "keyboard.h"
#include "settings.h"
-#include "sound.h"
-extern keysyms_map_t unicode_keysyms_map[];
-
-#include "sound/sfifo.h"
-
-extern sfifo_t sound_fifo;
-
@implementation DisplayOpenGLView
static DisplayOpenGLView *instance = nil;
@@ -109,6 +106,22 @@
[[self window] setContentSize:size];
}
+- (id)installServer
+{
+ NSConnection *theConnection;
+ theConnection = [NSConnection defaultConnection];
+ NSLog(@"Creating connection...");
+
+ [theConnection setRootObject:self];
+ if ([theConnection registerName:@"DisplayOpenGLViewSvr"] == NO) {
+ NSLog(@"DisplayOpenGLView failed to register name\n");
+ }
+
+ [theConnection retain];
+ NSLog(@"done.\n");
+ return self;
+}
+
-(id) initWithFrame:(NSRect)frameRect
{
/* Init pixel format attribs */
@@ -132,14 +145,16 @@
} else {
self = [super initWithFrame:frameRect pixelFormat:pixFmt];
instance = self;
+
+ emulator = [[Emulator alloc] init];
+
+ [self installServer];
}
[pixFmt release];
[[self openGLContext] makeCurrentContext];
- timer = nil;
-
/* Setup some basic OpenGL stuff */
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
@@ -148,14 +163,6 @@
screenTexInitialised = NO;
- optDown = NO;
- ctrlDown = NO;
- shiftDown = NO;
-
- cocoakeyboard_caps_shift_pressed = 0;
- cocoakeyboard_symbol_shift_pressed = 0;
- unicode_keysym = INPUT_KEY_NONE;
-
target_ratio = 4.0f/3.0f;
return self;
@@ -170,25 +177,18 @@
if( fuse_init( ac, av ) ) {
fprintf( stderr, "%s: error initialising -- giving up!\n", fuse_progname );
}
-
- [self initKeyboard];
-
- time = CFAbsoluteTimeGetCurrent(); /* set emulation time start time */
}
-(void) drawRect:(NSRect)aRect
{
- CFTimeInterval nowTime = CFAbsoluteTimeGetCurrent();
- CFTimeInterval deltaTime = nowTime - time;
- if (deltaTime <= 1.0) { /* skip pauses */
- [self updateEmulationForTimeDelta:deltaTime];
- }
- time = nowTime;
-
if( NO == screenTexInitialised ) return;
/* Need to draw texture to screen here */
+ /* FIXME: lock screen - direct lock probably faster [emulation lockScreen]; */
+ /* should draw directly from emulation screen instead of screenTex, switch between
+ buffers there */
memcpy( screenTex.pixels, screen->pixels, screenTex.pitch * screenTex.full_height );
+ /* FIXME: unlock screen - direct lock probably faster [emulation unlockScreen]; */
[[self openGLContext] makeCurrentContext];
@@ -345,169 +345,46 @@
screenTexInitialised = YES;
}
-/* given a delta time in seconds, update overall emulation state */
--(void) updateEmulationForTimeDelta:(CFAbsoluteTime)deltaTime
-{
- if( sound_enabled ) {
- /* emulate until fifo is full */
- while( sfifo_space( &sound_fifo ) >= (sound_stereo+1) * 2 * sound_framesiz ) {
- event_do_frame();
- }
- } else {
- float speed = ( settings_current.emulation_speed < 1 ?
- 100.0 :
- settings_current.emulation_speed ) / 100.0;
- libspectrum_dword time_tstates = deltaTime *
- machine_current->timings.processor_speed *
- speed + 0.5;
- event_do_timer( time_tstates );
- }
-}
-
--(void) setEmulationHz:(float)hz
-{
- [timer invalidate];
- [timer release];
-
- timer = [[NSTimer scheduledTimerWithTimeInterval: (1.0f / hz)
- target:self selector:@selector(drawRect:)
- userInfo:self repeats:true] retain];
-}
-
-(void) mouseMoved:(NSEvent *)theEvent
{
- if( ui_mouse_grabbed ) {
- int dx = [theEvent deltaX];
- int dy = [theEvent deltaY];
-
- if( dx < -128 ) dx = -128;
- else if( dx > 128 ) dx = 128;
-
- if( dy < -128 ) dy = -128;
- else if( dy > 128 ) dy = 128;
-
- ui_mouse_motion( dx, dy );
- }
+ [emulator mouseMoved:theEvent];
}
-(void) mouseDown:(NSEvent *)theEvent
{
- ui_mouse_button( 1, 1 );
+ [emulator mouseDown:theEvent];
}
-(void) mouseUp:(NSEvent *)theEvent
{
- ui_mouse_button( 1, 0 );
+ [emulator mouseUp:theEvent];
}
-(void) rightMouseDown:(NSEvent *)theEvent
{
- ui_mouse_button( 3, 1 );
+ [emulator rightMouseDown:theEvent];
}
-(void) rightMouseUp:(NSEvent *)theEvent
{
- ui_mouse_button( 3, 0 );
+ [emulator rightMouseUp:theEvent];
}
-(void) otherMouseDown:(NSEvent *)theEvent
{
- ui_mouse_button( 2, 1 );
+ [emulator otherMouseDown:theEvent];
}
-(void) otherMouseUp:(NSEvent *)theEvent
{
- ui_mouse_button( 2, 0 );
+ [emulator otherMouseUp:theEvent];
}
--(void) initKeyboard
-{
- keysyms_map_t *ptr3;
-
- unicode_keysyms_hash = g_hash_table_new( g_int_hash, g_int_equal );
-
- for( ptr3 = (keysyms_map_t *)unicode_keysyms_map; ptr3->ui; ptr3++ )
- g_hash_table_insert( unicode_keysyms_hash, &( ptr3->ui ),
- &( ptr3->fuse ) );
-}
-
--(void) modifierChange:(input_event_type)theType oldState:(BOOL)old newState:(BOOL)new
-{
- if( old != new ) {
- input_event_t fuse_event;
- fuse_event.types.key.spectrum_key = theType;
- if( new == YES )
- fuse_event.type = INPUT_EVENT_KEYPRESS;
- else
- fuse_event.type = INPUT_EVENT_KEYRELEASE;
- input_event( &fuse_event );
- }
-}
-
-(void) flagsChanged:(NSEvent *)theEvent
{
- int flags = [theEvent modifierFlags];
- BOOL optDownNew = (flags & NSAlternateKeyMask) ? YES : NO;
- BOOL ctrlDownNew = (flags & NSControlKeyMask) ? YES : NO;
- BOOL shiftDownNew = ( flags & NSShiftKeyMask ) ? YES : NO;
-
- [self modifierChange:INPUT_KEY_Alt_L oldState:optDown newState:optDownNew];
- [self modifierChange:INPUT_KEY_Control_L oldState:ctrlDown newState:ctrlDownNew];
- [self modifierChange:INPUT_KEY_Shift_L oldState:shiftDown newState:shiftDownNew];
-
- optDown = optDownNew;
- ctrlDown = ctrlDownNew;
- shiftDown = shiftDownNew;
+ [emulator flagsChanged:theEvent];
}
--(input_key) otherKeysymsRemap:(libspectrum_dword)ui_keysym inHash:(GHashTable*)hash
-{
- const input_key *ptr;
-
- ptr = g_hash_table_lookup( hash, &ui_keysym );
-
- return ptr ? *ptr : INPUT_KEY_NONE;
-}
-
--(void) keyChange:(NSEvent *)theEvent type:(input_event_type)type
-{
- unsigned short keyCode = [theEvent keyCode];
- NSString *characters = [theEvent charactersIgnoringModifiers];
- if ([characters length]) {
- input_key fuse_keysym;
- input_event_t fuse_event;
-
- fuse_keysym = keysyms_remap( keyCode );
- if( fuse_keysym == INPUT_KEY_NONE ) {
- fuse_keysym = [self otherKeysymsRemap:[characters characterAtIndex:0]
- inHash:unicode_keysyms_hash];
- if( fuse_keysym != INPUT_KEY_NONE ) {
- unicode_keysym = fuse_keysym;
- /* record current values of caps and symbol shift. We will temoprarily
- * override these for the duration of the unicoded simulated keypresses
- */
- if( ( cocoakeyboard_caps_shift_pressed = keyboard_state( KEYBOARD_Caps ) ) )
- {
- keyboard_release( KEYBOARD_Caps );
- }
- if( ( cocoakeyboard_symbol_shift_pressed =
- keyboard_state( KEYBOARD_Symbol ) ) ) {
- keyboard_release( KEYBOARD_Symbol );
- }
- }
- }
-
- fuse_event.type = type;
- if( unicode_keysym == INPUT_KEY_NONE )
- fuse_event.types.key.native_key = fuse_keysym;
- else
- fuse_event.types.key.native_key = unicode_keysym;
- fuse_event.types.key.spectrum_key = fuse_keysym;
-
- input_event( &fuse_event );
- }
-}
-
-(void) keyDown:(NSEvent *)theEvent
{
if( settings_current.full_screen ) {
@@ -520,13 +397,12 @@
break;
}
}
-
- [self keyChange:theEvent type:INPUT_EVENT_KEYPRESS];
+ [emulator keyDown:theEvent];
}
-(void) keyUp:(NSEvent *)theEvent
{
- [self keyChange:theEvent type:INPUT_EVENT_KEYRELEASE];
+ [emulator keyUp:theEvent];
}
-(BOOL) acceptsFirstResponder
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2007-01-20 14:43:22
|
Revision: 294
http://svn.sourceforge.net/fuse-for-macosx/?rev=294&view=rev
Author: fredm
Date: 2007-01-20 06:43:22 -0800 (Sat, 20 Jan 2007)
Log Message:
-----------
* Move emulation object to it's own thread and call main thread methods with
performSelectorOnMainThread:withObject:waitUntilDone:, call emulation thread
methods with DO when emulation is not paused, this should avoid sound glitches
when menus are selected or window is minimised
* Fix screen updating during fastloading
* Make sure that fuse_end is called somewhere on exit
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/display.c
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/FuseMenus.h
branches/fusegl/fuse/fusepb/FuseMenus.m
branches/fusegl/fuse/fusepb/controllers/DebuggerController.m
branches/fusegl/fuse/fusepb/controllers/FuseController.h
branches/fusegl/fuse/fusepb/controllers/FuseController.m
branches/fusegl/fuse/fusepb/controllers/LoadBinaryController.m
branches/fusegl/fuse/fusepb/controllers/MemoryBrowserController.m
branches/fusegl/fuse/fusepb/controllers/PokeFinderController.m
branches/fusegl/fuse/fusepb/controllers/PreferencesController.m
branches/fusegl/fuse/fusepb/controllers/RollbackController.m
branches/fusegl/fuse/fusepb/controllers/SaveBinaryController.m
branches/fusegl/fuse/fusepb/controllers/TapeBrowserController.m
branches/fusegl/fuse/fusepb/models/Emulator.h
branches/fusegl/fuse/fusepb/models/Emulator.m
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/settings.pl
branches/fusegl/fuse/ui/cocoa/cocoaui.m
Added Paths:
-----------
branches/fusegl/fuse/ui/cocoa/cocoadisplay.m
Removed Paths:
-------------
branches/fusegl/fuse/ui/cocoa/cocoadisplay.c
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-01-14 11:27:54 UTC (rev 293)
+++ branches/fusegl/fuse/TODO 2007-01-20 14:43:22 UTC (rev 294)
@@ -15,17 +15,18 @@
X Add support for bilinear etc. OpenGL filters
X Add option to snap window size to 1x, 2x, 3x
X Grab mouse in fullscreen mode
-X Vend FuseController and DisplayOpenGLView
-X Move emulation to it's own object and vend it
-* Move emulation to it's own thread and call FuseController and DisplayOpenGLView
- through their vended objects
-* Use sheets rather than modal dialogs
-* Run emulation in seperate thread to avoid sound glitches when menus are
- selected or window is minimised
+X Move emulation to it's own object
+X Move emulation object to it's own thread and call main thread methods with
+ performSelectorOnMainThread:withObject:waitUntilDone:, call emulation thread
+ methods with DO when emulation is not paused, this should avoid sound glitches
+ when menus are selected or window is minimised
+X Fix screen updating during fastloading
+X Make sure that fuse_end is called somewhere on exit
+* Use screenshot style code for minimise icon rather than reading out of GL texture
* Restore activity icons
* Add native joystick processing (removes SDL joystick input dependency from
Fuse)
-* Fix screen updating during fastloading
+* Use sheets rather than modal dialogs (for Save As)
* Put in latest hq[23]x filters (HQ2x_555 from ScummVM should do the trick)
* Make border display optional
* Quit keyhandling when command key is pressed
Modified: branches/fusegl/fuse/display.c
===================================================================
--- branches/fusegl/fuse/display.c 2007-01-14 11:27:54 UTC (rev 293)
+++ branches/fusegl/fuse/display.c 2007-01-20 14:43:22 UTC (rev 294)
@@ -641,7 +641,7 @@
critical_region_x = beam_x;
}
-static void
+inline static void
get_beam_position( int *x, int *y )
{
if( tstates < machine_current->line_times[ 0 ] ) {
@@ -655,8 +655,8 @@
*x = ( tstates - machine_current->line_times[ *y ] ) / 4;
}
-void
-display_update_critical( int x, int y )
+inline static void
+update_critical_internal( int x, int y )
{
int beam_x, beam_y;
@@ -683,9 +683,15 @@
copy_critical_region( beam_x, beam_y );
}
+void
+display_update_critical( int x, int y )
+{
+ update_critical_internal( x, y );
+}
+
/* Mark the 8-pixel chunk at (x,y) as maybe dirty and update the critical
region as appropriate */
-static void
+inline static void
display_dirty_chunk( int x, int y )
{
/* If the write is between the start of the critical region and the
@@ -693,7 +699,7 @@
if( y > critical_region_y ||
( y == critical_region_y && x >= critical_region_x ) ) {
- display_update_critical( x, y );
+ update_critical_internal( x, y );
}
display_maybe_dirty[y] |= ( (libspectrum_dword)1 << x );
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-01-14 11:27:54 UTC (rev 293)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-01-20 14:43:22 UTC (rev 294)
@@ -273,7 +273,7 @@
B6A6F1200B3EA737000B88E9 /* cocoascreenshot.m in Sources */ = {isa = PBXBuildFile; fileRef = B6A6F11E0B3EA737000B88E9 /* cocoascreenshot.m */; };
B6B076B20B59FE9A00D4F95C /* Emulator.h in Headers */ = {isa = PBXBuildFile; fileRef = B6B076B00B59FE9A00D4F95C /* Emulator.h */; };
B6B076B30B59FE9A00D4F95C /* Emulator.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B076B10B59FE9A00D4F95C /* Emulator.m */; };
- B6CE7F400B2830A300EB65B3 /* cocoadisplay.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */; };
+ B6B99F8A0B5F798700EE408F /* cocoadisplay.m in Sources */ = {isa = PBXBuildFile; fileRef = B6B99F890B5F798700EE408F /* cocoadisplay.m */; };
B6CE7F410B2830A300EB65B3 /* cocoadisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */; };
B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */; };
B6CE7F440B2830A300EB65B3 /* cocoaui.h in Headers */ = {isa = PBXBuildFile; fileRef = B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */; };
@@ -486,6 +486,7 @@
B6AF242A04156EE700F48F48 /* blank.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = blank.icns; path = resources/blank.icns; sourceTree = SOURCE_ROOT; };
B6B076B00B59FE9A00D4F95C /* Emulator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Emulator.h; sourceTree = "<group>"; };
B6B076B10B59FE9A00D4F95C /* Emulator.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = Emulator.m; sourceTree = "<group>"; };
+ B6B99F890B5F798700EE408F /* cocoadisplay.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoadisplay.m; sourceTree = "<group>"; };
B6BA1A8B04E4F3290017354F /* gcrypt.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = gcrypt.framework; path = ../../libgcrypt/build/Deployment/gcrypt.framework; sourceTree = SOURCE_ROOT; };
B6BA1A9404E4F88F0017354F /* uijoystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = uijoystick.h; path = ../ui/uijoystick.h; sourceTree = SOURCE_ROOT; };
B6BA6F0207B1E04200E44C8D /* Preferences.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Preferences.nib; path = nibs/Preferences.nib; sourceTree = "<group>"; };
@@ -503,7 +504,6 @@
B6CC82FF0800E408006EFFB9 /* CAMachines.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = CAMachines.h; path = content_arrays/CAMachines.h; sourceTree = SOURCE_ROOT; };
B6CC83000800E408006EFFB9 /* CAMachines.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = CAMachines.m; path = content_arrays/CAMachines.m; sourceTree = SOURCE_ROOT; };
B6CD0B9E06069F4A00847338 /* fuse.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = fuse.cpp; path = ../fuse.cpp; sourceTree = SOURCE_ROOT; };
- B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cocoadisplay.c; sourceTree = "<group>"; };
B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cocoadisplay.h; sourceTree = "<group>"; };
B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = cocoajoystick.c; sourceTree = "<group>"; };
B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = cocoaui.h; sourceTree = "<group>"; };
@@ -918,8 +918,8 @@
B6CE7E8A0B28027000EB65B3 /* cocoa */ = {
isa = PBXGroup;
children = (
- B6CE7F3A0B2830A300EB65B3 /* cocoadisplay.c */,
B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */,
+ B6B99F890B5F798700EE408F /* cocoadisplay.m */,
B6A6F10D0B3D6360000B88E9 /* cocoaerror.m */,
B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */,
B6A6F11D0B3EA737000B88E9 /* cocoascreenshot.h */,
@@ -1467,7 +1467,6 @@
B64E29FE0A65337A006863D9 /* NSString+CarbonFSRefCreation.m in Sources */,
B64E2A020A6533FD006863D9 /* thumbnail.m in Sources */,
B6403FD80A7E4B1A00E00B11 /* loader.c in Sources */,
- B6CE7F400B2830A300EB65B3 /* cocoadisplay.c in Sources */,
B6CE7F420B2830A300EB65B3 /* cocoajoystick.c in Sources */,
B6CE7F520B283A0700EB65B3 /* main.mm in Sources */,
B6CE7FCE0B28FBD600EB65B3 /* DisplayOpenGLView.m in Sources */,
@@ -1481,6 +1480,7 @@
B6A24E3B0B49C78700AD5B9D /* hq2x.cpp in Sources */,
B6A24E3D0B49C78700AD5B9D /* hq3x.cpp in Sources */,
B6B076B30B59FE9A00D4F95C /* Emulator.m in Sources */,
+ B6B99F8A0B5F798700EE408F /* cocoadisplay.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: branches/fusegl/fuse/fusepb/FuseMenus.h
===================================================================
--- branches/fusegl/fuse/fusepb/FuseMenus.h 2007-01-14 11:27:54 UTC (rev 293)
+++ branches/fusegl/fuse/fusepb/FuseMenus.h 2007-01-20 14:43:22 UTC (rev 294)
@@ -30,19 +30,6 @@
#include "ui/cocoa/cocoadisplay.h"
-void CreateTexture(Cocoa_Texture*);
-void DestroyTexture(void);
void SetEmulationHz(float);
-void Hide(void);
-void Open(void);
-void SaveAs(void);
-void Minimise(void);
-void Help(void);
-void Keyboard(void);
-void TapePlay(void);
-void RzxInsertSnap(void);
-void RzxRollback(void);
-void Preferences(void);
-
#endif /* #ifndef FUSEMENUS_H */
Modified: branches/fusegl/fuse/fusepb/FuseMenus.m
===================================================================
--- branches/fusegl/fuse/fusepb/FuseMenus.m 2007-01-14 11:27:54 UTC (rev 293)
+++ branches/fusegl/fuse/fusepb/FuseMenus.m 2007-01-20 14:43:22 UTC (rev 294)
@@ -27,97 +27,11 @@
*/
-#import "DisplayOpenGLView.h"
#import "Emulator.h"
#import "FuseController.h"
#import "FuseMenus.h"
-/* Definition of Mac native keycodes for characters used as menu shortcuts that
- bring up a window. */
-#define QZ_m 0x2E
-#define QZ_s 0x01
-#define QZ_h 0x04
-#define QZ_SLASH 0x2C
-#define QZ_f 0x03
-#define QZ_o 0x1F
-#define QZ_p 0x23
-#define QZ_b 0x0b
-#define QZ_r 0x0f
-#define QZ_k 0x28
-#define QZ_COMMA 0x2B
-
-void
-CreateTexture(Cocoa_Texture* new_screen)
-{
- [[DisplayOpenGLView instance] createTexture:new_screen];
-}
-
-void DestroyTexture(void)
-{
- [[DisplayOpenGLView instance] destroyTexture];
-}
-
void SetEmulationHz( float hz )
{
[[Emulator instance] setEmulationHz:hz];
}
-
-void Hide(void)
-{
- [NSApp hide:[FuseController singleton]];
- [[FuseController singleton] releaseCmdKeys:@"h":QZ_h];
-}
-
-void Open(void)
-{
- [[FuseController singleton] open:nil];
- [[FuseController singleton] releaseCmdKeys:@"o":QZ_o];
-}
-
-void SaveAs(void)
-{
- [[FuseController singleton] save_as:nil];
- [[FuseController singleton] releaseCmdKeys:@"s":QZ_s];
-}
-
-void Minimise(void)
-{
- [[NSApp keyWindow] performMiniaturize:[FuseController singleton]];
- [[FuseController singleton] releaseCmdKeys:@"m":QZ_m];
-}
-
-void Help(void)
-{
- [NSApp showHelp:[FuseController singleton]];
- [[FuseController singleton] releaseCmdKeys:@"?":QZ_SLASH];
-}
-
-void Keyboard(void)
-{
- [[FuseController singleton] showKeyboardPane:nil];
- [[FuseController singleton] releaseCmdKeys:@"k":QZ_k];
-}
-
-void TapePlay(void)
-{
- [[FuseController singleton] tape_play:nil];
- [[FuseController singleton] releaseCmdKeys:@"p":QZ_p];
-}
-
-void RzxInsertSnap(void)
-{
- [[FuseController singleton] rzx_insert_snap:nil];
- [[FuseController singleton] releaseCmdKeys:@"b":QZ_b];
-}
-
-void RzxRollback(void)
-{
- [[FuseController singleton] rzx_rollback:nil];
- [[FuseController singleton] releaseCmdKeys:@"r":QZ_r];
-}
-
-void Preferences(void)
-{
- [[FuseController singleton] showPreferencesPane:nil];
- [[FuseController singleton] releaseCmdKeys:@",":QZ_COMMA];
-}
Modified: branches/fusegl/fuse/fusepb/controllers/DebuggerController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/DebuggerController.m 2007-01-14 11:27:54 UTC (rev 293)
+++ branches/fusegl/fuse/fusepb/controllers/DebuggerController.m 2007-01-20 14:43:22 UTC (rev 294)
@@ -25,6 +25,7 @@
*/
#import "DebuggerController.h"
+#import "DisplayOpenGLView.h"
#include <config.h>
@@ -163,7 +164,7 @@
- (void)debugger_activate:(id)sender
{
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
[singleton showWindow:nil];
@@ -623,7 +624,7 @@
{
[NSApp stopModal];
debugger_active = 0;
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
return 0;
}
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.h
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.h 2007-01-14 11:27:54 UTC (rev 293)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.h 2007-01-20 14:43:22 UTC (rev 294)
@@ -128,8 +128,6 @@
- (IBAction)saveFileTypeClicked:(id)sender;
-- (id)installServer;
-
- savePanelAccessoryView;
- (NSPopUpButton*) saveFileType;
@@ -148,12 +146,13 @@
- (void)ui_menu_activate_media_ide_simple8bit:(int)active;
- (void)ui_menu_activate_media_ide_zxatasp:(int)active;
- (void)ui_menu_activate_media_ide_zxcf:(int)active;
-- (int)ui_statusbar_update_speed:(float)speed;
-- (void)openFile:(char *)filename;
+- (void)openFile:(const char *)filename;
- (void)openRecent:(id)sender;
+- (void)addRecentSnapshotWithString:(NSString*)file;
- (void)addRecentSnapshot:(const char *)filename;
- (void)clearRecentSnapshots;
+- (void)setTitle:(NSString*)title;
- (void)openDisk:(specplus3_drive_number)drive;
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.m 2007-01-14 11:27:54 UTC (rev 293)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.m 2007-01-20 14:43:22 UTC (rev 294)
@@ -40,6 +40,8 @@
#import "SaveBinaryController.h"
#import "TapeBrowserController.h"
+#import "DisplayOpenGLView.h"
+
#include "dck.h"
#include "debugger/debugger.h"
#include "divide.h"
@@ -141,22 +143,6 @@
return singleton ? singleton : [[self alloc] init];
}
-- (id)installServer
-{
- NSConnection *theConnection;
- theConnection = [NSConnection defaultConnection];
- NSLog(@"Creating connection...");
-
- [theConnection setRootObject:self];
- if ([theConnection registerName:@"FuseControllerSvr"] == NO) {
- NSLog(@"FuseController failed to register name\n");
- }
-
- [theConnection retain];
- NSLog(@"done.\n");
- return self;
-}
-
- (id)init
{
if ( singleton ) {
@@ -228,8 +214,6 @@
recentSnapFileNames = [NSMutableArray arrayWithCapacity:NUM_RECENT_ITEMS];
[recentSnapFileNames retain];
-
- [self installServer];
}
return singleton;
@@ -270,11 +254,11 @@
int error;
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_openpanel_get_filename( @"Insert Timex dock cartridge", dckFileTypes );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
error = dck_insert( filename );
if(error) goto error;
@@ -284,16 +268,16 @@
error:
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)dock_eject:(id)sender
{
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
dck_eject();
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)if2_open:(id)sender
@@ -301,11 +285,11 @@
int error;
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_openpanel_get_filename( @"Insert Interface II cartridge", romFileTypes );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
error = if2_insert( filename );
if(error) goto error;
@@ -315,16 +299,16 @@
error:
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)if2_eject:(id)sender
{
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
if2_eject();
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)ide_insert:(id)sender
@@ -332,11 +316,11 @@
int error=0;
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_openpanel_get_filename( @"Insert hard disk file", ideFileTypes );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
switch( [sender tag] ) {
case 41: error = simpleide_insert( filename, LIBSPECTRUM_IDE_MASTER ); break;
@@ -355,12 +339,12 @@
error:
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)ide_commit:(id)sender
{
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
switch( [sender tag] ) {
case 51: simpleide_commit( LIBSPECTRUM_IDE_MASTER ); break;
@@ -372,7 +356,7 @@
case 57: divide_commit( LIBSPECTRUM_IDE_SLAVE ); break;
}
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)ide_eject:(id)sender
@@ -397,10 +381,10 @@
{
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_openpanel_get_filename( @"Insert microdrive disk file", mdrFileTypes );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
if1_mdr_insert( filename, [sender tag] - 30 );
@@ -408,7 +392,7 @@
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)mdr_commit:(id)sender
@@ -417,10 +401,10 @@
if( !if1_mdr_sync( NULL, [sender tag] - 30 ) ) return;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_savepanel_get_filename( @"Write Microdrive Cartridge As", [NSArray arrayWithObjects:@"mdr", nil] );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
if1_mdr_sync( filename, [sender tag] - 30 );
@@ -428,7 +412,7 @@
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)mdr_eject:(id)sender
@@ -437,10 +421,10 @@
if( !if1_mdr_eject( NULL, [sender tag] - 30 ) ) return;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_savepanel_get_filename( @"Write Microdrive Cartridge As", [NSArray arrayWithObjects:@"mdr", nil] );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
if1_mdr_eject( filename, [sender tag] - 30 );
@@ -448,7 +432,7 @@
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)mdr_writep:(id)sender
@@ -462,11 +446,11 @@
{
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_openpanel_get_filename( @"Open Spectrum File", allFileTypes );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
[self addRecentSnapshot:filename];
@@ -474,28 +458,28 @@
free(filename);
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)reset:(id)sender
{
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
machine_reset();
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)nmi:(id)sender
{
int error;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
error = event_add( 0, EVENT_TYPE_NMI );
/* Complain if( error ) return error; */
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)rzx_play:(id)sender
@@ -504,11 +488,11 @@
if( rzx_playback || rzx_recording ) return;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
recording = cocoaui_openpanel_get_filename( @"Start Replay", rzxFileTypes );
- if( !recording ) { fuse_emulation_unpause(); return; }
+ if( !recording ) { [[DisplayOpenGLView instance] unpause]; return; }
[self addRecentSnapshot:recording];
@@ -520,7 +504,7 @@
ui_menu_activate( UI_MENU_ITEM_RECORDING, 1 );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)rzx_insert_snap:(id)sender
@@ -550,18 +534,18 @@
if( !rzx_recording ) return;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
error = libspectrum_rzx_rollback( rzx, &snap );
- if( error ) { fuse_emulation_unpause(); return; }
+ if( error ) { [[DisplayOpenGLView instance] unpause]; return; }
error = snapshot_copy_from( snap );
- if( error ) { fuse_emulation_unpause(); return; }
+ if( error ) { [[DisplayOpenGLView instance] unpause]; return; }
error = libspectrum_rzx_start_input( rzx, tstates );
- if( error ) { fuse_emulation_unpause(); return; }
+ if( error ) { [[DisplayOpenGLView instance] unpause]; return; }
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)rzx_start:(id)sender
@@ -570,10 +554,10 @@
if( rzx_playback || rzx_recording ) return;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
recording = cocoaui_savepanel_get_filename( @"Start Recording", [NSArray arrayWithObjects:@"rzx", nil] );
- if( !recording ) { fuse_emulation_unpause(); return; }
+ if( !recording ) { [[DisplayOpenGLView instance] unpause]; return; }
rzx_start_recording( recording, 1 );
@@ -581,7 +565,7 @@
ui_menu_activate( UI_MENU_ITEM_RECORDING, 1 );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)rzx_start_snap:(id)sender
@@ -590,16 +574,16 @@
if( rzx_playback || rzx_recording ) return;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
snap = cocoaui_openpanel_get_filename( @"Load Snapshot", snapFileTypes );
- if( !snap ) { fuse_emulation_unpause(); return; }
+ if( !snap ) { [[DisplayOpenGLView instance] unpause]; return; }
recording = cocoaui_savepanel_get_filename( @"Start Recording", [NSArray arrayWithObjects:@"rzx", nil] );
- if( !recording ) { free( snap ); fuse_emulation_unpause(); return; }
+ if( !recording ) { free( snap ); [[DisplayOpenGLView instance] unpause]; return; }
if( snapshot_read( snap ) ) {
- free( snap ); free( recording ); fuse_emulation_unpause(); return;
+ free( snap ); free( recording ); [[DisplayOpenGLView instance] unpause]; return;
}
rzx_start_recording( recording, settings_current.embed_snapshot );
@@ -610,7 +594,7 @@
ui_menu_activate( UI_MENU_ITEM_RECORDING, 1 );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)rzx_stop:(id)sender
@@ -627,10 +611,10 @@
if( psg_recording ) return;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
psgfile = cocoaui_savepanel_get_filename( @"Start AY Sound Recording", [NSArray arrayWithObjects:@"psg", nil] );
- if( !psgfile ) { fuse_emulation_unpause(); return; }
+ if( !psgfile ) { [[DisplayOpenGLView instance] unpause]; return; }
psg_start_recording( psgfile );
@@ -640,7 +624,7 @@
ui_menu_activate( UI_MENU_ITEM_AY_LOGGING, 1 );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)psg_stop:(id)sender
@@ -655,11 +639,11 @@
{
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_savepanel_get_filename( @"Save Snapshot As", [NSArray arrayWithObjects:@"szx", @"z80", @"sna", nil] );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
snapshot_write( filename );
@@ -670,18 +654,18 @@
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)open_screen:(id)sender
{
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_openpanel_get_filename( @"Open SCR Screenshot", scrFileType );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
screenshot_scr_read( filename );
@@ -691,7 +675,7 @@
display_refresh_all();
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)profiler_start:(id)sender
@@ -703,27 +687,27 @@
{
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_savepanel_get_filename( @"Save Profile Data As", [NSArray arrayWithObjects:@"profile", nil] );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
profile_finish( filename );
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)save_screen:(id)sender
{
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_savepanel_get_filename( @"Save Screenshot As", [NSArray arrayWithObjects:@"scr", nil] );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
screenshot_scr_write( filename );
@@ -734,18 +718,18 @@
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)export_screen:(id)sender
{
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_savepanel_get_filename( @"Export Screenshot", [NSArray arrayWithObjects:@"png", @"tiff", @"bmp", @"jpg", @"gif", nil] );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
screenshot_write( filename );
@@ -754,7 +738,7 @@
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)save_options:(id)sender
@@ -787,11 +771,11 @@
{
char *filename = NULL;
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
filename = cocoaui_openpanel_get_filename( @"Open Tape", tapeFileTypes );
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
tape_open_default_autoload( filename, NULL );
@@ -799,7 +783,7 @@
free( filename );
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (IBAction)tape_play:(id)sender
@@ -1042,13 +1026,6 @@
[if1 setEnabled:active == 0 ? NO : YES];
}
-- (int)ui_statusbar_update_speed:(float)speed
-{
- [window setTitle:[NSString stringWithFormat:@"Fuse - %3.0f%%", speed]];
-
- return 0;
-}
-
- (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem
{
switch( [menuItem tag] ) {
@@ -1140,13 +1117,11 @@
}
}
-- (void)openFile:(char *)filename
+- (void)openFile:(const char *)filename
{
- if( !filename ) { fuse_emulation_unpause(); return; }
+ if( !filename ) { [[DisplayOpenGLView instance] unpause]; return; }
- utils_open_file( filename, settings_current.auto_load, NULL );
-
- display_refresh_all();
+ [[DisplayOpenGLView instance] openFile:filename];
}
- (void)openRecent:(id)fileMenu
@@ -1159,11 +1134,11 @@
[self addRecentSnapshot:filename];
- fuse_emulation_pause();
+ [[DisplayOpenGLView instance] pause];
[self openFile:filename];
- fuse_emulation_unpause();
+ [[DisplayOpenGLView instance] unpause];
}
- (void)generateUniqueLabels:(NSString *)filename
@@ -1229,14 +1204,13 @@
}
}
-- (void)addRecentSnapshot:(const char *)filename
+- (void)addRecentSnapshotWithString:(NSString*)file
{
NSMenuItem *menuItem;
- NSString *file = [NSString stringWithUTF8String:filename];
NSFileManager *manager = [NSFileManager defaultManager];
/* We only work with absolute paths */
- if(*filename != '/') return;
+ if([file characterAtIndex:0...
[truncated message content] |
|
From: <fr...@us...> - 2007-02-14 10:54:13
|
Revision: 306
http://svn.sourceforge.net/fuse-for-macosx/?rev=306&view=rev
Author: fredm
Date: 2007-02-14 02:54:11 -0800 (Wed, 14 Feb 2007)
Log Message:
-----------
Fix tape browser, restore tape/disk/mdr status icons, as a side effect Fuse
is now 10.4 only.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/display.c
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/controllers/FuseController.h
branches/fusegl/fuse/fusepb/controllers/FuseController.m
branches/fusegl/fuse/fusepb/controllers/TapeBrowserController.h
branches/fusegl/fuse/fusepb/controllers/TapeBrowserController.m
branches/fusegl/fuse/fusepb/models/Emulator.h
branches/fusegl/fuse/fusepb/models/Emulator.m
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/ui/cocoa/cocoadisplay.h
branches/fusegl/fuse/ui/cocoa/cocoadisplay.m
Added Paths:
-----------
branches/fusegl/fuse/ui/cocoa/cocoastatusbar.m
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/TODO 2007-02-14 10:54:11 UTC (rev 306)
@@ -22,13 +22,19 @@
when menus are selected or window is minimised
X Fix screen updating during fastloading
X Make sure that fuse_end is called somewhere on exit
-* Use screenshot style code for minimise icon rather than reading out of GL texture
-* Restore activity icons
+X Restore activity icons
+* Make activity icons transparent
+* Use double buffered texture (in cocoadisplay have screen 0 and 1 for use of
+ DisplayOpenGLView and flip between them on frame end), should also have a
+ mutex taken while DisplayOpenGLView changes and cocoadisplay flips to
+ prevent thread sync problems
+* Sort out remaining FuseController calls into emulator object/thread
* Add native joystick processing (removes SDL joystick input dependency from
Fuse)
+* Quit keyhandling when command key is pressed
* Use sheets rather than modal dialogs (for Save As)
* Put in latest hq[23]x filters (HQ2x_555 from ScummVM should do the trick)
* Make border display optional
-* Quit keyhandling when command key is pressed
+* Figure out why minimise icon image is partially blanked when minimise starts
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/display.c
===================================================================
--- branches/fusegl/fuse/display.c 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/display.c 2007-02-14 10:54:11 UTC (rev 306)
@@ -727,16 +727,7 @@
for( i = 0; i < 8; i++ ) display_dirty_chunk( x, y + i );
}
-/* Get the attributes for the eight pixels starting at
- ( (8*x) , y ) */
-static void
-display_get_attr( int x, int y,
- libspectrum_byte *ink, libspectrum_byte *paper )
-{
- display_parse_attr( display_get_attr_byte( x, y ), ink, paper );
-}
-
-void
+inline void
display_parse_attr( libspectrum_byte attr,
libspectrum_byte *ink, libspectrum_byte *paper )
{
@@ -749,7 +740,16 @@
}
}
+/* Get the attributes for the eight pixels starting at
+ ( (8*x) , y ) */
static void
+display_get_attr( int x, int y,
+ libspectrum_byte *ink, libspectrum_byte *paper )
+{
+ display_parse_attr( display_get_attr_byte( x, y ), ink, paper );
+}
+
+static void
push_border_change( int colour )
{
int beam_x, beam_y;
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-02-14 10:54:11 UTC (rev 306)
@@ -256,6 +256,7 @@
B650986E09366C8F003AF1BF /* rom.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650986B09366C8F003AF1BF /* rom.icns */; };
B650986F09366C8F003AF1BF /* rzx.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650986C09366C8F003AF1BF /* rzx.icns */; };
B650987109366CA2003AF1BF /* szx.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650987009366CA2003AF1BF /* szx.icns */; };
+ B67DC2190B63835100FA31B6 /* cocoastatusbar.m in Sources */ = {isa = PBXBuildFile; fileRef = B67DC2180B63835100FA31B6 /* cocoastatusbar.m */; };
B6825549091817F30014B5EE /* divide.c in Sources */ = {isa = PBXBuildFile; fileRef = B6825547091817F30014B5EE /* divide.c */; };
B682554A091817F30014B5EE /* divide.h in Headers */ = {isa = PBXBuildFile; fileRef = B6825548091817F30014B5EE /* divide.h */; };
B6A24E330B49C67D00AD5B9D /* scalers16.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B6A24E320B49C67D00AD5B9D /* scalers16.cpp */; };
@@ -433,6 +434,7 @@
B66EA7830401075300A864FD /* FuseMenus.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FuseMenus.h; sourceTree = SOURCE_ROOT; };
B66EA7840401075300A864FD /* FuseMenus.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = FuseMenus.m; sourceTree = SOURCE_ROOT; };
B678E4060608FB4300678A33 /* spec_se.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = spec_se.c; path = ../machines/spec_se.c; sourceTree = SOURCE_ROOT; };
+ B67DC2180B63835100FA31B6 /* cocoastatusbar.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = cocoastatusbar.m; sourceTree = "<group>"; };
B67F204203D4B629007BE3A0 /* trdos.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = trdos.c; sourceTree = "<group>"; };
B67F204303D4B629007BE3A0 /* trdos.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = trdos.h; sourceTree = "<group>"; };
B67F3C1407ED1C9D0045339F /* ScalerNameToIdTransformer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ScalerNameToIdTransformer.h; path = transformers/ScalerNameToIdTransformer.h; sourceTree = SOURCE_ROOT; };
@@ -924,6 +926,7 @@
B6CE7F3C0B2830A300EB65B3 /* cocoajoystick.c */,
B6A6F11D0B3EA737000B88E9 /* cocoascreenshot.h */,
B6A6F11E0B3EA737000B88E9 /* cocoascreenshot.m */,
+ B67DC2180B63835100FA31B6 /* cocoastatusbar.m */,
B6CE7F3E0B2830A300EB65B3 /* cocoaui.h */,
B6A6F0D90B3D141B000B88E9 /* cocoaui.m */,
B6E0252B0B38AFE500E23A0F /* keysyms.m */,
@@ -1481,6 +1484,7 @@
B6A24E3D0B49C78700AD5B9D /* hq3x.cpp in Sources */,
B6B076B30B59FE9A00D4F95C /* Emulator.m in Sources */,
B6B99F8A0B5F798700EE408F /* cocoadisplay.m in Sources */,
+ B67DC2190B63835100FA31B6 /* cocoastatusbar.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1628,13 +1632,13 @@
B63319B4086803BA00732AA3 /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ );
DEAD_CODE_STRIPPING = YES;
GCC_DYNAMIC_NO_PIC = YES;
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO;
- MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
- MACOSX_DEPLOYMENT_TARGET_ppc = 10.3;
- SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
- SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk;
YACCFLAGS = "-d";
YACC_GENERATED_FILE_STEM = InputFileStem;
ZERO_LINK = YES;
@@ -1644,13 +1648,13 @@
B63319B5086803BA00732AA3 /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ );
DEAD_CODE_STRIPPING = YES;
GCC_DYNAMIC_NO_PIC = YES;
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO;
- MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
- MACOSX_DEPLOYMENT_TARGET_ppc = 10.3;
- SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
- SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk;
YACCFLAGS = "-d";
YACC_GENERATED_FILE_STEM = InputFileStem;
ZERO_LINK = YES;
@@ -1660,13 +1664,13 @@
B63319B6086803BA00732AA3 /* Default */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ );
DEAD_CODE_STRIPPING = YES;
GCC_DYNAMIC_NO_PIC = YES;
GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO;
- MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
- MACOSX_DEPLOYMENT_TARGET_ppc = 10.3;
- SDKROOT_i386 = /Developer/SDKs/MacOSX10.4u.sdk;
- SDKROOT_ppc = /Developer/SDKs/MacOSX10.3.9.sdk;
YACCFLAGS = "-d";
YACC_GENERATED_FILE_STEM = InputFileStem;
ZERO_LINK = YES;
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.h
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.h 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.h 2007-02-14 10:54:11 UTC (rev 306)
@@ -1,8 +1,6 @@
/* FuseController.h: Routines for dealing with the Cocoa UI
- Copyright (c) 2002-2004 Fredrick Meunier
+ Copyright (c) 2002-2007 Fredrick Meunier
- $Id: FuseController.h,v 1.3 2005/04/21 16:15:09 fred 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
the Free Software Foundation; either version 2 of the License, or
@@ -156,7 +154,9 @@
- (void)openDisk:(specplus3_drive_number)drive;
-- (void)setTapePlayMenu:(ui_statusbar_state)state;
+- (void)setDiskState:(NSNumber*)state;
+- (void)setTapeState:(NSNumber*)state;
+- (void)setMdrState:(NSNumber*)state;
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication;
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
Modified: branches/fusegl/fuse/fusepb/controllers/FuseController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/FuseController.m 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/fusepb/controllers/FuseController.m 2007-02-14 10:54:11 UTC (rev 306)
@@ -1,5 +1,5 @@
/* FuseController.m: Routines for dealing with the Cocoa user interface
- Copyright (c) 2000-2004 Philip Kendall, Russell Marks, Fredrick Meunier,
+ Copyright (c) 2000-2007 Philip Kendall, Russell Marks, Fredrick Meunier,
Mark Grebe <ata...@co...>
$Id: FuseController.m,v 1.3 2005/04/21 16:15:09 fred Exp $
@@ -43,7 +43,6 @@
#import "DisplayOpenGLView.h"
#include "dck.h"
-#include "debugger/debugger.h"
#include "divide.h"
#include "event.h"
#include "fuse.h"
@@ -55,10 +54,6 @@
#include "rzx.h"
#include "screenshot.h"
#include "ui/cocoa/cocoascreenshot.h"
-#if 0
-#include "sdlui.h"
-#include "sdldisplay.h"
-#endif
#include "settings.h"
#include "settings_cocoa.h"
#include "simpleide.h"
@@ -788,12 +783,12 @@
- (IBAction)tape_play:(id)sender
{
- tape_toggle_play( 0 );
+ [[DisplayOpenGLView instance] tapeTogglePlay];
}
- (IBAction)tape_rewind:(id)sender
{
- tape_select_block( 0 );
+ [[DisplayOpenGLView instance] tapeRewind];
}
- (IBAction)tape_write:(id)sender
@@ -803,7 +798,7 @@
- (IBAction)cocoa_break:(id)sender
{
- debugger_mode = DEBUGGER_MODE_HALTED;
+ [[DisplayOpenGLView instance] cocoaBreak];
}
- (IBAction)showRollbackPane:(id)sender
@@ -1307,11 +1302,19 @@
[[DisplayOpenGLView instance] unpause];
}
-- (void)setTapePlayMenu:(ui_statusbar_state)state
+- (void)setDiskState:(NSNumber*)state
{
- [tapePlay setTitle:state == UI_STATUSBAR_STATE_ACTIVE ? @"Pause" : @"Play"];
}
+- (void)setTapeState:(NSNumber*)state
+{
+ [tapePlay setTitle:[state unsignedCharValue] == UI_STATUSBAR_STATE_ACTIVE ? @"Pause" : @"Play"];
+}
+
+- (void)setMdrState:(NSNumber*)state
+{
+}
+
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
{
return YES;
@@ -1885,37 +1888,3 @@
return confirm;
}
-
-/* The statusbar handling function */
-int
-ui_statusbar_update( ui_statusbar_item item, ui_statusbar_state state )
-{
- switch( item ) {
-
- case UI_STATUSBAR_ITEM_DISK:
- //sdl_disk_state = state;
- return 0;
-
- case UI_STATUSBAR_ITEM_PAUSED:
- /* We don't support pausing this version of Fuse */
- return 0;
-
- case UI_STATUSBAR_ITEM_TAPE:
- //sdl_tape_state = state;
- [[FuseController singleton] setTapePlayMenu:state];
- return 0;
-
- case UI_STATUSBAR_ITEM_MICRODRIVE:
- //sdl_mdr_state = state;
- return 0;
-
- case UI_STATUSBAR_ITEM_MOUSE:
- /* We don't support showing a grab icon */
- return 0;
-
- }
-
- ui_error( UI_ERROR_ERROR, "Attempt to update unknown statusbar item %d",
- item );
- return 1;
-}
Modified: branches/fusegl/fuse/fusepb/controllers/TapeBrowserController.h
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/TapeBrowserController.h 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/fusepb/controllers/TapeBrowserController.h 2007-02-14 10:54:11 UTC (rev 306)
@@ -41,7 +41,12 @@
- (IBAction)apply:(id)sender;
- (void)showWindow:(id)sender;
-- (void)update:(ui_tape_browser_update_type)change block:(libspectrum_tape_block *)block;
+- (void)clearContents;
+- (void)addObjectToTapeContents:(NSDictionary*)info;
+- (void)addObjectToInfoContents:(NSDictionary*)info;
+- (void)setTapeIndex:(NSNumber*)index;
+- (void)setInitialising:(NSNumber*)value;
+
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification;
- (NSArrayController *)tapeController;
Modified: branches/fusegl/fuse/fusepb/controllers/TapeBrowserController.m
===================================================================
--- branches/fusegl/fuse/fusepb/controllers/TapeBrowserController.m 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/fusepb/controllers/TapeBrowserController.m 2007-02-14 10:54:11 UTC (rev 306)
@@ -98,46 +98,35 @@
[super showWindow:sender];
- [self update:UI_TAPE_BROWSER_NEW_TAPE block:NULL];
+ [[DisplayOpenGLView instance] tapeWindowInitialise];
[[DisplayOpenGLView instance] unpause];
}
-- (void)update:(ui_tape_browser_update_type)change block:(libspectrum_tape_block *)block
+- (void)clearContents
{
- int error;
+ [tapeController removeObjects:[tapeController arrangedObjects]];
+ [infoController removeObjects:[infoController arrangedObjects]];
+}
- [[DisplayOpenGLView instance] pause];
+- (void)addObjectToTapeContents:(NSDictionary*)info
+{
+ [tapeController addObject:info];
+}
- if( change == UI_TAPE_BROWSER_NEW_TAPE ) {
- [tapeController removeObjects:[tapeController arrangedObjects]];
- [infoController removeObjects:[infoController arrangedObjects]];
+- (void)addObjectToInfoContents:(NSDictionary*)info
+{
+ [infoController addObject:info];
+}
- initialising = YES;
- error = tape_foreach( add_block_details, self );
- initialising = NO;
- if( error ) return;
- }
+- (void)setTapeIndex:(NSNumber*)index
+{
+ [tapeController setSelectionIndex:[index unsignedIntValue]];
+}
- if( change == UI_TAPE_BROWSER_SELECT_BLOCK ||
- change == UI_TAPE_BROWSER_NEW_TAPE ) {
- int current_block = tape_get_current_block();
- if(current_block >= 0) {
- [tapeController setSelectionIndex:current_block];
- }
- }
-
- if( change == UI_TAPE_BROWSER_NEW_BLOCK && block ) {
- add_block_details( block, self );
- }
-
- if( tape_modified ) {
- [[self window] setDocumentEdited:YES];
- } else {
- [[self window] setDocumentEdited:NO];
- }
-
- [[DisplayOpenGLView instance] unpause];
+- (void)setInitialising:(NSNumber*)value
+{
+ initialising = [value boolValue];
}
- (NSArrayController *)tapeController
@@ -155,7 +144,7 @@
static void
add_block_details( libspectrum_tape_block *block, void *user_data )
{
- NSArrayController *tableContents = [(TapeBrowserController*)user_data tapeController];
+ TapeBrowserController *tapeBrowserController = (TapeBrowserController*)user_data;
NSString *type, *data;
char buffer[256];
NSArray *keys = [NSArray arrayWithObjects: @"type", @"data", nil];
@@ -166,10 +155,13 @@
tape_block_details( buffer, 256, block );
data = [NSString stringWithUTF8String:buffer];
values = [NSArray arrayWithObjects: type, data, nil];
- [tableContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToTapeContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
if( libspectrum_tape_block_type( block ) == LIBSPECTRUM_TAPE_BLOCK_ARCHIVE_INFO ) {
- NSArrayController *infoContents = [(TapeBrowserController*)user_data infoController];
int i;
for( i = 0; i < libspectrum_tape_block_count( block ); i++ ) {
NSString *info;
@@ -182,7 +174,11 @@
encoding:NSISOLatin1StringEncoding
#endif
], nil];
- [infoContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
case 1:
info = [NSString stringWithCString:
@@ -193,7 +189,11 @@
];
values = [NSArray arrayWithObjects: @"Publishers",
[[info componentsSeparatedByString:@"\n"] componentsJoinedByString:@", "], nil];
- [infoContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
case 2:
info = [NSString stringWithCString:
@@ -204,7 +204,11 @@
];
values = [NSArray arrayWithObjects: @"Authors",
[[info componentsSeparatedByString:@"\n"] componentsJoinedByString:@", "], nil];
- [infoContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
case 3:
values = [NSArray arrayWithObjects: @"Year",
@@ -215,7 +219,11 @@
encoding:NSISOLatin1StringEncoding
#endif
] intValue]], nil];
- [infoContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
case 4:
info = [NSString stringWithCString:
@@ -226,7 +234,11 @@
];
values = [NSArray arrayWithObjects: @"Languages",
[[info componentsSeparatedByString:@"\n"] componentsJoinedByString:@", "], nil];
- [infoContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
case 5:
values = [NSArray arrayWithObjects: @"Category",
@@ -235,7 +247,11 @@
encoding:NSISOLatin1StringEncoding
#endif
], nil];
- [infoContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
case 6:
values = [NSArray arrayWithObjects: @"Price",
@@ -244,7 +260,11 @@
encoding:NSISOLatin1StringEncoding
#endif
], nil];
- [infoContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
case 7:
values = [NSArray arrayWithObjects: @"Loader",
@@ -253,7 +273,11 @@
encoding:NSISOLatin1StringEncoding
#endif
], nil];
- [infoContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
case 8:
values = [NSArray arrayWithObjects: @"Origin",
@@ -262,8 +286,11 @@
encoding:NSISOLatin1StringEncoding
#endif
], nil];
- [infoContents addObject:[[NSMutableDictionary alloc]
- initWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
case 255:
values = [NSArray arrayWithObjects: @"Comment",
@@ -272,7 +299,11 @@
encoding:NSISOLatin1StringEncoding
#endif
], nil];
- [infoContents addObject:[NSMutableDictionary dictionaryWithObjects:values forKeys:keys]];
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(addObjectToInfoContents:)
+ withObject:[NSDictionary dictionaryWithObjects:values forKeys:keys]
+ waitUntilDone:NO
+ ];
break;
default: NSLog(@"(Unknown string): %s",
(const char *)libspectrum_tape_block_texts( block, i ));
@@ -286,9 +317,59 @@
ui_tape_browser_update( ui_tape_browser_update_type change,
libspectrum_tape_block *block )
{
+ int error;
+ TapeBrowserController* tapeBrowserController;
+
if( !dialog_created ) return 0;
- [[TapeBrowserController singleton] update:change block:block];
+ fuse_emulation_pause();
+ tapeBrowserController = [TapeBrowserController singleton];
+
+ if( change == UI_TAPE_BROWSER_NEW_TAPE ) {
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(clearContents)
+ withObject:nil
+ waitUntilDone:NO
+ ];
+
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(setInitialising:)
+ withObject:[NSNumber numberWithBool:YES]
+ waitUntilDone:NO
+ ];
+ error = tape_foreach( add_block_details, tapeBrowserController );
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(setInitialising:)
+ withObject:[NSNumber numberWithBool:NO]
+ waitUntilDone:NO
+ ];
+ if( error ) return error;
+ }
+
+ if( change == UI_TAPE_BROWSER_SELECT_BLOCK ||
+ change == UI_TAPE_BROWSER_NEW_TAPE ) {
+ int current_block = tape_get_current_block();
+ if(current_block >= 0) {
+ [tapeBrowserController
+ performSelectorOnMainThread:@selector(setTapeIndex:)
+ withObject:[NSNumber numberWithUnsignedInt:current_block]
+ waitUntilDone:NO
+ ];
+ }
+ }
+
+ if( change == UI_TAPE_BROWSER_NEW_BLOCK && block ) {
+ add_block_details( block, tapeBrowserController );
+ }
+
+ if( tape_modified ) {
+ [[tapeBrowserController window] setDocumentEdited:YES];
+ } else {
+ [[tapeBrowserController window] setDocumentEdited:NO];
+ }
+
+ fuse_emulation_unpause();
+
return 0;
}
Modified: branches/fusegl/fuse/fusepb/models/Emulator.h
===================================================================
--- branches/fusegl/fuse/fusepb/models/Emulator.h 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/fusepb/models/Emulator.h 2007-02-14 10:54:11 UTC (rev 306)
@@ -64,6 +64,10 @@
-(id) init;
-(void) openFile:(const char *)filename;
+-(void) tapeTogglePlay;
+-(void) tapeRewind;
+-(void) tapeWindowInitialise;
+-(void) cocoaBreak;
-(void) pause;
-(void) unpause;
Modified: branches/fusegl/fuse/fusepb/models/Emulator.m
===================================================================
--- branches/fusegl/fuse/fusepb/models/Emulator.m 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/fusepb/models/Emulator.m 2007-02-14 10:54:11 UTC (rev 306)
@@ -25,6 +25,7 @@
#import "DisplayOpenGLView.h"
#import "Emulator.h"
+#include "debugger/debugger.h"
#include "event.h"
#include "fuse.h"
#include "fusepb/main.h"
@@ -32,6 +33,7 @@
#include "machine.h"
#include "settings.h"
#include "sound.h"
+#include "tape.h"
#include "ui/ui.h"
#include "utils.h"
@@ -163,6 +165,26 @@
display_refresh_all();
}
+-(void) tapeTogglePlay
+{
+ tape_toggle_play( 0 );
+}
+
+-(void) tapeRewind
+{
+ tape_select_block( 0 );
+}
+
+-(void) tapeWindowInitialise
+{
+ ui_tape_browser_update( UI_TAPE_BROWSER_NEW_TAPE, NULL );
+}
+
+-(void) cocoaBreak
+{
+ debugger_mode = DEBUGGER_MODE_HALTED;
+}
+
-(void) pause
{
if( isEmulating ) {
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-02-14 10:54:11 UTC (rev 306)
@@ -24,10 +24,15 @@
#import <Cocoa/Cocoa.h>
+#include <OpenGL/gl.h>
+#include <OpenGL/glext.h>
+#include <OpenGL/glu.h>
+
#include <libspectrum.h>
#include "input.h"
#include "ui/cocoa/cocoadisplay.h"
+#include "ui/ui.h"
@class Emulator;
@@ -35,9 +40,27 @@
{
/* Need texture size and dimensions and two backing textures */
Cocoa_Texture screenTex; /* Screen texture */
+ GLuint screenTexId;
+ Cocoa_Texture redCassetteTex;
+ GLuint redCassette;
+ Cocoa_Texture greenCassetteTex;
+ GLuint greenCassette;
+ Cocoa_Texture redMdrTex;
+ GLuint redMdr;
+ Cocoa_Texture greenMdrTex;
+ GLuint greenMdr;
+ Cocoa_Texture redDiskTex;
+ GLuint redDisk;
+ Cocoa_Texture greenDiskTex;
+ GLuint greenDisk;
+
BOOL screenTexInitialised;
+ ui_statusbar_state disk_state;
+ ui_statusbar_state mdr_state;
+ ui_statusbar_state tape_state;
+
NSWindow *fullscreenWindow;
NSWindow *windowedWindow;
@@ -56,17 +79,38 @@
-(void) createTexture:(Cocoa_Texture*)newScreen;
-(void) destroyTexture;
+-(void) uploadIconTexture:(GLuint*)textureName
+ width:(GLsizei)width
+ height:(GLsizei)height
+ pixels:(unsigned char *)pixels;
+-(void) blitIcon:(Cocoa_Texture*)texture name:(GLuint)textureName;
-(void) setServer:(id)anObject;
-(id) initWithFrame:(NSRect)frameRect;
-(void) awakeFromNib;
+-(void) loadPicture:(NSString *) name
+ greenTex:(Cocoa_Texture*)greenTexture
+ greenIcon:(GLuint*)greenTextureName
+ redTex:(Cocoa_Texture*)redTexture
+ redIcon:(GLuint*)redTextureName
+ xOrigin:(int)x
+ yOrigin:(int)y;
+
-(void) setNeedsDisplayYes;
-(void) openFile:(const char *)filename;
+-(void) tapeTogglePlay;
+-(void) tapeRewind;
+-(void) tapeWindowInitialise;
+-(void) cocoaBreak;
-(void) pause;
-(void) unpause;
+-(void) setDiskState:(NSNumber*)state;
+-(void) setTapeState:(NSNumber*)state;
+-(void) setMdrState:(NSNumber*)state;
+
-(void) mouseMoved:(NSEvent *)theEvent;
-(void) mouseDown:(NSEvent *)theEvent;
-(void) mouseUp:(NSEvent *)theEvent;
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-02-06 11:48:10 UTC (rev 305)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-02-14 10:54:11 UTC (rev 306)
@@ -24,6 +24,7 @@
#import "DisplayOpenGLView.h"
#import "Emulator.h"
+#import "FuseController.h"
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
@@ -33,6 +34,47 @@
#include "fusepb/main.h"
#include "settings.h"
+unsigned char *
+NSBitmapImageRepToRGBAPixelArray(NSBitmapImageRep * bitmap, int red)
+{
+ unsigned char * pixels;
+ NSBitmapImageRep * bitmap2;
+ NSGraphicsContext * context;
+#define BYTES_PER_PIXEL 4
+ int targetWidth = [bitmap pixelsWide];
+ int targetHeight = [bitmap pixelsHigh];
+
+ pixels = (unsigned char *) malloc(BYTES_PER_PIXEL * targetWidth * targetHeight);
+ bitmap2 = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: &pixels
+ pixelsWide: targetWidth
+ pixelsHigh: targetHeight
+ bitsPerSample: 8
+ samplesPerPixel: 4
+ hasAlpha: YES
+ isPlanar: NO
+ colorSpaceName: NSDeviceRGBColorSpace
+ bitmapFormat: NSAlphaNonpremultipliedBitmapFormat
+ bytesPerRow: (targetWidth * BYTES_PER_PIXEL)
+ bitsPerPixel: (BYTES_PER_PIXEL * 8)];
+
+ context = [NSGraphicsContext graphicsContextWithBitmapImageRep: bitmap2];
+ [NSGraphicsContext saveGraphicsState];
+ [NSGraphicsContext setCurrentContext: context];
+ [bitmap drawInRect: NSMakeRect(0, 0, targetWidth, targetHeight)];
+ [NSGraphicsContext restoreGraphicsState];
+
+ int i;
+ for( i = 0; i < ta...
[truncated message content] |
|
From: <fr...@us...> - 2007-03-31 05:24:09
|
Revision: 312
http://svn.sourceforge.net/fuse-for-macosx/?rev=312&view=rev
Author: fredm
Date: 2007-03-30 22:24:10 -0700 (Fri, 30 Mar 2007)
Log Message:
-----------
Restore joystick processing (by reusing SDL joystick input files from SDL).
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
branches/fusegl/fuse/fusepb/content_arrays/HIDJoysticks.m
branches/fusegl/fuse/ui/cocoa/cocoajoystick.c
Added Paths:
-----------
branches/fusegl/fuse/ui/cocoa/SDL_joystick/
branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick.c
branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick.h
branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick_c.h
branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_sysjoystick.c
branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_sysjoystick.h
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-03-10 12:53:34 UTC (rev 311)
+++ branches/fusegl/fuse/TODO 2007-03-31 05:24:10 UTC (rev 312)
@@ -23,18 +23,19 @@
X Fix screen updating during fastloading
X Make sure that fuse_end is called somewhere on exit
X Restore activity icons
+X Restore joystick processing (re-use SDL joystick input files from SDL)
* Make activity icons transparent
* Use double buffered texture (in cocoadisplay have screen 0 and 1 for use of
DisplayOpenGLView and flip between them on frame end), should also have a
mutex taken while DisplayOpenGLView changes and cocoadisplay flips to
prevent thread sync problems
* Sort out remaining FuseController calls into emulator object/thread
-* Add native joystick processing (removes SDL joystick input dependency from
- Fuse)
* Quit keyhandling when command key is pressed
* Use sheets rather than modal dialogs (for Save As)
* Put in latest hq[23]x filters (HQ2x_555 from ScummVM should do the trick)
* Make border display optional
* Figure out why minimise icon image is partially blanked when minimise starts
+* Make sure that printer text is available as we go on OS X
+* Allow Cmd-w to close as many operations as possible
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj
===================================================================
--- branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-03-10 12:53:34 UTC (rev 311)
+++ branches/fusegl/fuse/fusepb/Fuse.xcodeproj/project.pbxproj 2007-03-31 05:24:10 UTC (rev 312)
@@ -256,6 +256,11 @@
B650986E09366C8F003AF1BF /* rom.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650986B09366C8F003AF1BF /* rom.icns */; };
B650986F09366C8F003AF1BF /* rzx.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650986C09366C8F003AF1BF /* rzx.icns */; };
B650987109366CA2003AF1BF /* szx.icns in Resources */ = {isa = PBXBuildFile; fileRef = B650987009366CA2003AF1BF /* szx.icns */; };
+ B65352DB0B8CF6780083F942 /* SDL_joystick.h in Headers */ = {isa = PBXBuildFile; fileRef = B65352BD0B89B8AA0083F942 /* SDL_joystick.h */; };
+ B65352F20B8CF6CC0083F942 /* SDL_sysjoystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B65352BE0B89B8AA0083F942 /* SDL_sysjoystick.c */; };
+ B65352F30B8CF6CC0083F942 /* SDL_sysjoystick.h in Headers */ = {isa = PBXBuildFile; fileRef = B65352BF0B89B8AA0083F942 /* SDL_sysjoystick.h */; };
+ B65353150B8FF3D20083F942 /* SDL_joystick.c in Sources */ = {isa = PBXBuildFile; fileRef = B65353140B8FF3D20083F942 /* SDL_joystick.c */; };
+ B653532B0B902CB20083F942 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B653532A0B902CB20083F942 /* IOKit.framework */; };
B67DC2190B63835100FA31B6 /* cocoastatusbar.m in Sources */ = {isa = PBXBuildFile; fileRef = B67DC2180B63835100FA31B6 /* cocoastatusbar.m */; };
B6825549091817F30014B5EE /* divide.c in Sources */ = {isa = PBXBuildFile; fileRef = B6825547091817F30014B5EE /* divide.c */; };
B682554A091817F30014B5EE /* divide.h in Headers */ = {isa = PBXBuildFile; fileRef = B6825548091817F30014B5EE /* divide.h */; };
@@ -417,6 +422,11 @@
B650C40A0765988200DE7E81 /* tape_scorpion.szx */ = {isa = PBXFileReference; lastKnownFileType = file; name = tape_scorpion.szx; path = ../lib/compressed/tape_scorpion.szx; sourceTree = SOURCE_ROOT; };
B650F73E07E7CD3F00E4F3AF /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PreferencesController.h; path = controllers/PreferencesController.h; sourceTree = SOURCE_ROOT; };
B650F73F07E7CD3F00E4F3AF /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PreferencesController.m; path = controllers/PreferencesController.m; sourceTree = SOURCE_ROOT; };
+ B65352BD0B89B8AA0083F942 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_joystick.h; sourceTree = "<group>"; };
+ B65352BE0B89B8AA0083F942 /* SDL_sysjoystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_sysjoystick.c; sourceTree = "<group>"; };
+ B65352BF0B89B8AA0083F942 /* SDL_sysjoystick.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDL_sysjoystick.h; sourceTree = "<group>"; };
+ B65353140B8FF3D20083F942 /* SDL_joystick.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = SDL_joystick.c; sourceTree = "<group>"; };
+ B653532A0B902CB20083F942 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
B65E4C600445DB7D00A864FD /* dck.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = dck.c; path = ../dck.c; sourceTree = SOURCE_ROOT; };
B65E4C610445DB7D00A864FD /* dck.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dck.h; path = ../dck.h; sourceTree = SOURCE_ROOT; };
B66050EC0606AAF500247454 /* breakpoint.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = breakpoint.c; path = ../debugger/breakpoint.c; sourceTree = SOURCE_ROOT; };
@@ -646,6 +656,7 @@
B6A6F0EE0B3D5F9E000B88E9 /* CoreAudio.framework in Frameworks */,
B6A6F0F30B3D602F000B88E9 /* AudioUnit.framework in Frameworks */,
B6A6F1060B3D60D0000B88E9 /* OpenGL.framework in Frameworks */,
+ B653532B0B902CB20083F942 /* IOKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -674,8 +685,9 @@
isa = PBXGroup;
children = (
B6A6F0F20B3D602F000B88E9 /* AudioUnit.framework */,
+ B64E2A160A6534A3006863D9 /* Carbon.framework */,
B6A6F0ED0B3D5F9E000B88E9 /* CoreAudio.framework */,
- B64E2A160A6534A3006863D9 /* Carbon.framework */,
+ B653532A0B902CB20083F942 /* IOKit.framework */,
B6202BD105BD43D800A1EA8F /* libbz2.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
F520C8BC038D022E01A804BA /* OpenGL.framework */,
@@ -758,6 +770,17 @@
name = Frameworks;
sourceTree = "<group>";
};
+ B6042DBD0BBE2606000CC959 /* SDL_joystick */ = {
+ isa = PBXGroup;
+ children = (
+ B65353140B8FF3D20083F942 /* SDL_joystick.c */,
+ B65352BD0B89B8AA0083F942 /* SDL_joystick.h */,
+ B65352BE0B89B8AA0083F942 /* SDL_sysjoystick.c */,
+ B65352BF0B89B8AA0083F942 /* SDL_sysjoystick.h */,
+ );
+ path = SDL_joystick;
+ sourceTree = "<group>";
+ };
B632C6AD03E5360C00A864FD /* Controllers */ = {
isa = PBXGroup;
children = (
@@ -920,6 +943,7 @@
B6CE7E8A0B28027000EB65B3 /* cocoa */ = {
isa = PBXGroup;
children = (
+ B6042DBD0BBE2606000CC959 /* SDL_joystick */,
B6CE7F3B0B2830A300EB65B3 /* cocoadisplay.h */,
B6B99F890B5F798700EE408F /* cocoadisplay.m */,
B6A6F10D0B3D6360000B88E9 /* cocoaerror.m */,
@@ -1246,6 +1270,8 @@
B6A24E3C0B49C78700AD5B9D /* hq2x.h in Headers */,
B6A24E3E0B49C78700AD5B9D /* hq3x.h in Headers */,
B6B076B20B59FE9A00D4F95C /* Emulator.h in Headers */,
+ B65352DB0B8CF6780083F942 /* SDL_joystick.h in Headers */,
+ B65352F30B8CF6CC0083F942 /* SDL_sysjoystick.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1485,6 +1511,8 @@
B6B076B30B59FE9A00D4F95C /* Emulator.m in Sources */,
B6B99F8A0B5F798700EE408F /* cocoadisplay.m in Sources */,
B67DC2190B63835100FA31B6 /* cocoastatusbar.m in Sources */,
+ B65352F20B8CF6CC0083F942 /* SDL_sysjoystick.c in Sources */,
+ B65353150B8FF3D20083F942 /* SDL_joystick.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1505,10 +1533,7 @@
B61F46A609121DF100C8096C /* Development */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- i386,
- ppc,
- );
+ ARCHS = i386;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(HOME)/Library/Frameworks",
@@ -1550,10 +1575,7 @@
B61F46A709121DF100C8096C /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- i386,
- ppc,
- );
+ ARCHS = i386;
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(HOME)/Library/Frameworks",
@@ -1594,10 +1616,7 @@
B61F46A809121DF100C8096C /* Default */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = (
- i386,
- ppc,
- );
+ ARCHS = i386;
FRAMEWORK_SEARCH_PATHS = (
"$(HOME)/Library/Frameworks",
../../libspectrum/build/Deployment,
Modified: branches/fusegl/fuse/fusepb/content_arrays/HIDJoysticks.m
===================================================================
--- branches/fusegl/fuse/fusepb/content_arrays/HIDJoysticks.m 2007-03-10 12:53:34 UTC (rev 311)
+++ branches/fusegl/fuse/fusepb/content_arrays/HIDJoysticks.m 2007-03-31 05:24:10 UTC (rev 312)
@@ -28,6 +28,7 @@
#include <libspectrum.h>
+#include "ui/cocoa/SDL_joystick/SDL_sysjoystick.h"
#include "joystick.h"
@implementation HIDJoystick
@@ -42,17 +43,15 @@
joysticks = [NSMutableArray arrayWithCapacity:joysticks_supported+1];
[joysticks addObject:[HIDJoystick joystickWithName:@"None" andType:0]];
-#if 0
if( joysticks_supported > 0 ){
for( i=0; i<joysticks_supported; i++ ) {
[joysticks addObject:
[HIDJoystick joystickWithName:[NSString stringWithUTF8String:
- HID_JoystickName(i)]
+ SDL_SYS_JoystickName(i)]
andType:i+1]
];
}
}
-#endif
}
return joysticks;
}
Added: branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick.c
===================================================================
--- branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick.c (rev 0)
+++ branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick.c 2007-03-31 05:24:10 UTC (rev 312)
@@ -0,0 +1,582 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2006 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ sl...@li...
+*/
+//#include "SDL_config.h"
+
+/* This is the joystick API for Simple DirectMedia Layer */
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "ui.h"
+
+//#include "SDL_events.h"
+#include "SDL_sysjoystick.h"
+#include "SDL_joystick_c.h"
+#if 0
+#include "../events/SDL_events_c.h"
+#endif
+
+/* This is used for Quake III Arena */
+#if SDL_EVENTS_DISABLED
+#define SDL_Lock_EventThread()
+#define SDL_Unlock_EventThread()
+#endif
+
+#define SDL_EVENTS_DISABLED 1
+
+Uint8 SDL_numjoysticks = 0;
+SDL_Joystick **SDL_joysticks = NULL;
+static SDL_Joystick *default_joystick = NULL;
+
+int SDL_JoystickInit(void)
+{
+ int arraylen;
+ int status;
+
+ SDL_numjoysticks = 0;
+ status = SDL_SYS_JoystickInit();
+ if ( status >= 0 ) {
+ arraylen = (status+1)*sizeof(*SDL_joysticks);
+ SDL_joysticks = (SDL_Joystick **)malloc(arraylen);
+ if ( SDL_joysticks == NULL ) {
+ SDL_numjoysticks = 0;
+ } else {
+ memset(SDL_joysticks, 0, arraylen);
+ SDL_numjoysticks = status;
+ }
+ status = 0;
+ }
+ default_joystick = NULL;
+ return(status);
+}
+
+/*
+ * Count the number of joysticks attached to the system
+ */
+int SDL_NumJoysticks(void)
+{
+ return SDL_numjoysticks;
+}
+
+/*
+ * Get the implementation dependent name of a joystick
+ */
+const char *SDL_JoystickName(int device_index)
+{
+ if ( (device_index < 0) || (device_index >= SDL_numjoysticks) ) {
+ ui_error( UI_ERROR_ERROR, "There are %d joysticks available",
+ SDL_numjoysticks);
+ return(NULL);
+ }
+ return(SDL_SYS_JoystickName(device_index));
+}
+
+/*
+ * Open a joystick for use - the index passed as an argument refers to
+ * the N'th joystick on the system. This index is the value which will
+ * identify this joystick in future joystick events.
+ *
+ * This function returns a joystick identifier, or NULL if an error occurred.
+ */
+SDL_Joystick *SDL_JoystickOpen(int device_index)
+{
+ int i;
+ SDL_Joystick *joystick;
+
+ if ( (device_index < 0) || (device_index >= SDL_numjoysticks) ) {
+ ui_error( UI_ERROR_ERROR, "There are %d joysticks available",
+ SDL_numjoysticks);
+ return(NULL);
+ }
+
+ /* If the joystick is already open, return it */
+ for ( i=0; SDL_joysticks[i]; ++i ) {
+ if ( device_index == SDL_joysticks[i]->index ) {
+ joystick = SDL_joysticks[i];
+ ++joystick->ref_count;
+ return(joystick);
+ }
+ }
+
+ /* Create and initialize the joystick */
+ joystick = (SDL_Joystick *)malloc((sizeof *joystick));
+ if ( joystick != NULL ) {
+ memset(joystick, 0, (sizeof *joystick));
+ joystick->index = device_index;
+ if ( SDL_SYS_JoystickOpen(joystick) < 0 ) {
+ free(joystick);
+ joystick = NULL;
+ } else {
+ if ( joystick->naxes > 0 ) {
+ joystick->axes = (Sint16 *)malloc
+ (joystick->naxes*sizeof(Sint16));
+ }
+ if ( joystick->nhats > 0 ) {
+ joystick->hats = (Uint8 *)malloc
+ (joystick->nhats*sizeof(Uint8));
+ }
+ if ( joystick->nballs > 0 ) {
+ joystick->balls = (struct balldelta *)malloc
+ (joystick->nballs*sizeof(*joystick->balls));
+ }
+ if ( joystick->nbuttons > 0 ) {
+ joystick->buttons = (Uint8 *)malloc
+ (joystick->nbuttons*sizeof(Uint8));
+ }
+ if ( ((joystick->naxes > 0) && !joystick->axes)
+ || ((joystick->nhats > 0) && !joystick->hats)
+ || ((joystick->nballs > 0) && !joystick->balls)
+ || ((joystick->nbuttons > 0) && !joystick->buttons)) {
+ //SDL_OutOfMemory();
+ SDL_JoystickClose(joystick);
+ joystick = NULL;
+ }
+ if ( joystick->axes ) {
+ memset(joystick->axes, 0,
+ joystick->naxes*sizeof(Sint16));
+ }
+ if ( joystick->hats ) {
+ memset(joystick->hats, 0,
+ joystick->nhats*sizeof(Uint8));
+ }
+ if ( joystick->balls ) {
+ memset(joystick->balls, 0,
+ joystick->nballs*sizeof(*joystick->balls));
+ }
+ if ( joystick->buttons ) {
+ memset(joystick->buttons, 0,
+ joystick->nbuttons*sizeof(Uint8));
+ }
+ }
+ }
+ if ( joystick ) {
+ /* Add joystick to list */
+ ++joystick->ref_count;
+ //SDL_Lock_EventThread();
+ for ( i=0; SDL_joysticks[i]; ++i )
+ /* Skip to next joystick */;
+ SDL_joysticks[i] = joystick;
+ //SDL_Unlock_EventThread();
+ }
+ return(joystick);
+}
+
+/*
+ * Returns 1 if the joystick has been opened, or 0 if it has not.
+ */
+int SDL_JoystickOpened(int device_index)
+{
+ int i, opened;
+
+ opened = 0;
+ for ( i=0; SDL_joysticks[i]; ++i ) {
+ if ( SDL_joysticks[i]->index == (Uint8)device_index ) {
+ opened = 1;
+ break;
+ }
+ }
+ return(opened);
+}
+
+static int ValidJoystick(SDL_Joystick **joystick)
+{
+ int valid;
+
+ if ( *joystick == NULL ) {
+ *joystick = default_joystick;
+ }
+ if ( *joystick == NULL ) {
+ ui_error( UI_ERROR_ERROR, "Joystick hasn't been opened yet");
+ valid = 0;
+ } else {
+ valid = 1;
+ }
+ return valid;
+}
+
+/*
+ * Get the device index of an opened joystick.
+ */
+int SDL_JoystickIndex(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->index);
+}
+
+/*
+ * Get the number of multi-dimensional axis controls on a joystick
+ */
+int SDL_JoystickNumAxes(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->naxes);
+}
+
+/*
+ * Get the number of hats on a joystick
+ */
+int SDL_JoystickNumHats(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->nhats);
+}
+
+/*
+ * Get the number of trackballs on a joystick
+ */
+int SDL_JoystickNumBalls(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->nballs);
+}
+
+/*
+ * Get the number of buttons on a joystick
+ */
+int SDL_JoystickNumButtons(SDL_Joystick *joystick)
+{
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+ return(joystick->nbuttons);
+}
+
+/*
+ * Get the current state of an axis control on a joystick
+ */
+Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis)
+{
+ Sint16 state;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return(0);
+ }
+ if ( axis < joystick->naxes ) {
+ state = joystick->axes[axis];
+ } else {
+ ui_error( UI_ERROR_ERROR, "Joystick only has %d axes", joystick->naxes);
+ state = 0;
+ }
+ return(state);
+}
+
+/*
+ * Get the current state of a hat on a joystick
+ */
+Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat)
+{
+ Uint8 state;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return(0);
+ }
+ if ( hat < joystick->nhats ) {
+ state = joystick->hats[hat];
+ } else {
+ ui_error( UI_ERROR_ERROR, "Joystick only has %d hats", joystick->nhats);
+ state = 0;
+ }
+ return(state);
+}
+
+/*
+ * Get the ball axis change since the last poll
+ */
+int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
+{
+ int retval;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return(-1);
+ }
+
+ retval = 0;
+ if ( ball < joystick->nballs ) {
+ if ( dx ) {
+ *dx = joystick->balls[ball].dx;
+ }
+ if ( dy ) {
+ *dy = joystick->balls[ball].dy;
+ }
+ joystick->balls[ball].dx = 0;
+ joystick->balls[ball].dy = 0;
+ } else {
+ ui_error( UI_ERROR_ERROR, "Joystick only has %d balls", joystick->nballs);
+ retval = -1;
+ }
+ return(retval);
+}
+
+/*
+ * Get the current state of a button on a joystick
+ */
+Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button)
+{
+ Uint8 state;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return(0);
+ }
+ if ( button < joystick->nbuttons ) {
+ state = joystick->buttons[button];
+ } else {
+ ui_error( UI_ERROR_ERROR, "Joystick only has %d buttons",joystick->nbuttons);
+ state = 0;
+ }
+ return(state);
+}
+
+/*
+ * Close a joystick previously opened with SDL_JoystickOpen()
+ */
+void SDL_JoystickClose(SDL_Joystick *joystick)
+{
+ int i;
+
+ if ( ! ValidJoystick(&joystick) ) {
+ return;
+ }
+
+ /* First decrement ref count */
+ if ( --joystick->ref_count > 0 ) {
+ return;
+ }
+
+ /* Lock the event queue - prevent joystick polling */
+ //SDL_Lock_EventThread();
+
+ if ( joystick == default_joystick ) {
+ default_joystick = NULL;
+ }
+ SDL_SYS_JoystickClose(joystick);
+
+ /* Remove joystick from list */
+ for ( i=0; SDL_joysticks[i]; ++i ) {
+ if ( joystick == SDL_joysticks[i] ) {
+ memcpy(&SDL_joysticks[i], &SDL_joysticks[i+1],
+ (SDL_numjoysticks-i)*sizeof(joystick));
+ break;
+ }
+ }
+
+ /* Let the event thread keep running */
+ //SDL_Unlock_EventThread();
+
+ /* Free the data associated with this joystick */
+ if ( joystick->axes ) {
+ free(joystick->axes);
+ }
+ if ( joystick->hats ) {
+ free(joystick->hats);
+ }
+ if ( joystick->balls ) {
+ free(joystick->balls);
+ }
+ if ( joystick->buttons ) {
+ free(joystick->buttons);
+ }
+ free(joystick);
+}
+
+void SDL_JoystickQuit(void)
+{
+ /* Stop the event polling */
+ //SDL_Lock_EventThread();
+ SDL_numjoysticks = 0;
+ //SDL_Unlock_EventThread();
+
+ /* Quit the joystick setup */
+ SDL_SYS_JoystickQuit();
+ if ( SDL_joysticks ) {
+ free(SDL_joysticks);
+ SDL_joysticks = NULL;
+ }
+}
+
+
+/* These are global for SDL_sysjoystick.c and SDL_events.c */
+
+int SDL_PrivateJoystickAxis(SDL_Joystick *joystick, Uint8 axis, Sint16 value)
+{
+ int posted;
+
+ /* Update internal joystick state */
+ joystick->axes[axis] = value;
+
+ /* Post the event, if desired */
+ posted = 0;
+#if 0
+ if ( SDL_ProcessEvents[SDL_JOYAXISMOTION] == SDL_ENABLE ) {
+ SDL_Event event;
+ event.type = SDL_JOYAXISMOTION;
+ event.jaxis.which = joystick->index;
+ event.jaxis.axis = axis;
+ event.jaxis.value = value;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+ return(posted);
+}
+
+int SDL_PrivateJoystickHat(SDL_Joystick *joystick, Uint8 hat, Uint8 value)
+{
+ int posted;
+
+ /* Update internal joystick state */
+ joystick->hats[hat] = value;
+
+ /* Post the event, if desired */
+ posted = 0;
+#if 0
+ if ( SDL_ProcessEvents[SDL_JOYHATMOTION] == SDL_ENABLE ) {
+ SDL_Event event;
+ event.jhat.type = SDL_JOYHATMOTION;
+ event.jhat.which = joystick->index;
+ event.jhat.hat = hat;
+ event.jhat.value = value;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+ return(posted);
+}
+
+int SDL_PrivateJoystickBall(SDL_Joystick *joystick, Uint8 ball,
+ Sint16 xrel, Sint16 yrel)
+{
+ int posted;
+
+ /* Update internal mouse state */
+ joystick->balls[ball].dx += xrel;
+ joystick->balls[ball].dy += yrel;
+
+ /* Post the event, if desired */
+ posted = 0;
+#if 0
+ if ( SDL_ProcessEvents[SDL_JOYBALLMOTION] == SDL_ENABLE ) {
+ SDL_Event event;
+ event.jball.type = SDL_JOYBALLMOTION;
+ event.jball.which = joystick->index;
+ event.jball.ball = ball;
+ event.jball.xrel = xrel;
+ event.jball.yrel = yrel;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+ return(posted);
+}
+
+int SDL_PrivateJoystickButton(SDL_Joystick *joystick, Uint8 button, Uint8 state)
+{
+ int posted;
+#if 0
+ SDL_Event event;
+
+ switch ( state ) {
+ case SDL_PRESSED:
+ event.type = SDL_JOYBUTTONDOWN;
+ break;
+ case SDL_RELEASED:
+ event.type = SDL_JOYBUTTONUP;
+ break;
+ default:
+ /* Invalid state -- bail */
+ return(0);
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+
+ /* Update internal joystick state */
+ joystick->buttons[button] = state;
+
+ /* Post the event, if desired */
+ posted = 0;
+#if 0
+ if ( SDL_ProcessEvents[event.type] == SDL_ENABLE ) {
+ event.jbutton.which = joystick->index;
+ event.jbutton.button = button;
+ event.jbutton.state = state;
+ if ( (SDL_EventOK == NULL) || (*SDL_EventOK)(&event) ) {
+ posted = 1;
+ SDL_PushEvent(&event);
+ }
+ }
+#endif /* !SDL_EVENTS_DISABLED */
+ return(posted);
+}
+
+void SDL_JoystickUpdate(void)
+{
+ int i;
+
+ for ( i=0; SDL_joysticks[i]; ++i ) {
+ SDL_SYS_JoystickUpdate(SDL_joysticks[i]);
+ }
+}
+
+#define SDL_IGNORE 0
+
+int SDL_JoystickEventState(int state)
+{
+#if SDL_EVENTS_DISABLED
+ return SDL_IGNORE;
+#else
+ const Uint8 event_list[] = {
+ SDL_JOYAXISMOTION, SDL_JOYBALLMOTION, SDL_JOYHATMOTION,
+ SDL_JOYBUTTONDOWN, SDL_JOYBUTTONUP,
+ };
+ unsigned int i;
+
+ switch (state) {
+ case SDL_QUERY:
+ state = SDL_IGNORE;
+ for ( i=0; i<SDL_arraysize(event_list); ++i ) {
+ state = SDL_EventState(event_list[i],SDL_QUERY);
+ if ( state == SDL_ENABLE ) {
+ break;
+ }
+ }
+ break;
+ default:
+ for ( i=0; i<SDL_arraysize(event_list); ++i ) {
+ SDL_EventState(event_list[i], state);
+ }
+ break;
+ }
+ return(state);
+#endif /* SDL_EVENTS_DISABLED */
+}
Added: branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick.h
===================================================================
--- branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick.h (rev 0)
+++ branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick.h 2007-03-31 05:24:10 UTC (rev 312)
@@ -0,0 +1,175 @@
+/*
+ SDL - Simple DirectMedia Layer
+ Copyright (C) 1997-2006 Sam Lantinga
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Sam Lantinga
+ sl...@li...
+*/
+
+/* Include file for SDL joystick event handling */
+
+#ifndef _SDL_joystick_h
+#define _SDL_joystick_h
+
+//#include "SDL_stdinc.h"
+//#include "SDL_error.h"
+
+//#include "begin_code.h"
+
+#include <sys/types.h>
+
+#define Sint16 int16_t
+#define Uint8 uint8_t
+
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* In order to use these functions, SDL_Init() must have been called
+ with the SDL_INIT_JOYSTICK flag. This causes SDL to scan the system
+ for joysticks, and load appropriate drivers.
+*/
+
+/* The joystick structure used to identify an SDL joystick */
+struct _SDL_Joystick;
+typedef struct _SDL_Joystick SDL_Joystick;
+
+
+/* Function prototypes */
+int SDL_JoystickInit(void);
+void SDL_JoystickQuit(void);
+/*
+ * Count the number of joysticks attached to the system
+ */
+extern int SDL_NumJoysticks(void);
+
+/*
+ * Get the implementation dependent name of a joystick.
+ * This can be called before any joysticks are opened.
+ * If no name can be found, this function returns NULL.
+ */
+extern const char * SDL_JoystickName(int device_index);
+
+/*
+ * Open a joystick for use - the index passed as an argument refers to
+ * the N'th joystick on the system. This index is the value which will
+ * identify this joystick in future joystick events.
+ *
+ * This function returns a joystick identifier, or NULL if an error occurred.
+ */
+extern SDL_Joystick * SDL_JoystickOpen(int device_index);
+
+/*
+ * Returns 1 if the joystick has been opened, or 0 if it has not.
+ */
+extern int SDL_JoystickOpened(int device_index);
+
+/*
+ * Get the device index of an opened joystick.
+ */
+extern int SDL_JoystickIndex(SDL_Joystick *joystick);
+
+/*
+ * Get the number of general axis controls on a joystick
+ */
+extern int SDL_JoystickNumAxes(SDL_Joystick *joystick);
+
+/*
+ * Get the number of trackballs on a joystick
+ * Joystick trackballs have only relative motion events associated
+ * with them and their state cannot be polled.
+ */
+extern int SDL_JoystickNumBalls(SDL_Joystick *joystick);
+
+/*
+ * Get the number of POV hats on a joystick
+ */
+extern int SDL_JoystickNumHats(SDL_Joystick *joystick);
+
+/*
+ * Get the number of buttons on a joystick
+ */
+extern int SDL_JoystickNumButtons(SDL_Joystick *joystick);
+
+/*
+ * Update the current state of the open joysticks.
+ * This is called automatically by the event loop if any joystick
+ * events are enabled.
+ */
+extern void SDL_JoystickUpdate(void);
+
+/*
+ * Enable/disable joystick event polling.
+ * If joystick events are disabled, you must call SDL_JoystickUpdate()
+ * yourself and check the state of the joystick when you want joystick
+ * information.
+ * The state can be one of SDL_QUERY, SDL_ENABLE or SDL_IGNORE.
+ */
+extern int SDL_JoystickEventState(int state);
+
+/*
+ * Get the current state of an axis control on a joystick
+ * The state is a value ranging from -32768 to 32767.
+ * The axis indices start at index 0.
+ */
+extern Sint16 SDL_JoystickGetAxis(SDL_Joystick *joystick, int axis);
+
+/*
+ * Get the current state of a POV hat on a joystick
+ * The return value is one of the following positions:
+ */
+#define SDL_HAT_CENTERED 0x00
+#define SDL_HAT_UP 0x01
+#define SDL_HAT_RIGHT 0x02
+#define SDL_HAT_DOWN 0x04
+#define SDL_HAT_LEFT 0x08
+#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP)
+#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
+#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
+#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
+/*
+ * The hat indices start at index 0.
+ */
+extern Uint8 SDL_JoystickGetHat(SDL_Joystick *joystick, int hat);
+
+/*
+ * Get the ball axis change since the last poll
+ * This returns 0, or -1 if you passed it invalid parameters.
+ * The ball indices start at index 0.
+ */
+extern int SDL_JoystickGetBall(SDL_Joystick *joystick, int ball, int *dx, int *dy);
+
+/*
+ * Get the current state of a button on a joystick
+ * The button indices start at index 0.
+ */
+extern Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
+
+/*
+ * Close a joystick previously opened with SDL_JoystickOpen()
+ */
+extern void SDL_JoystickClose(SDL_Joystick *joystick);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+}
+#endif
+//#include "close_code.h"
+
+#endif /* _SDL_joystick_h */
Added: branches/fusegl/fuse/ui/cocoa/SDL_joystick/SDL_joystick_c.h
=============================================...
[truncated message content] |
|
From: <fr...@us...> - 2007-04-07 03:26:57
|
Revision: 341
http://svn.sourceforge.net/fuse-for-macosx/?rev=341&view=rev
Author: fredm
Date: 2007-04-06 20:26:32 -0700 (Fri, 06 Apr 2007)
Log Message:
-----------
Add volume output adjustment for coreaudio.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/sound/coreaudiosound.c
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-04-06 09:48:36 UTC (rev 340)
+++ branches/fusegl/fuse/TODO 2007-04-07 03:26:32 UTC (rev 341)
@@ -24,18 +24,24 @@
X Make sure that fuse_end is called somewhere on exit
X Restore activity icons
X Restore joystick processing (re-use SDL joystick input files from SDL)
-* Make activity icons transparent
+X Sort out remaining FuseController calls into emulator object/thread
+X Restore application level volume adjustment
* Use double buffered texture (in cocoadisplay have screen 0 and 1 for use of
DisplayOpenGLView and flip between them on frame end), should also have a
mutex taken while DisplayOpenGLView changes and cocoadisplay flips to
prevent thread sync problems
-* Sort out remaining FuseController calls into emulator object/thread
* Quit keyhandling when command key is pressed
* Use sheets rather than modal dialogs (for Save As)
* Put in latest hq[23]x filters (HQ2x_555 from ScummVM should do the trick)
* Make border display optional
* Figure out why minimise icon image is partially blanked when minimise starts
-* Make sure that printer text is available as we go on OS X
* Allow Cmd-w to close as many operations as possible
+* Make activity icons transparent
+* Seperate out sound buffer interleaving code to allow for the use of hardware etc.
+ sound mixing
+* Add .WAV loader using audiofile
+* Shouldn't be able to load Interface II carts in Pentagon
+* Add volume option to standard fuse + a sound API method to set volume (or a
+ parameter to sound_lowlevel_init)
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/sound/coreaudiosound.c
===================================================================
--- branches/fusegl/fuse/sound/coreaudiosound.c 2007-04-06 09:48:36 UTC (rev 340)
+++ branches/fusegl/fuse/sound/coreaudiosound.c 2007-04-07 03:26:32 UTC (rev 341)
@@ -66,6 +66,7 @@
UInt32 deviceBufferSize; /* bufferSize returned by
kAudioDevicePropertyBufferSize */
int error;
+ Float32 vol = 1.0 - settings_current.volume / 5.0;
/* get the default output device for the HAL */
count = sizeof( device );
@@ -160,6 +161,18 @@
return 1;
}
+ err = AudioUnitSetParameter( gOutputUnit,
+ kHALOutputParam_Volume,
+ kAudioUnitScope_Global,
+ 0,
+ vol,
+ 0 );
+ if( err ) {
+ ui_error( UI_ERROR_ERROR, "AudioUnitSetParameter-Vol=%4.4s, %ld", (char*)&err,
+ err );
+ return 1;
+ }
+
err = AudioUnitInitialize( gOutputUnit );
if( err ) {
ui_error( UI_ERROR_ERROR, "AudioUnitInitialize=%ld", err );
@@ -258,7 +271,7 @@
ioData->mBuffers[1].mData : 0;
if( out_r ) {
- /* Deinterleave the left and right stereo channels into their approptiate
+ /* Deinterleave the left and right stereo channels into their appropriate
buffers */
while( sfifo_used( &sound_fifo ) && len ) {
f = sfifo_read( &sound_fifo, out_l, deviceFormat.mBytesPerFrame );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <fr...@us...> - 2007-05-15 12:46:37
|
Revision: 369
http://svn.sourceforge.net/fuse-for-macosx/?rev=369&view=rev
Author: fredm
Date: 2007-05-15 05:45:49 -0700 (Tue, 15 May 2007)
Log Message:
-----------
Add a second screen texture to ensure there is no reading of the old
texture while it is being updated, also add a buffer for the spectrum
screen seperate from the one being updated in the emulator thread to
prevent any synchronisation problems between the emulator and GUI
threads.
Modified Paths:
--------------
branches/fusegl/fuse/TODO
branches/fusegl/fuse/fusepb/English.lproj/InfoPlist.strings
branches/fusegl/fuse/fusepb/FuseMenus.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
branches/fusegl/fuse/ui/cocoa/cocoadisplay.h
branches/fusegl/fuse/ui/cocoa/cocoadisplay.m
Modified: branches/fusegl/fuse/TODO
===================================================================
--- branches/fusegl/fuse/TODO 2007-05-12 01:33:29 UTC (rev 368)
+++ branches/fusegl/fuse/TODO 2007-05-15 12:45:49 UTC (rev 369)
@@ -43,5 +43,8 @@
* Shouldn't be able to load Interface II carts in Pentagon
* Add volume option to standard fuse + a sound API method to set volume (or a
parameter to sound_lowlevel_init)
+* Save ROM into szx when using a non-default one
+* Randomise FRAMES sys var after autoload snapshot loaded in order to try and
+ get less deterministic program behaviour after load is complete
$Id: TODO,v 1.4 2004/03/02 13:38:08 pak21 Exp $
Modified: branches/fusegl/fuse/fusepb/English.lproj/InfoPlist.strings
===================================================================
(Binary files differ)
Modified: branches/fusegl/fuse/fusepb/FuseMenus.h
===================================================================
--- branches/fusegl/fuse/fusepb/FuseMenus.h 2007-05-12 01:33:29 UTC (rev 368)
+++ branches/fusegl/fuse/fusepb/FuseMenus.h 2007-05-15 12:45:49 UTC (rev 369)
@@ -28,8 +28,6 @@
#ifndef FUSEMENUS_H
#define FUSEMENUS_H
-#include "ui/cocoa/cocoadisplay.h"
-
void SetEmulationHz(float);
#endif /* #ifndef FUSEMENUS_H */
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-05-12 01:33:29 UTC (rev 368)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.h 2007-05-15 12:45:49 UTC (rev 369)
@@ -36,13 +36,16 @@
#include "ui/cocoa/cocoadisplay.h"
#include "ui/ui.h"
+#define MAX_SCREEN_BUFFERS 2
+
@class Emulator;
@interface DisplayOpenGLView : NSOpenGLView
{
/* Need texture size and dimensions and two backing textures */
- Cocoa_Texture screenTex; /* Screen texture */
- GLuint screenTexId;
+ Cocoa_Texture screenTex[MAX_SCREEN_BUFFERS]; /* Screen texture */
+ GLuint screenTexId[MAX_SCREEN_BUFFERS];
+ int currentScreenTex;
Cocoa_Texture redCassetteTex;
GLuint redCassette;
Modified: branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m
===================================================================
--- branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-05-12 01:33:29 UTC (rev 368)
+++ branches/fusegl/fuse/fusepb/views/DisplayOpenGLView.m 2007-05-15 12:45:49 UTC (rev 369)
@@ -137,8 +137,8 @@
break;
case 0:
default: /* Actual size */
- size.width = screenTex.image_width;
- size.height = screenTex.image_height;
+ size.width = screenTex[0].image_width;
+ size.height = screenTex[0].image_height;
}
[[self window] setContentSize:size];
@@ -224,6 +224,8 @@
[NSThread detachNewThreadSelector:@selector(connectWithPorts:)
toTarget:real_emulator withObject:portArray];
+ currentScreenTex = 0;
+
return self;
}
@@ -374,36 +376,40 @@
{
if( NO == screenTexInitialised ) return;
+ currentScreenTex = !currentScreenTex;
+
/* Need to draw texture to screen here */
/* FIXME: lock screen - direct lock probably faster [emulation lockScreen]; */
+ [buffered_screen_lock lock];
/* should draw directly from emulation screen instead of screenTex, switch between
buffers there */
- memcpy( screenTex.pixels, screen->pixels, screenTex.pitch * screenTex.full_height );
+ memcpy( screenTex[currentScreenTex].pixels, buffered_screen.pixels, screenTex[currentScreenTex].pitch * screenTex[currentScreenTex].full_height );
/* FIXME: unlock screen - direct lock probably faster [emulation unlockScreen]; */
+ [buffered_screen_lock unlock];
[[self openGLContext] makeCurrentContext];
glClear( GL_COLOR_BUFFER_BIT );
/* Bind, update and draw new image */
- glBindTexture( GL_TEXTURE_RECTANGLE_EXT, screenTexId );
+ glBindTexture( GL_TEXTURE_RECTANGLE_EXT, screenTexId[currentScreenTex] );
- glTexSubImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, screenTex.full_width,
- screenTex.full_height, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
- screenTex.pixels );
+ glTexSubImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, screenTex[currentScreenTex].full_width,
+ screenTex[currentScreenTex].full_height, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
+ screenTex[currentScreenTex].pixels );
glBegin( GL_QUADS );
- glTexCoord2f( (float)screenTex.image_width, (float)(screenTex.image_xoffset) );
+ glTexCoord2f( (float)screenTex[currentScreenTex].image_width, (float)(screenTex[currentScreenTex].image_xoffset) );
glVertex2f( 1.0f, 1.0f );
- glTexCoord2f( (float)screenTex.image_width, (float)screenTex.image_height );
+ glTexCoord2f( (float)screenTex[currentScreenTex].image_width, (float)screenTex[currentScreenTex].image_height );
glVertex2f( 1.0f, -1.0f );
- glTexCoord2f( (float)screenTex.image_xoffset, (float)screenTex.image_height );
+ glTexCoord2f( (float)screenTex[currentScreenTex].image_xoffset, (float)screenTex[currentScreenTex].image_height );
glVertex2f( -1.0f, -1.0f );
- glTexCoord2f( (float)screenTex.image_xoffset, (float)screenTex.image_yoffset );
+ glTexCoord2f( (float)screenTex[currentScreenTex].image_xoffset, (float)screenTex[currentScreenTex].image_yoffset );
glVertex2f( -1.0f, 1.0f );
glEnd();
@@ -482,47 +488,47 @@
if( screenTexInitialised == NO) return;
/* FIXME: May want to have a double buffered texture later */
-#if 0
- for(i = 0; i < 1; i++) {
- GLint dt = i+1;
- glDeleteTextures(1, &dt);
+ glDeleteTextures( MAX_SCREEN_BUFFERS, screenTexId );
+ for(i = 0; i < MAX_SCREEN_BUFFERS; i++)
+ {
+ free( screenTex[i].pixels );
+ screenTex[i].pixels = NULL;
}
-#endif
- glDeleteTextures( 1, &screenTexId );
screenTexInitialised = NO;
}
--(void) createTexture:(Cocoa_Texture*)newScreen;
+-(void) createTexture:(Cocoa_Texture*)newScreen
{
- GLint i;
+ GLuint i;
- screenTex.full_width = newScreen->full_width;
- screenTex.full_height = newScreen->full_height;
- screenTex.image_width = newScreen->image_width;
- screenTex.image_height = newScreen->image_height;
- screenTex.image_xoffset = newScreen->image_xoffset;
- screenTex.image_yoffset = newScreen->image_yoffset;
- screenTex.pixels = calloc( screenTex.full_width * screenTex.full_height, sizeof(uint16_t) );
- if( !screenTex.pixels ) {
- fprintf( stderr, "%s: couldn't create screenTex.pixels\n", fuse_progname );
- return;
- }
- screenTex.pitch = screenTex.full_width * sizeof(uint16_t);
-
[[self openGLContext] makeCurrentContext];
[[self openGLContext] update];
/* FIXME: May want to have a double buffered texture later */
- //for(i = 0; i < 1; i++)
- //{
- glGenTextures( 1, &screenTexId );
+ glGenTextures( MAX_SCREEN_BUFFERS, screenTexId );
+
+ for(i = 0; i < MAX_SCREEN_BUFFERS; i++)
+ {
+ screenTex[i].full_width = newScreen->full_width;
+ screenTex[i].full_height = newScreen->full_height;
+ screenTex[i].image_width = newScreen->image_width;
+ screenTex[i].image_height = newScreen->image_height;
+ screenTex[i].image_xoffset = newScreen->image_xoffset;
+ screenTex[i].image_yoffset = newScreen->image_yoffset;
+ screenTex[i].pixels = calloc( screenTex[i].full_width * screenTex[i].full_height, sizeof(uint16_t) );
+ if( !screenTex[i].pixels ) {
+ fprintf( stderr, "%s: couldn't create screenTex[%ud].pixels\n", fuse_progname, (unsigned int)i );
+ return;
+ }
+ screenTex[i].pitch = screenTex[i].full_width * sizeof(uint16_t);
+
glDisable( GL_TEXTURE_2D );
glEnable( GL_TEXTURE_RECTANGLE_EXT );
- glBindTexture( GL_TEXTURE_RECTANGLE_EXT, screenTexId );
+ glBindTexture( GL_TEXTURE_RECTANGLE_EXT, screenTexId[i] );
glTextureRangeAPPLE( GL_TEXTURE_RECTANGLE_EXT,
- screenTex.full_width * screenTex.pitch,
- screenTex.pixels );
+ screenTex[i].full_width * screenTex[i].pitch,
+ screenTex[i].pixels );
glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_STORAGE_HINT_APPLE,
GL_STORAGE_CACHED_APPLE );
@@ -534,10 +540,10 @@
glTexParameteri( GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 );
- glTexImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, screenTex.full_width,
- screenTex.full_height, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
- screenTex.pixels );
- //}
+ glTexImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, screenTex[i].full_width,
+ screenTex[i].full_height, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV,
+ screenTex[i].pixels );
+ }
screenTexInitialised = YES;
}
Modified: branches/fusegl/fuse/ui/cocoa/cocoadisplay.h
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoadisplay.h 2007-05-12 01:33:29 UTC (rev 368)
+++ branches/fusegl/fuse/ui/cocoa/cocoadisplay.h 2007-05-15 12:45:49 UTC (rev 369)
@@ -27,6 +27,8 @@
#ifndef FUSE_COCOADISPLAY_H
#define FUSE_COCOADISPLAY_H
+#import <Foundation/NSLock.h>
+
#include "ui/ui.h"
typedef struct Cocoa_Texture {
@@ -43,6 +45,9 @@
/* Screen texture */
extern Cocoa_Texture* screen;
+extern NSLock *buffered_screen_lock;
+extern Cocoa_Texture buffered_screen;
+
void cocoadisplay_display_updated( void );
#endif /* #ifndef FUSE_COCOADISPLAY_H */
Modified: branches/fusegl/fuse/ui/cocoa/cocoadisplay.m
===================================================================
--- branches/fusegl/fuse/ui/cocoa/cocoadisplay.m 2007-05-12 01:33:29 UTC (rev 368)
+++ branches/fusegl/fuse/ui/cocoa/cocoadisplay.m 2007-05-15 12:45:49 UTC (rev 369)
@@ -62,6 +62,12 @@
/* Screen texture after scaling (only if a transforming scaler is in place) */
Cocoa_Texture scaled_screen;
+/* Screen texture second buffer */
+Cocoa_Texture buffered_screen;
+
+/* and a lock to protect it from concurrent access */
+NSLock *buffered_screen_lock;
+
/* Colours are in 1A 5R 5G 5B format */
static uint16_t colour_values[] = {
0x0000,
@@ -117,10 +123,10 @@
static int
allocate_screen( Cocoa_Texture* screen, int height, int width,
- float scaling_factor )
+ float scaling_factor )
{
- screen->image_width = image_width * display_current_size;
- screen->image_height = image_height * display_current_size;
+ screen->image_width = width * scaling_factor;
+ screen->image_height = height * scaling_factor;
/* Need some extra bytes around when using 2xSaI */
screen->full_width = screen->image_width+3;
@@ -130,7 +136,7 @@
screen->pixels = calloc( screen->full_width*screen->full_height, sizeof(uint16_t) );
if( !screen->pixels ) {
- fprintf( stderr, "%s: couldn't create screen.pixels\n", fuse_progname );
+ fprintf( stderr, "%s: couldn't allocate screen.pixels\n", fuse_progname );
return 1;
}
@@ -168,8 +174,12 @@
screen = &scaled_screen;
}
+ error = allocate_screen( &buffered_screen, screen->image_height,
+ screen->image_width, 1.0f );
+ if( error ) return error;
+
/* Create OpenGL textures for the image in DisplayOpenGLView */
- [[DisplayOpenGLView instance] createTexture:screen];
+ [[DisplayOpenGLView instance] createTexture:&buffered_screen];
/* Redraw the entire screen... */
display_refresh_all();
@@ -213,6 +223,9 @@
if ( scaler_select_scaler( current_scaler ) )
scaler_select_scaler( SCALER_NORMAL );
+ buffered_screen_lock = [[NSLock alloc] init];
+ [buffered_screen_lock retain];
+
cocoadisplay_load_gfx_mode();
/* We can now output error messages to our output device */
@@ -229,6 +242,7 @@
/* Free the old surfaces */
free_screen( &unscaled_screen );
free_screen( &scaled_screen );
+ free_screen( &buffered_screen );
/* Setup the new GFX mode */
cocoadisplay_load_gfx_mode();
@@ -371,6 +385,12 @@
uidisplay_frame_end( void )
{
if( display_updated )
+ /* obtain lock for buffered screen */
+ [buffered_screen_lock lock];
+ /* copy screen data to buffered screen */
+ memcpy( buffered_screen.pixels, screen->pixels, screen->pitch * screen->full_height );
+ /* release lock for buffered screen */
+ [buffered_screen_lock unlock];
[[DisplayOpenGLView instance]
performSelectorOnMainThread:@selector(setNeedsDisplayYes)
withObject:nil
@@ -410,8 +430,11 @@
[[DisplayOpenGLView instance] destroyTexture];
}
+ [buffered_screen_lock release];
+
free_screen( &unscaled_screen );
free_screen( &scaled_screen );
+ free_screen( &buffered_screen );
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|