revision 106:9048bac046c3
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 106:9048bac046c3 |
parent | 105:1faa0745f200 |
child | 107:e576dd36073a |
author | nkeynes |
date | Tue Mar 14 12:45:53 2006 +0000 (18 years ago) |
Move driver selection out to main at long last. Add video NULL driver for
headless operation
Make dcload exit() actually exit
headless operation
Make dcload exit() actually exit
src/Makefile.am | view | annotate | diff | log | ||
src/Makefile.in | view | annotate | diff | log | ||
src/aica/aica.c | view | annotate | diff | log | ||
src/aica/audio.c | view | annotate | diff | log | ||
src/aica/audio.h | view | annotate | diff | log | ||
src/dcload.c | view | annotate | diff | log | ||
src/drivers/audio_esd.c | view | annotate | diff | log | ||
src/drivers/audio_null.c | view | annotate | diff | log | ||
src/drivers/video_gtk.c | view | annotate | diff | log | ||
src/drivers/video_null.c | view | annotate | diff | log | ||
src/gui/gui.c | view | annotate | diff | log | ||
src/main.c | view | annotate | diff | log | ||
src/pvr2/pvr2.c | view | annotate | diff | log | ||
src/video.h | view | annotate | diff | log |
1.1 --- a/src/Makefile.am Tue Mar 14 11:44:29 2006 +00001.2 +++ b/src/Makefile.am Tue Mar 14 12:45:53 2006 +00001.3 @@ -32,7 +32,7 @@1.4 gui/debug_win.c gui/dump_win.c \1.5 loader.c bootstrap.c util.c \1.6 drivers/audio_null.c drivers/audio_esd.c \1.7 - drivers/video_gtk.c drivers/video_gtk.h \1.8 + drivers/video_null.c drivers/video_gtk.c drivers/video_gtk.h \1.9 drivers/video_x11.c drivers/video_x11.h1.11 dream_LDADD = @PACKAGE_LIBS@ $(INTLLIBS) -lesd
2.1 --- a/src/Makefile.in Tue Mar 14 11:44:29 2006 +00002.2 +++ b/src/Makefile.in Tue Mar 14 12:45:53 2006 +00002.3 @@ -159,7 +159,7 @@2.4 gui/debug_win.c gui/dump_win.c \2.5 loader.c bootstrap.c util.c \2.6 drivers/audio_null.c drivers/audio_esd.c \2.7 - drivers/video_gtk.c drivers/video_gtk.h \2.8 + drivers/video_null.c drivers/video_gtk.c drivers/video_gtk.h \2.9 drivers/video_x11.c drivers/video_x11.h2.12 @@ -186,8 +186,8 @@2.13 interface.$(OBJEXT) callbacks.$(OBJEXT) gui.$(OBJEXT) \2.14 mmr_win.$(OBJEXT) debug_win.$(OBJEXT) dump_win.$(OBJEXT) \2.15 loader.$(OBJEXT) bootstrap.$(OBJEXT) util.$(OBJEXT) \2.16 - audio_null.$(OBJEXT) audio_esd.$(OBJEXT) video_gtk.$(OBJEXT) \2.17 - video_x11.$(OBJEXT)2.18 + audio_null.$(OBJEXT) audio_esd.$(OBJEXT) video_null.$(OBJEXT) \2.19 + video_gtk.$(OBJEXT) video_x11.$(OBJEXT)2.20 dream_OBJECTS = $(am_dream_OBJECTS)2.21 dream_DEPENDENCIES =2.22 dream_LDFLAGS =2.23 @@ -215,7 +215,8 @@2.24 @AMDEP_TRUE@ ./$(DEPDIR)/syscall.Po ./$(DEPDIR)/ta.Po \2.25 @AMDEP_TRUE@ ./$(DEPDIR)/texcache.Po ./$(DEPDIR)/timer.Po \2.26 @AMDEP_TRUE@ ./$(DEPDIR)/util.Po ./$(DEPDIR)/video_gtk.Po \2.27 -@AMDEP_TRUE@ ./$(DEPDIR)/video_x11.Po ./$(DEPDIR)/watch.Po2.28 +@AMDEP_TRUE@ ./$(DEPDIR)/video_null.Po ./$(DEPDIR)/video_x11.Po \2.29 +@AMDEP_TRUE@ ./$(DEPDIR)/watch.Po2.30 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \2.31 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)2.32 CCLD = $(CC)2.33 @@ -307,6 +308,7 @@2.34 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@2.35 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@2.36 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video_gtk.Po@am__quote@2.37 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video_null.Po@am__quote@2.38 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video_x11.Po@am__quote@2.39 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watch.Po@am__quote@2.41 @@ -970,6 +972,28 @@2.42 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.43 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o audio_esd.obj `if test -f 'drivers/audio_esd.c'; then $(CYGPATH_W) 'drivers/audio_esd.c'; else $(CYGPATH_W) '$(srcdir)/drivers/audio_esd.c'; fi`2.45 +video_null.o: drivers/video_null.c2.46 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_null.o -MD -MP -MF "$(DEPDIR)/video_null.Tpo" \2.47 +@am__fastdepCC_TRUE@ -c -o video_null.o `test -f 'drivers/video_null.c' || echo '$(srcdir)/'`drivers/video_null.c; \2.48 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_null.Tpo" "$(DEPDIR)/video_null.Po"; \2.49 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_null.Tpo"; exit 1; \2.50 +@am__fastdepCC_TRUE@ fi2.51 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_null.c' object='video_null.o' libtool=no @AMDEPBACKSLASH@2.52 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_null.Po' tmpdepfile='$(DEPDIR)/video_null.TPo' @AMDEPBACKSLASH@2.53 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.54 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_null.o `test -f 'drivers/video_null.c' || echo '$(srcdir)/'`drivers/video_null.c2.55 +2.56 +video_null.obj: drivers/video_null.c2.57 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_null.obj -MD -MP -MF "$(DEPDIR)/video_null.Tpo" \2.58 +@am__fastdepCC_TRUE@ -c -o video_null.obj `if test -f 'drivers/video_null.c'; then $(CYGPATH_W) 'drivers/video_null.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_null.c'; fi`; \2.59 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_null.Tpo" "$(DEPDIR)/video_null.Po"; \2.60 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_null.Tpo"; exit 1; \2.61 +@am__fastdepCC_TRUE@ fi2.62 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_null.c' object='video_null.obj' libtool=no @AMDEPBACKSLASH@2.63 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_null.Po' tmpdepfile='$(DEPDIR)/video_null.TPo' @AMDEPBACKSLASH@2.64 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.65 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_null.obj `if test -f 'drivers/video_null.c'; then $(CYGPATH_W) 'drivers/video_null.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_null.c'; fi`2.66 +2.67 video_gtk.o: drivers/video_gtk.c2.68 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_gtk.o -MD -MP -MF "$(DEPDIR)/video_gtk.Tpo" \2.69 @am__fastdepCC_TRUE@ -c -o video_gtk.o `test -f 'drivers/video_gtk.c' || echo '$(srcdir)/'`drivers/video_gtk.c; \
3.1 --- a/src/aica/aica.c Tue Mar 14 11:44:29 2006 +00003.2 +++ b/src/aica/aica.c Tue Mar 14 12:45:53 2006 +00003.3 @@ -1,5 +1,5 @@3.4 /**3.5 - * $Id: aica.c,v 1.16 2006-01-22 22:40:05 nkeynes Exp $3.6 + * $Id: aica.c,v 1.17 2006-03-14 12:45:53 nkeynes Exp $3.7 *3.8 * This is the core sound system (ie the bit which does the actual work)3.9 *3.10 @@ -21,9 +21,9 @@3.11 #include "dream.h"3.12 #include "dreamcast.h"3.13 #include "mem.h"3.14 -#include "aica.h"3.15 +#include "aica/aica.h"3.16 #include "armcore.h"3.17 -#include "audio.h"3.18 +#include "aica/audio.h"3.19 #define MMIO_IMPL3.20 #include "aica.h"3.22 @@ -53,7 +53,6 @@3.23 MMIO_NOTRACE(AICA1);3.24 arm_mem_init();3.25 aica_reset();3.26 - audio_set_output( &esd_audio_driver, 44100, AUDIO_FMT_16BIT|AUDIO_FMT_STEREO );3.27 }3.29 void aica_reset( void )
4.1 --- a/src/aica/audio.c Tue Mar 14 11:44:29 2006 +00004.2 +++ b/src/aica/audio.c Tue Mar 14 12:45:53 2006 +00004.3 @@ -1,5 +1,5 @@4.4 /**4.5 - * $Id: audio.c,v 1.4 2006-01-17 12:54:02 nkeynes Exp $4.6 + * $Id: audio.c,v 1.5 2006-03-14 12:45:53 nkeynes Exp $4.7 *4.8 * Audio mixer core. Combines all the active streams into a single sound4.9 * buffer for output.4.10 @@ -52,7 +52,7 @@4.11 * output buffers, flushing any current data and reallocating as4.12 * necessary.4.13 */4.14 -void audio_set_output( audio_driver_t driver,4.15 +void audio_set_driver( audio_driver_t driver,4.16 uint32_t samplerate, int format )4.17 {4.18 uint32_t bytes_per_sample = 1;4.19 @@ -82,7 +82,7 @@4.20 audio.read_buffer = 0;4.22 if( driver == NULL )4.23 - driver = &null_audio_driver;4.24 + driver = &audio_null_driver;4.25 audio_driver = driver;4.26 audio_driver->set_output_format( samplerate, format );4.27 }
5.1 --- a/src/aica/audio.h Tue Mar 14 11:44:29 2006 +00005.2 +++ b/src/aica/audio.h Tue Mar 14 12:45:53 2006 +00005.3 @@ -1,5 +1,5 @@5.4 /**5.5 - * $Id: audio.h,v 1.5 2006-02-05 04:01:55 nkeynes Exp $5.6 + * $Id: audio.h,v 1.6 2006-03-14 12:45:53 nkeynes Exp $5.7 *5.8 * Audio engine, ie the part that does the actual work.5.9 *5.10 @@ -33,6 +33,7 @@5.11 #define AUDIO_FMT_SIGNED 05.12 #define AUDIO_FMT_UNSIGNED 85.14 +#define AUDIO_FMT_16ST (AUDIO_FMT_16BIT|AUDIO_FMT_STEREO)5.16 typedef struct audio_channel {5.17 gboolean active;5.18 @@ -67,15 +68,15 @@5.19 gboolean (*process_buffer)( audio_buffer_t buffer );5.20 } *audio_driver_t;5.22 -extern struct audio_driver null_audio_driver;5.23 -extern struct audio_driver esd_audio_driver;5.24 +extern struct audio_driver audio_null_driver;5.25 +extern struct audio_driver audio_esd_driver;5.27 /**5.28 * Set the output driver, sample rate and format. Also initializes the5.29 * output buffers, flushing any current data and reallocating as5.30 * necessary. Must be called before attempting to generate any audio.5.31 */5.32 -void audio_set_output( audio_driver_t driver, uint32_t samplerate,5.33 +void audio_set_driver( audio_driver_t driver, uint32_t samplerate,5.34 int format );5.36 /**
6.1 --- a/src/dcload.c Tue Mar 14 11:44:29 2006 +00006.2 +++ b/src/dcload.c Tue Mar 14 12:45:53 2006 +00006.3 @@ -1,5 +1,5 @@6.4 /**6.5 - * $Id: dcload.c,v 1.1 2006-03-13 12:38:34 nkeynes Exp $6.6 + * $Id: dcload.c,v 1.2 2006-03-14 12:45:50 nkeynes Exp $6.7 *6.8 * DC-load syscall implementation.6.9 *6.10 @@ -70,10 +70,7 @@6.11 }6.12 break;6.13 case SYS_EXIT:6.14 - dreamcast_stop();6.15 - sh4_stop();6.16 - sh4r.r[0] = 0;6.17 - break;6.18 + exit( sh4r.r[4] );6.19 default:6.20 sh4r.r[0] = -1;6.21 }
7.1 --- a/src/drivers/audio_esd.c Tue Mar 14 11:44:29 2006 +00007.2 +++ b/src/drivers/audio_esd.c Tue Mar 14 12:45:53 2006 +00007.3 @@ -1,5 +1,5 @@7.4 /**7.5 - * $Id: audio_esd.c,v 1.5 2006-01-22 22:40:05 nkeynes Exp $7.6 + * $Id: audio_esd.c,v 1.6 2006-03-14 12:45:53 nkeynes Exp $7.7 *7.8 * The esd (esound) audio driver7.9 *7.10 @@ -22,7 +22,7 @@7.11 int esd_handle = -1;7.12 int esd_sample_size = 1;7.14 -gboolean esd_audio_set_format( uint32_t rate, uint32_t format )7.15 +gboolean audio_esd_set_format( uint32_t rate, uint32_t format )7.16 {7.17 if( esd_handle != -1 ) {7.18 esd_close(esd_handle);7.19 @@ -44,7 +44,7 @@7.20 return TRUE;7.21 }7.23 -gboolean esd_audio_process_buffer( audio_buffer_t buffer )7.24 +gboolean audio_esd_process_buffer( audio_buffer_t buffer )7.25 {7.26 if( esd_handle != -1 ) {7.27 write( esd_handle, buffer->data, buffer->length );7.28 @@ -55,5 +55,5 @@7.29 }7.30 }7.32 -struct audio_driver esd_audio_driver = { "esd", esd_audio_set_format, esd_audio_process_buffer };7.33 +struct audio_driver audio_esd_driver = { "esd", audio_esd_set_format, audio_esd_process_buffer };
8.1 --- a/src/drivers/audio_null.c Tue Mar 14 11:44:29 2006 +00008.2 +++ b/src/drivers/audio_null.c Tue Mar 14 12:45:53 2006 +00008.3 @@ -1,5 +1,5 @@8.4 /**8.5 - * $Id: audio_null.c,v 1.2 2006-01-12 12:38:59 nkeynes Exp $8.6 + * $Id: audio_null.c,v 1.3 2006-03-14 12:45:53 nkeynes Exp $8.7 *8.8 * The "null" audio driver, which just discards all input without even8.9 * looking at it.8.10 @@ -18,14 +18,14 @@8.11 */8.12 #include "aica/audio.h"8.14 -gboolean null_audio_set_format( uint32_t rate, uint32_t format )8.15 +gboolean audio_null_set_format( uint32_t rate, uint32_t format )8.16 {8.17 return TRUE;8.18 }8.20 -gboolean null_audio_process_buffer( audio_buffer_t buffer )8.21 +gboolean audio_null_process_buffer( audio_buffer_t buffer )8.22 {8.23 return TRUE;8.24 }8.26 -struct audio_driver null_audio_driver = { "null", null_audio_set_format, null_audio_process_buffer };8.27 +struct audio_driver audio_null_driver = { "null", audio_null_set_format, audio_null_process_buffer };
9.1 --- a/src/drivers/video_gtk.c Tue Mar 14 11:44:29 2006 +00009.2 +++ b/src/drivers/video_gtk.c Tue Mar 14 12:45:53 2006 +00009.3 @@ -1,5 +1,5 @@9.4 /**9.5 - * $Id: video_gtk.c,v 1.2 2006-03-13 12:39:07 nkeynes Exp $9.6 + * $Id: video_gtk.c,v 1.3 2006-03-14 12:45:53 nkeynes Exp $9.7 *9.8 * The PC side of the video support (responsible for actually displaying /9.9 * rendering frames)9.10 @@ -35,7 +35,7 @@9.11 gboolean video_gtk_display_frame( video_buffer_t frame );9.12 gboolean video_gtk_blank( uint32_t rgb );9.14 -struct video_driver video_gtk_driver = { "Gtk",9.15 +struct video_driver video_gtk_driver = { "gtk",9.16 NULL,9.17 NULL,9.18 video_gtk_set_output_format,
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000010.2 +++ b/src/drivers/video_null.c Tue Mar 14 12:45:53 2006 +000010.3 @@ -0,0 +1,55 @@10.4 +/**10.5 + * $Id: video_null.c,v 1.1 2006-03-14 12:45:53 nkeynes Exp $10.6 + *10.7 + * Null video output driver (ie no video output whatsoever)10.8 + *10.9 + * Copyright (c) 2005 Nathan Keynes.10.10 + *10.11 + * This program is free software; you can redistribute it and/or modify10.12 + * it under the terms of the GNU General Public License as published by10.13 + * the Free Software Foundation; either version 2 of the License, or10.14 + * (at your option) any later version.10.15 + *10.16 + * This program is distributed in the hope that it will be useful,10.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of10.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10.19 + * GNU General Public License for more details.10.20 + */10.21 +10.22 +#include "video.h"10.23 +10.24 +gboolean video_null_set_output_format( uint32_t hres, uint32_t vres,10.25 + int colour_format )10.26 +{10.27 + return TRUE;10.28 +}10.29 +10.30 +gboolean video_null_set_render_format( uint32_t hres, uint32_t vres,10.31 + int colour_format, gboolean tex )10.32 +{10.33 + return TRUE;10.34 +}10.35 +10.36 +gboolean video_null_display_frame( video_buffer_t buffer )10.37 +{10.38 + return TRUE;10.39 +}10.40 +10.41 +gboolean video_null_blank( uint32_t colour )10.42 +{10.43 + return TRUE;10.44 +}10.45 +10.46 +void video_null_display_back_buffer( void )10.47 +{10.48 +}10.49 +10.50 +10.51 +struct video_driver video_null_driver = { "null",10.52 + NULL,10.53 + NULL,10.54 + video_null_set_output_format,10.55 + video_null_set_render_format,10.56 + video_null_display_frame,10.57 + video_null_blank,10.58 + video_null_display_back_buffer };
11.1 --- a/src/gui/gui.c Tue Mar 14 11:44:29 2006 +000011.2 +++ b/src/gui/gui.c Tue Mar 14 12:45:53 2006 +000011.3 @@ -1,5 +1,5 @@11.4 /**11.5 - * $Id: gui.c,v 1.9 2005-12-26 11:47:15 nkeynes Exp $11.6 + * $Id: gui.c,v 1.10 2006-03-14 12:45:53 nkeynes Exp $11.7 *11.8 * Top-level GUI (GTK2) module.11.9 *11.10 @@ -124,6 +124,8 @@11.11 }11.13 void gtk_gui_update(void) {11.14 + if( main_debug == NULL )11.15 + return;11.16 update_registers(main_debug);11.17 update_icount(main_debug);11.18 update_mmr_win();
12.1 --- a/src/main.c Tue Mar 14 11:44:29 2006 +000012.2 +++ b/src/main.c Tue Mar 14 12:45:53 2006 +000012.3 @@ -1,5 +1,5 @@12.4 /**12.5 - * $Id: main.c,v 1.14 2006-03-14 11:44:29 nkeynes Exp $12.6 + * $Id: main.c,v 1.15 2006-03-14 12:45:50 nkeynes Exp $12.7 *12.8 * Main program, initializes dreamcast and gui, then passes control off to12.9 * the gtk main loop (currently).12.10 @@ -29,6 +29,8 @@12.11 #include "dream.h"12.12 #include "syscall.h"12.13 #include "dreamcast.h"12.14 +#include "aica/audio.h"12.15 +#include "video.h"12.17 #define S3M_PLAYER "s3mplay.bin"12.19 @@ -36,13 +38,23 @@12.20 struct option longopts[1] = { { NULL, 0, 0, 0 } };12.21 char *aica_program = NULL;12.22 char *s3m_file = NULL;12.23 +char *video_driver_name = "gtk";12.24 +char *audio_driver_name = "esd";12.25 gboolean start_immediately = FALSE;12.26 gboolean headless = FALSE;12.27 gboolean without_bios = FALSE;12.29 +audio_driver_t audio_driver_list[] = { &audio_null_driver,12.30 + &audio_esd_driver,12.31 + NULL };12.32 +12.33 +video_driver_t video_driver_list[] = { &video_null_driver,12.34 + &video_gtk_driver,12.35 + NULL };12.36 +12.37 int main (int argc, char *argv[])12.38 {12.39 - int opt;12.40 + int opt, i;12.41 #ifdef ENABLE_NLS12.42 bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR);12.43 textdomain (PACKAGE);12.44 @@ -58,8 +70,10 @@12.45 s3m_file = optarg;12.46 break;12.47 case 'A': /* Audio driver */12.48 + audio_driver_name = optarg;12.49 break;12.50 case 'V': /* Video driver */12.51 + video_driver_name = optarg;12.52 break;12.53 case 'p': /* Start immediately */12.54 start_immediately = TRUE;12.55 @@ -99,6 +113,34 @@12.56 bios_install();12.57 dcload_install();12.58 }12.59 +12.60 + for( i=0; audio_driver_list[i] != NULL; i++ ) {12.61 + if( strcasecmp( audio_driver_list[i]->name, audio_driver_name ) == 0 ) {12.62 + audio_set_driver( audio_driver_list[i], 44100, AUDIO_FMT_16ST );12.63 + break;12.64 + }12.65 +12.66 + }12.67 + if( audio_driver_list[i] == NULL ) {12.68 + ERROR( "Audio driver '%s' not found, using null driver", audio_driver_name );12.69 + audio_set_driver( &audio_null_driver, 44100, AUDIO_FMT_16ST );12.70 + }12.71 +12.72 + if( headless ) {12.73 + video_set_driver( &video_null_driver );12.74 + } else {12.75 + for( i=0; video_driver_list[i] != NULL; i++ ) {12.76 + if( strcasecmp( video_driver_list[i]->name, video_driver_name ) == 0 ) {12.77 + video_set_driver( video_driver_list[i] );12.78 + break;12.79 + }12.80 + }12.81 + if( video_driver_list[i] == NULL ) {12.82 + ERROR( "Video driver '%s' not found, using null driver", video_driver_name );12.83 + video_set_driver( &video_null_driver );12.84 + }12.85 + }12.86 +12.87 INFO( "DreamOn! ready..." );12.88 if( optind < argc ) {12.89 file_load_magic( argv[optind] );
13.1 --- a/src/pvr2/pvr2.c Tue Mar 14 11:44:29 2006 +000013.2 +++ b/src/pvr2/pvr2.c Tue Mar 14 12:45:53 2006 +000013.3 @@ -1,5 +1,5 @@13.4 /**13.5 - * $Id: pvr2.c,v 1.17 2006-03-13 12:39:07 nkeynes Exp $13.6 + * $Id: pvr2.c,v 1.18 2006-03-14 12:45:53 nkeynes Exp $13.7 *13.8 * PVR2 (Video) Core MMIO registers.13.9 *13.10 @@ -61,8 +61,17 @@13.11 register_io_region( &mmio_region_PVR2PAL );13.12 register_io_region( &mmio_region_PVR2TA );13.13 video_base = mem_get_region_by_name( MEM_REGION_VIDEO );13.14 - video_driver = &video_gtk_driver;13.15 - video_driver->set_display_format( 640, 480, COLFMT_RGB32 );13.16 +}13.17 +13.18 +void video_set_driver( video_driver_t driver )13.19 +{13.20 + if( video_driver != NULL && video_driver->shutdown_driver != NULL )13.21 + video_driver->shutdown_driver();13.22 +13.23 + video_driver = driver;13.24 + if( driver->init_driver != NULL )13.25 + driver->init_driver();13.26 + driver->set_display_format( 640, 480, COLFMT_RGB32 );13.27 }13.29 uint32_t pvr2_line_count = 0;
14.1 --- a/src/video.h Tue Mar 14 11:44:29 2006 +000014.2 +++ b/src/video.h Tue Mar 14 12:45:53 2006 +000014.3 @@ -1,5 +1,5 @@14.4 /**14.5 - * $Id: video.h,v 1.5 2006-03-13 12:39:03 nkeynes Exp $14.6 + * $Id: video.h,v 1.6 2006-03-14 12:45:50 nkeynes Exp $14.7 *14.8 * The PC side of the video support (responsible for actually displaying /14.9 * rendering frames)14.10 @@ -118,6 +118,7 @@14.11 extern uint32_t pvr2_frame_counter;14.13 extern struct video_driver video_gtk_driver;14.14 +extern struct video_driver video_null_driver;14.16 #ifdef __cplusplus14.17 }
.