Search
lxdream.org :: lxdream :: r94:8d80d9c7cc7d
lxdream 0.9.1
released Jun 29
Download Now
changeset94:8d80d9c7cc7d
parent93:bb1def61e901
child95:7c0dac698ea2
authornkeynes
dateSun Feb 05 04:05:27 2006 +0000 (18 years ago)
Video code reshuffle to start getting real video happening.
Implement colourspace conversions
Various tweaks
Makefile.am
Makefile.in
TODO
configure
configure.in
src/Makefile.am
src/Makefile.in
src/asic.c
src/drivers/gl_glx.c
src/drivers/video_gtk.c
src/drivers/video_x11.c
src/drivers/video_x11.h
src/gui/debug_win.c
src/main.c
src/pvr2/pvr2.c
src/pvr2/pvr2.h
src/video.c
src/video.h
1.1 --- a/Makefile.am Sun Feb 05 04:04:25 2006 +0000
1.2 +++ b/Makefile.am Sun Feb 05 04:05:27 2006 +0000
1.3 @@ -1,6 +1,6 @@
1.4 ## Process this file with automake to produce Makefile.in
1.5
1.6 -SUBDIRS = src po
1.7 +SUBDIRS = src po test
1.8
1.9 EXTRA_DIST = \
1.10 autogen.sh \
2.1 --- a/Makefile.in Sun Feb 05 04:04:25 2006 +0000
2.2 +++ b/Makefile.in Sun Feb 05 04:05:27 2006 +0000
2.3 @@ -126,7 +126,7 @@
2.4 sysconfdir = @sysconfdir@
2.5 target_alias = @target_alias@
2.6
2.7 -SUBDIRS = src po
2.8 +SUBDIRS = src po test
2.9
2.10 EXTRA_DIST = \
2.11 autogen.sh \
3.1 --- a/TODO Sun Feb 05 04:04:25 2006 +0000
3.2 +++ b/TODO Sun Feb 05 04:05:27 2006 +0000
3.3 @@ -1,12 +1,14 @@
3.4 Immediate stuff to look at:
3.5
3.6 - * Maple bus
3.7 - - various controllers
3.8 + * Disassemble ARM boot program, print out, analyze
3.9 + * Disassemble SH4 region in question as well actually.
3.10 + * Write ARM loader + test program, test on actual DC.
3.11
3.12 * IDE/GDRom drive
3.13 - cd-file interface (cdi, bin/cue, , nrg, mds, etc)
3.14
3.15 And then
3.16 + * Add load/save button to memory viewer
3.17 * EXTDMA unit
3.18 * PowerVR chip
3.19 * Sound chip
4.1 --- a/configure Sun Feb 05 04:04:25 2006 +0000
4.2 +++ b/configure Sun Feb 05 04:05:27 2006 +0000
4.3 @@ -4238,7 +4238,6 @@
4.4 fi
4.5
4.6
4.7 -pkg_modules="libgnomeui-2.0"
4.8
4.9 succeeded=no
4.10
4.11 @@ -4293,23 +4292,23 @@
4.12 else
4.13 PKG_CONFIG_MIN_VERSION=0.9.0
4.14 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
4.15 - echo "$as_me:$LINENO: checking for $pkg_modules" >&5
4.16 -echo $ECHO_N "checking for $pkg_modules... $ECHO_C" >&6
4.17 -
4.18 - if $PKG_CONFIG --exists "$pkg_modules" ; then
4.19 + echo "$as_me:$LINENO: checking for libgnomeui-2.0 esound " >&5
4.20 +echo $ECHO_N "checking for libgnomeui-2.0 esound ... $ECHO_C" >&6
4.21 +
4.22 + if $PKG_CONFIG --exists " libgnomeui-2.0 esound " ; then
4.23 echo "$as_me:$LINENO: result: yes" >&5
4.24 echo "${ECHO_T}yes" >&6
4.25 succeeded=yes
4.26
4.27 echo "$as_me:$LINENO: checking PACKAGE_CFLAGS" >&5
4.28 echo $ECHO_N "checking PACKAGE_CFLAGS... $ECHO_C" >&6
4.29 - PACKAGE_CFLAGS=`$PKG_CONFIG --cflags "$pkg_modules"`
4.30 + PACKAGE_CFLAGS=`$PKG_CONFIG --cflags " libgnomeui-2.0 esound "`
4.31 echo "$as_me:$LINENO: result: $PACKAGE_CFLAGS" >&5
4.32 echo "${ECHO_T}$PACKAGE_CFLAGS" >&6
4.33
4.34 echo "$as_me:$LINENO: checking PACKAGE_LIBS" >&5
4.35 echo $ECHO_N "checking PACKAGE_LIBS... $ECHO_C" >&6
4.36 - PACKAGE_LIBS=`$PKG_CONFIG --libs "$pkg_modules"`
4.37 + PACKAGE_LIBS=`$PKG_CONFIG --libs " libgnomeui-2.0 esound "`
4.38 echo "$as_me:$LINENO: result: $PACKAGE_LIBS" >&5
4.39 echo "${ECHO_T}$PACKAGE_LIBS" >&6
4.40 else
4.41 @@ -4317,7 +4316,7 @@
4.42 PACKAGE_LIBS=""
4.43 ## If we have a custom action on failure, don't print errors, but
4.44 ## do set a variable so people can do so.
4.45 - PACKAGE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$pkg_modules"`
4.46 + PACKAGE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors " libgnomeui-2.0 esound "`
4.47 echo $PACKAGE_PKG_ERRORS
4.48 fi
4.49
4.50 @@ -4332,12 +4331,86 @@
4.51 if test $succeeded = yes; then
4.52 :
4.53 else
4.54 - { { echo "$as_me:$LINENO: error: Library requirements ($pkg_modules) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
4.55 -echo "$as_me: error: Library requirements ($pkg_modules) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
4.56 - { (exit 1); exit 1; }; }
4.57 - fi
4.58 -
4.59 -
4.60 + { { echo "$as_me:$LINENO: error: Library requirements ( libgnomeui-2.0 esound ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5
4.61 +echo "$as_me: error: Library requirements ( libgnomeui-2.0 esound ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
4.62 + { (exit 1); exit 1; }; }
4.63 + fi
4.64 +
4.65 +
4.66 +
4.67 +
4.68 +
4.69 +echo "$as_me:$LINENO: checking for glXQueryVersion in -lGL" >&5
4.70 +echo $ECHO_N "checking for glXQueryVersion in -lGL... $ECHO_C" >&6
4.71 +if test "${ac_cv_lib_GL_glXQueryVersion+set}" = set; then
4.72 + echo $ECHO_N "(cached) $ECHO_C" >&6
4.73 +else
4.74 + ac_check_lib_save_LIBS=$LIBS
4.75 +LIBS="-lGL $LIBS"
4.76 +cat >conftest.$ac_ext <<_ACEOF
4.77 +/* confdefs.h. */
4.78 +_ACEOF
4.79 +cat confdefs.h >>conftest.$ac_ext
4.80 +cat >>conftest.$ac_ext <<_ACEOF
4.81 +/* end confdefs.h. */
4.82 +
4.83 +/* Override any gcc2 internal prototype to avoid an error. */
4.84 +#ifdef __cplusplus
4.85 +extern "C"
4.86 +#endif
4.87 +/* We use char because int might match the return type of a gcc2
4.88 + builtin and then its argument prototype would still apply. */
4.89 +char glXQueryVersion ();
4.90 +int
4.91 +main ()
4.92 +{
4.93 +glXQueryVersion ();
4.94 + ;
4.95 + return 0;
4.96 +}
4.97 +_ACEOF
4.98 +rm -f conftest.$ac_objext conftest$ac_exeext
4.99 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
4.100 + (eval $ac_link) 2>conftest.er1
4.101 + ac_status=$?
4.102 + grep -v '^ *+' conftest.er1 >conftest.err
4.103 + rm -f conftest.er1
4.104 + cat conftest.err >&5
4.105 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
4.106 + (exit $ac_status); } &&
4.107 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
4.108 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4.109 + (eval $ac_try) 2>&5
4.110 + ac_status=$?
4.111 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
4.112 + (exit $ac_status); }; } &&
4.113 + { ac_try='test -s conftest$ac_exeext'
4.114 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
4.115 + (eval $ac_try) 2>&5
4.116 + ac_status=$?
4.117 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
4.118 + (exit $ac_status); }; }; then
4.119 + ac_cv_lib_GL_glXQueryVersion=yes
4.120 +else
4.121 + echo "$as_me: failed program was:" >&5
4.122 +sed 's/^/| /' conftest.$ac_ext >&5
4.123 +
4.124 +ac_cv_lib_GL_glXQueryVersion=no
4.125 +fi
4.126 +rm -f conftest.err conftest.$ac_objext \
4.127 + conftest$ac_exeext conftest.$ac_ext
4.128 +LIBS=$ac_check_lib_save_LIBS
4.129 +fi
4.130 +echo "$as_me:$LINENO: result: $ac_cv_lib_GL_glXQueryVersion" >&5
4.131 +echo "${ECHO_T}$ac_cv_lib_GL_glXQueryVersion" >&6
4.132 +if test $ac_cv_lib_GL_glXQueryVersion = yes; then
4.133 + cat >>confdefs.h <<_ACEOF
4.134 +#define HAVE_LIBGL 1
4.135 +_ACEOF
4.136 +
4.137 + LIBS="-lGL $LIBS"
4.138 +
4.139 +fi
4.140
4.141
4.142 GETTEXT_PACKAGE=dream
5.1 --- a/configure.in Sun Feb 05 04:04:25 2006 +0000
5.2 +++ b/configure.in Sun Feb 05 04:05:27 2006 +0000
5.3 @@ -10,11 +10,14 @@
5.4 AM_PROG_CC_STDC
5.5 AC_HEADER_STDC
5.6
5.7 -pkg_modules="libgnomeui-2.0"
5.8 -PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
5.9 +PKG_CHECK_MODULES(PACKAGE,
5.10 + [ libgnomeui-2.0 dnl
5.11 + esound ])
5.12 AC_SUBST(PACKAGE_CFLAGS)
5.13 AC_SUBST(PACKAGE_LIBS)
5.14
5.15 +AC_CHECK_LIB(GL, glXQueryVersion)
5.16 +
5.17 GETTEXT_PACKAGE=dream
5.18 AC_SUBST(GETTEXT_PACKAGE)
5.19 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
6.1 --- a/src/Makefile.am Sun Feb 05 04:04:25 2006 +0000
6.2 +++ b/src/Makefile.am Sun Feb 05 04:05:27 2006 +0000
6.3 @@ -15,7 +15,7 @@
6.4 pvr2.c pvr2.h \
6.5 bios.c bios.h \
6.6 gdrom/ide.c gdrom/ide.h \
6.7 - video.c dreamcast.c dreamcast.h \
6.8 + dreamcast.c dreamcast.h \
6.9 sh4/intc.c sh4/intc.h sh4/sh4mem.c sh4/timer.c sh4/dmac.c \
6.10 sh4/sh4core.c sh4/sh4core.h sh4/sh4dasm.c sh4/sh4dasm.h \
6.11 sh4/sh4mmio.c sh4/sh4mmio.h sh4/scif.c \
6.12 @@ -29,7 +29,10 @@
6.13 gui/callbacks.c gui/callbacks.h \
6.14 gui/gui.c gui/gui.h gui/mmr_win.c \
6.15 gui/debug_win.c gui/dump_win.c \
6.16 - loader.c bootstrap.c util.c
6.17 + loader.c bootstrap.c util.c \
6.18 + drivers/video_gtk.c drivers/video_gtk.h \
6.19 + drivers/video_x11.c drivers/video_x11.h \
6.20 + drivers/gl_glx.c
6.21
6.22 dream_LDADD = @PACKAGE_LIBS@ $(INTLLIBS) -lesd
6.23
7.1 --- a/src/Makefile.in Sun Feb 05 04:04:25 2006 +0000
7.2 +++ b/src/Makefile.in Sun Feb 05 04:05:27 2006 +0000
7.3 @@ -142,7 +142,7 @@
7.4 pvr2.c pvr2.h \
7.5 bios.c bios.h \
7.6 gdrom/ide.c gdrom/ide.h \
7.7 - video.c dreamcast.c dreamcast.h \
7.8 + dreamcast.c dreamcast.h \
7.9 sh4/intc.c sh4/intc.h sh4/sh4mem.c sh4/timer.c sh4/dmac.c \
7.10 sh4/sh4core.c sh4/sh4core.h sh4/sh4dasm.c sh4/sh4dasm.h \
7.11 sh4/sh4mmio.c sh4/sh4mmio.h sh4/scif.c \
7.12 @@ -156,7 +156,10 @@
7.13 gui/callbacks.c gui/callbacks.h \
7.14 gui/gui.c gui/gui.h gui/mmr_win.c \
7.15 gui/debug_win.c gui/dump_win.c \
7.16 - loader.c bootstrap.c util.c
7.17 + loader.c bootstrap.c util.c \
7.18 + drivers/video_gtk.c drivers/video_gtk.h \
7.19 + drivers/video_x11.c drivers/video_x11.h \
7.20 + drivers/gl_glx.c
7.21
7.22
7.23 dream_LDADD = @PACKAGE_LIBS@ $(INTLLIBS) -lesd
7.24 @@ -172,16 +175,17 @@
7.25
7.26 am_dream_OBJECTS = main.$(OBJEXT) mem.$(OBJEXT) watch.$(OBJEXT) \
7.27 asic.$(OBJEXT) pvr2.$(OBJEXT) bios.$(OBJEXT) ide.$(OBJEXT) \
7.28 - video.$(OBJEXT) dreamcast.$(OBJEXT) intc.$(OBJEXT) \
7.29 - sh4mem.$(OBJEXT) timer.$(OBJEXT) dmac.$(OBJEXT) \
7.30 - sh4core.$(OBJEXT) sh4dasm.$(OBJEXT) sh4mmio.$(OBJEXT) \
7.31 - scif.$(OBJEXT) armcore.$(OBJEXT) armdasm.$(OBJEXT) \
7.32 - armmem.$(OBJEXT) aica.$(OBJEXT) audio.$(OBJEXT) \
7.33 - audio_null.$(OBJEXT) audio_esd.$(OBJEXT) maple.$(OBJEXT) \
7.34 - controller.$(OBJEXT) support.$(OBJEXT) interface.$(OBJEXT) \
7.35 - callbacks.$(OBJEXT) gui.$(OBJEXT) mmr_win.$(OBJEXT) \
7.36 - debug_win.$(OBJEXT) dump_win.$(OBJEXT) loader.$(OBJEXT) \
7.37 - bootstrap.$(OBJEXT) util.$(OBJEXT)
7.38 + dreamcast.$(OBJEXT) intc.$(OBJEXT) sh4mem.$(OBJEXT) \
7.39 + timer.$(OBJEXT) dmac.$(OBJEXT) sh4core.$(OBJEXT) \
7.40 + sh4dasm.$(OBJEXT) sh4mmio.$(OBJEXT) scif.$(OBJEXT) \
7.41 + armcore.$(OBJEXT) armdasm.$(OBJEXT) armmem.$(OBJEXT) \
7.42 + aica.$(OBJEXT) audio.$(OBJEXT) audio_null.$(OBJEXT) \
7.43 + audio_esd.$(OBJEXT) maple.$(OBJEXT) controller.$(OBJEXT) \
7.44 + support.$(OBJEXT) interface.$(OBJEXT) callbacks.$(OBJEXT) \
7.45 + gui.$(OBJEXT) mmr_win.$(OBJEXT) debug_win.$(OBJEXT) \
7.46 + dump_win.$(OBJEXT) loader.$(OBJEXT) bootstrap.$(OBJEXT) \
7.47 + util.$(OBJEXT) video_gtk.$(OBJEXT) video_x11.$(OBJEXT) \
7.48 + gl_glx.$(OBJEXT)
7.49 dream_OBJECTS = $(am_dream_OBJECTS)
7.50 dream_DEPENDENCIES =
7.51 dream_LDFLAGS =
7.52 @@ -197,16 +201,17 @@
7.53 @AMDEP_TRUE@ ./$(DEPDIR)/callbacks.Po ./$(DEPDIR)/controller.Po \
7.54 @AMDEP_TRUE@ ./$(DEPDIR)/debug_win.Po ./$(DEPDIR)/dmac.Po \
7.55 @AMDEP_TRUE@ ./$(DEPDIR)/dreamcast.Po ./$(DEPDIR)/dump_win.Po \
7.56 -@AMDEP_TRUE@ ./$(DEPDIR)/gui.Po ./$(DEPDIR)/ide.Po \
7.57 -@AMDEP_TRUE@ ./$(DEPDIR)/intc.Po ./$(DEPDIR)/interface.Po \
7.58 -@AMDEP_TRUE@ ./$(DEPDIR)/loader.Po ./$(DEPDIR)/main.Po \
7.59 -@AMDEP_TRUE@ ./$(DEPDIR)/maple.Po ./$(DEPDIR)/mem.Po \
7.60 -@AMDEP_TRUE@ ./$(DEPDIR)/mmr_win.Po ./$(DEPDIR)/pvr2.Po \
7.61 -@AMDEP_TRUE@ ./$(DEPDIR)/scif.Po ./$(DEPDIR)/sh4core.Po \
7.62 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4dasm.Po ./$(DEPDIR)/sh4mem.Po \
7.63 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4mmio.Po ./$(DEPDIR)/support.Po \
7.64 -@AMDEP_TRUE@ ./$(DEPDIR)/timer.Po ./$(DEPDIR)/util.Po \
7.65 -@AMDEP_TRUE@ ./$(DEPDIR)/video.Po ./$(DEPDIR)/watch.Po
7.66 +@AMDEP_TRUE@ ./$(DEPDIR)/gl_glx.Po ./$(DEPDIR)/gui.Po \
7.67 +@AMDEP_TRUE@ ./$(DEPDIR)/ide.Po ./$(DEPDIR)/intc.Po \
7.68 +@AMDEP_TRUE@ ./$(DEPDIR)/interface.Po ./$(DEPDIR)/loader.Po \
7.69 +@AMDEP_TRUE@ ./$(DEPDIR)/main.Po ./$(DEPDIR)/maple.Po \
7.70 +@AMDEP_TRUE@ ./$(DEPDIR)/mem.Po ./$(DEPDIR)/mmr_win.Po \
7.71 +@AMDEP_TRUE@ ./$(DEPDIR)/pvr2.Po ./$(DEPDIR)/scif.Po \
7.72 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4core.Po ./$(DEPDIR)/sh4dasm.Po \
7.73 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4mem.Po ./$(DEPDIR)/sh4mmio.Po \
7.74 +@AMDEP_TRUE@ ./$(DEPDIR)/support.Po ./$(DEPDIR)/timer.Po \
7.75 +@AMDEP_TRUE@ ./$(DEPDIR)/util.Po ./$(DEPDIR)/video_gtk.Po \
7.76 +@AMDEP_TRUE@ ./$(DEPDIR)/video_x11.Po ./$(DEPDIR)/watch.Po
7.77 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
7.78 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
7.79 CCLD = $(CC)
7.80 @@ -274,6 +279,7 @@
7.81 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dmac.Po@am__quote@
7.82 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dreamcast.Po@am__quote@
7.83 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dump_win.Po@am__quote@
7.84 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_glx.Po@am__quote@
7.85 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui.Po@am__quote@
7.86 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ide.Po@am__quote@
7.87 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intc.Po@am__quote@
7.88 @@ -292,7 +298,8 @@
7.89 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/support.Po@am__quote@
7.90 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@
7.91 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@
7.92 -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video.Po@am__quote@
7.93 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video_gtk.Po@am__quote@
7.94 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video_x11.Po@am__quote@
7.95 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watch.Po@am__quote@
7.96
7.97 .c.o:
7.98 @@ -866,6 +873,72 @@
7.99 @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/dump_win.Po' tmpdepfile='$(DEPDIR)/dump_win.TPo' @AMDEPBACKSLASH@
7.100 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.101 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dump_win.obj `if test -f 'gui/dump_win.c'; then $(CYGPATH_W) 'gui/dump_win.c'; else $(CYGPATH_W) '$(srcdir)/gui/dump_win.c'; fi`
7.102 +
7.103 +video_gtk.o: drivers/video_gtk.c
7.104 +@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" \
7.105 +@am__fastdepCC_TRUE@ -c -o video_gtk.o `test -f 'drivers/video_gtk.c' || echo '$(srcdir)/'`drivers/video_gtk.c; \
7.106 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_gtk.Tpo" "$(DEPDIR)/video_gtk.Po"; \
7.107 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_gtk.Tpo"; exit 1; \
7.108 +@am__fastdepCC_TRUE@ fi
7.109 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_gtk.c' object='video_gtk.o' libtool=no @AMDEPBACKSLASH@
7.110 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_gtk.Po' tmpdepfile='$(DEPDIR)/video_gtk.TPo' @AMDEPBACKSLASH@
7.111 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.112 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_gtk.o `test -f 'drivers/video_gtk.c' || echo '$(srcdir)/'`drivers/video_gtk.c
7.113 +
7.114 +video_gtk.obj: drivers/video_gtk.c
7.115 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_gtk.obj -MD -MP -MF "$(DEPDIR)/video_gtk.Tpo" \
7.116 +@am__fastdepCC_TRUE@ -c -o video_gtk.obj `if test -f 'drivers/video_gtk.c'; then $(CYGPATH_W) 'drivers/video_gtk.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_gtk.c'; fi`; \
7.117 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_gtk.Tpo" "$(DEPDIR)/video_gtk.Po"; \
7.118 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_gtk.Tpo"; exit 1; \
7.119 +@am__fastdepCC_TRUE@ fi
7.120 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_gtk.c' object='video_gtk.obj' libtool=no @AMDEPBACKSLASH@
7.121 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_gtk.Po' tmpdepfile='$(DEPDIR)/video_gtk.TPo' @AMDEPBACKSLASH@
7.122 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.123 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_gtk.obj `if test -f 'drivers/video_gtk.c'; then $(CYGPATH_W) 'drivers/video_gtk.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_gtk.c'; fi`
7.124 +
7.125 +video_x11.o: drivers/video_x11.c
7.126 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_x11.o -MD -MP -MF "$(DEPDIR)/video_x11.Tpo" \
7.127 +@am__fastdepCC_TRUE@ -c -o video_x11.o `test -f 'drivers/video_x11.c' || echo '$(srcdir)/'`drivers/video_x11.c; \
7.128 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_x11.Tpo" "$(DEPDIR)/video_x11.Po"; \
7.129 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_x11.Tpo"; exit 1; \
7.130 +@am__fastdepCC_TRUE@ fi
7.131 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_x11.c' object='video_x11.o' libtool=no @AMDEPBACKSLASH@
7.132 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_x11.Po' tmpdepfile='$(DEPDIR)/video_x11.TPo' @AMDEPBACKSLASH@
7.133 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.134 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_x11.o `test -f 'drivers/video_x11.c' || echo '$(srcdir)/'`drivers/video_x11.c
7.135 +
7.136 +video_x11.obj: drivers/video_x11.c
7.137 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT video_x11.obj -MD -MP -MF "$(DEPDIR)/video_x11.Tpo" \
7.138 +@am__fastdepCC_TRUE@ -c -o video_x11.obj `if test -f 'drivers/video_x11.c'; then $(CYGPATH_W) 'drivers/video_x11.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_x11.c'; fi`; \
7.139 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/video_x11.Tpo" "$(DEPDIR)/video_x11.Po"; \
7.140 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/video_x11.Tpo"; exit 1; \
7.141 +@am__fastdepCC_TRUE@ fi
7.142 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/video_x11.c' object='video_x11.obj' libtool=no @AMDEPBACKSLASH@
7.143 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/video_x11.Po' tmpdepfile='$(DEPDIR)/video_x11.TPo' @AMDEPBACKSLASH@
7.144 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.145 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o video_x11.obj `if test -f 'drivers/video_x11.c'; then $(CYGPATH_W) 'drivers/video_x11.c'; else $(CYGPATH_W) '$(srcdir)/drivers/video_x11.c'; fi`
7.146 +
7.147 +gl_glx.o: drivers/gl_glx.c
7.148 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gl_glx.o -MD -MP -MF "$(DEPDIR)/gl_glx.Tpo" \
7.149 +@am__fastdepCC_TRUE@ -c -o gl_glx.o `test -f 'drivers/gl_glx.c' || echo '$(srcdir)/'`drivers/gl_glx.c; \
7.150 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gl_glx.Tpo" "$(DEPDIR)/gl_glx.Po"; \
7.151 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gl_glx.Tpo"; exit 1; \
7.152 +@am__fastdepCC_TRUE@ fi
7.153 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/gl_glx.c' object='gl_glx.o' libtool=no @AMDEPBACKSLASH@
7.154 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gl_glx.Po' tmpdepfile='$(DEPDIR)/gl_glx.TPo' @AMDEPBACKSLASH@
7.155 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.156 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gl_glx.o `test -f 'drivers/gl_glx.c' || echo '$(srcdir)/'`drivers/gl_glx.c
7.157 +
7.158 +gl_glx.obj: drivers/gl_glx.c
7.159 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gl_glx.obj -MD -MP -MF "$(DEPDIR)/gl_glx.Tpo" \
7.160 +@am__fastdepCC_TRUE@ -c -o gl_glx.obj `if test -f 'drivers/gl_glx.c'; then $(CYGPATH_W) 'drivers/gl_glx.c'; else $(CYGPATH_W) '$(srcdir)/drivers/gl_glx.c'; fi`; \
7.161 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gl_glx.Tpo" "$(DEPDIR)/gl_glx.Po"; \
7.162 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/gl_glx.Tpo"; exit 1; \
7.163 +@am__fastdepCC_TRUE@ fi
7.164 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='drivers/gl_glx.c' object='gl_glx.obj' libtool=no @AMDEPBACKSLASH@
7.165 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/gl_glx.Po' tmpdepfile='$(DEPDIR)/gl_glx.TPo' @AMDEPBACKSLASH@
7.166 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.167 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gl_glx.obj `if test -f 'drivers/gl_glx.c'; then $(CYGPATH_W) 'drivers/gl_glx.c'; else $(CYGPATH_W) '$(srcdir)/drivers/gl_glx.c'; fi`
7.168 uninstall-info-am:
7.169
7.170 ETAGS = etags
8.1 --- a/src/asic.c Sun Feb 05 04:04:25 2006 +0000
8.2 +++ b/src/asic.c Sun Feb 05 04:05:27 2006 +0000
8.3 @@ -1,5 +1,5 @@
8.4 /**
8.5 - * $Id: asic.c,v 1.10 2006-01-01 08:09:42 nkeynes Exp $
8.6 + * $Id: asic.c,v 1.11 2006-02-05 04:05:27 nkeynes Exp $
8.7 *
8.8 * Support for the miscellaneous ASIC functions (Primarily event multiplexing,
8.9 * and DMA).
8.10 @@ -73,6 +73,9 @@
8.11 }
8.12 break;
8.13 case PVRDMACTL: /* Initiate PVR DMA transfer */
8.14 + MMIO_WRITE( ASIC, reg, val );
8.15 + WARN( "Write to ASIC (%03X <= %08X) [%s: %s]",
8.16 + reg, val, MMIO_REGID(ASIC,reg), MMIO_REGDESC(ASIC,reg) );
8.17 if( val & 1 ) {
8.18 uint32_t dest_addr = MMIO_READ( ASIC, PVRDMADEST) &0x1FFFFFE0;
8.19 uint32_t count = MMIO_READ( ASIC, PVRDMACNT );
8.20 @@ -102,22 +105,31 @@
8.21 sh4_stop();
8.22 return 0x000000B;
8.23 */
8.24 - case PIRQ0:
8.25 - case PIRQ1:
8.26 - case PIRQ2:
8.27 - val = MMIO_READ(ASIC, reg);
8.28 -// WARN( "Read from ASIC (%03X => %08X) [%s: %s]",
8.29 -// reg, val, MMIO_REGID(ASIC,reg), MMIO_REGDESC(ASIC,reg) );
8.30 - return val;
8.31 - case G2STATUS:
8.32 - return 0; /* find out later if there's any cases we actually need to care about */
8.33 - default:
8.34 - val = MMIO_READ(ASIC, reg);
8.35 - WARN( "Read from ASIC (%03X => %08X) [%s: %s]",
8.36 - reg, val, MMIO_REGID(ASIC,reg), MMIO_REGDESC(ASIC,reg) );
8.37 - return val;
8.38 + case PIRQ0:
8.39 + case PIRQ1:
8.40 + case PIRQ2:
8.41 + case IRQA0:
8.42 + case IRQA1:
8.43 + case IRQA2:
8.44 + case IRQB0:
8.45 + case IRQB1:
8.46 + case IRQB2:
8.47 + case IRQC0:
8.48 + case IRQC1:
8.49 + case IRQC2:
8.50 + val = MMIO_READ(ASIC, reg);
8.51 + // WARN( "Read from ASIC (%03X => %08X) [%s: %s]",
8.52 + // reg, val, MMIO_REGID(ASIC,reg), MMIO_REGDESC(ASIC,reg) );
8.53 + return val;
8.54 + case G2STATUS:
8.55 + return 0; /* find out later if there's any cases we actually need to care about */
8.56 + default:
8.57 + val = MMIO_READ(ASIC, reg);
8.58 + WARN( "Read from ASIC (%03X => %08X) [%s: %s]",
8.59 + reg, val, MMIO_REGID(ASIC,reg), MMIO_REGDESC(ASIC,reg) );
8.60 + return val;
8.61 }
8.62 -
8.63 +
8.64 }
8.65
8.66 void asic_event( int event )
8.67 @@ -215,7 +227,7 @@
8.68 return idereg.status;
8.69 default:
8.70 val = MMIO_READ( EXTDMA, reg );
8.71 - DEBUG( "EXTDMA read %08X => %08X", reg, val );
8.72 + //DEBUG( "EXTDMA read %08X => %08X", reg, val );
8.73 return val;
8.74 }
8.75 }
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/src/drivers/gl_glx.c Sun Feb 05 04:05:27 2006 +0000
9.3 @@ -0,0 +1,56 @@
9.4 +/**
9.5 + * $Id: gl_glx.c,v 1.1 2006-02-05 04:05:27 nkeynes Exp $
9.6 + *
9.7 + * GLX framebuffer support. Note depends on an X11 video driver
9.8 + * (ie video_gtk) to maintain the X11 side of things.
9.9 + *
9.10 + * Copyright (c) 2005 Nathan Keynes.
9.11 + *
9.12 + * This program is free software; you can redistribute it and/or modify
9.13 + * it under the terms of the GNU General Public License as published by
9.14 + * the Free Software Foundation; either version 2 of the License, or
9.15 + * (at your option) any later version.
9.16 + *
9.17 + * This program is distributed in the hope that it will be useful,
9.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
9.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9.20 + * GNU General Public License for more details.
9.21 + */
9.22 +
9.23 +#include "dream.h"
9.24 +#include <X11/Xlib.h>
9.25 +#include <GL/glx.h>
9.26 +#include "video.h"
9.27 +#include "drivers/video_x11.h"
9.28 +
9.29 +gboolean gl_glx_init( )
9.30 +{
9.31 + int major, minor;
9.32 + const char *glxExts, *glxServer;
9.33 + int screen = XScreenNumberOfScreen(video_x11_screen);
9.34 +
9.35 + if( glXQueryVersion( video_x11_display, &major, &minor ) == False ) {
9.36 + ERROR( "X Display lacks the GLX nature" );
9.37 + return FALSE;
9.38 + }
9.39 + if( major < 1 || minor < 1 ) {
9.40 + ERROR( "GLX version %d.%d is not supported", major, minor );
9.41 + return FALSE;
9.42 + }
9.43 +
9.44 + glxExts = glXQueryExtensionsString( video_x11_display, screen );
9.45 + glxServer = glXQueryServerString( video_x11_display, screen, GLX_VENDOR );
9.46 + INFO( "GLX version %d.%d, %s. Supported exts: %s", major, minor,
9.47 + glxServer, glxExts );
9.48 +}
9.49 +
9.50 +gboolean gl_glx_start_frame( uint32_t width, uint32_t height,
9.51 + int colour_format )
9.52 +{
9.53 + return FALSE;
9.54 +}
9.55 +
9.56 +gboolean gl_glx_swap_frame( )
9.57 +{
9.58 + return FALSE;
9.59 +}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/src/drivers/video_gtk.c Sun Feb 05 04:05:27 2006 +0000
10.3 @@ -0,0 +1,136 @@
10.4 +/**
10.5 + * $Id: video_gtk.c,v 1.1 2006-02-05 04:05:27 nkeynes Exp $
10.6 + *
10.7 + * The PC side of the video support (responsible for actually displaying /
10.8 + * rendering frames)
10.9 + *
10.10 + * Copyright (c) 2005 Nathan Keynes.
10.11 + *
10.12 + * This program is free software; you can redistribute it and/or modify
10.13 + * it under the terms of the GNU General Public License as published by
10.14 + * the Free Software Foundation; either version 2 of the License, or
10.15 + * (at your option) any later version.
10.16 + *
10.17 + * This program is distributed in the hope that it will be useful,
10.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
10.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10.20 + * GNU General Public License for more details.
10.21 + */
10.22 +
10.23 +#include <gnome.h>
10.24 +#include <gdk/gdkx.h>
10.25 +#include <stdint.h>
10.26 +#include "video.h"
10.27 +#include "drivers/video_x11.h"
10.28 +
10.29 +GdkImage *video_img = NULL;
10.30 +GtkWindow *video_win = NULL;
10.31 +GtkWidget *video_area = NULL;
10.32 +uint32_t video_width = 640;
10.33 +uint32_t video_height = 480;
10.34 +uint32_t video_frame_count = 0;
10.35 +
10.36 +gboolean video_gtk_set_output_format( uint32_t width, uint32_t height,
10.37 + int colour_format );
10.38 +gboolean video_gtk_display_frame( video_buffer_t frame );
10.39 +gboolean video_gtk_blank( uint32_t rgb );
10.40 +
10.41 +struct video_driver video_gtk_driver = { "Gtk", video_gtk_set_output_format,
10.42 + video_gtk_display_frame,
10.43 + video_gtk_blank };
10.44 +
10.45 +gboolean video_gtk_set_output_format( uint32_t width, uint32_t height,
10.46 + int colour_format )
10.47 +{
10.48 + video_width = width;
10.49 + video_height = height;
10.50 + if( video_win == NULL ) {
10.51 + video_win = GTK_WINDOW(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
10.52 + gtk_window_set_title( video_win, "DreamOn! - Emulation Window" );
10.53 + gtk_window_set_policy( video_win, FALSE, FALSE, FALSE );
10.54 + gtk_window_set_default_size( video_win, width, height );
10.55 +
10.56 + video_area = gtk_image_new();
10.57 + gtk_widget_show( GTK_WIDGET(video_area) );
10.58 + gtk_container_add( GTK_CONTAINER(video_win), GTK_WIDGET(video_area) );
10.59 + gtk_widget_show( GTK_WIDGET(video_win) );
10.60 + video_x11_set_display( gdk_x11_display_get_xdisplay( gtk_widget_get_display(video_area)),
10.61 + gdk_x11_screen_get_xscreen( gtk_widget_get_screen(video_area)),
10.62 + GDK_WINDOW_XWINDOW( GTK_WIDGET(video_win)->window ) );
10.63 +
10.64 + }
10.65 + gtk_window_set_default_size( video_win, width, height );
10.66 + video_img = gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_system(),
10.67 + width, height );
10.68 + gtk_image_set_from_image( GTK_IMAGE(video_area), video_img, NULL );
10.69 + /* Note old image is auto de-refed */
10.70 + return TRUE;
10.71 +}
10.72 +
10.73 +
10.74 +/**
10.75 + * Fill the entire frame with the specified colour (00RRGGBB)
10.76 + */
10.77 +gboolean video_gtk_blank( uint32_t colour )
10.78 +{
10.79 + char *p = video_img->mem;
10.80 + int i;
10.81 + for( i=0; i<video_width*video_height; i++ ) {
10.82 + *p++ = (colour>>16) & 0xFF;
10.83 + *p++ = (colour>>8) & 0xFF;
10.84 + *p++ = (colour) & 0xFF;
10.85 + *p++ = 0;
10.86 + }
10.87 +}
10.88 +
10.89 +gboolean video_gtk_display_frame( video_buffer_t frame )
10.90 +{
10.91 + uint32_t bytes_per_line, x, y;
10.92 + char *src = frame->data;
10.93 + char *dest = video_img->mem;
10.94 +
10.95 + switch( frame->colour_format ) {
10.96 + case COLFMT_RGB15:
10.97 + for( y=0; y < frame->vres; y++ ) {
10.98 + uint16_t *p = (uint16_t *)src;
10.99 + for( x=0; x < frame->vres; x++ ) {
10.100 + uint16_t pixel = *p++;
10.101 + *dest++ = (pixel & 0x1F) << 3;
10.102 + *dest++ = (pixel & 0x3E0) >> 2;
10.103 + *dest++ = (pixel & 0x7C00) >> 7;
10.104 + *dest++ = 0;
10.105 + }
10.106 + src += frame->rowstride;
10.107 + }
10.108 + break;
10.109 + case COLFMT_RGB16:
10.110 + for( y=0; y < frame->vres; y++ ) {
10.111 + uint16_t *p = (uint16_t *)src;
10.112 + for( x=0; x < frame->vres; x++ ) {
10.113 + uint16_t pixel = *p++;
10.114 + *dest++ = (pixel & 0x1F) << 3;
10.115 + *dest++ = (pixel & 0x7E0) >> 3;
10.116 + *dest++ = (pixel & 0xF800) >> 8;
10.117 + *dest++ = 0;
10.118 + }
10.119 + src += frame->rowstride;
10.120 + }
10.121 + break;
10.122 + case COLFMT_RGB32:
10.123 + bytes_per_line = frame->hres << 2;
10.124 + if( bytes_per_line == frame->rowstride ) {
10.125 + /* A little bit faster */
10.126 + memcpy( dest, src, bytes_per_line * frame->vres );
10.127 + } else {
10.128 + for( y=0; y< frame->vres; y++ ) {
10.129 + memcpy( dest, src, bytes_per_line );
10.130 + src += frame->rowstride;
10.131 + dest += bytes_per_line;
10.132 + }
10.133 + }
10.134 + break;
10.135 + }
10.136 + gtk_widget_queue_draw( video_area );
10.137 + return TRUE;
10.138 +}
10.139 +
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/src/drivers/video_x11.c Sun Feb 05 04:05:27 2006 +0000
11.3 @@ -0,0 +1,31 @@
11.4 +/**
11.5 + * $Id: video_x11.c,v 1.1 2006-02-05 04:05:27 nkeynes Exp $
11.6 + *
11.7 + * Parent for all X11 display drivers.
11.8 + *
11.9 + * Copyright (c) 2005 Nathan Keynes.
11.10 + *
11.11 + * This program is free software; you can redistribute it and/or modify
11.12 + * it under the terms of the GNU General Public License as published by
11.13 + * the Free Software Foundation; either version 2 of the License, or
11.14 + * (at your option) any later version.
11.15 + *
11.16 + * This program is distributed in the hope that it will be useful,
11.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
11.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11.19 + * GNU General Public License for more details.
11.20 + */
11.21 +
11.22 +#include "drivers/video_x11.h"
11.23 +
11.24 +Display *video_x11_display = NULL;
11.25 +Screen *video_x11_screen = NULL;
11.26 +Window video_x11_window = 0;
11.27 +
11.28 +void video_x11_set_display( Display *display, Screen *screen, Window window )
11.29 +{
11.30 + video_x11_display = display;
11.31 + video_x11_screen = screen;
11.32 + video_x11_window = window;
11.33 +}
11.34 +
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/src/drivers/video_x11.h Sun Feb 05 04:05:27 2006 +0000
12.3 @@ -0,0 +1,31 @@
12.4 +/**
12.5 + * $Id: video_x11.h,v 1.1 2006-02-05 04:05:27 nkeynes Exp $
12.6 + *
12.7 + * Parent for all X11 display drivers.
12.8 + *
12.9 + * Copyright (c) 2005 Nathan Keynes.
12.10 + *
12.11 + * This program is free software; you can redistribute it and/or modify
12.12 + * it under the terms of the GNU General Public License as published by
12.13 + * the Free Software Foundation; either version 2 of the License, or
12.14 + * (at your option) any later version.
12.15 + *
12.16 + * This program is distributed in the hope that it will be useful,
12.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.19 + * GNU General Public License for more details.
12.20 + */
12.21 +
12.22 +#ifndef video_x11_driver_H
12.23 +#define video_x11_driver_H
12.24 +
12.25 +#include "X11/Xlib.h"
12.26 +#include "video.h"
12.27 +
12.28 +void video_x11_set_display( Display *display, Screen *screen, Window window );
12.29 +
12.30 +extern Display *video_x11_display;
12.31 +extern Screen *video_x11_screen;
12.32 +extern Window video_x11_window;
12.33 +
12.34 +#endif
13.1 --- a/src/gui/debug_win.c Sun Feb 05 04:04:25 2006 +0000
13.2 +++ b/src/gui/debug_win.c Sun Feb 05 04:05:27 2006 +0000
13.3 @@ -1,5 +1,5 @@
13.4 /**
13.5 - * $Id: debug_win.c,v 1.15 2006-01-10 13:58:35 nkeynes Exp $
13.6 + * $Id: debug_win.c,v 1.16 2006-02-05 04:05:27 nkeynes Exp $
13.7 * This file is responsible for the main debugger gui frame.
13.8 *
13.9 * Copyright (c) 2005 Nathan Keynes.
13.10 @@ -131,7 +131,7 @@
13.11 void update_icount( debug_info_t data )
13.12 {
13.13 // sprintf( data->icounter_text, "%d", *data->cpu->icount );
13.14 - sprintf( data->icounter_text, "%d", video_frame_count );
13.15 + sprintf( data->icounter_text, "%d", pvr2_frame_counter );
13.16 gtk_progress_bar_set_text( data->icounter, data->icounter_text );
13.17 }
13.18
14.1 --- a/src/main.c Sun Feb 05 04:04:25 2006 +0000
14.2 +++ b/src/main.c Sun Feb 05 04:05:27 2006 +0000
14.3 @@ -1,5 +1,5 @@
14.4 /**
14.5 - * $Id: main.c,v 1.12 2006-01-22 22:40:53 nkeynes Exp $
14.6 + * $Id: main.c,v 1.13 2006-02-05 04:05:27 nkeynes Exp $
14.7 *
14.8 * Main program, initializes dreamcast and gui, then passes control off to
14.9 * the gtk main loop (currently).
14.10 @@ -22,8 +22,8 @@
14.11 #ifdef HAVE_CONFIG_H
14.12 # include <config.h>
14.13 #endif
14.14 -
14.15 #include <unistd.h>
14.16 +#include <getopt.h>
14.17 #include <gnome.h>
14.18 #include "gui/gui.h"
14.19 #include "dream.h"
14.20 @@ -33,6 +33,7 @@
14.21 #define S3M_PLAYER "s3mplay.bin"
14.22
14.23 char *option_list = "a:s:A:V:phb";
14.24 +struct option longopts[1] = { { NULL, 0, 0, 0 } };
14.25 char *aica_program = NULL;
14.26 char *s3m_file = NULL;
14.27 gboolean start_immediately = FALSE;
14.28 @@ -47,7 +48,7 @@
14.29 textdomain (PACKAGE);
14.30 #endif
14.31
14.32 - while( (opt = getopt( argc, argv, option_list )) != -1 ) {
14.33 + while( (opt = getopt_long( argc, argv, option_list, longopts, NULL )) != -1 ) {
14.34 switch( opt ) {
14.35 case 'a': /* AICA only mode - argument is an AICA program */
14.36 aica_program = optarg;
14.37 @@ -73,11 +74,12 @@
14.38 }
14.39
14.40 if( aica_program == NULL ) {
14.41 - dreamcast_init();
14.42 if( !headless ) {
14.43 gnome_init ("dreamon", VERSION, argc, argv);
14.44 - video_open();
14.45 + dreamcast_init();
14.46 dreamcast_register_module( &gtk_gui_module );
14.47 + } else {
14.48 + dreamcast_init();
14.49 }
14.50 } else {
14.51 dreamcast_configure_aica_only();
14.52 @@ -96,6 +98,10 @@
14.53 bios_install();
14.54 }
14.55 INFO( "DreamOn! ready..." );
14.56 + if( optind < argc ) {
14.57 + file_load_magic( argv[optind] );
14.58 + }
14.59 +
14.60 if( start_immediately )
14.61 dreamcast_run();
14.62 if( !headless ) {
15.1 --- a/src/pvr2/pvr2.c Sun Feb 05 04:04:25 2006 +0000
15.2 +++ b/src/pvr2/pvr2.c Sun Feb 05 04:05:27 2006 +0000
15.3 @@ -1,5 +1,5 @@
15.4 /**
15.5 - * $Id: pvr2.c,v 1.13 2006-01-22 22:38:51 nkeynes Exp $
15.6 + * $Id: pvr2.c,v 1.14 2006-02-05 04:05:27 nkeynes Exp $
15.7 *
15.8 * PVR2 (Video) MMIO and supporting functions.
15.9 *
15.10 @@ -30,7 +30,11 @@
15.11
15.12 void pvr2_init( void );
15.13 uint32_t pvr2_run_slice( uint32_t );
15.14 -void pvr2_next_frame( void );
15.15 +void pvr2_display_frame( void );
15.16 +
15.17 +video_driver_t video_driver = NULL;
15.18 +struct video_buffer video_buffer[2];
15.19 +int video_buffer_idx = 0;
15.20
15.21 struct dreamcast_module pvr2_module = { "PVR2", pvr2_init, NULL, NULL,
15.22 pvr2_run_slice, NULL,
15.23 @@ -42,16 +46,18 @@
15.24 register_io_region( &mmio_region_PVR2PAL );
15.25 register_io_region( &mmio_region_PVR2TA );
15.26 video_base = mem_get_region_by_name( MEM_REGION_VIDEO );
15.27 + video_driver = &video_gtk_driver;
15.28 }
15.29
15.30 uint32_t pvr2_time_counter = 0;
15.31 +uint32_t pvr2_frame_counter = 0;
15.32 uint32_t pvr2_time_per_frame = 20000000;
15.33
15.34 uint32_t pvr2_run_slice( uint32_t nanosecs )
15.35 {
15.36 pvr2_time_counter += nanosecs;
15.37 while( pvr2_time_counter >= pvr2_time_per_frame ) {
15.38 - pvr2_next_frame();
15.39 + pvr2_display_frame();
15.40 pvr2_time_counter -= pvr2_time_per_frame;
15.41 }
15.42 return nanosecs;
15.43 @@ -66,46 +72,51 @@
15.44 * the window. If the video configuration has changed, first recompute the
15.45 * new frame size/depth.
15.46 */
15.47 -void pvr2_next_frame( void )
15.48 +void pvr2_display_frame( void )
15.49 {
15.50 - if( bChanged ) {
15.51 - int dispsize = MMIO_READ( PVR2, DISPSIZE );
15.52 - int dispmode = MMIO_READ( PVR2, DISPMODE );
15.53 - int vidcfg = MMIO_READ( PVR2, VIDCFG );
15.54 - vid_stride = ((dispsize & DISPSIZE_MODULO) >> 20) - 1;
15.55 - vid_lpf = ((dispsize & DISPSIZE_LPF) >> 10) + 1;
15.56 - vid_ppl = ((dispsize & DISPSIZE_PPL)) + 1;
15.57 - vid_col = (dispmode & DISPMODE_COL);
15.58 - frame_start = video_base + MMIO_READ( PVR2, DISPADDR1 );
15.59 - interlaced = (vidcfg & VIDCFG_I ? 1 : 0);
15.60 - bEnabled = (dispmode & DISPMODE_DE) && (vidcfg & VIDCFG_VO ) ? 1 : 0;
15.61 - vid_size = (vid_ppl * vid_lpf) << (interlaced ? 3 : 2);
15.62 - vid_hres = vid_ppl;
15.63 - vid_vres = vid_lpf;
15.64 - if( interlaced ) vid_vres <<= 1;
15.65 - switch( vid_col ) {
15.66 - case MODE_RGB15:
15.67 - case MODE_RGB16: vid_hres <<= 1; break;
15.68 - case MODE_RGB24: vid_hres *= 3; break;
15.69 - case MODE_RGB32: vid_hres <<= 2; break;
15.70 - }
15.71 - vid_hres >>= 2;
15.72 - video_update_size( vid_hres, vid_vres, vid_col );
15.73 - bChanged = 0;
15.74 - }
15.75 + int dispsize = MMIO_READ( PVR2, DISPSIZE );
15.76 + int dispmode = MMIO_READ( PVR2, DISPMODE );
15.77 + int vidcfg = MMIO_READ( PVR2, VIDCFG );
15.78 + int vid_stride = ((dispsize & DISPSIZE_MODULO) >> 20) - 1;
15.79 + int vid_lpf = ((dispsize & DISPSIZE_LPF) >> 10) + 1;
15.80 + int vid_ppl = ((dispsize & DISPSIZE_PPL)) + 1;
15.81 + gboolean bEnabled = (dispmode & DISPMODE_DE) && (vidcfg & VIDCFG_VO ) ? TRUE : FALSE;
15.82 + gboolean interlaced = (vidcfg & VIDCFG_I ? TRUE : FALSE);
15.83 if( bEnabled ) {
15.84 - if( MMIO_READ( PVR2, VIDCFG2 ) & 0x08 ) {
15.85 - /* Blanked */
15.86 - uint32_t colour = MMIO_READ( PVR2, BORDERCOL );
15.87 - video_fill( colour );
15.88 - } else {
15.89 - /* Assume bit depths match for now... */
15.90 - memcpy( video_data, frame_start, vid_size );
15.91 + video_buffer_t buffer = &video_buffer[video_buffer_idx];
15.92 + video_buffer_idx = !video_buffer_idx;
15.93 + video_buffer_t last = &video_buffer[video_buffer_idx];
15.94 + buffer->colour_format = (dispmode & DISPMODE_COL);
15.95 + buffer->rowstride = (vid_ppl + vid_stride) << 2;
15.96 + buffer->data = frame_start = video_base + MMIO_READ( PVR2, DISPADDR1 );
15.97 + buffer->vres = vid_lpf;
15.98 + if( interlaced ) buffer->vres <<= 1;
15.99 + switch( buffer->colour_format ) {
15.100 + case COLFMT_RGB15:
15.101 + case COLFMT_RGB16: buffer->hres = vid_ppl << 1; break;
15.102 + case COLFMT_RGB24: buffer->hres = (vid_ppl << 2) / 3; break;
15.103 + case COLFMT_RGB32: buffer->hres = vid_ppl; break;
15.104 + }
15.105 +
15.106 + if( video_driver != NULL ) {
15.107 + if( buffer->hres != last->hres ||
15.108 + buffer->vres != last->vres ||
15.109 + buffer->colour_format != last->colour_format) {
15.110 + video_driver->set_output_format( buffer->hres, buffer->vres,
15.111 + buffer->colour_format );
15.112 + }
15.113 + if( MMIO_READ( PVR2, VIDCFG2 ) & 0x08 ) { /* Blanked */
15.114 + uint32_t colour = MMIO_READ( PVR2, BORDERCOL );
15.115 + video_driver->display_blank_frame( colour );
15.116 + } else {
15.117 + video_driver->display_frame( buffer );
15.118 + }
15.119 }
15.120 } else {
15.121 - memset( video_data, 0, vid_size );
15.122 + video_buffer_idx = 0;
15.123 + video_buffer[0].hres = video_buffer[0].vres = 0;
15.124 }
15.125 - video_update_frame();
15.126 + pvr2_frame_counter++;
15.127 asic_event( EVENT_SCANLINE1 );
15.128 asic_event( EVENT_SCANLINE2 );
15.129 asic_event( EVENT_RETRACE );
15.130 @@ -123,12 +134,6 @@
15.131 MMIO_REGID(PVR2,reg), MMIO_REGDESC(PVR2,reg) );
15.132
15.133 switch(reg) {
15.134 - case DISPSIZE: bChanged = 1;
15.135 - case DISPMODE: bChanged = 1;
15.136 - case DISPADDR1: bChanged = 1;
15.137 - case DISPADDR2: bChanged = 1;
15.138 - case VIDCFG: bChanged = 1;
15.139 - break;
15.140 case RENDSTART:
15.141 if( val == 0xFFFFFFFF )
15.142 pvr2_render_scene();
15.143 @@ -159,7 +164,7 @@
15.144 {
15.145 /* Actual rendering goes here :) */
15.146 asic_event( EVENT_PVR_RENDER_DONE );
15.147 - DEBUG( "Rendered frame %d", video_frame_count );
15.148 + DEBUG( "Rendered frame %d", pvr2_frame_counter );
15.149 }
15.150
15.151 /** Tile Accelerator */
15.152 @@ -196,7 +201,7 @@
15.153 int count = length >> 5;
15.154 for( i=0; i<count; i++ ){
15.155 unsigned int type = (cmd_list[i].command >> 24) & 0xFF;
15.156 - DEBUG( "PVR2 cmd: %08X %08X %08X", cmd_list[i].command, cmd_list[i].param1, cmd_list[i].param2 );
15.157 + DEBUG( "PVR2 cmd: %08X %08X %08X %08X %08X %08X %08X %08X", cmd_list[i].command, cmd_list[i].param1, cmd_list[i].param2, cmd_list[i].texture, cmd_list[i].alpha, cmd_list[i].red, cmd_list[i].green, cmd_list[i].blue );
15.158 if( type == 0 ) {
15.159 /* End of list */
15.160 switch( pvr2_last_poly_type ) {
16.1 --- a/src/pvr2/pvr2.h Sun Feb 05 04:04:25 2006 +0000
16.2 +++ b/src/pvr2/pvr2.h Sun Feb 05 04:05:27 2006 +0000
16.3 @@ -1,5 +1,5 @@
16.4 /**
16.5 - * $Id: pvr2.h,v 1.6 2006-01-22 22:38:51 nkeynes Exp $
16.6 + * $Id: pvr2.h,v 1.7 2006-02-05 04:05:27 nkeynes Exp $
16.7 *
16.8 * PVR2 (video chip) MMIO registers and functions.
16.9 *
16.10 @@ -83,10 +83,10 @@
16.11 #define DISPMODE_COL 0x0000000C /* Colour mode */
16.12 #define DISPMODE_CD 0x08000000 /* Clock double */
16.13
16.14 -#define MODE_RGB15 0x00000000
16.15 -#define MODE_RGB16 0x00000004
16.16 -#define MODE_RGB24 0x00000008
16.17 -#define MODE_RGB32 0x0000000C
16.18 +#define COLFMT_RGB15 0x00000000
16.19 +#define COLFMT_RGB16 0x00000004
16.20 +#define COLFMT_RGB24 0x00000008
16.21 +#define COLFMT_RGB32 0x0000000C
16.22
16.23 #define DISPSIZE_MODULO 0x3FF00000 /* line skip +1 (32-bit words)*/
16.24 #define DISPSIZE_LPF 0x000FFC00 /* lines per field */
17.1 --- a/src/video.c Sun Feb 05 04:04:25 2006 +0000
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,71 +0,0 @@
17.4 -/**
17.5 - * $Id: video.c,v 1.3 2006-01-03 12:21:45 nkeynes Exp $
17.6 - *
17.7 - * The PC side of the video support (responsible for actually displaying /
17.8 - * rendering frames)
17.9 - *
17.10 - * Copyright (c) 2005 Nathan Keynes.
17.11 - *
17.12 - * This program is free software; you can redistribute it and/or modify
17.13 - * it under the terms of the GNU General Public License as published by
17.14 - * the Free Software Foundation; either version 2 of the License, or
17.15 - * (at your option) any later version.
17.16 - *
17.17 - * This program is distributed in the hope that it will be useful,
17.18 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
17.19 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17.20 - * GNU General Public License for more details.
17.21 - */
17.22 -
17.23 -#include <gnome.h>
17.24 -#include <stdint.h>
17.25 -
17.26 -GdkImage *img;
17.27 -GtkWindow *video_win;
17.28 -GtkWidget *video_area;
17.29 -char *video_data;
17.30 -uint32_t video_width = 640;
17.31 -uint32_t video_height = 480;
17.32 -uint32_t video_frame_count = 0;
17.33 -
17.34 -void video_open( void )
17.35 -{
17.36 - img = gdk_image_new( GDK_IMAGE_FASTEST, gdk_visual_get_system(),
17.37 - 640, 480 );
17.38 - video_win = GTK_WINDOW(gtk_window_new( GTK_WINDOW_TOPLEVEL ));
17.39 - video_area = gtk_image_new_from_image(img, NULL);
17.40 - gtk_widget_show( video_area );
17.41 - gtk_container_add( GTK_CONTAINER(video_win), video_area );
17.42 - video_data = img->mem;
17.43 -
17.44 - gtk_window_set_title( video_win, "DreamOn! - Emulation Window" );
17.45 - gtk_window_set_policy( video_win, FALSE, FALSE, FALSE );
17.46 - gtk_window_set_default_size( video_win, 640, 480 );
17.47 -
17.48 - gtk_widget_show( GTK_WIDGET(video_win) );
17.49 -}
17.50 -
17.51 -/**
17.52 - * Fill the entire frame with the specified colour (00RRGGBB)
17.53 - */
17.54 -void video_fill( uint32_t colour )
17.55 -{
17.56 - char *p = video_data;
17.57 - int i;
17.58 - for( i=0; i<video_width*video_height; i++ ) {
17.59 - *p++ = (colour>>16) & 0xFF;
17.60 - *p++ = (colour>>8) & 0xFF;
17.61 - *p++ = (colour) & 0xFF;
17.62 - }
17.63 -}
17.64 -
17.65 -void video_update_frame( void )
17.66 -{
17.67 - video_frame_count++;
17.68 - gtk_widget_queue_draw( video_area );
17.69 -}
17.70 -
17.71 -void video_update_size( int hres, int vres, int colmode )
17.72 -{
17.73 - /* do something intelligent */
17.74 -}
18.1 --- a/src/video.h Sun Feb 05 04:04:25 2006 +0000
18.2 +++ b/src/video.h Sun Feb 05 04:05:27 2006 +0000
18.3 @@ -1,5 +1,5 @@
18.4 /**
18.5 - * $Id: video.h,v 1.3 2006-01-03 12:21:45 nkeynes Exp $
18.6 + * $Id: video.h,v 1.4 2006-02-05 04:05:27 nkeynes Exp $
18.7 *
18.8 * The PC side of the video support (responsible for actually displaying /
18.9 * rendering frames)
18.10 @@ -21,17 +21,41 @@
18.11 #define dream_video_H
18.12
18.13 #include <stdint.h>
18.14 +#include <glib.h>
18.15
18.16 #ifdef __cplusplus
18.17 extern "C" {
18.18 #endif
18.19
18.20 +#define COLFMT_RGB15 0x00000000
18.21 +#define COLFMT_RGB16 0x00000004
18.22 +#define COLFMT_RGB24 0x00000008
18.23 +#define COLFMT_RGB32 0x0000000C
18.24 +
18.25 +typedef struct video_buffer {
18.26 + uint32_t hres;
18.27 + uint32_t vres;
18.28 + uint32_t rowstride;
18.29 + int colour_format;
18.30 + char *data;
18.31 +} *video_buffer_t;
18.32 +
18.33 +typedef struct video_driver {
18.34 + char *name;
18.35 + gboolean (*set_output_format)( uint32_t hres, uint32_t vres,
18.36 + int colour_fmt );
18.37 + gboolean (*display_frame)( video_buffer_t buffer );
18.38 + gboolean (*display_blank_frame)( uint32_t rgb );
18.39 +} *video_driver_t;
18.40 +
18.41 +
18.42 void video_open( void );
18.43 void video_update_frame( void );
18.44 void video_update_size( int, int, int );
18.45
18.46 -extern char *video_data;
18.47 -extern uint32_t video_frame_count;
18.48 +extern uint32_t pvr2_frame_counter;
18.49 +
18.50 +extern struct video_driver video_gtk_driver;
18.51
18.52 #ifdef __cplusplus
18.53 }
.