[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. |