revision 700:4650d0c7f6f9
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 700:4650d0c7f6f9 |
parent | 699:d9ba9a9e5d14 |
child | 701:1ff36bb68c79 |
author | nkeynes |
date | Sun Jun 22 06:49:00 2008 +0000 (15 years ago) |
Big cleanup of the command-line options
Add an actual manpage (*gasp*)
Add an actual manpage (*gasp*)
1.1 --- a/Makefile.am Sun Jun 22 06:21:57 2008 +00001.2 +++ b/Makefile.am Sun Jun 22 06:49:00 2008 +00001.3 @@ -1,5 +1,7 @@1.4 ## Process this file with automake to produce Makefile.in1.6 +POD2MAN=@POD2MAN@1.7 +1.8 if BUILD_SYSTEST1.9 TEST_SUBDIR = test1.10 endif1.11 @@ -7,6 +9,11 @@1.13 EXTRA_DIST = autogen.sh1.15 +man_MANS = lxdream.11.16 +1.17 +lxdream.1: lxdream.pod1.18 + $(POD2MAN) $< $@1.19 +1.20 install-data-local:1.21 @$(NORMAL_INSTALL)1.22 if test -d $(srcdir)/pixmaps; then \
2.1 --- a/Makefile.in Sun Jun 22 06:21:57 2008 +00002.2 +++ b/Makefile.in Sun Jun 22 06:49:00 2008 +00002.3 @@ -58,6 +58,10 @@2.4 install-recursive installcheck-recursive installdirs-recursive \2.5 pdf-recursive ps-recursive uninstall-info-recursive \2.6 uninstall-recursive2.7 +man1dir = $(mandir)/man12.8 +am__installdirs = "$(DESTDIR)$(man1dir)"2.9 +NROFF = nroff2.10 +MANS = $(man_MANS)2.11 ETAGS = etags2.12 CTAGS = ctags2.13 DIST_SUBDIRS = src po test2.14 @@ -165,6 +169,8 @@2.15 PACKAGE_VERSION = @PACKAGE_VERSION@2.16 PATH_SEPARATOR = @PATH_SEPARATOR@2.17 PKG_CONFIG = @PKG_CONFIG@2.18 +POD2HTML = @POD2HTML@2.19 +POD2MAN = @POD2MAN@2.20 POFILES = @POFILES@2.21 POSUB = @POSUB@2.22 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@2.23 @@ -232,6 +238,7 @@2.24 @BUILD_SYSTEST_TRUE@TEST_SUBDIR = test2.25 SUBDIRS = src po $(TEST_SUBDIR)2.26 EXTRA_DIST = autogen.sh2.27 +man_MANS = lxdream.12.28 all: config.h2.29 $(MAKE) $(AM_MAKEFLAGS) all-recursive2.31 @@ -289,6 +296,51 @@2.32 test/Makefile: $(top_builddir)/config.status $(top_srcdir)/test/Makefile.in2.33 cd $(top_builddir) && $(SHELL) ./config.status $@2.34 uninstall-info-am:2.35 +install-man1: $(man1_MANS) $(man_MANS)2.36 + @$(NORMAL_INSTALL)2.37 + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"2.38 + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \2.39 + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \2.40 + for i in $$l2; do \2.41 + case "$$i" in \2.42 + *.1*) list="$$list $$i" ;; \2.43 + esac; \2.44 + done; \2.45 + for i in $$list; do \2.46 + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \2.47 + else file=$$i; fi; \2.48 + ext=`echo $$i | sed -e 's/^.*\\.//'`; \2.49 + case "$$ext" in \2.50 + 1*) ;; \2.51 + *) ext='1' ;; \2.52 + esac; \2.53 + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \2.54 + inst=`echo $$inst | sed -e 's/^.*\///'`; \2.55 + inst=`echo $$inst | sed '$(transform)'`.$$ext; \2.56 + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \2.57 + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \2.58 + done2.59 +uninstall-man1:2.60 + @$(NORMAL_UNINSTALL)2.61 + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \2.62 + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \2.63 + for i in $$l2; do \2.64 + case "$$i" in \2.65 + *.1*) list="$$list $$i" ;; \2.66 + esac; \2.67 + done; \2.68 + for i in $$list; do \2.69 + ext=`echo $$i | sed -e 's/^.*\\.//'`; \2.70 + case "$$ext" in \2.71 + 1*) ;; \2.72 + *) ext='1' ;; \2.73 + esac; \2.74 + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \2.75 + inst=`echo $$inst | sed -e 's/^.*\///'`; \2.76 + inst=`echo $$inst | sed '$(transform)'`.$$ext; \2.77 + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \2.78 + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \2.79 + done2.81 # This directory's subdirectories are mostly independent; you can cd2.82 # into them and run `make' without going through this Makefile.2.83 @@ -570,9 +622,12 @@2.84 check-am: all-am2.85 check: check-recursive2.86 @GUI_COCOA_FALSE@all-local:2.87 -all-am: Makefile config.h all-local2.88 +all-am: Makefile $(MANS) config.h all-local2.89 installdirs: installdirs-recursive2.90 installdirs-am:2.91 + for dir in "$(DESTDIR)$(man1dir)"; do \2.92 + test -z "$$dir" || $(mkdir_p) "$$dir"; \2.93 + done2.94 install: install-recursive2.95 install-exec: install-exec-recursive2.96 install-data: install-data-recursive2.97 @@ -616,13 +671,13 @@2.99 info-am:2.101 -install-data-am: install-data-local2.102 +install-data-am: install-data-local install-man2.104 install-exec-am:2.106 install-info: install-info-recursive2.108 -install-man:2.109 +install-man: install-man12.111 installcheck-am:2.113 @@ -644,10 +699,12 @@2.115 ps-am:2.117 -uninstall-am: uninstall-info-am2.118 +uninstall-am: uninstall-info-am uninstall-man2.120 uninstall-info: uninstall-info-recursive2.122 +uninstall-man: uninstall-man12.123 +2.124 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-local \2.125 am--refresh check check-am clean clean-generic clean-recursive \2.126 ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \2.127 @@ -657,13 +714,17 @@2.128 dvi-am html html-am info info-am install install-am \2.129 install-data install-data-am install-data-local install-exec \2.130 install-exec-am install-info install-info-am install-man \2.131 - install-strip installcheck installcheck-am installdirs \2.132 - installdirs-am maintainer-clean maintainer-clean-generic \2.133 - maintainer-clean-recursive mostlyclean mostlyclean-generic \2.134 - mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \2.135 - uninstall uninstall-am uninstall-info-am2.136 + install-man1 install-strip installcheck installcheck-am \2.137 + installdirs installdirs-am maintainer-clean \2.138 + maintainer-clean-generic maintainer-clean-recursive \2.139 + mostlyclean mostlyclean-generic mostlyclean-recursive pdf \2.140 + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \2.141 + uninstall-info-am uninstall-man uninstall-man12.144 +lxdream.1: lxdream.pod2.145 + $(POD2MAN) $< $@2.146 +2.147 install-data-local:2.148 @$(NORMAL_INSTALL)2.149 if test -d $(srcdir)/pixmaps; then \2.150 @@ -695,6 +756,8 @@2.151 @GUI_COCOA_TRUE@ cp src/lxdream lxdream.app/Contents/MacOS2.152 @GUI_COCOA_TRUE@ cp -R pixmaps/* lxdream.app/Contents/Resources2.153 @GUI_COCOA_TRUE@ @echo --- Done ---2.154 +2.155 +bundle: all2.156 # Tell versions [3.59,3.63) of GNU make to not export all variables.2.157 # Otherwise a system limit (for SysV at least) may be exceeded.2.158 .NOEXPORT:
3.1 --- a/configure Sun Jun 22 06:21:57 2008 +00003.2 +++ b/configure Sun Jun 22 06:49:00 2008 +00003.3 @@ -725,6 +725,8 @@3.4 host_cpu3.5 host_vendor3.6 host_os3.7 +POD2MAN3.8 +POD2HTML3.9 GUI_COCOA_TRUE3.10 GUI_COCOA_FALSE3.11 PKG_CONFIG3.12 @@ -6458,6 +6460,89 @@3.13 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac3.16 +3.17 +# Extract the first word of "pod2man", so it can be a program name with args.3.18 +set dummy pod2man; ac_word=$23.19 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&53.20 +$as_echo_n "checking for $ac_word... " >&6; }3.21 +if test "${ac_cv_path_POD2MAN+set}" = set; then3.22 + $as_echo_n "(cached) " >&63.23 +else3.24 + case $POD2MAN in3.25 + [\\/]* | ?:[\\/]*)3.26 + ac_cv_path_POD2MAN="$POD2MAN" # Let the user override the test with a path.3.27 + ;;3.28 + *)3.29 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR3.30 +for as_dir in $PATH3.31 +do3.32 + IFS=$as_save_IFS3.33 + test -z "$as_dir" && as_dir=.3.34 + for ac_exec_ext in '' $ac_executable_extensions; do3.35 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then3.36 + ac_cv_path_POD2MAN="$as_dir/$ac_word$ac_exec_ext"3.37 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&53.38 + break 23.39 + fi3.40 +done3.41 +done3.42 +IFS=$as_save_IFS3.43 +3.44 + ;;3.45 +esac3.46 +fi3.47 +POD2MAN=$ac_cv_path_POD2MAN3.48 +if test -n "$POD2MAN"; then3.49 + { $as_echo "$as_me:$LINENO: result: $POD2MAN" >&53.50 +$as_echo "$POD2MAN" >&6; }3.51 +else3.52 + { $as_echo "$as_me:$LINENO: result: no" >&53.53 +$as_echo "no" >&6; }3.54 +fi3.55 +3.56 +3.57 +# Extract the first word of "pod2html", so it can be a program name with args.3.58 +set dummy pod2html; ac_word=$23.59 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&53.60 +$as_echo_n "checking for $ac_word... " >&6; }3.61 +if test "${ac_cv_path_POD2HTML+set}" = set; then3.62 + $as_echo_n "(cached) " >&63.63 +else3.64 + case $POD2HTML in3.65 + [\\/]* | ?:[\\/]*)3.66 + ac_cv_path_POD2HTML="$POD2HTML" # Let the user override the test with a path.3.67 + ;;3.68 + *)3.69 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR3.70 +for as_dir in $PATH3.71 +do3.72 + IFS=$as_save_IFS3.73 + test -z "$as_dir" && as_dir=.3.74 + for ac_exec_ext in '' $ac_executable_extensions; do3.75 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then3.76 + ac_cv_path_POD2HTML="$as_dir/$ac_word$ac_exec_ext"3.77 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&53.78 + break 23.79 + fi3.80 +done3.81 +done3.82 +IFS=$as_save_IFS3.83 +3.84 + ;;3.85 +esac3.86 +fi3.87 +POD2HTML=$ac_cv_path_POD2HTML3.88 +if test -n "$POD2HTML"; then3.89 + { $as_echo "$as_me:$LINENO: result: $POD2HTML" >&53.90 +$as_echo "$POD2HTML" >&6; }3.91 +else3.92 + { $as_echo "$as_me:$LINENO: result: no" >&53.93 +$as_echo "no" >&6; }3.94 +fi3.95 +3.96 +3.97 +3.98 +3.99 # Check whether --enable-trace was given.3.100 if test "${enable_trace+set}" = set; then3.101 enableval=$enable_trace; if test "$enableval" == "yes"; then
4.1 --- a/configure.in Sun Jun 22 06:21:57 2008 +00004.2 +++ b/configure.in Sun Jun 22 06:49:00 2008 +00004.3 @@ -13,6 +13,12 @@4.4 AC_HEADER_STDC4.5 AC_CANONICAL_BUILD4.6 AC_CANONICAL_HOST4.7 +4.8 +AC_PATH_PROG(POD2MAN, [pod2man])4.9 +AC_PATH_PROG(POD2HTML, [pod2html])4.10 +4.11 +dnl ---------------- enable/with flags ------------------4.12 +4.13 AC_ARG_ENABLE( trace,4.14 AS_HELP_STRING( [--enable-trace], [Enable generation of IO traces (warning: hurts performance)]),4.15 [if test "$enableval" == "yes"; then
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +00005.2 +++ b/lxdream.pod Sun Jun 22 06:49:00 2008 +00005.3 @@ -0,0 +1,118 @@5.4 +=head1 NAME5.5 +5.6 +lxdream - A dreamcast emulator5.7 +5.8 +=head1 SYNOPSIS5.9 +5.10 +lxdream [options] [disc-image-file] [program-file]5.11 +5.12 +=head1 DESCRIPTION5.13 +5.14 +=head1 OPTIONS5.15 +5.16 +=over5.17 +5.18 +=item B<-A>, B<--audio>=I<audio-driver>5.19 +5.20 +Set the preferred audio driver. If the specified audio driver cannot start, the system5.21 +will try all other available drivers in the standard order. To see which drivers are5.22 +supported, run lxdream -A ?5.23 +5.24 +=item B<-c>, B<--config>=F<config-filename>5.25 +5.26 +Load configuration information from F<config-filename> instead of the system default5.27 +5.28 +=item B<-d>, B<--debugger>5.29 +5.30 +Launch the debugger on startup (GTK platforms only).5.31 +5.32 +=item B<-h>, B<--help>5.33 +5.34 +Print command line usage information5.35 +5.36 +=item B<-H>, B<--headless>5.37 +5.38 +Run in headless mode (no GUI or video output). This is mainly useful for testing CPU5.39 +functions and performance. Equivalent to -V null.5.40 +5.41 +=item B<-l>, B<--log>=I<log-level>5.42 +5.43 +Set the system log level to the specified level of verbosity, which must be one of the following options:5.44 +FATAL, ERROR, WARN, INFO, DEBUG, TRACE (non-case-sensitive, and only the first letter is required). The5.45 +default level is WARN.5.46 +5.47 +=item B<-m> B<--multiplier>=I<scale>5.48 +5.49 +Change the SH4 core clock speed using the supplied floating-point multiplier, where 1.05.50 +is full speed, 0.5 is half speed, and so on. The default is 0.5.5.51 +5.52 +=item B<-n>5.53 +5.54 +Don't start running on startup, even if a disc or program file was supplied. By default5.55 +the system will start automatically if a disc or program was given on the command line.5.56 +5.57 +=item B<-p>5.58 +5.59 +Start running on startup, even if no disc or program file was supplied. By default5.60 +the system will only start automatically if a disc or program was given on the command5.61 +line.5.62 +5.63 +=item B<-t>, B<--run-time>=I<seconds>5.64 +5.65 +Run the dreamcast for exactly the specified amount of time, and then terminate, ie5.66 +lxdream -pt 5.2 will exit after 5.2 seconds of emulated runtime. Useful for performance5.67 +measurements of arbitrary sections of code.5.68 +5.69 +=item B<-T>, B<--trace>=I<trace-list>5.70 +5.71 +Activate I/O region tracing for the specified list of MMIO regions. This option is only5.72 +available if lxdream was configured with --enable-trace. If enabled, trace-list may be5.73 +a comma-separated list of 1 or more of the following: ALL, ASIC, AICA0, AICA1, AICA2, AICARTC,5.74 +EXTDMA, PVR2, MMU, UBC, BSC, DMAC, CPG, RTC, INTC, TMU, SCI, and SCIF.5.75 +5.76 +Warning: this option implicitly sets the verbosity level to 'trace', and will generate a huge5.77 +amount of output.5.78 +5.79 +=item B<-u>, B<--unsafe>5.80 +5.81 +Allow unsafe dcload syscalls. Without this option, the only permitted calls are reads, writes, and5.82 +seeks on stdin, stdout and stderr. If you're writing your own code that uses the other syscalls, you5.83 +probably want to enable this. Otherwise it's safer to leave it off.5.84 +5.85 +=item B<-v>, B<--version>5.86 +5.87 +Print the lxdream version string.5.88 +5.89 +=item B<-V> I<video-driver>5.90 +5.91 +Set the preferred video driver. If the specified video driver cannot start, the system5.92 +will exit with an error. To see the available video drivers, run lxdream -V ?5.93 +5.94 +=item B<-x>5.95 +5.96 +Disable the SH4 translator and run in pure emulation mode. Generally you only want to do this for testing5.97 +purposes (ie if you think you've found a translator bug) as it's much slower this way.5.98 +5.99 +=back5.100 +5.101 +=head1 FILES5.102 +5.103 +=over5.104 +5.105 +=item B<$HOME/.lxdreamrc>5.106 +5.107 +Default user configuration file. This will be created at startup if it doesn't5.108 +already exist, unless an alternative file is specified with -c.5.109 +5.110 +=back5.111 +5.112 +=head1 COPYRIGHT5.113 +5.114 +Copyright 2005-2008 Nathan Keynes <nkeynes@lxdream.org>5.115 +5.116 +This program is free software; you can redistribute it and/or modify5.117 +it under the terms of the GNU General Public License as published by5.118 +the Free Software Foundation; either version 2 of the License, or5.119 +(at your option) any later version.5.120 +5.121 +=cut
6.1 --- a/src/Makefile.in Sun Jun 22 06:21:57 2008 +00006.2 +++ b/src/Makefile.in Sun Jun 22 06:49:00 2008 +00006.3 @@ -290,6 +290,8 @@6.4 PACKAGE_VERSION = @PACKAGE_VERSION@6.5 PATH_SEPARATOR = @PATH_SEPARATOR@6.6 PKG_CONFIG = @PKG_CONFIG@6.7 +POD2HTML = @POD2HTML@6.8 +POD2MAN = @POD2MAN@6.9 POFILES = @POFILES@6.10 POSUB = @POSUB@6.11 PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
7.1 --- a/src/aica/audio.c Sun Jun 22 06:21:57 2008 +00007.2 +++ b/src/aica/audio.c Sun Jun 22 06:49:00 2008 +00007.3 @@ -19,7 +19,7 @@7.5 #include "aica/aica.h"7.6 #include "aica/audio.h"7.7 -#include "glib/gmem.h"7.8 +#include <glib/gmem.h>7.9 #include "dream.h"7.10 #include <assert.h>7.11 #include <string.h>7.12 @@ -48,7 +48,7 @@7.13 NULL };7.15 #define NUM_BUFFERS 37.16 -#define MS_PER_BUFFER 10007.17 +#define MS_PER_BUFFER 1007.19 #define BUFFER_EMPTY 07.20 #define BUFFER_WRITING 17.21 @@ -99,6 +99,16 @@7.22 return NULL;7.23 }7.25 +void print_audio_drivers( FILE * out )7.26 +{7.27 + int i;7.28 + fprintf( out, "Available audio drivers:\n" );7.29 + for( i=0; audio_driver_list[i] != NULL; i++ ) {7.30 + fprintf( out, " %-8s %s\n", audio_driver_list[i]->name,7.31 + gettext(audio_driver_list[i]->description) );7.32 + }7.33 +}7.34 +7.35 audio_driver_t audio_init_driver( const char *preferred_driver )7.36 {7.37 audio_driver_t audio_driver = get_audio_driver_by_name(preferred_driver);7.38 @@ -407,7 +417,7 @@7.39 break;7.40 }7.41 case AUDIO_FMT_8BIT: {7.42 - int8_t *data = (uint8_t *)&buf->data[buf->posn];7.43 + int8_t *data = (int8_t *)&buf->data[buf->posn];7.44 for( j=0; j < num_samples; j++ ) {7.45 *data++ = (int8_t)(result_buf[j][0] >> 16);7.46 *data++ = (int8_t)(result_buf[j][1] >> 16);7.47 @@ -419,7 +429,7 @@7.48 break;7.49 }7.50 buf = audio.output_buffers[audio.write_buffer];7.51 - data = (uint8_t *)&buf->data[0];7.52 + data = (int8_t *)&buf->data[0];7.53 }7.54 }7.55 break;
8.1 --- a/src/aica/audio.h Sun Jun 22 06:21:57 2008 +00008.2 +++ b/src/aica/audio.h Sun Jun 22 06:49:00 2008 +00008.3 @@ -21,6 +21,8 @@8.4 #include <stdint.h>8.5 #include <stdio.h>8.6 #include <glib/gtypes.h>8.7 +#include <glib/gi18n.h>8.8 +8.10 #ifdef __cplusplus8.11 extern "C" {8.12 @@ -75,6 +77,7 @@8.14 typedef struct audio_driver {8.15 char *name;8.16 + char *description;8.17 uint32_t sample_rate;8.18 uint32_t sample_format;8.19 gboolean (*init)( );8.20 @@ -84,6 +87,12 @@8.21 gboolean (*shutdown)( );8.22 } *audio_driver_t;8.24 +8.25 +/**8.26 + * Print the configured audio drivers to the output stream, one to a line.8.27 + */8.28 +void print_audio_drivers( FILE *out );8.29 +8.30 audio_driver_t get_audio_driver_by_name( const char *name );8.32 /**
9.1 --- a/src/display.c Sun Jun 22 06:21:57 2008 +00009.2 +++ b/src/display.c Sun Jun 22 06:49:00 2008 +00009.3 @@ -415,6 +415,16 @@9.4 return display_driver->convert_to_dckeysym(keycode);9.5 }9.7 +void print_display_drivers( FILE *out )9.8 +{9.9 + int i;9.10 + fprintf( out, "Available video drivers:\n" );9.11 + for( i=0; display_driver_list[i] != NULL; i++ ) {9.12 + fprintf( out, " %-8s %s\n", display_driver_list[i]->name,9.13 + gettext(display_driver_list[i]->description) );9.14 + }9.15 +}9.16 +9.17 display_driver_t get_display_driver_by_name( const char *name )9.18 {9.19 int i;
10.1 --- a/src/display.h Sun Jun 22 06:21:57 2008 +000010.2 +++ b/src/display.h Sun Jun 22 06:49:00 2008 +000010.3 @@ -23,7 +23,9 @@10.4 #define GL_GLEXT_PROTOTYPES 110.6 #include <stdint.h>10.7 +#include <stdio.h>10.8 #include <glib.h>10.9 +#include <glib/gi18n.h>10.10 #include "lxdream.h"10.11 #ifdef APPLE_BUILD10.12 #include <OpenGL/gl.h>10.13 @@ -98,6 +100,11 @@10.14 typedef struct display_driver {10.15 char *name;10.16 /**10.17 + * Short (<60 chars) description of the driver. This should be marked for10.18 + * localization.10.19 + */10.20 + char *description;10.21 + /**10.22 * Initialize the driver. This is called only once at startup time, and10.23 * is guaranteed to be called before any other methods.10.24 * @return TRUE if the driver was successfully initialized, otherwise10.25 @@ -178,6 +185,10 @@10.27 } *display_driver_t;10.29 +/**10.30 + * Print the configured video drivers to the output stream, one to a line.10.31 + */10.32 +void print_display_drivers( FILE *out );10.33 display_driver_t get_display_driver_by_name( const char *name );10.34 gboolean display_set_driver( display_driver_t driver );
11.1 --- a/src/drivers/audio_alsa.c Sun Jun 22 06:21:57 2008 +000011.2 +++ b/src/drivers/audio_alsa.c Sun Jun 22 06:49:00 2008 +000011.3 @@ -184,6 +184,7 @@11.5 struct audio_driver audio_alsa_driver = {11.6 "alsa",11.7 + N_("Linux ALSA system driver"),11.8 DEFAULT_SAMPLE_RATE,11.9 DEFAULT_SAMPLE_FORMAT,11.10 audio_alsa_init,
12.1 --- a/src/drivers/audio_esd.c Sun Jun 22 06:21:57 2008 +000012.2 +++ b/src/drivers/audio_esd.c Sun Jun 22 06:49:00 2008 +000012.3 @@ -69,7 +69,9 @@12.4 return TRUE;12.5 }12.7 -struct audio_driver audio_esd_driver = { "esd",12.8 +struct audio_driver audio_esd_driver = {12.9 + "esd",12.10 + N_("Enlightened Sound Daemon driver"),12.11 DEFAULT_SAMPLE_RATE,12.12 DEFAULT_SAMPLE_FORMAT,12.13 audio_esd_init,
13.1 --- a/src/drivers/audio_null.c Sun Jun 22 06:21:57 2008 +000013.2 +++ b/src/drivers/audio_null.c Sun Jun 22 06:49:00 2008 +000013.3 @@ -33,7 +33,9 @@13.4 return TRUE;13.5 }13.7 -struct audio_driver audio_null_driver = { "null",13.8 +struct audio_driver audio_null_driver = {13.9 + "null",13.10 + N_("Null (no audio) driver"),13.11 DEFAULT_SAMPLE_RATE,13.12 DEFAULT_SAMPLE_FORMAT,13.13 audio_null_init,
14.1 --- a/src/drivers/audio_osx.c Sun Jun 22 06:21:57 2008 +000014.2 +++ b/src/drivers/audio_osx.c Sun Jun 22 06:49:00 2008 +000014.3 @@ -131,7 +131,9 @@14.4 }14.7 -struct audio_driver audio_osx_driver = { "osx",14.8 +struct audio_driver audio_osx_driver = {14.9 + "osx",14.10 + N_("OS X CoreAudio system driver"),14.11 DEFAULT_SAMPLE_RATE,14.12 AUDIO_FMT_FLOATST,14.13 audio_osx_init,
15.1 --- a/src/drivers/audio_pulse.c Sun Jun 22 06:21:57 2008 +000015.2 +++ b/src/drivers/audio_pulse.c Sun Jun 22 06:49:00 2008 +000015.3 @@ -74,7 +74,9 @@15.4 return TRUE;15.5 }15.7 -struct audio_driver audio_pulse_driver = { "pulse",15.8 +struct audio_driver audio_pulse_driver = {15.9 + "pulse",15.10 + N_("PulseAudio sound server driver"),15.11 DEFAULT_SAMPLE_RATE,15.12 DEFAULT_SAMPLE_FORMAT,15.13 audio_pulse_init,
16.1 --- a/src/drivers/video_gtk.c Sun Jun 22 06:21:57 2008 +000016.2 +++ b/src/drivers/video_gtk.c Sun Jun 22 06:49:00 2008 +000016.3 @@ -126,13 +126,17 @@16.4 uint16_t video_gtk_resolve_keysym( const gchar *keysym );16.5 uint16_t video_gtk_keycode_to_dckeysym(uint16_t keycode);16.7 -struct display_driver display_gtk_driver = { "gtk", video_gtk_init, video_gtk_shutdown,16.8 - video_gtk_resolve_keysym,16.9 - video_gtk_keycode_to_dckeysym,16.10 - NULL,16.11 - NULL, NULL, NULL, NULL, NULL,16.12 - video_gtk_display_blank, NULL };16.13 -16.14 +struct display_driver display_gtk_driver = {16.15 + "gtk",16.16 + N_("GTK-based OpenGL driver"),16.17 + video_gtk_init,16.18 + video_gtk_shutdown,16.19 + video_gtk_resolve_keysym,16.20 + video_gtk_keycode_to_dckeysym,16.21 + NULL,16.22 + NULL, NULL, NULL, NULL, NULL,16.23 + video_gtk_display_blank, NULL };16.24 +16.25 uint16_t video_gtk_resolve_keysym( const gchar *keysym )16.26 {16.27 int val = gdk_keyval_from_name( keysym );
17.1 --- a/src/drivers/video_null.c Sun Jun 22 06:21:57 2008 +000017.2 +++ b/src/drivers/video_null.c Sun Jun 22 06:49:00 2008 +000017.3 @@ -56,16 +56,18 @@17.4 }17.7 -struct display_driver display_null_driver = { "null",17.8 - NULL,17.9 - NULL,17.10 - NULL,17.11 - NULL,17.12 - NULL,17.13 - video_null_create_render_buffer,17.14 - video_null_destroy_render_buffer,17.15 - video_null_set_render_target,17.16 - video_null_load_frame_buffer,17.17 - video_null_display_render_buffer,17.18 - video_null_display_blank,17.19 - video_null_read_render_buffer };17.20 +struct display_driver display_null_driver = {17.21 + "null",17.22 + N_("Null (no video) driver"),17.23 + NULL,17.24 + NULL,17.25 + NULL,17.26 + NULL,17.27 + NULL,17.28 + video_null_create_render_buffer,17.29 + video_null_destroy_render_buffer,17.30 + video_null_set_render_target,17.31 + video_null_load_frame_buffer,17.32 + video_null_display_render_buffer,17.33 + video_null_display_blank,17.34 + video_null_read_render_buffer };
18.1 --- a/src/drivers/video_osx.c Sun Jun 22 06:21:57 2008 +000018.2 +++ b/src/drivers/video_osx.c Sun Jun 22 06:49:00 2008 +000018.3 @@ -36,12 +36,15 @@18.4 static uint16_t video_osx_resolve_keysym( const gchar *keysym );18.5 static uint16_t video_osx_keycode_to_dckeysym(uint16_t keycode);18.7 -struct display_driver display_osx_driver = { "osx", video_osx_init, video_osx_shutdown,18.8 - video_osx_resolve_keysym,18.9 - video_osx_keycode_to_dckeysym,18.10 - NULL,18.11 - NULL, NULL, NULL, NULL, NULL,18.12 - video_osx_display_blank, NULL };18.13 +struct display_driver display_osx_driver = {18.14 + "osx",18.15 + N_("OS X Cocoa GUI-based OpenGL driver"),18.16 + video_osx_init, video_osx_shutdown,18.17 + video_osx_resolve_keysym,18.18 + video_osx_keycode_to_dckeysym,18.19 + NULL,18.20 + NULL, NULL, NULL, NULL, NULL,18.21 + video_osx_display_blank, NULL };18.24 static NSView *video_view = NULL;
19.1 --- a/src/main.c Sun Jun 22 06:21:57 2008 +000019.2 +++ b/src/main.c Sun Jun 22 06:49:00 2008 +000019.3 @@ -33,24 +33,62 @@19.4 #include "maple/maple.h"19.5 #include "sh4/sh4.h"19.7 -#define S3M_PLAYER "s3mplay.bin"19.8 -19.9 -char *option_list = "a:m:s:A:V:v:puhbd:c:t:T:xDn";19.10 -struct option longopts[1] = { { NULL, 0, 0, 0 } };19.11 +char *option_list = "a:A:c:dhHl:m:npt:T:uvV:x?";19.12 +struct option longopts[] = {19.13 + { "aica", required_argument, NULL, 'a' },19.14 + { "audio", required_argument, NULL, 'A' },19.15 + { "config", required_argument, NULL, 'c' },19.16 + { "debugger", no_argument, NULL, 'D' },19.17 + { "help", no_argument, NULL, 'h' },19.18 + { "headless", no_argument, NULL, 'H' },19.19 + { "log", required_argument, NULL,'l' },19.20 + { "multiplier", required_argument, NULL, 'm' },19.21 + { "run-time", required_argument, NULL, 't' },19.22 + { "trace", required_argument, NULL, 'T' },19.23 + { "unsafe", no_argument, NULL, 'u' },19.24 + { "video", no_argument, NULL, 'V' },19.25 + { "version", no_argument, NULL, 'v' },19.26 + { NULL, 0, 0, 0 } };19.27 char *aica_program = NULL;19.28 -char *s3m_file = NULL;19.29 -const char *disc_file = NULL;19.30 char *display_driver_name = NULL;19.31 char *audio_driver_name = NULL;19.32 char *trace_regions = NULL;19.33 gboolean start_immediately = FALSE;19.34 gboolean no_start = FALSE;19.35 gboolean headless = FALSE;19.36 -gboolean without_bios = FALSE;19.37 gboolean use_xlat = TRUE;19.38 gboolean show_debugger = FALSE;19.39 extern uint32_t sh4_cpu_multiplier;19.41 +void print_version()19.42 +{19.43 + printf( "lxdream " APP_VERSION "\n" );19.44 +}19.45 +19.46 +void print_usage()19.47 +{19.48 + print_version();19.49 + printf( "Usage: lxdream [options] [disc-file] [program-file]\n\n" );19.50 +19.51 + printf( "Options:\n" );19.52 + printf( " -a, --aica=PROGFILE %s\n", _("Run the AICA SPU only, with the supplied program") );19.53 + printf( " -A, --audio=DRIVER %s\n", _("Use the specified audio driver (? to list)") );19.54 + printf( " -c, --config=CONFFILE %s\n", _("Load configuration from CONFFILE") );19.55 + printf( " -d, --debugger %s\n", _("Start in debugger mode") );19.56 + printf( " -h, --help %s\n", _("Display this usage information") );19.57 + printf( " -H, --headless %s\n", _("Run in headless (no video) mode") );19.58 + printf( " -l, --log=LEVEL %s\n", _("Set the output log level") );19.59 + printf( " -m, --multiplier=SCALE %s\n", _("Set the SH4 multiplier (1.0 = fullspeed)") );19.60 + printf( " -n %s\n", _("Don't start running immediately") );19.61 + printf( " -p %s\n", _("Start running immediately on startup") );19.62 + printf( " -t, --run-time=SECONDS %s\n", _("Run for the specified number of seconds") );19.63 + printf( " -T, --trace=REGIONS %s\n", _("Output trace information for the named regions") );19.64 + printf( " -u, --unsafe %s\n", _("Allow unsafe dcload syscalls") );19.65 + printf( " -v, --version %s\n", _("Print the lxdream version string") );19.66 + printf( " -V, --video=DRIVER %s\n", _("Use the specified video driver (? to list)") );19.67 + printf( " -x %s\n", _("Disable the SH4 translator") );19.68 +}19.69 +19.70 int main (int argc, char *argv[])19.71 {19.72 int opt;19.73 @@ -71,15 +109,33 @@19.74 case 'a': /* AICA only mode - argument is an AICA program */19.75 aica_program = optarg;19.76 break;19.77 + case 'A': /* Audio driver */19.78 + audio_driver_name = optarg;19.79 + if( strcmp(audio_driver_name, "?") == 0 ) {19.80 + print_version();19.81 + print_audio_drivers(stdout);19.82 + exit(0);19.83 + }19.84 + break;19.85 case 'c': /* Config file */19.86 lxdream_set_config_filename(optarg);19.87 break;19.88 - case 'd': /* Mount disc */19.89 - disc_file = optarg;19.90 - break;19.91 - case 'D': /* Launch w/ debugger */19.92 + case 'd': /* Launch w/ debugger */19.93 show_debugger = TRUE;19.94 break;19.95 + case 'h': /* help */19.96 + case '?':19.97 + print_usage();19.98 + exit(0);19.99 + break;19.100 + case 'H': /* Headless - shorthand for -V null */19.101 + display_driver_name = "null";19.102 + break;19.103 + case 'l': /* Log verbosity */19.104 + if( !set_global_log_level(optarg) ) {19.105 + ERROR( "Unrecognized log level '%s'", optarg );19.106 + }19.107 + break;19.108 case 'm': /* Set SH4 CPU clock multiplier (default 0.5) */19.109 t = strtod(optarg, NULL);19.110 sh4_cpu_multiplier = (int)(1000.0/t);19.111 @@ -88,29 +144,10 @@19.112 no_start = TRUE;19.113 start_immediately = FALSE;19.114 break;19.115 - case 's': /* AICA-only w/ S3M player */19.116 - aica_program = S3M_PLAYER;19.117 - s3m_file = optarg;19.118 - break;19.119 - case 'A': /* Audio driver */19.120 - audio_driver_name = optarg;19.121 - break;19.122 - case 'V': /* Video driver */19.123 - display_driver_name = optarg;19.124 - break;19.125 case 'p': /* Start immediately */19.126 start_immediately = TRUE;19.127 no_start = FALSE;19.128 - break;19.129 - case 'u': /* Allow unsafe dcload syscalls */19.130 - dcload_set_allow_unsafe(TRUE);19.131 break;19.132 - case 'b': /* No BIOS */19.133 - without_bios = TRUE;19.134 - break;19.135 - case 'h': /* Headless */19.136 - headless = TRUE;19.137 - break;19.138 case 't': /* Time limit + auto quit */19.139 t = strtod(optarg, NULL);19.140 time_secs = (uint32_t)t;19.141 @@ -122,11 +159,21 @@19.142 trace_regions = optarg;19.143 set_global_log_level("trace");19.144 break;19.145 - case 'v': /* Log verbosity */19.146 - if( !set_global_log_level(optarg) ) {19.147 - ERROR( "Unrecognized log level '%s'", optarg );19.148 - }19.149 + case 'u': /* Allow unsafe dcload syscalls */19.150 + dcload_set_allow_unsafe(TRUE);19.151 + break;19.152 + case 'v':19.153 + print_version();19.154 + exit(0);19.155 break;19.156 + case 'V': /* Video driver */19.157 + display_driver_name = optarg;19.158 + if( strcmp(display_driver_name,"?") == 0 ) {19.159 + print_version();19.160 + print_display_drivers(stdout);19.161 + exit(0);19.162 + }19.163 + break;19.164 case 'x': /* Disable translator */19.165 use_xlat = FALSE;19.166 break;19.167 @@ -137,61 +184,50 @@19.168 gdrom_list_init();19.170 if( aica_program == NULL ) {19.171 - dreamcast_init();19.172 + dreamcast_init();19.173 } else {19.174 - dreamcast_configure_aica_only();19.175 - mem_load_block( aica_program, 0x00800000, 2048*1024 );19.176 - if( s3m_file != NULL ) {19.177 - mem_load_block( s3m_file, 0x00810000, 2048*1024 - 0x10000 );19.178 - }19.179 + dreamcast_configure_aica_only();19.180 + mem_load_block( aica_program, 0x00800000, 2048*1024 );19.181 }19.182 mem_set_trace( trace_regions, TRUE );19.184 - if( without_bios ) {19.185 - bios_install();19.186 - dcload_install();19.187 - }19.188 -19.189 audio_init_driver( audio_driver_name, 44100, AUDIO_FMT_16ST );19.191 + headless = display_driver_name != NULL && strcasecmp( display_driver_name, "null" ) == 0;19.192 if( headless ) {19.193 - display_set_driver( &display_null_driver );19.194 + display_set_driver( &display_null_driver );19.195 } else {19.196 - gui_init(show_debugger);19.197 + gui_init(show_debugger);19.199 - display_driver_t display_driver = get_display_driver_by_name(display_driver_name);19.200 - if( display_driver == NULL ) {19.201 - ERROR( "Video driver '%s' not found, aborting.", display_driver_name );19.202 - exit(2);19.203 - } else if( display_set_driver( display_driver ) == FALSE ) {19.204 - ERROR( "Video driver '%s' failed to initialize (could not connect to display?)",19.205 - display_driver->name );19.206 - exit(2);19.207 - }19.208 + display_driver_t display_driver = get_display_driver_by_name(display_driver_name);19.209 + if( display_driver == NULL ) {19.210 + ERROR( "Video driver '%s' not found, aborting.", display_driver_name );19.211 + exit(2);19.212 + } else if( display_set_driver( display_driver ) == FALSE ) {19.213 + ERROR( "Video driver '%s' failed to initialize (could not connect to display?)",19.214 + display_driver->name );19.215 + exit(2);19.216 + }19.217 }19.219 maple_reattach_all();19.220 INFO( "%s! ready...", APP_NAME );19.222 for( ; optind < argc; optind++ ) {19.223 - gboolean ok = gdrom_mount_image(argv[optind]);19.224 - if( !ok ) {19.225 - ok = file_load_magic( argv[optind] );19.226 - }19.227 - if( !ok ) {19.228 - ERROR( "Unrecognized file '%s'", argv[optind] );19.229 - }19.230 - if( !no_start ) {19.231 - start_immediately = ok;19.232 - }19.233 - }19.234 -19.235 - if( disc_file != NULL ) {19.236 - gdrom_mount_image( disc_file );19.237 + gboolean ok = gdrom_mount_image(argv[optind]);19.238 + if( !ok ) {19.239 + ok = file_load_magic( argv[optind] );19.240 + }19.241 + if( !ok ) {19.242 + ERROR( "Unrecognized file '%s'", argv[optind] );19.243 + }19.244 + if( !no_start ) {19.245 + start_immediately = ok;19.246 + }19.247 }19.249 if( gdrom_get_current_disc() == NULL ) {19.250 - disc_file = lxdream_get_config_value( CONFIG_GDROM );19.251 + const gchar *disc_file = lxdream_get_config_value( CONFIG_GDROM );19.252 if( disc_file != NULL ) {19.253 gdrom_mount_image( disc_file );19.254 }
20.1 --- a/src/pvr2/glutil.c Sun Jun 22 06:21:57 2008 +000020.2 +++ b/src/pvr2/glutil.c Sun Jun 22 06:49:00 2008 +000020.3 @@ -79,7 +79,7 @@20.5 void glPrintInfo( FILE *out )20.6 {20.7 - const GLubyte *extensions = glGetString(GL_EXTENSIONS);20.8 + const gchar *extensions = (const gchar *)glGetString(GL_EXTENSIONS);20.9 gchar **ext_split = g_strsplit(extensions, " ", 0);20.10 unsigned int i;
.