Search
lxdream.org :: lxdream :: r10:c898b37506e0
lxdream 0.9.1
released Jun 29
Download Now
changeset10:c898b37506e0
parent9:2784c7660165
child11:0a82ef380c45
authornkeynes
dateSun Dec 11 05:15:36 2005 +0000 (18 years ago)
Add CPU disasembly options to mode dropdown
Split sh4/mem.c into core mem.c and sh4/mem.c
Start adding copyright comments to file headers
aclocal.m4
configure
dream.glade
dream.gladep
po/Makefile.in.in
src/Makefile.am
src/Makefile.in
src/bootstrap.c
src/cpu.h
src/gui/callbacks.c
src/gui/debug_win.c
src/gui/gui.h
src/gui/interface.c
src/gui/support.h
src/mem.c
src/mem.h
src/mmio.h
src/sh4/mem.c
src/sh4/mem.h
src/sh4/mmio.h
src/sh4/sh4core.c
src/sh4/sh4core.h
src/sh4/sh4dasm.c
src/sh4/sh4dasm.h
src/sh4/sh4mem.c
src/sh4/sh4mmio.c
src/sh4/sh4mmio.h
1.1 --- a/aclocal.m4 Thu Dec 08 13:38:00 2005 +0000
1.2 +++ b/aclocal.m4 Sun Dec 11 05:15:36 2005 +0000
1.3 @@ -1092,7 +1092,7 @@
1.4
1.5
1.6 # Copyright (C) 1995-2002 Free Software Foundation, Inc.
1.7 -# Copyright (C) 2001-2003 Red Hat, Inc.
1.8 +# Copyright (C) 2001-2003,2004 Red Hat, Inc.
1.9 #
1.10 # This file is free software, distributed under the terms of the GNU
1.11 # General Public License. As a special exception to the GNU General
1.12 @@ -1115,7 +1115,9 @@
1.13 #
1.14 # Added better handling of ALL_LINGUAS from GNU gettext version
1.15 # written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
1.16 -
1.17 +#
1.18 +# Modified to require ngettext
1.19 +# Matthias Clasen <mclasen@redhat.com> 08/06/2004
1.20 #
1.21 # We need this here as well, since someone might use autoconf-2.5x
1.22 # to configure GLib then an older version to configure a package
1.23 @@ -1208,16 +1210,27 @@
1.24 #
1.25 # First check in libc
1.26 #
1.27 - AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1.28 + AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
1.29 [AC_TRY_LINK([
1.30 #include <libintl.h>
1.31 ],
1.32 - [return (int) dgettext ("","")],
1.33 - gt_cv_func_dgettext_libc=yes,
1.34 - gt_cv_func_dgettext_libc=no)
1.35 + [return !ngettext ("","", 1)],
1.36 + gt_cv_func_ngettext_libc=yes,
1.37 + gt_cv_func_ngettext_libc=no)
1.38 ])
1.39
1.40 - if test "$gt_cv_func_dgettext_libc" = "yes" ; then
1.41 + if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1.42 + AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
1.43 + [AC_TRY_LINK([
1.44 +#include <libintl.h>
1.45 +],
1.46 + [return !dgettext ("","")],
1.47 + gt_cv_func_dgettext_libc=yes,
1.48 + gt_cv_func_dgettext_libc=no)
1.49 + ])
1.50 + fi
1.51 +
1.52 + if test "$gt_cv_func_ngettext_libc" = "yes" ; then
1.53 AC_CHECK_FUNCS(bind_textdomain_codeset)
1.54 fi
1.55
1.56 @@ -1225,25 +1238,29 @@
1.57 # If we don't have everything we want, check in libintl
1.58 #
1.59 if test "$gt_cv_func_dgettext_libc" != "yes" \
1.60 + || test "$gt_cv_func_ngettext_libc" != "yes" \
1.61 || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
1.62
1.63 AC_CHECK_LIB(intl, bindtextdomain,
1.64 - [AC_CHECK_LIB(intl, dgettext,
1.65 - gt_cv_func_dgettext_libintl=yes)])
1.66 + [AC_CHECK_LIB(intl, ngettext,
1.67 + [AC_CHECK_LIB(intl, dgettext,
1.68 + gt_cv_func_dgettext_libintl=yes)])])
1.69
1.70 if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
1.71 AC_MSG_CHECKING([if -liconv is needed to use gettext])
1.72 AC_MSG_RESULT([])
1.73 - AC_CHECK_LIB(intl, dcgettext,
1.74 + AC_CHECK_LIB(intl, ngettext,
1.75 + [AC_CHECK_LIB(intl, dcgettext,
1.76 [gt_cv_func_dgettext_libintl=yes
1.77 libintl_extra_libs=-liconv],
1.78 - :,-liconv)
1.79 + :,-liconv)],
1.80 + :,-liconv)
1.81 fi
1.82
1.83 #
1.84 # If we found libintl, then check in it for bind_textdomain_codeset();
1.85 # we'll prefer libc if neither have bind_textdomain_codeset(),
1.86 - # and both have dgettext
1.87 + # and both have dgettext and ngettext
1.88 #
1.89 if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
1.90 glib_save_LIBS="$LIBS"
1.91 @@ -1255,7 +1272,8 @@
1.92 if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
1.93 gt_cv_func_dgettext_libc=no
1.94 else
1.95 - if test "$gt_cv_func_dgettext_libc" = "yes"; then
1.96 + if test "$gt_cv_func_dgettext_libc" = "yes" \
1.97 + && test "$gt_cv_func_ngettext_libc" = "yes"; then
1.98 gt_cv_func_dgettext_libintl=no
1.99 fi
1.100 fi
1.101 @@ -1370,7 +1388,7 @@
1.102 # on various variables needed by the Makefile.in.in installed by
1.103 # glib-gettextize.
1.104 dnl
1.105 -glib_DEFUN(GLIB_GNU_GETTEXT,
1.106 +glib_DEFUN([GLIB_GNU_GETTEXT],
1.107 [AC_REQUIRE([AC_PROG_CC])dnl
1.108 AC_REQUIRE([AC_HEADER_STDC])dnl
1.109
1.110 @@ -1447,7 +1465,7 @@
1.111 # -------------------------------
1.112 # Define VARIABLE to the location where catalog files will
1.113 # be installed by po/Makefile.
1.114 -glib_DEFUN(GLIB_DEFINE_LOCALEDIR,
1.115 +glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
1.116 [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
1.117 glib_save_prefix="$prefix"
1.118 glib_save_exec_prefix="$exec_prefix"
1.119 @@ -1468,7 +1486,7 @@
1.120 dnl Now the definitions that aclocal will find
1.121 dnl
1.122 ifdef(glib_configure_in,[],[
1.123 -AC_DEFUN(AM_GLIB_GNU_GETTEXT,[GLIB_GNU_GETTEXT($@)])
1.124 -AC_DEFUN(AM_GLIB_DEFINE_LOCALEDIR,[GLIB_DEFINE_LOCALEDIR($@)])
1.125 +AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
1.126 +AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
1.127 ])dnl
1.128
2.1 --- a/configure Thu Dec 08 13:38:00 2005 +0000
2.2 +++ b/configure Sun Dec 11 05:15:36 2005 +0000
2.3 @@ -4783,7 +4783,65 @@
2.4 #
2.5 # First check in libc
2.6 #
2.7 - echo "$as_me:$LINENO: checking for dgettext in libc" >&5
2.8 + echo "$as_me:$LINENO: checking for ngettext in libc" >&5
2.9 +echo $ECHO_N "checking for ngettext in libc... $ECHO_C" >&6
2.10 +if test "${gt_cv_func_ngettext_libc+set}" = set; then
2.11 + echo $ECHO_N "(cached) $ECHO_C" >&6
2.12 +else
2.13 + cat >conftest.$ac_ext <<_ACEOF
2.14 +/* confdefs.h. */
2.15 +_ACEOF
2.16 +cat confdefs.h >>conftest.$ac_ext
2.17 +cat >>conftest.$ac_ext <<_ACEOF
2.18 +/* end confdefs.h. */
2.19 +
2.20 +#include <libintl.h>
2.21 +
2.22 +int
2.23 +main ()
2.24 +{
2.25 +return !ngettext ("","", 1)
2.26 + ;
2.27 + return 0;
2.28 +}
2.29 +_ACEOF
2.30 +rm -f conftest.$ac_objext conftest$ac_exeext
2.31 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
2.32 + (eval $ac_link) 2>conftest.er1
2.33 + ac_status=$?
2.34 + grep -v '^ *+' conftest.er1 >conftest.err
2.35 + rm -f conftest.er1
2.36 + cat conftest.err >&5
2.37 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.38 + (exit $ac_status); } &&
2.39 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
2.40 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2.41 + (eval $ac_try) 2>&5
2.42 + ac_status=$?
2.43 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.44 + (exit $ac_status); }; } &&
2.45 + { ac_try='test -s conftest$ac_exeext'
2.46 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2.47 + (eval $ac_try) 2>&5
2.48 + ac_status=$?
2.49 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.50 + (exit $ac_status); }; }; then
2.51 + gt_cv_func_ngettext_libc=yes
2.52 +else
2.53 + echo "$as_me: failed program was:" >&5
2.54 +sed 's/^/| /' conftest.$ac_ext >&5
2.55 +
2.56 +gt_cv_func_ngettext_libc=no
2.57 +fi
2.58 +rm -f conftest.err conftest.$ac_objext \
2.59 + conftest$ac_exeext conftest.$ac_ext
2.60 +
2.61 +fi
2.62 +echo "$as_me:$LINENO: result: $gt_cv_func_ngettext_libc" >&5
2.63 +echo "${ECHO_T}$gt_cv_func_ngettext_libc" >&6
2.64 +
2.65 + if test "$gt_cv_func_ngettext_libc" = "yes" ; then
2.66 + echo "$as_me:$LINENO: checking for dgettext in libc" >&5
2.67 echo $ECHO_N "checking for dgettext in libc... $ECHO_C" >&6
2.68 if test "${gt_cv_func_dgettext_libc+set}" = set; then
2.69 echo $ECHO_N "(cached) $ECHO_C" >&6
2.70 @@ -4800,7 +4858,7 @@
2.71 int
2.72 main ()
2.73 {
2.74 -return (int) dgettext ("","")
2.75 +return !dgettext ("","")
2.76 ;
2.77 return 0;
2.78 }
2.79 @@ -4839,8 +4897,9 @@
2.80 fi
2.81 echo "$as_me:$LINENO: result: $gt_cv_func_dgettext_libc" >&5
2.82 echo "${ECHO_T}$gt_cv_func_dgettext_libc" >&6
2.83 -
2.84 - if test "$gt_cv_func_dgettext_libc" = "yes" ; then
2.85 + fi
2.86 +
2.87 + if test "$gt_cv_func_ngettext_libc" = "yes" ; then
2.88
2.89 for ac_func in bind_textdomain_codeset
2.90 do
2.91 @@ -4948,6 +5007,7 @@
2.92 # If we don't have everything we want, check in libintl
2.93 #
2.94 if test "$gt_cv_func_dgettext_libc" != "yes" \
2.95 + || test "$gt_cv_func_ngettext_libc" != "yes" \
2.96 || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
2.97
2.98 echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5
2.99 @@ -5014,6 +5074,70 @@
2.100 echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5
2.101 echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6
2.102 if test $ac_cv_lib_intl_bindtextdomain = yes; then
2.103 + echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5
2.104 +echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6
2.105 +if test "${ac_cv_lib_intl_ngettext+set}" = set; then
2.106 + echo $ECHO_N "(cached) $ECHO_C" >&6
2.107 +else
2.108 + ac_check_lib_save_LIBS=$LIBS
2.109 +LIBS="-lintl $LIBS"
2.110 +cat >conftest.$ac_ext <<_ACEOF
2.111 +/* confdefs.h. */
2.112 +_ACEOF
2.113 +cat confdefs.h >>conftest.$ac_ext
2.114 +cat >>conftest.$ac_ext <<_ACEOF
2.115 +/* end confdefs.h. */
2.116 +
2.117 +/* Override any gcc2 internal prototype to avoid an error. */
2.118 +#ifdef __cplusplus
2.119 +extern "C"
2.120 +#endif
2.121 +/* We use char because int might match the return type of a gcc2
2.122 + builtin and then its argument prototype would still apply. */
2.123 +char ngettext ();
2.124 +int
2.125 +main ()
2.126 +{
2.127 +ngettext ();
2.128 + ;
2.129 + return 0;
2.130 +}
2.131 +_ACEOF
2.132 +rm -f conftest.$ac_objext conftest$ac_exeext
2.133 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
2.134 + (eval $ac_link) 2>conftest.er1
2.135 + ac_status=$?
2.136 + grep -v '^ *+' conftest.er1 >conftest.err
2.137 + rm -f conftest.er1
2.138 + cat conftest.err >&5
2.139 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.140 + (exit $ac_status); } &&
2.141 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
2.142 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2.143 + (eval $ac_try) 2>&5
2.144 + ac_status=$?
2.145 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.146 + (exit $ac_status); }; } &&
2.147 + { ac_try='test -s conftest$ac_exeext'
2.148 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2.149 + (eval $ac_try) 2>&5
2.150 + ac_status=$?
2.151 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.152 + (exit $ac_status); }; }; then
2.153 + ac_cv_lib_intl_ngettext=yes
2.154 +else
2.155 + echo "$as_me: failed program was:" >&5
2.156 +sed 's/^/| /' conftest.$ac_ext >&5
2.157 +
2.158 +ac_cv_lib_intl_ngettext=no
2.159 +fi
2.160 +rm -f conftest.err conftest.$ac_objext \
2.161 + conftest$ac_exeext conftest.$ac_ext
2.162 +LIBS=$ac_check_lib_save_LIBS
2.163 +fi
2.164 +echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5
2.165 +echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6
2.166 +if test $ac_cv_lib_intl_ngettext = yes; then
2.167 echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5
2.168 echo $ECHO_N "checking for dgettext in -lintl... $ECHO_C" >&6
2.169 if test "${ac_cv_lib_intl_dgettext+set}" = set; then
2.170 @@ -5083,13 +5207,79 @@
2.171
2.172 fi
2.173
2.174 +fi
2.175 +
2.176
2.177 if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
2.178 echo "$as_me:$LINENO: checking if -liconv is needed to use gettext" >&5
2.179 echo $ECHO_N "checking if -liconv is needed to use gettext... $ECHO_C" >&6
2.180 echo "$as_me:$LINENO: result: " >&5
2.181 echo "${ECHO_T}" >&6
2.182 - echo "$as_me:$LINENO: checking for dcgettext in -lintl" >&5
2.183 + echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5
2.184 +echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6
2.185 +if test "${ac_cv_lib_intl_ngettext+set}" = set; then
2.186 + echo $ECHO_N "(cached) $ECHO_C" >&6
2.187 +else
2.188 + ac_check_lib_save_LIBS=$LIBS
2.189 +LIBS="-lintl -liconv $LIBS"
2.190 +cat >conftest.$ac_ext <<_ACEOF
2.191 +/* confdefs.h. */
2.192 +_ACEOF
2.193 +cat confdefs.h >>conftest.$ac_ext
2.194 +cat >>conftest.$ac_ext <<_ACEOF
2.195 +/* end confdefs.h. */
2.196 +
2.197 +/* Override any gcc2 internal prototype to avoid an error. */
2.198 +#ifdef __cplusplus
2.199 +extern "C"
2.200 +#endif
2.201 +/* We use char because int might match the return type of a gcc2
2.202 + builtin and then its argument prototype would still apply. */
2.203 +char ngettext ();
2.204 +int
2.205 +main ()
2.206 +{
2.207 +ngettext ();
2.208 + ;
2.209 + return 0;
2.210 +}
2.211 +_ACEOF
2.212 +rm -f conftest.$ac_objext conftest$ac_exeext
2.213 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
2.214 + (eval $ac_link) 2>conftest.er1
2.215 + ac_status=$?
2.216 + grep -v '^ *+' conftest.er1 >conftest.err
2.217 + rm -f conftest.er1
2.218 + cat conftest.err >&5
2.219 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.220 + (exit $ac_status); } &&
2.221 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
2.222 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2.223 + (eval $ac_try) 2>&5
2.224 + ac_status=$?
2.225 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.226 + (exit $ac_status); }; } &&
2.227 + { ac_try='test -s conftest$ac_exeext'
2.228 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2.229 + (eval $ac_try) 2>&5
2.230 + ac_status=$?
2.231 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
2.232 + (exit $ac_status); }; }; then
2.233 + ac_cv_lib_intl_ngettext=yes
2.234 +else
2.235 + echo "$as_me: failed program was:" >&5
2.236 +sed 's/^/| /' conftest.$ac_ext >&5
2.237 +
2.238 +ac_cv_lib_intl_ngettext=no
2.239 +fi
2.240 +rm -f conftest.err conftest.$ac_objext \
2.241 + conftest$ac_exeext conftest.$ac_ext
2.242 +LIBS=$ac_check_lib_save_LIBS
2.243 +fi
2.244 +echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5
2.245 +echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6
2.246 +if test $ac_cv_lib_intl_ngettext = yes; then
2.247 + echo "$as_me:$LINENO: checking for dcgettext in -lintl" >&5
2.248 echo $ECHO_N "checking for dcgettext in -lintl... $ECHO_C" >&6
2.249 if test "${ac_cv_lib_intl_dcgettext+set}" = set; then
2.250 echo $ECHO_N "(cached) $ECHO_C" >&6
2.251 @@ -5159,12 +5349,16 @@
2.252 :
2.253 fi
2.254
2.255 +else
2.256 + :
2.257 +fi
2.258 +
2.259 fi
2.260
2.261 #
2.262 # If we found libintl, then check in it for bind_textdomain_codeset();
2.263 # we'll prefer libc if neither have bind_textdomain_codeset(),
2.264 - # and both have dgettext
2.265 + # and both have dgettext and ngettext
2.266 #
2.267 if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
2.268 glib_save_LIBS="$LIBS"
2.269 @@ -5276,7 +5470,8 @@
2.270 if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
2.271 gt_cv_func_dgettext_libc=no
2.272 else
2.273 - if test "$gt_cv_func_dgettext_libc" = "yes"; then
2.274 + if test "$gt_cv_func_dgettext_libc" = "yes" \
2.275 + && test "$gt_cv_func_ngettext_libc" = "yes"; then
2.276 gt_cv_func_dgettext_libintl=no
2.277 fi
2.278 fi
3.1 --- a/dream.glade Thu Dec 08 13:38:00 2005 +0000
3.2 +++ b/dream.glade Sun Dec 11 05:15:36 2005 +0000
3.3 @@ -15,6 +15,12 @@
3.4 <property name="default_height">700</property>
3.5 <property name="resizable">True</property>
3.6 <property name="destroy_with_parent">False</property>
3.7 + <property name="decorated">True</property>
3.8 + <property name="skip_taskbar_hint">False</property>
3.9 + <property name="skip_pager_hint">False</property>
3.10 + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
3.11 + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
3.12 + <property name="focus_on_map">True</property>
3.13 <property name="enable_layout_config">True</property>
3.14 <signal name="delete_event" handler="on_debug_win_delete_event"/>
3.15
3.16 @@ -191,78 +197,128 @@
3.17 <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
3.18 <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
3.19 <property name="tooltips">True</property>
3.20 + <property name="show_arrow">True</property>
3.21
3.22 <child>
3.23 - <widget class="button" id="load_btn">
3.24 + <widget class="GtkToolButton" id="load_btn">
3.25 <property name="visible">True</property>
3.26 <property name="tooltip" translatable="yes">New File</property>
3.27 <property name="label" translatable="yes">Load</property>
3.28 <property name="use_underline">True</property>
3.29 - <property name="stock_pixmap">gtk-open</property>
3.30 + <property name="stock_id">gtk-open</property>
3.31 + <property name="visible_horizontal">True</property>
3.32 + <property name="visible_vertical">True</property>
3.33 + <property name="is_important">False</property>
3.34 <signal name="clicked" handler="on_load_btn_clicked"/>
3.35 </widget>
3.36 + <packing>
3.37 + <property name="expand">False</property>
3.38 + <property name="homogeneous">True</property>
3.39 + </packing>
3.40 </child>
3.41
3.42 <child>
3.43 - <widget class="button" id="reset_btn">
3.44 + <widget class="GtkToolButton" id="reset_btn">
3.45 <property name="visible">True</property>
3.46 <property name="tooltip" translatable="yes">Open File</property>
3.47 <property name="label" translatable="yes">Reset</property>
3.48 <property name="use_underline">True</property>
3.49 - <property name="stock_pixmap">gtk-refresh</property>
3.50 + <property name="stock_id">gtk-refresh</property>
3.51 + <property name="visible_horizontal">True</property>
3.52 + <property name="visible_vertical">True</property>
3.53 + <property name="is_important">False</property>
3.54 <signal name="clicked" handler="on_reset_btn_clicked"/>
3.55 </widget>
3.56 + <packing>
3.57 + <property name="expand">False</property>
3.58 + <property name="homogeneous">True</property>
3.59 + </packing>
3.60 </child>
3.61
3.62 <child>
3.63 - <widget class="button" id="stop_btn">
3.64 + <widget class="GtkToolButton" id="stop_btn">
3.65 <property name="visible">True</property>
3.66 <property name="tooltip" translatable="yes">Save File</property>
3.67 <property name="label" translatable="yes">Stop</property>
3.68 <property name="use_underline">True</property>
3.69 - <property name="stock_pixmap">gtk-stop</property>
3.70 + <property name="stock_id">gtk-stop</property>
3.71 + <property name="visible_horizontal">True</property>
3.72 + <property name="visible_vertical">True</property>
3.73 + <property name="is_important">False</property>
3.74 <signal name="clicked" handler="on_stop_btn_clicked"/>
3.75 </widget>
3.76 + <packing>
3.77 + <property name="expand">False</property>
3.78 + <property name="homogeneous">True</property>
3.79 + </packing>
3.80 </child>
3.81
3.82 <child>
3.83 - <widget class="button" id="step_btn">
3.84 + <widget class="GtkToolButton" id="step_btn">
3.85 <property name="visible">True</property>
3.86 <property name="label" translatable="yes">Step</property>
3.87 <property name="use_underline">True</property>
3.88 - <property name="stock_pixmap">gtk-redo</property>
3.89 + <property name="stock_id">gtk-redo</property>
3.90 + <property name="visible_horizontal">True</property>
3.91 + <property name="visible_vertical">True</property>
3.92 + <property name="is_important">False</property>
3.93 <signal name="clicked" handler="on_step_btn_clicked"/>
3.94 </widget>
3.95 + <packing>
3.96 + <property name="expand">False</property>
3.97 + <property name="homogeneous">True</property>
3.98 + </packing>
3.99 </child>
3.100
3.101 <child>
3.102 - <widget class="button" id="run_btn">
3.103 + <widget class="GtkToolButton" id="run_btn">
3.104 <property name="visible">True</property>
3.105 <property name="label" translatable="yes">Run</property>
3.106 <property name="use_underline">True</property>
3.107 - <property name="stock_pixmap">gtk-go-forward</property>
3.108 + <property name="stock_id">gtk-go-forward</property>
3.109 + <property name="visible_horizontal">True</property>
3.110 + <property name="visible_vertical">True</property>
3.111 + <property name="is_important">False</property>
3.112 <signal name="clicked" handler="on_run_btn_clicked"/>
3.113 </widget>
3.114 + <packing>
3.115 + <property name="expand">False</property>
3.116 + <property name="homogeneous">True</property>
3.117 + </packing>
3.118 </child>
3.119
3.120 <child>
3.121 - <widget class="button" id="runto_btn">
3.122 + <widget class="GtkToolButton" id="runto_btn">
3.123 <property name="visible">True</property>
3.124 <property name="label" translatable="yes">Run to</property>
3.125 <property name="use_underline">True</property>
3.126 - <property name="stock_pixmap">gtk-goto-last</property>
3.127 + <property name="stock_id">gtk-goto-last</property>
3.128 + <property name="visible_horizontal">True</property>
3.129 + <property name="visible_vertical">True</property>
3.130 + <property name="is_important">False</property>
3.131 <signal name="clicked" handler="on_runto_btn_clicked"/>
3.132 </widget>
3.133 + <packing>
3.134 + <property name="expand">False</property>
3.135 + <property name="homogeneous">True</property>
3.136 + </packing>
3.137 </child>
3.138
3.139 <child>
3.140 - <widget class="button" id="break_btn">
3.141 + <widget class="GtkToolButton" id="break_btn">
3.142 <property name="visible">True</property>
3.143 <property name="label" translatable="yes">Break</property>
3.144 <property name="use_underline">True</property>
3.145 - <property name="stock_pixmap">gtk-close</property>
3.146 + <property name="stock_id">gtk-close</property>
3.147 + <property name="visible_horizontal">True</property>
3.148 + <property name="visible_vertical">True</property>
3.149 + <property name="is_important">False</property>
3.150 <signal name="clicked" handler="on_break_btn_clicked"/>
3.151 </widget>
3.152 + <packing>
3.153 + <property name="expand">False</property>
3.154 + <property name="homogeneous">True</property>
3.155 + </packing>
3.156 </child>
3.157 </widget>
3.158 </child>
3.159 @@ -313,6 +369,10 @@
3.160 <property name="yalign">0.5</property>
3.161 <property name="xpad">0</property>
3.162 <property name="ypad">0</property>
3.163 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.164 + <property name="width_chars">-1</property>
3.165 + <property name="single_line_mode">False</property>
3.166 + <property name="angle">0</property>
3.167 </widget>
3.168 <packing>
3.169 <property name="padding">4</property>
3.170 @@ -330,7 +390,7 @@
3.171 <property name="max_length">0</property>
3.172 <property name="text" translatable="yes"></property>
3.173 <property name="has_frame">True</property>
3.174 - <property name="invisible_char" translatable="yes">*</property>
3.175 + <property name="invisible_char">*</property>
3.176 <property name="activates_default">False</property>
3.177 <signal name="key_press_event" handler="on_page_field_key_press_event"/>
3.178 </widget>
3.179 @@ -348,6 +408,7 @@
3.180 <property name="label" translatable="yes">Locked</property>
3.181 <property name="use_underline">True</property>
3.182 <property name="relief">GTK_RELIEF_NORMAL</property>
3.183 + <property name="focus_on_click">True</property>
3.184 <property name="active">False</property>
3.185 <property name="inconsistent">False</property>
3.186 <property name="draw_indicator">True</property>
3.187 @@ -367,6 +428,7 @@
3.188 <property name="label" translatable="yes"> Jump to PC </property>
3.189 <property name="use_underline">True</property>
3.190 <property name="relief">GTK_RELIEF_NORMAL</property>
3.191 + <property name="focus_on_click">True</property>
3.192 <signal name="clicked" handler="on_jump_pc_btn_clicked"/>
3.193 </widget>
3.194 <packing>
3.195 @@ -389,6 +451,10 @@
3.196 <property name="yalign">0.5</property>
3.197 <property name="xpad">0</property>
3.198 <property name="ypad">0</property>
3.199 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.200 + <property name="width_chars">-1</property>
3.201 + <property name="single_line_mode">False</property>
3.202 + <property name="angle">0</property>
3.203 </widget>
3.204 <packing>
3.205 <property name="padding">5</property>
3.206 @@ -410,12 +476,12 @@
3.207 <widget class="GtkEntry" id="mode_field">
3.208 <property name="visible">True</property>
3.209 <property name="can_focus">True</property>
3.210 - <property name="editable">True</property>
3.211 + <property name="editable">False</property>
3.212 <property name="visibility">True</property>
3.213 <property name="max_length">0</property>
3.214 - <property name="text" translatable="yes"></property>
3.215 + <property name="text" translatable="yes">SH4</property>
3.216 <property name="has_frame">True</property>
3.217 - <property name="invisible_char" translatable="yes">*</property>
3.218 + <property name="invisible_char">*</property>
3.219 <property name="activates_default">False</property>
3.220 <signal name="changed" handler="on_mode_field_changed"/>
3.221 </widget>
3.222 @@ -427,24 +493,26 @@
3.223 <property name="selection_mode">GTK_SELECTION_BROWSE</property>
3.224
3.225 <child>
3.226 - <widget class="GtkListItem" id="convertwidget2">
3.227 + <widget class="GtkListItem" id="listitem3">
3.228 <property name="visible">True</property>
3.229 + <property name="can_focus">True</property>
3.230 + <property name="label" translatable="yes">SH4</property>
3.231 + </widget>
3.232 + </child>
3.233
3.234 - <child>
3.235 - <widget class="GtkLabel" id="convertwidget3">
3.236 - <property name="visible">True</property>
3.237 - <property name="label" translatable="yes"></property>
3.238 - <property name="use_underline">False</property>
3.239 - <property name="use_markup">False</property>
3.240 - <property name="justify">GTK_JUSTIFY_LEFT</property>
3.241 - <property name="wrap">False</property>
3.242 - <property name="selectable">False</property>
3.243 - <property name="xalign">0</property>
3.244 - <property name="yalign">0.5</property>
3.245 - <property name="xpad">0</property>
3.246 - <property name="ypad">0</property>
3.247 - </widget>
3.248 - </child>
3.249 + <child>
3.250 + <widget class="GtkListItem" id="listitem4">
3.251 + <property name="visible">True</property>
3.252 + <property name="can_focus">True</property>
3.253 + <property name="label" translatable="yes">ARM7</property>
3.254 + </widget>
3.255 + </child>
3.256 +
3.257 + <child>
3.258 + <widget class="GtkListItem" id="listitem5">
3.259 + <property name="visible">True</property>
3.260 + <property name="can_focus">True</property>
3.261 + <property name="label" translatable="yes">ARM7T</property>
3.262 </widget>
3.263 </child>
3.264 </widget>
3.265 @@ -470,6 +538,10 @@
3.266 <property name="yalign">0.5</property>
3.267 <property name="xpad">0</property>
3.268 <property name="ypad">0</property>
3.269 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.270 + <property name="width_chars">-1</property>
3.271 + <property name="single_line_mode">False</property>
3.272 + <property name="angle">0</property>
3.273 </widget>
3.274 <packing>
3.275 <property name="padding">4</property>
3.276 @@ -518,6 +590,10 @@
3.277 <property name="yalign">0.5</property>
3.278 <property name="xpad">0</property>
3.279 <property name="ypad">0</property>
3.280 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.281 + <property name="width_chars">-1</property>
3.282 + <property name="single_line_mode">False</property>
3.283 + <property name="angle">0</property>
3.284 </widget>
3.285 </child>
3.286
3.287 @@ -534,6 +610,10 @@
3.288 <property name="yalign">0.5</property>
3.289 <property name="xpad">0</property>
3.290 <property name="ypad">0</property>
3.291 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.292 + <property name="width_chars">-1</property>
3.293 + <property name="single_line_mode">False</property>
3.294 + <property name="angle">0</property>
3.295 </widget>
3.296 </child>
3.297
3.298 @@ -550,6 +630,10 @@
3.299 <property name="yalign">0.5</property>
3.300 <property name="xpad">0</property>
3.301 <property name="ypad">0</property>
3.302 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.303 + <property name="width_chars">-1</property>
3.304 + <property name="single_line_mode">False</property>
3.305 + <property name="angle">0</property>
3.306 </widget>
3.307 </child>
3.308
3.309 @@ -566,6 +650,10 @@
3.310 <property name="yalign">0.5</property>
3.311 <property name="xpad">0</property>
3.312 <property name="ypad">0</property>
3.313 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.314 + <property name="width_chars">-1</property>
3.315 + <property name="single_line_mode">False</property>
3.316 + <property name="angle">0</property>
3.317 </widget>
3.318 </child>
3.319 </widget>
3.320 @@ -615,6 +703,10 @@
3.321 <property name="yalign">0.5</property>
3.322 <property name="xpad">0</property>
3.323 <property name="ypad">0</property>
3.324 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.325 + <property name="width_chars">-1</property>
3.326 + <property name="single_line_mode">False</property>
3.327 + <property name="angle">0</property>
3.328 </widget>
3.329 </child>
3.330
3.331 @@ -631,6 +723,10 @@
3.332 <property name="yalign">0.5</property>
3.333 <property name="xpad">0</property>
3.334 <property name="ypad">0</property>
3.335 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.336 + <property name="width_chars">-1</property>
3.337 + <property name="single_line_mode">False</property>
3.338 + <property name="angle">0</property>
3.339 </widget>
3.340 </child>
3.341 </widget>
3.342 @@ -680,6 +776,10 @@
3.343 <property name="yalign">0.5</property>
3.344 <property name="xpad">0</property>
3.345 <property name="ypad">0</property>
3.346 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.347 + <property name="width_chars">-1</property>
3.348 + <property name="single_line_mode">False</property>
3.349 + <property name="angle">0</property>
3.350 </widget>
3.351 </child>
3.352
3.353 @@ -696,6 +796,10 @@
3.354 <property name="yalign">0.5</property>
3.355 <property name="xpad">0</property>
3.356 <property name="ypad">0</property>
3.357 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.358 + <property name="width_chars">-1</property>
3.359 + <property name="single_line_mode">False</property>
3.360 + <property name="angle">0</property>
3.361 </widget>
3.362 </child>
3.363
3.364 @@ -712,6 +816,10 @@
3.365 <property name="yalign">0.5</property>
3.366 <property name="xpad">0</property>
3.367 <property name="ypad">0</property>
3.368 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.369 + <property name="width_chars">-1</property>
3.370 + <property name="single_line_mode">False</property>
3.371 + <property name="angle">0</property>
3.372 </widget>
3.373 </child>
3.374 </widget>
3.375 @@ -756,6 +864,12 @@
3.376 <property name="default_height">600</property>
3.377 <property name="resizable">True</property>
3.378 <property name="destroy_with_parent">False</property>
3.379 + <property name="decorated">True</property>
3.380 + <property name="skip_taskbar_hint">False</property>
3.381 + <property name="skip_pager_hint">False</property>
3.382 + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
3.383 + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
3.384 + <property name="focus_on_map">True</property>
3.385 <signal name="delete_event" handler="on_mmr_win_delete_event"/>
3.386
3.387 <child>
3.388 @@ -791,6 +905,10 @@
3.389 <property name="yalign">0.5</property>
3.390 <property name="xpad">0</property>
3.391 <property name="ypad">0</property>
3.392 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.393 + <property name="width_chars">-1</property>
3.394 + <property name="single_line_mode">False</property>
3.395 + <property name="angle">0</property>
3.396 </widget>
3.397 <packing>
3.398 <property name="type">tab</property>
3.399 @@ -818,6 +936,7 @@
3.400 <property name="label" translatable="yes">Close</property>
3.401 <property name="use_underline">True</property>
3.402 <property name="relief">GTK_RELIEF_NORMAL</property>
3.403 + <property name="focus_on_click">True</property>
3.404 <signal name="clicked" handler="on_mmr_close_clicked"/>
3.405 </widget>
3.406 </child>
3.407 @@ -836,6 +955,12 @@
3.408 <property name="border_width">1</property>
3.409 <property name="visible">True</property>
3.410 <property name="destroy_with_parent">False</property>
3.411 + <property name="decorated">True</property>
3.412 + <property name="skip_taskbar_hint">False</property>
3.413 + <property name="skip_pager_hint">False</property>
3.414 + <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
3.415 + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
3.416 + <property name="focus_on_map">True</property>
3.417 <property name="logo">dcemu.gif</property>
3.418 <property name="copyright" translatable="yes">Copyright(c) 2002 Nathan Keynes</property>
3.419 <property name="comments" translatable="yes"></property>
3.420 @@ -852,6 +977,12 @@
3.421 <property name="modal">False</property>
3.422 <property name="resizable">True</property>
3.423 <property name="destroy_with_parent">False</property>
3.424 + <property name="decorated">True</property>
3.425 + <property name="skip_taskbar_hint">False</property>
3.426 + <property name="skip_pager_hint">False</property>
3.427 + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
3.428 + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
3.429 + <property name="focus_on_map">True</property>
3.430
3.431 <child>
3.432 <widget class="GtkVBox" id="vbox3">
3.433 @@ -878,6 +1009,10 @@
3.434 <property name="yalign">0.5</property>
3.435 <property name="xpad">0</property>
3.436 <property name="ypad">0</property>
3.437 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.438 + <property name="width_chars">-1</property>
3.439 + <property name="single_line_mode">False</property>
3.440 + <property name="angle">0</property>
3.441 </widget>
3.442 <packing>
3.443 <property name="padding">0</property>
3.444 @@ -895,7 +1030,7 @@
3.445 <property name="max_length">0</property>
3.446 <property name="text" translatable="yes"></property>
3.447 <property name="has_frame">True</property>
3.448 - <property name="invisible_char" translatable="yes">*</property>
3.449 + <property name="invisible_char">*</property>
3.450 <property name="activates_default">False</property>
3.451 </widget>
3.452 <packing>
3.453 @@ -918,6 +1053,10 @@
3.454 <property name="yalign">0.5</property>
3.455 <property name="xpad">0</property>
3.456 <property name="ypad">0</property>
3.457 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.458 + <property name="width_chars">-1</property>
3.459 + <property name="single_line_mode">False</property>
3.460 + <property name="angle">0</property>
3.461 </widget>
3.462 <packing>
3.463 <property name="padding">0</property>
3.464 @@ -935,7 +1074,7 @@
3.465 <property name="max_length">0</property>
3.466 <property name="text" translatable="yes"></property>
3.467 <property name="has_frame">True</property>
3.468 - <property name="invisible_char" translatable="yes">*</property>
3.469 + <property name="invisible_char">*</property>
3.470 <property name="activates_default">False</property>
3.471 </widget>
3.472 <packing>
3.473 @@ -952,6 +1091,7 @@
3.474 <property name="label" translatable="yes">View</property>
3.475 <property name="use_underline">True</property>
3.476 <property name="relief">GTK_RELIEF_NORMAL</property>
3.477 + <property name="focus_on_click">True</property>
3.478 </widget>
3.479 <packing>
3.480 <property name="padding">0</property>
3.481 @@ -973,6 +1113,10 @@
3.482 <property name="yalign">0.5</property>
3.483 <property name="xpad">0</property>
3.484 <property name="ypad">0</property>
3.485 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.486 + <property name="width_chars">-1</property>
3.487 + <property name="single_line_mode">False</property>
3.488 + <property name="angle">0</property>
3.489 </widget>
3.490 <packing>
3.491 <property name="padding">0</property>
3.492 @@ -1002,6 +1146,8 @@
3.493 <property name="visible">True</property>
3.494 <property name="can_focus">True</property>
3.495 <property name="editable">True</property>
3.496 + <property name="overwrite">False</property>
3.497 + <property name="accepts_tab">True</property>
3.498 <property name="justification">GTK_JUSTIFY_LEFT</property>
3.499 <property name="wrap_mode">GTK_WRAP_NONE</property>
3.500 <property name="cursor_visible">True</property>
3.501 @@ -1033,6 +1179,12 @@
3.502 <property name="modal">False</property>
3.503 <property name="resizable">True</property>
3.504 <property name="destroy_with_parent">False</property>
3.505 + <property name="decorated">True</property>
3.506 + <property name="skip_taskbar_hint">False</property>
3.507 + <property name="skip_pager_hint">False</property>
3.508 + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
3.509 + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
3.510 + <property name="focus_on_map">True</property>
3.511
3.512 <child>
3.513 <widget class="GtkVBox" id="vbox4">
3.514 @@ -1059,6 +1211,10 @@
3.515 <property name="yalign">0.5</property>
3.516 <property name="xpad">0</property>
3.517 <property name="ypad">0</property>
3.518 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.519 + <property name="width_chars">-1</property>
3.520 + <property name="single_line_mode">False</property>
3.521 + <property name="angle">0</property>
3.522 </widget>
3.523 <packing>
3.524 <property name="padding">3</property>
3.525 @@ -1076,7 +1232,7 @@
3.526 <property name="max_length">0</property>
3.527 <property name="text" translatable="yes"></property>
3.528 <property name="has_frame">True</property>
3.529 - <property name="invisible_char" translatable="yes">*</property>
3.530 + <property name="invisible_char">*</property>
3.531 <property name="activates_default">False</property>
3.532 </widget>
3.533 <packing>
3.534 @@ -1099,6 +1255,10 @@
3.535 <property name="yalign">0.5</property>
3.536 <property name="xpad">0</property>
3.537 <property name="ypad">0</property>
3.538 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.539 + <property name="width_chars">-1</property>
3.540 + <property name="single_line_mode">False</property>
3.541 + <property name="angle">0</property>
3.542 </widget>
3.543 <packing>
3.544 <property name="padding">3</property>
3.545 @@ -1116,7 +1276,7 @@
3.546 <property name="max_length">0</property>
3.547 <property name="text" translatable="yes"></property>
3.548 <property name="has_frame">True</property>
3.549 - <property name="invisible_char" translatable="yes">*</property>
3.550 + <property name="invisible_char">*</property>
3.551 <property name="activates_default">False</property>
3.552 </widget>
3.553 <packing>
3.554 @@ -1139,6 +1299,10 @@
3.555 <property name="yalign">0.5</property>
3.556 <property name="xpad">0</property>
3.557 <property name="ypad">0</property>
3.558 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.559 + <property name="width_chars">-1</property>
3.560 + <property name="single_line_mode">False</property>
3.561 + <property name="angle">0</property>
3.562 </widget>
3.563 <packing>
3.564 <property name="padding">3</property>
3.565 @@ -1165,7 +1329,7 @@
3.566 <property name="max_length">0</property>
3.567 <property name="text" translatable="yes"></property>
3.568 <property name="has_frame">True</property>
3.569 - <property name="invisible_char" translatable="yes">*</property>
3.570 + <property name="invisible_char">*</property>
3.571 <property name="activates_default">False</property>
3.572 </widget>
3.573 </child>
3.574 @@ -1191,6 +1355,7 @@
3.575 <property name="label" translatable="yes">Add Watch</property>
3.576 <property name="use_underline">True</property>
3.577 <property name="relief">GTK_RELIEF_NORMAL</property>
3.578 + <property name="focus_on_click">True</property>
3.579 <signal name="clicked" handler="on_button_add_watch_clicked" last_modification_time="Sat, 13 Mar 2004 03:48:52 GMT"/>
3.580 </widget>
3.581 <packing>
3.582 @@ -1224,6 +1389,9 @@
3.583 <property name="rules_hint">False</property>
3.584 <property name="reorderable">False</property>
3.585 <property name="enable_search">False</property>
3.586 + <property name="fixed_height_mode">False</property>
3.587 + <property name="hover_selection">False</property>
3.588 + <property name="hover_expand">False</property>
3.589 </widget>
3.590 </child>
3.591 </widget>
3.592 @@ -1253,6 +1421,10 @@
3.593 <property name="yalign">0.5</property>
3.594 <property name="xpad">0</property>
3.595 <property name="ypad">0</property>
3.596 + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
3.597 + <property name="width_chars">-1</property>
3.598 + <property name="single_line_mode">False</property>
3.599 + <property name="angle">0</property>
3.600 </widget>
3.601 <packing>
3.602 <property name="padding">0</property>
3.603 @@ -1268,6 +1440,7 @@
3.604 <property name="label" translatable="yes">Clear all</property>
3.605 <property name="use_underline">True</property>
3.606 <property name="relief">GTK_RELIEF_NORMAL</property>
3.607 + <property name="focus_on_click">True</property>
3.608 <signal name="clicked" handler="on_button_clear_all_clicked" last_modification_time="Sat, 13 Mar 2004 04:50:23 GMT"/>
3.609 </widget>
3.610 <packing>
3.611 @@ -1284,6 +1457,7 @@
3.612 <property name="label" translatable="yes">Close</property>
3.613 <property name="use_underline">True</property>
3.614 <property name="relief">GTK_RELIEF_NORMAL</property>
3.615 + <property name="focus_on_click">True</property>
3.616 <signal name="clicked" handler="on_button_close_clicked" last_modification_time="Sat, 13 Mar 2004 04:50:29 GMT"/>
3.617 </widget>
3.618 <packing>
4.1 --- a/dream.gladep Thu Dec 08 13:38:00 2005 +0000
4.2 +++ b/dream.gladep Sun Dec 11 05:15:36 2005 +0000
4.3 @@ -2,6 +2,6 @@
4.4 <!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
4.5
4.6 <glade-project>
4.7 - <name>Dream2</name>
4.8 + <name>Dream</name>
4.9 <program_name>dream</program_name>
4.10 </glade-project>
5.1 --- a/po/Makefile.in.in Thu Dec 08 13:38:00 2005 +0000
5.2 +++ b/po/Makefile.in.in Sun Dec 11 05:15:36 2005 +0000
5.3 @@ -78,7 +78,7 @@
5.4
5.5 .po.gmo:
5.6 file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
5.7 - && rm -f $$file && $(GMSGFMT) -o $$file $<
5.8 + && rm -f $$file && $(GMSGFMT) -c -o $$file $<
5.9
5.10 .po.cat:
5.11 sed -f ../intl/po2msg.sed < $< > $*.msg \
5.12 @@ -93,6 +93,21 @@
5.13 $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES)
5.14 $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \
5.15 --add-comments --keyword=_ --keyword=N_ \
5.16 + --flag=g_strdup_printf:1:c-format \
5.17 + --flag=g_string_printf:2:c-format \
5.18 + --flag=g_string_append_printf:2:c-format \
5.19 + --flag=g_error_new:3:c-format \
5.20 + --flag=g_set_error:4:c-format \
5.21 + --flag=g_markup_printf_escaped:1:c-format \
5.22 + --flag=g_log:3:c-format \
5.23 + --flag=g_print:1:c-format \
5.24 + --flag=g_printerr:1:c-format \
5.25 + --flag=g_printf:1:c-format \
5.26 + --flag=g_fprintf:2:c-format \
5.27 + --flag=g_sprintf:2:c-format \
5.28 + --flag=g_snprintf:3:c-format \
5.29 + --flag=g_scanner_error:2:c-format \
5.30 + --flag=g_scanner_warn:2:c-format \
5.31 --files-from=$(srcdir)/POTFILES.in \
5.32 && test ! -f $(GETTEXT_PACKAGE).po \
5.33 || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \
6.1 --- a/src/Makefile.am Thu Dec 08 13:38:00 2005 +0000
6.2 +++ b/src/Makefile.am Sun Dec 11 05:15:36 2005 +0000
6.3 @@ -14,10 +14,11 @@
6.4 interface.c interface.h \
6.5 callbacks.c callbacks.h \
6.6 gui.c gui.h mmr_win.c debug_win.c dump_win.c \
6.7 + mem.c mem.h mmio.h \
6.8 asic.c asic.h pvr2.c pvr2.h ide.c ide.h \
6.9 video.c dreamcast.c dreamcast.h aica.c aica.h\
6.10 maple.c maple.h maple/controller.c maple/controller.h \
6.11 - sh4/intc.c sh4/intc.h sh4/mem.c sh4/mem.h sh4/mmio.h \
6.12 + sh4/intc.c sh4/intc.h sh4/sh4mem.c \
6.13 sh4/sh4core.c sh4/sh4core.h sh4/sh4dasm.c sh4/sh4dasm.h \
6.14 sh4/sh4mmio.c sh4/sh4mmio.h sh4/watch.c \
6.15 fileio.c ipbin.c
7.1 --- a/src/Makefile.in Thu Dec 08 13:38:00 2005 +0000
7.2 +++ b/src/Makefile.in Sun Dec 11 05:15:36 2005 +0000
7.3 @@ -141,10 +141,11 @@
7.4 interface.c interface.h \
7.5 callbacks.c callbacks.h \
7.6 gui.c gui.h mmr_win.c debug_win.c dump_win.c \
7.7 + mem.c mem.h mmio.h \
7.8 asic.c asic.h pvr2.c pvr2.h ide.c ide.h \
7.9 video.c dreamcast.c dreamcast.h aica.c aica.h\
7.10 maple.c maple.h maple/controller.c maple/controller.h \
7.11 - sh4/intc.c sh4/intc.h sh4/mem.c sh4/mem.h sh4/mmio.h \
7.12 + sh4/intc.c sh4/intc.h sh4/sh4mem.c \
7.13 sh4/sh4core.c sh4/sh4core.h sh4/sh4dasm.c sh4/sh4dasm.h \
7.14 sh4/sh4mmio.c sh4/sh4mmio.h sh4/watch.c \
7.15 fileio.c ipbin.c
7.16 @@ -163,10 +164,10 @@
7.17
7.18 am_dream_OBJECTS = main.$(OBJEXT) support.$(OBJEXT) interface.$(OBJEXT) \
7.19 callbacks.$(OBJEXT) gui.$(OBJEXT) mmr_win.$(OBJEXT) \
7.20 - debug_win.$(OBJEXT) dump_win.$(OBJEXT) asic.$(OBJEXT) \
7.21 - pvr2.$(OBJEXT) ide.$(OBJEXT) video.$(OBJEXT) \
7.22 + debug_win.$(OBJEXT) dump_win.$(OBJEXT) mem.$(OBJEXT) \
7.23 + asic.$(OBJEXT) pvr2.$(OBJEXT) ide.$(OBJEXT) video.$(OBJEXT) \
7.24 dreamcast.$(OBJEXT) aica.$(OBJEXT) maple.$(OBJEXT) \
7.25 - controller.$(OBJEXT) intc.$(OBJEXT) mem.$(OBJEXT) \
7.26 + controller.$(OBJEXT) intc.$(OBJEXT) sh4mem.$(OBJEXT) \
7.27 sh4core.$(OBJEXT) sh4dasm.$(OBJEXT) sh4mmio.$(OBJEXT) \
7.28 watch.$(OBJEXT) fileio.$(OBJEXT) ipbin.$(OBJEXT)
7.29 dream_OBJECTS = $(am_dream_OBJECTS)
7.30 @@ -186,8 +187,9 @@
7.31 @AMDEP_TRUE@ ./$(DEPDIR)/maple.Po ./$(DEPDIR)/mem.Po \
7.32 @AMDEP_TRUE@ ./$(DEPDIR)/mmr_win.Po ./$(DEPDIR)/pvr2.Po \
7.33 @AMDEP_TRUE@ ./$(DEPDIR)/sh4core.Po ./$(DEPDIR)/sh4dasm.Po \
7.34 -@AMDEP_TRUE@ ./$(DEPDIR)/sh4mmio.Po ./$(DEPDIR)/support.Po \
7.35 -@AMDEP_TRUE@ ./$(DEPDIR)/video.Po ./$(DEPDIR)/watch.Po
7.36 +@AMDEP_TRUE@ ./$(DEPDIR)/sh4mem.Po ./$(DEPDIR)/sh4mmio.Po \
7.37 +@AMDEP_TRUE@ ./$(DEPDIR)/support.Po ./$(DEPDIR)/video.Po \
7.38 +@AMDEP_TRUE@ ./$(DEPDIR)/watch.Po
7.39 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
7.40 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
7.41 CCLD = $(CC)
7.42 @@ -259,6 +261,7 @@
7.43 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pvr2.Po@am__quote@
7.44 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh4core.Po@am__quote@
7.45 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh4dasm.Po@am__quote@
7.46 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh4mem.Po@am__quote@
7.47 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sh4mmio.Po@am__quote@
7.48 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/support.Po@am__quote@
7.49 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/video.Po@am__quote@
7.50 @@ -330,27 +333,27 @@
7.51 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.52 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o intc.obj `if test -f 'sh4/intc.c'; then $(CYGPATH_W) 'sh4/intc.c'; else $(CYGPATH_W) '$(srcdir)/sh4/intc.c'; fi`
7.53
7.54 -mem.o: sh4/mem.c
7.55 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mem.o -MD -MP -MF "$(DEPDIR)/mem.Tpo" \
7.56 -@am__fastdepCC_TRUE@ -c -o mem.o `test -f 'sh4/mem.c' || echo '$(srcdir)/'`sh4/mem.c; \
7.57 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mem.Tpo" "$(DEPDIR)/mem.Po"; \
7.58 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/mem.Tpo"; exit 1; \
7.59 +sh4mem.o: sh4/sh4mem.c
7.60 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sh4mem.o -MD -MP -MF "$(DEPDIR)/sh4mem.Tpo" \
7.61 +@am__fastdepCC_TRUE@ -c -o sh4mem.o `test -f 'sh4/sh4mem.c' || echo '$(srcdir)/'`sh4/sh4mem.c; \
7.62 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sh4mem.Tpo" "$(DEPDIR)/sh4mem.Po"; \
7.63 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/sh4mem.Tpo"; exit 1; \
7.64 @am__fastdepCC_TRUE@ fi
7.65 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sh4/mem.c' object='mem.o' libtool=no @AMDEPBACKSLASH@
7.66 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/mem.Po' tmpdepfile='$(DEPDIR)/mem.TPo' @AMDEPBACKSLASH@
7.67 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sh4/sh4mem.c' object='sh4mem.o' libtool=no @AMDEPBACKSLASH@
7.68 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/sh4mem.Po' tmpdepfile='$(DEPDIR)/sh4mem.TPo' @AMDEPBACKSLASH@
7.69 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.70 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mem.o `test -f 'sh4/mem.c' || echo '$(srcdir)/'`sh4/mem.c
7.71 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sh4mem.o `test -f 'sh4/sh4mem.c' || echo '$(srcdir)/'`sh4/sh4mem.c
7.72
7.73 -mem.obj: sh4/mem.c
7.74 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mem.obj -MD -MP -MF "$(DEPDIR)/mem.Tpo" \
7.75 -@am__fastdepCC_TRUE@ -c -o mem.obj `if test -f 'sh4/mem.c'; then $(CYGPATH_W) 'sh4/mem.c'; else $(CYGPATH_W) '$(srcdir)/sh4/mem.c'; fi`; \
7.76 -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/mem.Tpo" "$(DEPDIR)/mem.Po"; \
7.77 -@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/mem.Tpo"; exit 1; \
7.78 +sh4mem.obj: sh4/sh4mem.c
7.79 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sh4mem.obj -MD -MP -MF "$(DEPDIR)/sh4mem.Tpo" \
7.80 +@am__fastdepCC_TRUE@ -c -o sh4mem.obj `if test -f 'sh4/sh4mem.c'; then $(CYGPATH_W) 'sh4/sh4mem.c'; else $(CYGPATH_W) '$(srcdir)/sh4/sh4mem.c'; fi`; \
7.81 +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/sh4mem.Tpo" "$(DEPDIR)/sh4mem.Po"; \
7.82 +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/sh4mem.Tpo"; exit 1; \
7.83 @am__fastdepCC_TRUE@ fi
7.84 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sh4/mem.c' object='mem.obj' libtool=no @AMDEPBACKSLASH@
7.85 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/mem.Po' tmpdepfile='$(DEPDIR)/mem.TPo' @AMDEPBACKSLASH@
7.86 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sh4/sh4mem.c' object='sh4mem.obj' libtool=no @AMDEPBACKSLASH@
7.87 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/sh4mem.Po' tmpdepfile='$(DEPDIR)/sh4mem.TPo' @AMDEPBACKSLASH@
7.88 @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
7.89 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mem.obj `if test -f 'sh4/mem.c'; then $(CYGPATH_W) 'sh4/mem.c'; else $(CYGPATH_W) '$(srcdir)/sh4/mem.c'; fi`
7.90 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sh4mem.obj `if test -f 'sh4/sh4mem.c'; then $(CYGPATH_W) 'sh4/sh4mem.c'; else $(CYGPATH_W) '$(srcdir)/sh4/sh4mem.c'; fi`
7.91
7.92 sh4core.o: sh4/sh4core.c
7.93 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sh4core.o -MD -MP -MF "$(DEPDIR)/sh4core.Tpo" \
8.1 --- a/src/bootstrap.c Thu Dec 08 13:38:00 2005 +0000
8.2 +++ b/src/bootstrap.c Sun Dec 11 05:15:36 2005 +0000
8.3 @@ -63,7 +63,7 @@
8.4 sprintf( buf, "%4.4s", head->crc );
8.5 crc = compute_crc16(head);
8.6 hcrc = strtol( buf, NULL, 16 );
8.7 - emit( crc == hcrc ? EMIT_INFO : EMIT_WARN, MODULE_ID,
8.8 + emit( NULL, crc == hcrc ? EMIT_INFO : EMIT_WARN, MODULE_ID,
8.9 " Header CRC: %04X (Computed %04X)", hcrc, crc );
8.10 INFO( " Boot File: %-16.16s", head->boot_file );
8.11 INFO( " Product ID: %-10.10s Product Ver: %-6.6s Date: %-8.8s",
9.1 --- a/src/cpu.h Thu Dec 08 13:38:00 2005 +0000
9.2 +++ b/src/cpu.h Sun Dec 11 05:15:36 2005 +0000
9.3 @@ -16,7 +16,7 @@
9.4 * @param buflen Maximum length of buffer
9.5 * @return next address to disassemble
9.6 */
9.7 -typedef int (*disasm_func_t)(uint32_t pc, char *buffer, int buflen );
9.8 +typedef uint32_t (*disasm_func_t)(uint32_t pc, char *buffer, int buflen );
9.9
9.10 #define REG_INT 0
9.11 #define REG_FLT 1
10.1 --- a/src/gui/callbacks.c Thu Dec 08 13:38:00 2005 +0000
10.2 +++ b/src/gui/callbacks.c Sun Dec 11 05:15:36 2005 +0000
10.3 @@ -218,7 +218,9 @@
10.4 on_mode_field_changed (GtkEditable *editable,
10.5 gpointer user_data)
10.6 {
10.7 -
10.8 + gchar *text = gtk_entry_get_text( GTK_ENTRY(editable) );
10.9 + debug_info_t data = get_debug_info( GTK_WIDGET(editable) );
10.10 + set_disassembly_cpu( data, text );
10.11 }
10.12
10.13
11.1 --- a/src/gui/debug_win.c Thu Dec 08 13:38:00 2005 +0000
11.2 +++ b/src/gui/debug_win.c Sun Dec 11 05:15:36 2005 +0000
11.3 @@ -1,4 +1,19 @@
11.4 -
11.5 +/**
11.6 + * $Id: debug_win.c,v 1.4 2005-12-11 05:15:36 nkeynes Exp $
11.7 + * This file is responsible for the main debugger gui frame.
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 #include <stdlib.h>
11.22 #include <stdarg.h>
11.23 #include <gnome.h>
11.24 @@ -57,7 +72,7 @@
11.25 appbar = gtk_object_get_data(GTK_OBJECT(win), "debug_appbar");
11.26 data->icounter = gnome_appbar_get_progress( appbar );
11.27 gtk_progress_bar_set_text(data->icounter, "1");
11.28 -
11.29 +
11.30 gtk_object_set_data( GTK_OBJECT(win), "debug_data", data );
11.31 return data;
11.32 }
11.33 @@ -127,7 +142,7 @@
11.34 for( i=from; i<to; ) {
11.35 i = data->cpu->disasm_func( i, buf, sizeof(buf) );
11.36 sprintf( addr, "%08X", i );
11.37 - op = mem_read_phys_word(i);
11.38 + op = sh4_read_phys_word(i);
11.39 sprintf( opcode, "%02X %02X", op&0xFF, op>>8 );
11.40 posn = gtk_clist_append( data->disasm_list, arr );
11.41 if( buf[0] == '?' )
11.42 @@ -181,6 +196,12 @@
11.43 data->disasm_pc = pc;
11.44 }
11.45
11.46 +void set_disassembly_cpu( debug_info_t data, char *cpu )
11.47 +{
11.48 +
11.49 +
11.50 +}
11.51 +
11.52 uint32_t row_to_address( debug_info_t data, int row ) {
11.53 return data->cpu->instr_size * row + data->disasm_from;
11.54 }
11.55 @@ -191,6 +212,7 @@
11.56 return (address - data->disasm_from) / data->cpu->instr_size;
11.57 }
11.58
11.59 +
11.60 void emit( void *ptr, int level, int source, char *msg, ... )
11.61 {
11.62 char buf[20], addr[10] = "", *p;
12.1 --- a/src/gui/gui.h Thu Dec 08 13:38:00 2005 +0000
12.2 +++ b/src/gui/gui.h Sun Dec 11 05:15:36 2005 +0000
12.3 @@ -31,6 +31,7 @@
12.4 void dump_win_update_all();
12.5 void set_disassembly_region( debug_info_t debug, unsigned int page );
12.6 void set_disassembly_pc( debug_info_t debug, unsigned int pc, gboolean select );
12.7 +void set_disassembly_cpu( debug_info_t debug, char *cpu_name );
12.8 void jump_to_disassembly( debug_info_t debug, unsigned int addr, gboolean select );
12.9 void jump_to_pc( debug_info_t debug, gboolean select );
12.10 uint32_t row_to_address( debug_info_t debug, int row );
13.1 --- a/src/gui/interface.c Thu Dec 08 13:38:00 2005 +0000
13.2 +++ b/src/gui/interface.c Sun Dec 11 05:15:36 2005 +0000
13.3 @@ -107,7 +107,8 @@
13.4 GtkWidget *debug_win;
13.5 GtkWidget *dock1;
13.6 GtkWidget *toolbar1;
13.7 - GtkWidget *tmp_toolbar_icon;
13.8 + GtkIconSize tmp_toolbar_icon_size;
13.9 + GtkWidget *tmp_image;
13.10 GtkWidget *load_btn;
13.11 GtkWidget *reset_btn;
13.12 GtkWidget *stop_btn;
13.13 @@ -144,8 +145,11 @@
13.14 GtkWidget *label31;
13.15 GtkWidget *label32;
13.16 GtkWidget *debug_appbar;
13.17 + GtkTooltips *tooltips;
13.18
13.19 - debug_win = gnome_app_new ("Dream2", _("DreamOn! Debugger"));
13.20 + tooltips = gtk_tooltips_new ();
13.21 +
13.22 + debug_win = gnome_app_new ("Dream", _("DreamOn! Debugger"));
13.23 gtk_window_set_default_size (GTK_WINDOW (debug_win), 1000, 700);
13.24
13.25 dock1 = GNOME_APP (debug_win)->dock;
13.26 @@ -160,76 +164,52 @@
13.27 BONOBO_DOCK_TOP, 1, 0, 0);
13.28 gtk_container_set_border_width (GTK_CONTAINER (toolbar1), 1);
13.29 gtk_toolbar_set_style (GTK_TOOLBAR (toolbar1), GTK_TOOLBAR_BOTH);
13.30 + tmp_toolbar_icon_size = gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1));
13.31
13.32 - tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-open", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1)));
13.33 - load_btn = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
13.34 - GTK_TOOLBAR_CHILD_BUTTON,
13.35 - NULL,
13.36 - _("Load"),
13.37 - _("New File"), NULL,
13.38 - tmp_toolbar_icon, NULL, NULL);
13.39 - gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar1)->children)->data))->label), TRUE);
13.40 + tmp_image = gtk_image_new_from_stock ("gtk-open", tmp_toolbar_icon_size);
13.41 + gtk_widget_show (tmp_image);
13.42 + load_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Load"));
13.43 gtk_widget_show (load_btn);
13.44 + gtk_container_add (GTK_CONTAINER (toolbar1), load_btn);
13.45 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (load_btn), tooltips, _("New File"), NULL);
13.46
13.47 - tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-refresh", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1)));
13.48 - reset_btn = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
13.49 - GTK_TOOLBAR_CHILD_BUTTON,
13.50 - NULL,
13.51 - _("Reset"),
13.52 - _("Open File"), NULL,
13.53 - tmp_toolbar_icon, NULL, NULL);
13.54 - gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar1)->children)->data))->label), TRUE);
13.55 + tmp_image = gtk_image_new_from_stock ("gtk-refresh", tmp_toolbar_icon_size);
13.56 + gtk_widget_show (tmp_image);
13.57 + reset_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Reset"));
13.58 gtk_widget_show (reset_btn);
13.59 + gtk_container_add (GTK_CONTAINER (toolbar1), reset_btn);
13.60 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (reset_btn), tooltips, _("Open File"), NULL);
13.61
13.62 - tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-stop", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1)));
13.63 - stop_btn = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
13.64 - GTK_TOOLBAR_CHILD_BUTTON,
13.65 - NULL,
13.66 - _("Stop"),
13.67 - _("Save File"), NULL,
13.68 - tmp_toolbar_icon, NULL, NULL);
13.69 - gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar1)->children)->data))->label), TRUE);
13.70 + tmp_image = gtk_image_new_from_stock ("gtk-stop", tmp_toolbar_icon_size);
13.71 + gtk_widget_show (tmp_image);
13.72 + stop_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Stop"));
13.73 gtk_widget_show (stop_btn);
13.74 + gtk_container_add (GTK_CONTAINER (toolbar1), stop_btn);
13.75 + gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (stop_btn), tooltips, _("Save File"), NULL);
13.76
13.77 - tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-redo", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1)));
13.78 - step_btn = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
13.79 - GTK_TOOLBAR_CHILD_BUTTON,
13.80 - NULL,
13.81 - _("Step"),
13.82 - NULL, NULL,
13.83 - tmp_toolbar_icon, NULL, NULL);
13.84 - gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar1)->children)->data))->label), TRUE);
13.85 + tmp_image = gtk_image_new_from_stock ("gtk-redo", tmp_toolbar_icon_size);
13.86 + gtk_widget_show (tmp_image);
13.87 + step_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Step"));
13.88 gtk_widget_show (step_btn);
13.89 + gtk_container_add (GTK_CONTAINER (toolbar1), step_btn);
13.90
13.91 - tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-go-forward", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1)));
13.92 - run_btn = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
13.93 - GTK_TOOLBAR_CHILD_BUTTON,
13.94 - NULL,
13.95 - _("Run"),
13.96 - NULL, NULL,
13.97 - tmp_toolbar_icon, NULL, NULL);
13.98 - gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar1)->children)->data))->label), TRUE);
13.99 + tmp_image = gtk_image_new_from_stock ("gtk-go-forward", tmp_toolbar_icon_size);
13.100 + gtk_widget_show (tmp_image);
13.101 + run_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Run"));
13.102 gtk_widget_show (run_btn);
13.103 + gtk_container_add (GTK_CONTAINER (toolbar1), run_btn);
13.104
13.105 - tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-goto-last", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1)));
13.106 - runto_btn = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
13.107 - GTK_TOOLBAR_CHILD_BUTTON,
13.108 - NULL,
13.109 - _("Run to"),
13.110 - NULL, NULL,
13.111 - tmp_toolbar_icon, NULL, NULL);
13.112 - gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar1)->children)->data))->label), TRUE);
13.113 + tmp_image = gtk_image_new_from_stock ("gtk-goto-last", tmp_toolbar_icon_size);
13.114 + gtk_widget_show (tmp_image);
13.115 + runto_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Run to"));
13.116 gtk_widget_show (runto_btn);
13.117 + gtk_container_add (GTK_CONTAINER (toolbar1), runto_btn);
13.118
13.119 - tmp_toolbar_icon = gtk_image_new_from_stock ("gtk-close", gtk_toolbar_get_icon_size (GTK_TOOLBAR (toolbar1)));
13.120 - break_btn = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar1),
13.121 - GTK_TOOLBAR_CHILD_BUTTON,
13.122 - NULL,
13.123 - _("Break"),
13.124 - NULL, NULL,
13.125 - tmp_toolbar_icon, NULL, NULL);
13.126 - gtk_label_set_use_underline (GTK_LABEL (((GtkToolbarChild*) (g_list_last (GTK_TOOLBAR (toolbar1)->children)->data))->label), TRUE);
13.127 + tmp_image = gtk_image_new_from_stock ("gtk-close", tmp_toolbar_icon_size);
13.128 + gtk_widget_show (tmp_image);
13.129 + break_btn = (GtkWidget*) gtk_tool_button_new (tmp_image, _("Break"));
13.130 gtk_widget_show (break_btn);
13.131 + gtk_container_add (GTK_CONTAINER (toolbar1), break_btn);
13.132
13.133 vpaned1 = gtk_vpaned_new ();
13.134 gtk_widget_show (vpaned1);
13.135 @@ -277,12 +257,16 @@
13.136 "GladeParentKey", mode_box);
13.137 gtk_widget_show (mode_box);
13.138 gtk_box_pack_start (GTK_BOX (hbox1), mode_box, FALSE, FALSE, 0);
13.139 - mode_box_items = g_list_append (mode_box_items, (gpointer) "");
13.140 + mode_box_items = g_list_append (mode_box_items, (gpointer) _("SH4"));
13.141 + mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7"));
13.142 + mode_box_items = g_list_append (mode_box_items, (gpointer) _("ARM7T"));
13.143 gtk_combo_set_popdown_strings (GTK_COMBO (mode_box), mode_box_items);
13.144 g_list_free (mode_box_items);
13.145
13.146 mode_field = GTK_COMBO (mode_box)->entry;
13.147 gtk_widget_show (mode_field);
13.148 + gtk_editable_set_editable (GTK_EDITABLE (mode_field), FALSE);
13.149 + gtk_entry_set_text (GTK_ENTRY (mode_field), _("SH4"));
13.150
13.151 label23 = gtk_label_new ("");
13.152 gtk_widget_show (label23);
13.153 @@ -473,6 +457,7 @@
13.154 GLADE_HOOKUP_OBJECT (debug_win, label31, "label31");
13.155 GLADE_HOOKUP_OBJECT (debug_win, label32, "label32");
13.156 GLADE_HOOKUP_OBJECT (debug_win, debug_appbar, "debug_appbar");
13.157 + GLADE_HOOKUP_OBJECT_NO_REF (debug_win, tooltips, "tooltips");
13.158
13.159 return debug_win;
13.160 }
13.161 @@ -554,7 +539,7 @@
13.162 if (!strcmp (translators, "translator_credits"))
13.163 translators = NULL;
13.164 about_win_logo_pixbuf = create_pixbuf ("dream/dcemu.gif");
13.165 - about_win = gnome_about_new ("Dream2", VERSION,
13.166 + about_win = gnome_about_new ("Dream", VERSION,
13.167 _("Copyright(c) 2002 Nathan Keynes"),
13.168 "",
13.169 authors,
13.170 @@ -562,6 +547,7 @@
13.171 translators,
13.172 about_win_logo_pixbuf);
13.173 gtk_container_set_border_width (GTK_CONTAINER (about_win), 1);
13.174 + gtk_window_set_type_hint (GTK_WINDOW (about_win), GDK_WINDOW_TYPE_HINT_DIALOG);
13.175
13.176 /* Store pointers to all widgets, for use by lookup_widget(). */
13.177 GLADE_HOOKUP_OBJECT_NO_REF (about_win, about_win, "about_win");
14.1 --- a/src/gui/support.h Thu Dec 08 13:38:00 2005 +0000
14.2 +++ b/src/gui/support.h Sun Dec 11 05:15:36 2005 +0000
14.3 @@ -2,8 +2,20 @@
14.4 * DO NOT EDIT THIS FILE - it is generated by Glade.
14.5 */
14.6
14.7 +#ifdef HAVE_CONFIG_H
14.8 +# include <config.h>
14.9 +#endif
14.10 +
14.11 #include <gnome.h>
14.12
14.13 +#undef Q_
14.14 +#ifdef ENABLE_NLS
14.15 +# define Q_(String) g_strip_context ((String), gettext (String))
14.16 +#else
14.17 +# define Q_(String) g_strip_context ((String), (String))
14.18 +#endif
14.19 +
14.20 +
14.21 /*
14.22 * Public Functions.
14.23 */
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
15.2 +++ b/src/mem.c Sun Dec 11 05:15:36 2005 +0000
15.3 @@ -0,0 +1,203 @@
15.4 +/**
15.5 + * $Id: mem.c,v 1.1 2005-12-11 05:15:36 nkeynes Exp $
15.6 + * mem.c is responsible for creating and maintaining the overall system memory
15.7 + * map, as visible from the SH4 processor.
15.8 + *
15.9 + * Copyright (c) 2005 Nathan Keynes.
15.10 + *
15.11 + * This program is free software; you can redistribute it and/or modify
15.12 + * it under the terms of the GNU General Public License as published by
15.13 + * the Free Software Foundation; either version 2 of the License, or
15.14 + * (at your option) any later version.
15.15 + *
15.16 + * This program is distributed in the hope that it will be useful,
15.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
15.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15.19 + * GNU General Public License for more details.
15.20 + */
15.21 +
15.22 +#include <sys/mman.h>
15.23 +#include <assert.h>
15.24 +#include <stdint.h>
15.25 +#include <stdlib.h>
15.26 +#include <stdio.h>
15.27 +#include <unistd.h>
15.28 +#include <fcntl.h>
15.29 +#include <errno.h>
15.30 +#include <string.h>
15.31 +#include <zlib.h>
15.32 +#include "dream.h"
15.33 +#include "mem.h"
15.34 +#include "mmio.h"
15.35 +#include "dreamcast.h"
15.36 +
15.37 +char **page_map = NULL;
15.38 +
15.39 +struct mem_region mem_rgn[MAX_MEM_REGIONS];
15.40 +struct mmio_region *io_rgn[MAX_IO_REGIONS];
15.41 +struct mmio_region *P4_io[4096];
15.42 +
15.43 +int num_io_rgns = 1, num_mem_rgns = 0;
15.44 +
15.45 +void *mem_alloc_pages( int n )
15.46 +{
15.47 + void *mem = mmap( NULL, n * 4096,
15.48 + PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0 );
15.49 + if( mem == MAP_FAILED ) {
15.50 + ERROR( "Memory allocation failure! (%s)", strerror(errno) );
15.51 + return NULL;
15.52 + }
15.53 + return mem;
15.54 +}
15.55 +
15.56 +
15.57 +void mem_init( void )
15.58 +{
15.59 + page_map = mmap( NULL, sizeof(char *) * PAGE_TABLE_ENTRIES,
15.60 + PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0 );
15.61 + if( page_map == MAP_FAILED ) {
15.62 + ERROR( "Unable to allocate page map! (%s)", strerror(errno) );
15.63 + page_map = NULL;
15.64 + return;
15.65 + }
15.66 +
15.67 + memset( page_map, 0, sizeof(uint32_t) * PAGE_TABLE_ENTRIES );
15.68 +}
15.69 +
15.70 +void mem_reset( void )
15.71 +{
15.72 + /* Restore all mmio registers to their initial settings */
15.73 + int i, j;
15.74 + for( i=1; i<num_io_rgns; i++ ) {
15.75 + for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
15.76 + if( io_rgn[i]->ports[j].def_val != UNDEFINED &&
15.77 + io_rgn[i]->ports[j].def_val != *io_rgn[i]->ports[j].val ) {
15.78 + io_rgn[i]->io_write( io_rgn[i]->ports[j].offset,
15.79 + io_rgn[i]->ports[j].def_val );
15.80 + }
15.81 + }
15.82 + }
15.83 +}
15.84 +
15.85 +struct mem_region *mem_map_region( void *mem, uint32_t base, uint32_t size,
15.86 + char *name, int flags )
15.87 +{
15.88 + int i;
15.89 + mem_rgn[num_mem_rgns].base = base;
15.90 + mem_rgn[num_mem_rgns].size = size;
15.91 + mem_rgn[num_mem_rgns].flags = flags;
15.92 + mem_rgn[num_mem_rgns].name = name;
15.93 + mem_rgn[num_mem_rgns].mem = mem;
15.94 + num_mem_rgns++;
15.95 +
15.96 + for( i=0; i<size>>PAGE_BITS; i++ )
15.97 + page_map[(base>>PAGE_BITS)+i] = mem + (i<<PAGE_BITS);
15.98 +
15.99 + return &mem_rgn[num_mem_rgns-1];
15.100 +}
15.101 +
15.102 +void *mem_create_ram_region( uint32_t base, uint32_t size, char *name )
15.103 +{
15.104 + char *mem;
15.105 +
15.106 + assert( (base&0xFFFFF000) == base ); /* must be page aligned */
15.107 + assert( (size&0x00000FFF) == 0 );
15.108 + assert( num_mem_rgns < MAX_MEM_REGIONS );
15.109 + assert( page_map != NULL );
15.110 +
15.111 + mem = mem_alloc_pages( size>>PAGE_BITS );
15.112 +
15.113 + mem_map_region( mem, base, size, name, 6 );
15.114 + return mem;
15.115 +}
15.116 +
15.117 +void *mem_load_rom( char *file, uint32_t base, uint32_t size, uint32_t crc )
15.118 +{
15.119 + char buf[512], *mem;
15.120 + int fd;
15.121 + uint32_t calc_crc;
15.122 + snprintf( buf, 512, "%s/%s",BIOS_PATH, file );
15.123 + fd = open( buf, O_RDONLY );
15.124 + if( fd == -1 ) {
15.125 + ERROR( "Bios file not found: %s", buf );
15.126 + return NULL;
15.127 + }
15.128 + mem = mmap( NULL, size, PROT_READ, MAP_PRIVATE, fd, 0 );
15.129 + if( mem == MAP_FAILED ) {
15.130 + ERROR( "Unable to map bios file: %s (%s)", file, strerror(errno) );
15.131 + close(fd);
15.132 + return NULL;
15.133 + }
15.134 + mem_map_region( mem, base, size, file, 4 );
15.135 +
15.136 + /* CRC check */
15.137 + calc_crc = crc32(0L, mem, size);
15.138 + if( calc_crc != crc ) {
15.139 + WARN( "Bios CRC Mismatch in %s: %08X (expected %08X)",
15.140 + file, calc_crc, crc);
15.141 + }
15.142 + return mem;
15.143 +}
15.144 +
15.145 +char *mem_get_region_by_name( char *name )
15.146 +{
15.147 + int i;
15.148 + for( i=0; i<num_mem_rgns; i++ ) {
15.149 + if( strcmp( mem_rgn[i].name, name ) == 0 )
15.150 + return mem_rgn[i].mem;
15.151 + }
15.152 + return NULL;
15.153 +}
15.154 +
15.155 +void register_io_region( struct mmio_region *io )
15.156 +{
15.157 + int i;
15.158 +
15.159 + assert(io);
15.160 + io->mem = mem_alloc_pages(2);
15.161 + io->save_mem = io->mem + PAGE_SIZE;
15.162 + io->index = (struct mmio_port **)malloc(1024*sizeof(struct mmio_port *));
15.163 + io->trace_flag = 1;
15.164 + memset( io->index, 0, 1024*sizeof(struct mmio_port *) );
15.165 + for( i=0; io->ports[i].id != NULL; i++ ) {
15.166 + io->ports[i].val = (uint32_t *)(io->mem + io->ports[i].offset);
15.167 + *io->ports[i].val = io->ports[i].def_val;
15.168 + io->index[io->ports[i].offset>>2] = &io->ports[i];
15.169 + }
15.170 + memcpy( io->save_mem, io->mem, PAGE_SIZE );
15.171 + if( (io->base & 0xFF000000) == 0xFF000000 ) {
15.172 + /* P4 area (on-chip I/O channels */
15.173 + P4_io[(io->base&0x1FFFFFFF)>>19] = io;
15.174 + } else {
15.175 + page_map[io->base>>12] = (char *)num_io_rgns;
15.176 + }
15.177 + io_rgn[num_io_rgns] = io;
15.178 + num_io_rgns++;
15.179 +}
15.180 +
15.181 +void register_io_regions( struct mmio_region **io )
15.182 +{
15.183 + while( *io ) register_io_region( *io++ );
15.184 +}
15.185 +
15.186 +int mem_has_page( uint32_t addr )
15.187 +{
15.188 + char *page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
15.189 + return page != NULL;
15.190 +}
15.191 +
15.192 +char *mem_get_page( uint32_t addr )
15.193 +{
15.194 + char *page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
15.195 + return page;
15.196 +}
15.197 +
15.198 +char *mem_get_region( uint32_t addr )
15.199 +{
15.200 + char *page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
15.201 + if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
15.202 + return NULL;
15.203 + } else {
15.204 + return page+(addr&0xFFF);
15.205 + }
15.206 +}
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
16.2 +++ b/src/mem.h Sun Dec 11 05:15:36 2005 +0000
16.3 @@ -0,0 +1,63 @@
16.4 +#ifndef dream_sh4_mem_H
16.5 +#define dream_sh4_mem_H
16.6 +
16.7 +#include <stdint.h>
16.8 +
16.9 +#ifdef __cplusplus
16.10 +extern "C" {
16.11 +#endif
16.12 +
16.13 +typedef struct mem_region {
16.14 + uint32_t base;
16.15 + uint32_t size;
16.16 + char *name;
16.17 + char *mem;
16.18 + int flags;
16.19 +} *mem_region_t;
16.20 +
16.21 +#define MAX_IO_REGIONS 24
16.22 +#define MAX_MEM_REGIONS 8
16.23 +
16.24 +#define MEM_REGION_MAIN "System RAM"
16.25 +#define MEM_REGION_VIDEO "Video RAM"
16.26 +#define MEM_REGION_AUDIO "Audio RAM"
16.27 +#define MEM_REGION_AUDIO_SCRATCH "Audio Scratch RAM"
16.28 +
16.29 +#define MB * (1024 * 1024)
16.30 +#define KB * 1024
16.31 +
16.32 +int32_t sh4_read_long( uint32_t addr );
16.33 +int32_t sh4_read_word( uint32_t addr );
16.34 +int32_t sh4_read_byte( uint32_t addr );
16.35 +void sh4_write_long( uint32_t addr, uint32_t val );
16.36 +void sh4_write_word( uint32_t addr, uint32_t val );
16.37 +void sh4_write_byte( uint32_t addr, uint32_t val );
16.38 +int32_t sh4_read_phys_word( uint32_t addr );
16.39 +
16.40 +void *mem_create_ram_region( uint32_t base, uint32_t size, char *name );
16.41 +void *mem_load_rom( char *name, uint32_t base, uint32_t size, uint32_t crc );
16.42 +char *mem_get_region( uint32_t addr );
16.43 +char *mem_get_region_by_name( char *name );
16.44 +int mem_has_page( uint32_t addr );
16.45 +char *mem_get_page( uint32_t addr );
16.46 +
16.47 +void mem_init( void );
16.48 +void mem_reset( void );
16.49 +
16.50 +#define ENABLE_WATCH 1
16.51 +
16.52 +#define WATCH_WRITE 1
16.53 +#define WATCH_READ 2
16.54 +#define WATCH_EXEC 3 /* AKA Breakpoint :) */
16.55 +
16.56 +typedef struct watch_point *watch_point_t;
16.57 +
16.58 +watch_point_t mem_new_watch( uint32_t start, uint32_t end, int flags );
16.59 +void mem_delete_watch( watch_point_t watch );
16.60 +watch_point_t mem_is_watched( uint32_t addr, int size, int op );
16.61 +
16.62 +extern char **page_map;
16.63 +#ifdef __cplusplus
16.64 +}
16.65 +#endif
16.66 +#endif
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
17.2 +++ b/src/mmio.h Sun Dec 11 05:15:36 2005 +0000
17.3 @@ -0,0 +1,152 @@
17.4 +#ifndef dream_mmio_H
17.5 +#define dream_mmio_H 1
17.6 +
17.7 +#ifdef __cplusplus
17.8 +extern "C" {
17.9 +#if 0
17.10 +}
17.11 +#endif
17.12 +#endif
17.13 +
17.14 +#include <stdint.h>
17.15 +#include <stdlib.h>
17.16 +#include "sh4core.h"
17.17 +
17.18 +#define PAGE_TABLE_ENTRIES 128*1024
17.19 +#define PAGE_SIZE 4096
17.20 +#define PAGE_BITS 12
17.21 +
17.22 +#define PORT_R 1
17.23 +#define PORT_W 2
17.24 +#define PORT_MEM 4 /* store written value */
17.25 +#define PORT_RW 3
17.26 +#define PORT_MR 5
17.27 +#define PORT_MRW 7
17.28 +#define UNDEFINED 0xDEADBEEF /* This has to be a value that nothing inits to */
17.29 +
17.30 +struct mmio_region {
17.31 + char *id, *desc;
17.32 + uint32_t base;
17.33 + int32_t (*io_read)(uint32_t addr);
17.34 + void (*io_write)(uint32_t addr, uint32_t val);
17.35 + char *mem;
17.36 + char *save_mem; /* Used to compare for gui updates */
17.37 + struct mmio_port {
17.38 + char *id, *desc;
17.39 + int width;
17.40 + uint32_t offset;
17.41 + uint32_t def_val;
17.42 + int flags;
17.43 + uint32_t *val;
17.44 + } ports[80];
17.45 + struct mmio_port **index; /* reverse lookup by address */
17.46 + int trace_flag; /* set to 1 to enable transfer traces */
17.47 +};
17.48 +
17.49 +void register_io_region( struct mmio_region *mmio );
17.50 +void register_io_regions( struct mmio_region **mmiolist );
17.51 +
17.52 +extern struct mmio_region *io_rgn[];
17.53 +extern int num_io_rgns;
17.54 +
17.55 +#define MMIO_READ( id, r ) *((int32_t *)(mmio_region_##id.mem + (r)))
17.56 +#define MMIO_WRITE( id, r, v ) *((int32_t *)(mmio_region_##id.mem + (r))) = (v)
17.57 +#define MMIO_REG( id, r ) ((int32_t *)(mmio_region_##id.mem + (r)))
17.58 +#define MMIO_REGID( mid, r ) (mmio_region_##mid.index[(r)>>2] != NULL ? \
17.59 + mmio_region_##mid.index[(r)>>2]->id : "<UNDEF>" )
17.60 +#define MMIO_REGDESC( mid, r) (mmio_region_##mid.index[(r)>>2] != NULL ? \
17.61 + mmio_region_##mid.index[(r)>>2]->desc : "Undefined register" )
17.62 +#define MMIO_TRACE( mid ) mmio_region_##mid.trace_flag = 1
17.63 +#define MMIO_NOTRACE( mid ) mmio_region_##mid.trace_flag = 0
17.64 +
17.65 +#define MMIO_REGID_BYNUM( mid, r ) (io_rgn[mid]->index[(r)>>2] != NULL ? \
17.66 + io_rgn[mid]->index[(r)>>2]->id : "<UNDEF>" )
17.67 +#define MMIO_REGDESC_BYNUM( mid, r ) (io_rgn[mid]->index[(r)>>2] != NULL ? \
17.68 + io_rgn[mid]->index[(r)>>2]->desc : "Undefined register" )
17.69 +#define MMIO_NAME_BYNUM( mid ) (io_rgn[mid]->id)
17.70 +
17.71 +#ifdef __cplusplus
17.72 +}
17.73 +#endif
17.74 +
17.75 +#endif
17.76 +
17.77 +#ifdef MMIO_IMPL
17.78 +
17.79 +#ifndef MMIO_IMPL_INCLUDED
17.80 +#define MMIO_IMPL_INCLUDED
17.81 +#undef MMIO_REGION_BEGIN
17.82 +#undef LONG_PORT
17.83 +#undef WORD_PORT
17.84 +#undef BYTE_PORT
17.85 +#undef MMIO_REGION_END
17.86 +#undef MMIO_REGION_LIST_BEGIN
17.87 +#undef MMIO_REGION
17.88 +#undef MMIO_REGION_LIST_END
17.89 +#define MMIO_REGION_BEGIN(b,id,d) struct mmio_region mmio_region_##id = { #id, d, b, mmio_region_##id##_read, mmio_region_##id##_write, 0, 0, {
17.90 +#define LONG_PORT( o,id,f,def,d ) { #id, d, 32, o, def, f },
17.91 +#define WORD_PORT( o,id,f,def,d ) { #id, d, 16, o, def, f },
17.92 +#define BYTE_PORT( o,id,f,def,d ) { #id, d, 8, o, def, f },
17.93 +#define MMIO_REGION_END {NULL, NULL, 0, 0, 0, 0} } };
17.94 +#define MMIO_REGION_LIST_BEGIN(id) struct mmio_region *mmio_list_##id[] = {
17.95 +#define MMIO_REGION( id ) &mmio_region_##id,
17.96 +#define MMIO_REGION_LIST_END NULL};
17.97 +
17.98 +/* Stub defines for modules we haven't got to yet, or ones which don't
17.99 + * actually need any direct code on read and/or write
17.100 + */
17.101 +#define MMIO_REGION_READ_STUBFN( id ) \
17.102 +int32_t mmio_region_##id##_read( uint32_t reg ) { \
17.103 + int32_t val = MMIO_READ( id, reg ); \
17.104 + WARN( "Read from unimplemented module %s (%03X => %08X) [%s: %s]",\
17.105 + #id, reg, val, MMIO_REGID(id,reg), MMIO_REGDESC(id,reg) ); \
17.106 + return val; \
17.107 +}
17.108 +#define MMIO_REGION_WRITE_STUBFN( id ) \
17.109 +void mmio_region_##id##_write( uint32_t reg, uint32_t val ) { \
17.110 + WARN( "Write to unimplemented module %s (%03X <= %08X) [%s: %s]", \
17.111 + #id, reg, val, MMIO_REGID(id,reg), MMIO_REGDESC(id,reg) ); \
17.112 + MMIO_WRITE( id, reg, val ); \
17.113 +}
17.114 +#define MMIO_REGION_STUBFNS( id ) \
17.115 + MMIO_REGION_READ_STUBFN( id ) \
17.116 + MMIO_REGION_WRITE_STUBFN( id )
17.117 +#define MMIO_REGION_READ_DEFFN( id ) \
17.118 +int32_t mmio_region_##id##_read( uint32_t reg ) { \
17.119 + return MMIO_READ( id, reg ); \
17.120 +}
17.121 +#define MMIO_REGION_WRITE_DEFFN( id ) \
17.122 +void mmio_region_##id##_write( uint32_t reg, uint32_t val ) { \
17.123 + MMIO_WRITE( id, reg, val ); \
17.124 +}
17.125 +#define MMIO_REGION_DEFFNS( id ) \
17.126 + MMIO_REGION_READ_DEFFN( id ) \
17.127 + MMIO_REGION_WRITE_DEFFN( id )
17.128 +#endif
17.129 +
17.130 +#define MMIO_REGION_WRITE_FN( id, reg, val ) \
17.131 +void mmio_region_##id##_write( uint32_t reg, uint32_t val )
17.132 +
17.133 +#define MMIO_REGION_READ_FN( id, reg ) \
17.134 +int32_t mmio_region_##id##_read( uint32_t reg )
17.135 +
17.136 +#else
17.137 +
17.138 +#ifndef MMIO_IFACE_INCLUDED
17.139 +#define MMIO_IFACE_INCLUDED
17.140 +#define MMIO_REGION_BEGIN(b,id,d) \
17.141 +extern struct mmio_region mmio_region_##id; \
17.142 +int32_t mmio_region_##id##_read(uint32_t); \
17.143 +void mmio_region_##id##_write(uint32_t, uint32_t); \
17.144 +enum mmio_region_##id##_port_t {
17.145 +#define LONG_PORT( o,id,f,def,d ) id = o,
17.146 +#define WORD_PORT( o,id,f,def,d ) id = o,
17.147 +#define BYTE_PORT( o,id,f,def,d ) id = o,
17.148 +#define MMIO_REGION_END };
17.149 +#define MMIO_REGION_LIST_BEGIN(id) extern struct mmio_region *mmio_list_##id[];
17.150 +#define MMIO_REGION( id )
17.151 +#define MMIO_REGION_LIST_END
17.152 +#endif
17.153 +
17.154 +#endif
17.155 +
18.1 --- a/src/sh4/mem.c Thu Dec 08 13:38:00 2005 +0000
18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
18.3 @@ -1,494 +0,0 @@
18.4 -#include <sys/mman.h>
18.5 -#include <assert.h>
18.6 -#include <stdint.h>
18.7 -#include <stdlib.h>
18.8 -#include <stdio.h>
18.9 -#include <unistd.h>
18.10 -#include <fcntl.h>
18.11 -#include <errno.h>
18.12 -#include <string.h>
18.13 -#include <zlib.h>
18.14 -#include "dream.h"
18.15 -#include "sh4core.h"
18.16 -#include "mem.h"
18.17 -#include "dreamcast.h"
18.18 -
18.19 -#define OC_BASE 0x1C000000
18.20 -#define OC_TOP 0x20000000
18.21 -
18.22 -#ifdef ENABLE_WATCH
18.23 -#define CHECK_READ_WATCH( addr, size ) \
18.24 - if( mem_is_watched(addr,size,WATCH_READ) != NULL ) { \
18.25 - WARN( "Watch triggered at %08X by %d byte read", addr, size ); \
18.26 - dreamcast_stop(); \
18.27 - }
18.28 -#define CHECK_WRITE_WATCH( addr, size, val ) \
18.29 - if( mem_is_watched(addr,size,WATCH_WRITE) != NULL ) { \
18.30 - WARN( "Watch triggered at %08X by %d byte write <= %0*X", addr, size, size*2, val ); \
18.31 - dreamcast_stop(); \
18.32 - }
18.33 -#else
18.34 -#define CHECK_READ_WATCH( addr, size )
18.35 -#define CHECK_WRITE_WATCH( addr, size )
18.36 -#endif
18.37 -
18.38 -#define TRANSLATE_VIDEO_64BIT_ADDRESS(a) ( (((a)&0x00FFFFF8)>>1)|(((a)&0x00000004)<<20)|((a)&0x03)|0x05000000 );
18.39 -
18.40 -static char **page_map = NULL;
18.41 -static char *cache = NULL;
18.42 -
18.43 -struct mem_region mem_rgn[MAX_MEM_REGIONS];
18.44 -struct mmio_region *io_rgn[MAX_IO_REGIONS];
18.45 -struct mmio_region *P4_io[4096];
18.46 -
18.47 -int num_io_rgns = 1, num_mem_rgns = 0;
18.48 -
18.49 -void *mem_alloc_pages( int n )
18.50 -{
18.51 - void *mem = mmap( NULL, n * 4096,
18.52 - PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0 );
18.53 - if( mem == MAP_FAILED ) {
18.54 - ERROR( "Memory allocation failure! (%s)", strerror(errno) );
18.55 - return NULL;
18.56 - }
18.57 - return mem;
18.58 -}
18.59 -
18.60 -
18.61 -void mem_init( void )
18.62 -{
18.63 - page_map = mmap( NULL, sizeof(char *) * PAGE_TABLE_ENTRIES,
18.64 - PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0 );
18.65 - if( page_map == MAP_FAILED ) {
18.66 - ERROR( "Unable to allocate page map! (%s)", strerror(errno) );
18.67 - page_map = NULL;
18.68 - return;
18.69 - }
18.70 -
18.71 - memset( page_map, 0, sizeof(uint32_t) * PAGE_TABLE_ENTRIES );
18.72 - cache = mem_alloc_pages(2);
18.73 -}
18.74 -
18.75 -void mem_reset( void )
18.76 -{
18.77 - /* Restore all mmio registers to their initial settings */
18.78 - int i, j;
18.79 - for( i=1; i<num_io_rgns; i++ ) {
18.80 - for( j=0; io_rgn[i]->ports[j].id != NULL; j++ ) {
18.81 - if( io_rgn[i]->ports[j].def_val != UNDEFINED &&
18.82 - io_rgn[i]->ports[j].def_val != *io_rgn[i]->ports[j].val ) {
18.83 - io_rgn[i]->io_write( io_rgn[i]->ports[j].offset,
18.84 - io_rgn[i]->ports[j].def_val );
18.85 - }
18.86 - }
18.87 - }
18.88 -}
18.89 -
18.90 -struct mem_region *mem_map_region( void *mem, uint32_t base, uint32_t size,
18.91 - char *name, int flags )
18.92 -{
18.93 - int i;
18.94 - mem_rgn[num_mem_rgns].base = base;
18.95 - mem_rgn[num_mem_rgns].size = size;
18.96 - mem_rgn[num_mem_rgns].flags = flags;
18.97 - mem_rgn[num_mem_rgns].name = name;
18.98 - mem_rgn[num_mem_rgns].mem = mem;
18.99 - num_mem_rgns++;
18.100 -
18.101 - for( i=0; i<size>>PAGE_BITS; i++ )
18.102 - page_map[(base>>PAGE_BITS)+i] = mem + (i<<PAGE_BITS);
18.103 -
18.104 - return &mem_rgn[num_mem_rgns-1];
18.105 -}
18.106 -
18.107 -void *mem_create_ram_region( uint32_t base, uint32_t size, char *name )
18.108 -{
18.109 - char *mem;
18.110 -
18.111 - assert( (base&0xFFFFF000) == base ); /* must be page aligned */
18.112 - assert( (size&0x00000FFF) == 0 );
18.113 - assert( num_mem_rgns < MAX_MEM_REGIONS );
18.114 - assert( page_map != NULL );
18.115 -
18.116 - mem = mem_alloc_pages( size>>PAGE_BITS );
18.117 -
18.118 - mem_map_region( mem, base, size, name, 6 );
18.119 - return mem;
18.120 -}
18.121 -
18.122 -void *mem_load_rom( char *file, uint32_t base, uint32_t size, uint32_t crc )
18.123 -{
18.124 - char buf[512], *mem;
18.125 - int fd;
18.126 - uint32_t calc_crc;
18.127 - snprintf( buf, 512, "%s/%s",BIOS_PATH, file );
18.128 - fd = open( buf, O_RDONLY );
18.129 - if( fd == -1 ) {
18.130 - ERROR( "Bios file not found: %s", buf );
18.131 - return NULL;
18.132 - }
18.133 - mem = mmap( NULL, size, PROT_READ, MAP_PRIVATE, fd, 0 );
18.134 - if( mem == MAP_FAILED ) {
18.135 - ERROR( "Unable to map bios file: %s (%s)", file, strerror(errno) );
18.136 - close(fd);
18.137 - return NULL;
18.138 - }
18.139 - mem_map_region( mem, base, size, file, 4 );
18.140 -
18.141 - /* CRC check */
18.142 - calc_crc = crc32(0L, mem, size);
18.143 - if( calc_crc != crc ) {
18.144 - WARN( "Bios CRC Mismatch in %s: %08X (expected %08X)",
18.145 - file, calc_crc, crc);
18.146 - }
18.147 - return mem;
18.148 -}
18.149 -
18.150 -char *mem_get_region_by_name( char *name )
18.151 -{
18.152 - int i;
18.153 - for( i=0; i<num_mem_rgns; i++ ) {
18.154 - if( strcmp( mem_rgn[i].name, name ) == 0 )
18.155 - return mem_rgn[i].mem;
18.156 - }
18.157 - return NULL;
18.158 -}
18.159 -
18.160 -#define OCRAM_START (0x1C000000>>PAGE_BITS)
18.161 -#define OCRAM_END (0x20000000>>PAGE_BITS)
18.162 -
18.163 -void mem_set_cache_mode( int mode )
18.164 -{
18.165 - uint32_t i;
18.166 - switch( mode ) {
18.167 - case MEM_OC_INDEX0: /* OIX=0 */
18.168 - for( i=OCRAM_START; i<OCRAM_END; i++ )
18.169 - page_map[i] = cache + ((i&0x02)<<(PAGE_BITS-1));
18.170 - break;
18.171 - case MEM_OC_INDEX1: /* OIX=1 */
18.172 - for( i=OCRAM_START; i<OCRAM_END; i++ )
18.173 - page_map[i] = cache + ((i&0x02000000)>>(25-PAGE_BITS));
18.174 - break;
18.175 - default: /* disabled */
18.176 - for( i=OCRAM_START; i<OCRAM_END; i++ )
18.177 - page_map[i] = NULL;
18.178 - break;
18.179 - }
18.180 -}
18.181 -
18.182 -void register_io_region( struct mmio_region *io )
18.183 -{
18.184 - int i;
18.185 -
18.186 - assert(io);
18.187 - io->mem = mem_alloc_pages(2);
18.188 - io->save_mem = io->mem + PAGE_SIZE;
18.189 - io->index = (struct mmio_port **)malloc(1024*sizeof(struct mmio_port *));
18.190 - io->trace_flag = 1;
18.191 - memset( io->index, 0, 1024*sizeof(struct mmio_port *) );
18.192 - for( i=0; io->ports[i].id != NULL; i++ ) {
18.193 - io->ports[i].val = (uint32_t *)(io->mem + io->ports[i].offset);
18.194 - *io->ports[i].val = io->ports[i].def_val;
18.195 - io->index[io->ports[i].offset>>2] = &io->ports[i];
18.196 - }
18.197 - memcpy( io->save_mem, io->mem, PAGE_SIZE );
18.198 - if( (io->base & 0xFF000000) == 0xFF000000 ) {
18.199 - /* P4 area (on-chip I/O channels */
18.200 - P4_io[(io->base&0x1FFFFFFF)>>19] = io;
18.201 - } else {
18.202 - page_map[io->base>>12] = (char *)num_io_rgns;
18.203 - }
18.204 - io_rgn[num_io_rgns] = io;
18.205 - num_io_rgns++;
18.206 -}
18.207 -
18.208 -void register_io_regions( struct mmio_region **io )
18.209 -{
18.210 - while( *io ) register_io_region( *io++ );
18.211 -}
18.212 -
18.213 -#define TRACE_IO( str, p, r, ... ) if(io_rgn[(uint32_t)p]->trace_flag) \
18.214 -TRACE( str " [%s.%s: %s]", __VA_ARGS__, \
18.215 - MMIO_NAME_BYNUM((uint32_t)p), MMIO_REGID_BYNUM((uint32_t)p, r), \
18.216 - MMIO_REGDESC_BYNUM((uint32_t)p, r) )
18.217 -
18.218 -
18.219 -int32_t mem_read_p4( uint32_t addr )
18.220 -{
18.221 - struct mmio_region *io = P4_io[(addr&0x1FFFFFFF)>>19];
18.222 - if( !io ) {
18.223 - ERROR( "Attempted read from unknown P4 region: %08X", addr );
18.224 - return 0;
18.225 - } else {
18.226 - return io->io_read( addr&0xFFF );
18.227 - }
18.228 -}
18.229 -
18.230 -void mem_write_p4( uint32_t addr, int32_t val )
18.231 -{
18.232 - struct mmio_region *io = P4_io[(addr&0x1FFFFFFF)>>19];
18.233 - if( !io ) {
18.234 - if( (addr & 0xFC000000) == 0xE0000000 ) {
18.235 - /* Store queue */
18.236 - SH4_WRITE_STORE_QUEUE( addr, val );
18.237 - } else {
18.238 - ERROR( "Attempted write to unknown P4 region: %08X", addr );
18.239 - }
18.240 - } else {
18.241 - io->io_write( addr&0xFFF, val );
18.242 - }
18.243 -}
18.244 -
18.245 -int mem_has_page( uint32_t addr )
18.246 -{
18.247 - char *page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
18.248 - return page != NULL;
18.249 -}
18.250 -
18.251 -int32_t mem_read_phys_word( uint32_t addr )
18.252 -{
18.253 - char *page;
18.254 - if( addr > 0xE0000000 ) /* P4 Area, handled specially */
18.255 - return SIGNEXT16(mem_read_p4( addr ));
18.256 -
18.257 - if( (addr&0x1F800000) == 0x04000000 ) {
18.258 - addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
18.259 - }
18.260 -
18.261 - page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
18.262 - if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
18.263 - if( page == NULL ) {
18.264 - ERROR( "Attempted word read to missing page: %08X",
18.265 - addr );
18.266 - return 0;
18.267 - }
18.268 - return SIGNEXT16(io_rgn[(uint32_t)page]->io_read(addr&0xFFF));
18.269 - } else {
18.270 - return SIGNEXT16(*(int16_t *)(page+(addr&0xFFF)));
18.271 - }
18.272 -}
18.273 -
18.274 -int32_t mem_read_long( uint32_t addr )
18.275 -{
18.276 - char *page;
18.277 -
18.278 - CHECK_READ_WATCH(addr,4);
18.279 -
18.280 - if( addr > 0xE0000000 ) /* P4 Area, handled specially */
18.281 - return mem_read_p4( addr );
18.282 -
18.283 - if( (addr&0x1F800000) == 0x04000000 ) {
18.284 - addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
18.285 - }
18.286 -
18.287 - if( IS_MMU_ENABLED() ) {
18.288 - ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
18.289 - sh4_stop();
18.290 - return 0;
18.291 - }
18.292 -
18.293 - page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
18.294 - if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
18.295 - int32_t val;
18.296 - if( page == NULL ) {
18.297 - ERROR( "Attempted long read to missing page: %08X", addr );
18.298 - return 0;
18.299 - }
18.300 - val = io_rgn[(uint32_t)page]->io_read(addr&0xFFF);
18.301 - TRACE_IO( "Long read %08X <= %08X", page, (addr&0xFFF), val, addr );
18.302 - return val;
18.303 - } else {
18.304 - return *(int32_t *)(page+(addr&0xFFF));
18.305 - }
18.306 -}
18.307 -
18.308 -int32_t mem_read_word( uint32_t addr )
18.309 -{
18.310 - char *page;
18.311 -
18.312 - CHECK_READ_WATCH(addr,2);
18.313 -
18.314 - if( addr > 0xE0000000 ) /* P4 Area, handled specially */
18.315 - return SIGNEXT16(mem_read_p4( addr ));
18.316 -
18.317 - if( (addr&0x1F800000) == 0x04000000 ) {
18.318 - addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
18.319 - }
18.320 -
18.321 - if( IS_MMU_ENABLED() ) {
18.322 - ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
18.323 - sh4_stop();
18.324 - return 0;
18.325 - }
18.326 -
18.327 - page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
18.328 - if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
18.329 - int32_t val;
18.330 - if( page == NULL ) {
18.331 - ERROR( "Attempted word read to missing page: %08X", addr );
18.332 - return 0;
18.333 - }
18.334 - val = SIGNEXT16(io_rgn[(uint32_t)page]->io_read(addr&0xFFF));
18.335 - TRACE_IO( "Word read %04X <= %08X", page, (addr&0xFFF), val&0xFFFF, addr );
18.336 - return val;
18.337 - } else {
18.338 - return SIGNEXT16(*(int16_t *)(page+(addr&0xFFF)));
18.339 - }
18.340 -}
18.341 -
18.342 -int32_t mem_read_byte( uint32_t addr )
18.343 -{
18.344 - char *page;
18.345 -
18.346 - CHECK_READ_WATCH(addr,1);
18.347 -
18.348 - if( addr > 0xE0000000 ) /* P4 Area, handled specially */
18.349 - return SIGNEXT8(mem_read_p4( addr ));
18.350 - if( (addr&0x1F800000) == 0x04000000 ) {
18.351 - addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
18.352 - }
18.353 -
18.354 - if( IS_MMU_ENABLED() ) {
18.355 - ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
18.356 - sh4_stop();
18.357 - return 0;
18.358 - }
18.359 -
18.360 - page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
18.361 - if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
18.362 - int32_t val;
18.363 - if( page == NULL ) {
18.364 - ERROR( "Attempted byte read to missing page: %08X", addr );
18.365 - return 0;
18.366 - }
18.367 - val = SIGNEXT8(io_rgn[(uint32_t)page]->io_read(addr&0xFFF));
18.368 - TRACE_IO( "Byte read %02X <= %08X", page, (addr&0xFFF), val&0xFF, addr );
18.369 - return val;
18.370 - } else {
18.371 - return SIGNEXT8(*(int8_t *)(page+(addr&0xFFF)));
18.372 - }
18.373 -}
18.374 -
18.375 -void mem_write_long( uint32_t addr, uint32_t val )
18.376 -{
18.377 - char *page;
18.378 -
18.379 - CHECK_WRITE_WATCH(addr,4,val);
18.380 -
18.381 - if( addr > 0xE0000000 ) {
18.382 - mem_write_p4( addr, val );
18.383 - return;
18.384 - }
18.385 - if( (addr&0x1F800000) == 0x04000000 ) {
18.386 - addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
18.387 - }
18.388 -
18.389 - if( IS_MMU_ENABLED() ) {
18.390 - ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
18.391 - sh4_stop();
18.392 - return;
18.393 - }
18.394 - if( (addr&0x1FFFFFFF) < 0x200000 ) {
18.395 - ERROR( "Attempted write to read-only memory: %08X => %08X", val, addr);
18.396 - sh4_stop();
18.397 - return;
18.398 - }
18.399 - page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
18.400 - if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
18.401 - if( page == NULL ) {
18.402 - ERROR( "Long write to missing page: %08X => %08X", val, addr );
18.403 - return;
18.404 - }
18.405 - TRACE_IO( "Long write %08X => %08X", page, (addr&0xFFF), val, addr );
18.406 - io_rgn[(uint32_t)page]->io_write(addr&0xFFF, val);
18.407 - } else {
18.408 - *(uint32_t *)(page+(addr&0xFFF)) = val;
18.409 - }
18.410 -}
18.411 -
18.412 -void mem_write_word( uint32_t addr, uint32_t val )
18.413 -{
18.414 - char *page;
18.415 -
18.416 - CHECK_WRITE_WATCH(addr,2,val);
18.417 -
18.418 - if( addr > 0xE0000000 ) {
18.419 - mem_write_p4( addr, (int16_t)val );
18.420 - return;
18.421 - }
18.422 - if( (addr&0x1F800000) == 0x04000000 ) {
18.423 - addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
18.424 - }
18.425 - if( IS_MMU_ENABLED() ) {
18.426 - ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
18.427 - sh4_stop();
18.428 - return;
18.429 - }
18.430 - page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
18.431 - if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
18.432 - if( page == NULL ) {
18.433 - ERROR( "Attempted word write to missing page: %08X", addr );
18.434 - return;
18.435 - }
18.436 - TRACE_IO( "Word write %04X => %08X", page, (addr&0xFFF), val&0xFFFF, addr );
18.437 - io_rgn[(uint32_t)page]->io_write(addr&0xFFF, val);
18.438 - } else {
18.439 - *(uint16_t *)(page+(addr&0xFFF)) = val;
18.440 - }
18.441 -}
18.442 -
18.443 -void mem_write_byte( uint32_t addr, uint32_t val )
18.444 -{
18.445 - char *page;
18.446 -
18.447 - CHECK_WRITE_WATCH(addr,1,val);
18.448 -
18.449 - if( addr > 0xE0000000 ) {
18.450 - mem_write_p4( addr, (int8_t)val );
18.451 - return;
18.452 - }
18.453 - if( (addr&0x1F800000) == 0x04000000 ) {
18.454 - addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
18.455 - }
18.456 -
18.457 - if( IS_MMU_ENABLED() ) {
18.458 - ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
18.459 - sh4_stop();
18.460 - return;
18.461 - }
18.462 - page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
18.463 - if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
18.464 - if( page == NULL ) {
18.465 - ERROR( "Attempted byte write to missing page: %08X", addr );
18.466 - return;
18.467 - }
18.468 - TRACE_IO( "Byte write %02X => %08X", page, (addr&0xFFF), val&0xFF, addr );
18.469 - io_rgn[(uint32_t)page]->io_write( (addr&0xFFF), val);
18.470 - } else {
18.471 - *(uint8_t *)(page+(addr&0xFFF)) = val;
18.472 - }
18.473 -}
18.474 -
18.475 -char *mem_get_region( uint32_t addr )
18.476 -{
18.477 - char *page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
18.478 - if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
18.479 - return NULL;
18.480 - } else {
18.481 - return page+(addr&0xFFF);
18.482 - }
18.483 -}
18.484 -
18.485 -/* FIXME: Handle all the many special cases when the range doesn't fall cleanly
18.486 - * into the same memory black
18.487 - */
18.488 -
18.489 -void mem_copy_from_sh4( char *dest, uint32_t srcaddr, size_t count ) {
18.490 - char *src = mem_get_region(srcaddr);
18.491 - memcpy( dest, src, count );
18.492 -}
18.493 -
18.494 -void mem_copy_to_sh4( uint32_t destaddr, char *src, size_t count ) {
18.495 - char *dest = mem_get_region(destaddr);
18.496 - memcpy( dest, src, count );
18.497 -}
19.1 --- a/src/sh4/mem.h Thu Dec 08 13:38:00 2005 +0000
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,96 +0,0 @@
19.4 -#ifndef dream_sh4_mem_H
19.5 -#define dream_sh4_mem_H
19.6 -
19.7 -#include <stdint.h>
19.8 -#include "sh4mmio.h"
19.9 -
19.10 -#ifdef __cplusplus
19.11 -extern "C" {
19.12 -#if 0
19.13 -}
19.14 -#endif
19.15 -#endif
19.16 -
19.17 -typedef struct mem_region {
19.18 - uint32_t base;
19.19 - uint32_t size;
19.20 - char *name;
19.21 - char *mem;
19.22 - int flags;
19.23 -} *mem_region_t;
19.24 -
19.25 -#define MAX_IO_REGIONS 24
19.26 -#define MAX_MEM_REGIONS 8
19.27 -
19.28 -#define MEM_REGION_MAIN "System RAM"
19.29 -#define MEM_REGION_VIDEO "Video RAM"
19.30 -#define MEM_REGION_AUDIO "Audio RAM"
19.31 -#define MEM_REGION_AUDIO_SCRATCH "Audio Scratch RAM"
19.32 -
19.33 -#define MB * (1024 * 1024)
19.34 -#define KB * 1024
19.35 -
19.36 -int32_t mem_read_long( uint32_t addr );
19.37 -int32_t mem_read_word( uint32_t addr );
19.38 -int32_t mem_read_byte( uint32_t addr );
19.39 -void mem_write_long( uint32_t addr, uint32_t val );
19.40 -void mem_write_word( uint32_t addr, uint32_t val );
19.41 -void mem_write_byte( uint32_t addr, uint32_t val );
19.42 -
19.43 -int32_t mem_read_phys_word( uint32_t addr );
19.44 -void *mem_create_ram_region( uint32_t base, uint32_t size, char *name );
19.45 -void *mem_load_rom( char *name, uint32_t base, uint32_t size, uint32_t crc );
19.46 -char *mem_get_region( uint32_t addr );
19.47 -char *mem_get_region_by_name( char *name );
19.48 -void mem_set_cache_mode( int );
19.49 -int mem_has_page( uint32_t addr );
19.50 -
19.51 -void mem_init( void );
19.52 -void mem_reset( void );
19.53 -
19.54 -#define ENABLE_WATCH 1
19.55 -
19.56 -#define WATCH_WRITE 1
19.57 -#define WATCH_READ 2
19.58 -#define WATCH_EXEC 3 /* AKA Breakpoint :) */
19.59 -
19.60 -typedef struct watch_point *watch_point_t;
19.61 -
19.62 -watch_point_t mem_new_watch( uint32_t start, uint32_t end, int flags );
19.63 -void mem_delete_watch( watch_point_t watch );
19.64 -watch_point_t mem_is_watched( uint32_t addr, int size, int op );
19.65 -
19.66 -/* mmucr register bits */
19.67 -#define MMUCR_AT 0x00000001 /* Address Translation enabled */
19.68 -#define MMUCR_TI 0x00000004 /* TLB invalidate (always read as 0) */
19.69 -#define MMUCR_SV 0x00000100 /* Single Virtual mode=1 / multiple virtual=0 */
19.70 -#define MMUCR_SQMD 0x00000200 /* Store queue mode bit (0=user, 1=priv only) */
19.71 -#define MMUCR_URC 0x0000FC00 /* UTLB access counter */
19.72 -#define MMUCR_URB 0x00FC0000 /* UTLB entry boundary */
19.73 -#define MMUCR_LRUI 0xFC000000 /* Least recently used ITLB */
19.74 -#define MMUCR_MASK 0xFCFCFF05
19.75 -#define MMUCR_RMASK 0xFCFCFF01 /* Read mask */
19.76 -
19.77 -#define IS_MMU_ENABLED() (MMIO_READ(MMU, MMUCR)&MMUCR_AT)
19.78 -
19.79 -/* ccr register bits */
19.80 -#define CCR_IIX 0x00008000 /* IC index enable */
19.81 -#define CCR_ICI 0x00000800 /* IC invalidation (always read as 0) */
19.82 -#define CCR_ICE 0x00000100 /* IC enable */
19.83 -#define CCR_OIX 0x00000080 /* OC index enable */
19.84 -#define CCR_ORA 0x00000020 /* OC RAM enable */
19.85 -#define CCR_OCI 0x00000008 /* OC invalidation (always read as 0) */
19.86 -#define CCR_CB 0x00000004 /* Copy-back (P1 area cache write mode) */
19.87 -#define CCR_WT 0x00000002 /* Write-through (P0,U0,P3 write mode) */
19.88 -#define CCR_OCE 0x00000001 /* OC enable */
19.89 -#define CCR_MASK 0x000089AF
19.90 -#define CCR_RMASK 0x000081A7 /* Read mask */
19.91 -
19.92 -#define MEM_OC_DISABLED 0
19.93 -#define MEM_OC_INDEX0 CCR_ORA
19.94 -#define MEM_OC_INDEX1 CCR_ORA|CCR_OIX
19.95 -
19.96 -#ifdef __cplusplus
19.97 -}
19.98 -#endif
19.99 -#endif
20.1 --- a/src/sh4/mmio.h Thu Dec 08 13:38:00 2005 +0000
20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
20.3 @@ -1,152 +0,0 @@
20.4 -#ifndef dream_mmio_H
20.5 -#define dream_mmio_H 1
20.6 -
20.7 -#ifdef __cplusplus
20.8 -extern "C" {
20.9 -#if 0
20.10 -}
20.11 -#endif
20.12 -#endif
20.13 -
20.14 -#include <stdint.h>
20.15 -#include <stdlib.h>
20.16 -#include "sh4core.h"
20.17 -
20.18 -#define PAGE_TABLE_ENTRIES 128*1024
20.19 -#define PAGE_SIZE 4096
20.20 -#define PAGE_BITS 12
20.21 -
20.22 -#define PORT_R 1
20.23 -#define PORT_W 2
20.24 -#define PORT_MEM 4 /* store written value */
20.25 -#define PORT_RW 3
20.26 -#define PORT_MR 5
20.27 -#define PORT_MRW 7
20.28 -#define UNDEFINED 0xDEADBEEF /* This has to be a value that nothing inits to */
20.29 -
20.30 -struct mmio_region {
20.31 - char *id, *desc;
20.32 - uint32_t base;
20.33 - int32_t (*io_read)(uint32_t addr);
20.34 - void (*io_write)(uint32_t addr, uint32_t val);
20.35 - char *mem;
20.36 - char *save_mem; /* Used to compare for gui updates */
20.37 - struct mmio_port {
20.38 - char *id, *desc;
20.39 - int width;
20.40 - uint32_t offset;
20.41 - uint32_t def_val;
20.42 - int flags;
20.43 - uint32_t *val;
20.44 - } ports[80];
20.45 - struct mmio_port **index; /* reverse lookup by address */
20.46 - int trace_flag; /* set to 1 to enable transfer traces */
20.47 -};
20.48 -
20.49 -void register_io_region( struct mmio_region *mmio );
20.50 -void register_io_regions( struct mmio_region **mmiolist );
20.51 -
20.52 -extern struct mmio_region *io_rgn[];
20.53 -extern int num_io_rgns;
20.54 -
20.55 -#define MMIO_READ( id, r ) *((int32_t *)(mmio_region_##id.mem + (r)))
20.56 -#define MMIO_WRITE( id, r, v ) *((int32_t *)(mmio_region_##id.mem + (r))) = (v)
20.57 -#define MMIO_REG( id, r ) ((int32_t *)(mmio_region_##id.mem + (r)))
20.58 -#define MMIO_REGID( mid, r ) (mmio_region_##mid.index[(r)>>2] != NULL ? \
20.59 - mmio_region_##mid.index[(r)>>2]->id : "<UNDEF>" )
20.60 -#define MMIO_REGDESC( mid, r) (mmio_region_##mid.index[(r)>>2] != NULL ? \
20.61 - mmio_region_##mid.index[(r)>>2]->desc : "Undefined register" )
20.62 -#define MMIO_TRACE( mid ) mmio_region_##mid.trace_flag = 1
20.63 -#define MMIO_NOTRACE( mid ) mmio_region_##mid.trace_flag = 0
20.64 -
20.65 -#define MMIO_REGID_BYNUM( mid, r ) (io_rgn[mid]->index[(r)>>2] != NULL ? \
20.66 - io_rgn[mid]->index[(r)>>2]->id : "<UNDEF>" )
20.67 -#define MMIO_REGDESC_BYNUM( mid, r ) (io_rgn[mid]->index[(r)>>2] != NULL ? \
20.68 - io_rgn[mid]->index[(r)>>2]->desc : "Undefined register" )
20.69 -#define MMIO_NAME_BYNUM( mid ) (io_rgn[mid]->id)
20.70 -
20.71 -#ifdef __cplusplus
20.72 -}
20.73 -#endif
20.74 -
20.75 -#endif
20.76 -
20.77 -#ifdef MMIO_IMPL
20.78 -
20.79 -#ifndef MMIO_IMPL_INCLUDED
20.80 -#define MMIO_IMPL_INCLUDED
20.81 -#undef MMIO_REGION_BEGIN
20.82 -#undef LONG_PORT
20.83 -#undef WORD_PORT
20.84 -#undef BYTE_PORT
20.85 -#undef MMIO_REGION_END
20.86 -#undef MMIO_REGION_LIST_BEGIN
20.87 -#undef MMIO_REGION
20.88 -#undef MMIO_REGION_LIST_END
20.89 -#define MMIO_REGION_BEGIN(b,id,d) struct mmio_region mmio_region_##id = { #id, d, b, mmio_region_##id##_read, mmio_region_##id##_write, 0, 0, {
20.90 -#define LONG_PORT( o,id,f,def,d ) { #id, d, 32, o, def, f },
20.91 -#define WORD_PORT( o,id,f,def,d ) { #id, d, 16, o, def, f },
20.92 -#define BYTE_PORT( o,id,f,def,d ) { #id, d, 8, o, def, f },
20.93 -#define MMIO_REGION_END {NULL, NULL, 0, 0, 0, 0} } };
20.94 -#define MMIO_REGION_LIST_BEGIN(id) struct mmio_region *mmio_list_##id[] = {
20.95 -#define MMIO_REGION( id ) &mmio_region_##id,
20.96 -#define MMIO_REGION_LIST_END NULL};
20.97 -
20.98 -/* Stub defines for modules we haven't got to yet, or ones which don't
20.99 - * actually need any direct code on read and/or write
20.100 - */
20.101 -#define MMIO_REGION_READ_STUBFN( id ) \
20.102 -int32_t mmio_region_##id##_read( uint32_t reg ) { \
20.103 - int32_t val = MMIO_READ( id, reg ); \
20.104 - WARN( "Read from unimplemented module %s (%03X => %08X) [%s: %s]",\
20.105 - #id, reg, val, MMIO_REGID(id,reg), MMIO_REGDESC(id,reg) ); \
20.106 - return val; \
20.107 -}
20.108 -#define MMIO_REGION_WRITE_STUBFN( id ) \
20.109 -void mmio_region_##id##_write( uint32_t reg, uint32_t val ) { \
20.110 - WARN( "Write to unimplemented module %s (%03X <= %08X) [%s: %s]", \
20.111 - #id, reg, val, MMIO_REGID(id,reg), MMIO_REGDESC(id,reg) ); \
20.112 - MMIO_WRITE( id, reg, val ); \
20.113 -}
20.114 -#define MMIO_REGION_STUBFNS( id ) \
20.115 - MMIO_REGION_READ_STUBFN( id ) \
20.116 - MMIO_REGION_WRITE_STUBFN( id )
20.117 -#define MMIO_REGION_READ_DEFFN( id ) \
20.118 -int32_t mmio_region_##id##_read( uint32_t reg ) { \
20.119 - return MMIO_READ( id, reg ); \
20.120 -}
20.121 -#define MMIO_REGION_WRITE_DEFFN( id ) \
20.122 -void mmio_region_##id##_write( uint32_t reg, uint32_t val ) { \
20.123 - MMIO_WRITE( id, reg, val ); \
20.124 -}
20.125 -#define MMIO_REGION_DEFFNS( id ) \
20.126 - MMIO_REGION_READ_DEFFN( id ) \
20.127 - MMIO_REGION_WRITE_DEFFN( id )
20.128 -#endif
20.129 -
20.130 -#define MMIO_REGION_WRITE_FN( id, reg, val ) \
20.131 -void mmio_region_##id##_write( uint32_t reg, uint32_t val )
20.132 -
20.133 -#define MMIO_REGION_READ_FN( id, reg ) \
20.134 -int32_t mmio_region_##id##_read( uint32_t reg )
20.135 -
20.136 -#else
20.137 -
20.138 -#ifndef MMIO_IFACE_INCLUDED
20.139 -#define MMIO_IFACE_INCLUDED
20.140 -#define MMIO_REGION_BEGIN(b,id,d) \
20.141 -extern struct mmio_region mmio_region_##id; \
20.142 -int32_t mmio_region_##id##_read(uint32_t); \
20.143 -void mmio_region_##id##_write(uint32_t, uint32_t); \
20.144 -enum mmio_region_##id##_port_t {
20.145 -#define LONG_PORT( o,id,f,def,d ) id = o,
20.146 -#define WORD_PORT( o,id,f,def,d ) id = o,
20.147 -#define BYTE_PORT( o,id,f,def,d ) id = o,
20.148 -#define MMIO_REGION_END };
20.149 -#define MMIO_REGION_LIST_BEGIN(id) extern struct mmio_region *mmio_list_##id[];
20.150 -#define MMIO_REGION( id )
20.151 -#define MMIO_REGION_LIST_END
20.152 -#endif
20.153 -
20.154 -#endif
20.155 -
21.1 --- a/src/sh4/sh4core.c Thu Dec 08 13:38:00 2005 +0000
21.2 +++ b/src/sh4/sh4core.c Sun Dec 11 05:15:36 2005 +0000
21.3 @@ -12,6 +12,7 @@
21.4 void sh4_init(void)
21.5 {
21.6 register_io_regions( mmio_list_sh4mmio );
21.7 + mmu_init();
21.8 }
21.9
21.10 void sh4_reset(void)
21.11 @@ -95,22 +96,22 @@
21.12 } \
21.13 return; } while(0)
21.14
21.15 -#define MEM_READ_BYTE( addr ) mem_read_byte(addr)
21.16 -#define MEM_READ_WORD( addr ) mem_read_word(addr)
21.17 -#define MEM_READ_LONG( addr ) mem_read_long(addr)
21.18 -#define MEM_WRITE_BYTE( addr, val ) mem_write_byte(addr, val)
21.19 -#define MEM_WRITE_WORD( addr, val ) mem_write_word(addr, val)
21.20 -#define MEM_WRITE_LONG( addr, val ) mem_write_long(addr, val)
21.21 +#define MEM_READ_BYTE( addr ) sh4_read_byte(addr)
21.22 +#define MEM_READ_WORD( addr ) sh4_read_word(addr)
21.23 +#define MEM_READ_LONG( addr ) sh4_read_long(addr)
21.24 +#define MEM_WRITE_BYTE( addr, val ) sh4_write_byte(addr, val)
21.25 +#define MEM_WRITE_WORD( addr, val ) sh4_write_word(addr, val)
21.26 +#define MEM_WRITE_LONG( addr, val ) sh4_write_long(addr, val)
21.27
21.28 #define MEM_FP_READ( addr, reg ) if( IS_FPU_DOUBLESIZE() ) { \
21.29 - ((uint32_t *)FR)[(reg)&0xE0] = mem_read_long(addr); \
21.30 - ((uint32_t *)FR)[(reg)|1] = mem_read_long(addr+4); \
21.31 -} else ((uint32_t *)FR)[reg] = mem_read_long(addr)
21.32 + ((uint32_t *)FR)[(reg)&0xE0] = sh4_read_long(addr); \
21.33 + ((uint32_t *)FR)[(reg)|1] = sh4_read_long(addr+4); \
21.34 +} else ((uint32_t *)FR)[reg] = sh4_read_long(addr)
21.35
21.36 #define MEM_FP_WRITE( addr, reg ) if( IS_FPU_DOUBLESIZE() ) { \
21.37 - mem_write_long( addr, ((uint32_t *)FR)[(reg)&0xE0] ); \
21.38 - mem_write_long( addr+4, ((uint32_t *)FR)[(reg)|1] ); \
21.39 -} else mem_write_long( addr, ((uint32_t *)FR)[reg] )
21.40 + sh4_write_long( addr, ((uint32_t *)FR)[(reg)&0xE0] ); \
21.41 + sh4_write_long( addr+4, ((uint32_t *)FR)[(reg)|1] ); \
21.42 +} else sh4_write_long( addr, ((uint32_t *)FR)[reg] )
21.43
21.44 #define FP_WIDTH (IS_FPU_DOUBLESIZE() ? 8 : 4)
21.45
22.1 --- a/src/sh4/sh4core.h Thu Dec 08 13:38:00 2005 +0000
22.2 +++ b/src/sh4/sh4core.h Sun Dec 11 05:15:36 2005 +0000
22.3 @@ -1,5 +1,20 @@
22.4 -/*
22.5 - * Header for the basic sh4 emulator core
22.6 +/**
22.7 + * $Id: sh4core.h,v 1.3 2005-12-11 05:15:36 nkeynes Exp $
22.8 + *
22.9 + * This file defines the public functions exported by the SH4 core, except
22.10 + * for disassembly functions defined in sh4dasm.h
22.11 + *
22.12 + * Copyright (c) 2005 Nathan Keynes.
22.13 + *
22.14 + * This program is free software; you can redistribute it and/or modify
22.15 + * it under the terms of the GNU General Public License as published by
22.16 + * the Free Software Foundation; either version 2 of the License, or
22.17 + * (at your option) any later version.
22.18 + *
22.19 + * This program is distributed in the hope that it will be useful,
22.20 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
22.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22.22 + * GNU General Public License for more details.
22.23 */
22.24 #ifndef sh4core_H
22.25 #define sh4core_H 1
22.26 @@ -46,6 +61,15 @@
22.27 void sh4_execute_instruction( void );
22.28 void sh4_raise_exception( int, int );
22.29
22.30 +/* SH4 Memory */
22.31 +int32_t sh4_read_long( uint32_t addr );
22.32 +int32_t sh4_read_word( uint32_t addr );
22.33 +int32_t sh4_read_byte( uint32_t addr );
22.34 +void sh4_write_long( uint32_t addr, uint32_t val );
22.35 +void sh4_write_word( uint32_t addr, uint32_t val );
22.36 +void sh4_write_byte( uint32_t addr, uint32_t val );
22.37 +int32_t sh4_read_phys_word( uint32_t addr );
22.38 +
22.39 void run_timers( int );
22.40
22.41 #define SIGNEXT4(n) ((((int32_t)(n))<<28)>>28)
23.1 --- a/src/sh4/sh4dasm.c Thu Dec 08 13:38:00 2005 +0000
23.2 +++ b/src/sh4/sh4dasm.c Sun Dec 11 05:15:36 2005 +0000
23.3 @@ -23,13 +23,14 @@
23.4 {"FPUL", REG_INT, &sh4r.fpul}, {"FPSCR", REG_INT, &sh4r.fpscr},
23.5 {NULL, 0, NULL} };
23.6
23.7 +
23.8 struct cpu_desc_struct sh4_cpu_desc = { "SH4", sh4_disasm_instruction, 2,
23.9 - &sh4r, sizeof(sh4r), sh4_reg_map,
23.10 + (char *)&sh4r, sizeof(sh4r), sh4_reg_map,
23.11 &sh4r.pc, &sh4r.icount };
23.12
23.13 -int sh4_disasm_instruction( int pc, char *buf, int len )
23.14 +uint32_t sh4_disasm_instruction( uint32_t pc, char *buf, int len )
23.15 {
23.16 - uint16_t ir = mem_read_word(pc);
23.17 + uint16_t ir = sh4_read_word(pc);
23.18
23.19 #define RN(ir) ((ir&0x0F00)>>8)
23.20 #define RN_BANK(ir) ((ir&0x0070)>>4)
23.21 @@ -274,7 +275,7 @@
23.22 break;
23.23 case 9: /* 1001xxxxxxxxxxxx */
23.24 snprintf( buf, len, "MOV.W [$%xh], R%-2d ; <- #%08x", (DISP8(ir)<<1)+pc+4, RN(ir),
23.25 - mem_read_word( (DISP8(ir)<<1)+pc+4 ) ); break;
23.26 + sh4_read_word( (DISP8(ir)<<1)+pc+4 ) ); break;
23.27 case 10:/* 1010xxxxxxxxxxxx */
23.28 snprintf( buf, len, "BRA $%xh", (DISP12(ir)<<1)+pc+4 ); break;
23.29 case 11:/* 1011xxxxxxxxxxxx */
23.30 @@ -301,7 +302,7 @@
23.31 break;
23.32 case 13:/* 1101xxxxxxxxxxxx */
23.33 snprintf( buf, len, "MOV.L [$%xh], R%-2d ; <- #%08x", (DISP8(ir)<<2)+(pc&~3)+4, RN(ir),
23.34 - mem_read_long( (DISP8(ir)<<2)+(pc&~3)+4 ) ); break;
23.35 + sh4_read_long( (DISP8(ir)<<2)+(pc&~3)+4 ) ); break;
23.36 case 14:/* 1110xxxxxxxxxxxx */
23.37 snprintf( buf, len, "MOV #%d, R%d", DISP8(ir), RN(ir)); break;
23.38 case 15:/* 1111xxxxxxxxxxxx */
23.39 @@ -363,7 +364,7 @@
23.40 char buf[80];
23.41
23.42 for( pc = from; pc < to; pc+=2 ) {
23.43 - uint16_t op = mem_read_word( pc );
23.44 + uint16_t op = sh4_read_word( pc );
23.45 buf[0] = '\0';
23.46 sh4_disasm_instruction( pc,
23.47 buf, sizeof(buf) );
24.1 --- a/src/sh4/sh4dasm.h Thu Dec 08 13:38:00 2005 +0000
24.2 +++ b/src/sh4/sh4dasm.h Sun Dec 11 05:15:36 2005 +0000
24.3 @@ -9,7 +9,7 @@
24.4
24.5 #include <stdio.h>
24.6
24.7 -int sh4_disasm_instruction( int pc, char *buf, int len );
24.8 +uint32_t sh4_disasm_instruction( uint32_t pc, char *buf, int len );
24.9 void sh4_disasm_region( FILE *f, int from, int to, int load_addr );
24.10
24.11 extern struct cpu_desc_struct sh4_cpu_desc;
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
25.2 +++ b/src/sh4/sh4mem.c Sun Dec 11 05:15:36 2005 +0000
25.3 @@ -0,0 +1,319 @@
25.4 +/**
25.5 + * $Id: sh4mem.c,v 1.1 2005-12-11 05:15:36 nkeynes Exp $
25.6 + * sh4mem.c is responsible for the SH4's access to memory (including memory
25.7 + * mapped I/O), using the page maps created in mem.c
25.8 + *
25.9 + * Copyright (c) 2005 Nathan Keynes.
25.10 + *
25.11 + * This program is free software; you can redistribute it and/or modify
25.12 + * it under the terms of the GNU General Public License as published by
25.13 + * the Free Software Foundation; either version 2 of the License, or
25.14 + * (at your option) any later version.
25.15 + *
25.16 + * This program is distributed in the hope that it will be useful,
25.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
25.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25.19 + * GNU General Public License for more details.
25.20 + */
25.21 +
25.22 +#include <string.h>
25.23 +#include <zlib.h>
25.24 +#include "dream.h"
25.25 +#include "mem.h"
25.26 +#include "mmio.h"
25.27 +#include "sh4mmio.h"
25.28 +#include "dreamcast.h"
25.29 +
25.30 +#define OC_BASE 0x1C000000
25.31 +#define OC_TOP 0x20000000
25.32 +
25.33 +#define TRANSLATE_VIDEO_64BIT_ADDRESS(a) ( (((a)&0x00FFFFF8)>>1)|(((a)&0x00000004)<<20)|((a)&0x03)|0x05000000 );
25.34 +
25.35 +#ifdef ENABLE_WATCH
25.36 +#define CHECK_READ_WATCH( addr, size ) \
25.37 + if( mem_is_watched(addr,size,WATCH_READ) != NULL ) { \
25.38 + WARN( "Watch triggered at %08X by %d byte read", addr, size ); \
25.39 + dreamcast_stop(); \
25.40 + }
25.41 +#define CHECK_WRITE_WATCH( addr, size, val ) \
25.42 + if( mem_is_watched(addr,size,WATCH_WRITE) != NULL ) { \
25.43 + WARN( "Watch triggered at %08X by %d byte write <= %0*X", addr, size, size*2, val ); \
25.44 + dreamcast_stop(); \
25.45 + }
25.46 +#else
25.47 +#define CHECK_READ_WATCH( addr, size )
25.48 +#define CHECK_WRITE_WATCH( addr, size )
25.49 +#endif
25.50 +
25.51 +#define TRACE_IO( str, p, r, ... ) if(io_rgn[(uint32_t)p]->trace_flag) \
25.52 +TRACE( str " [%s.%s: %s]", __VA_ARGS__, \
25.53 + MMIO_NAME_BYNUM((uint32_t)p), MMIO_REGID_BYNUM((uint32_t)p, r), \
25.54 + MMIO_REGDESC_BYNUM((uint32_t)p, r) )
25.55 +
25.56 +extern struct mem_region mem_rgn[];
25.57 +extern struct mmio_region *P4_io[];
25.58 +
25.59 +int32_t sh4_read_p4( uint32_t addr )
25.60 +{
25.61 + struct mmio_region *io = P4_io[(addr&0x1FFFFFFF)>>19];
25.62 + if( !io ) {
25.63 + ERROR( "Attempted read from unknown P4 region: %08X", addr );
25.64 + return 0;
25.65 + } else {
25.66 + return io->io_read( addr&0xFFF );
25.67 + }
25.68 +}
25.69 +
25.70 +void sh4_write_p4( uint32_t addr, int32_t val )
25.71 +{
25.72 + struct mmio_region *io = P4_io[(addr&0x1FFFFFFF)>>19];
25.73 + if( !io ) {
25.74 + if( (addr & 0xFC000000) == 0xE0000000 ) {
25.75 + /* Store queue */
25.76 + SH4_WRITE_STORE_QUEUE( addr, val );
25.77 + } else {
25.78 + ERROR( "Attempted write to unknown P4 region: %08X", addr );
25.79 + }
25.80 + } else {
25.81 + io->io_write( addr&0xFFF, val );
25.82 + }
25.83 +}
25.84 +
25.85 +int32_t sh4_read_phys_word( uint32_t addr )
25.86 +{
25.87 + char *page;
25.88 + if( addr > 0xE0000000 ) /* P4 Area, handled specially */
25.89 + return SIGNEXT16(sh4_read_p4( addr ));
25.90 +
25.91 + if( (addr&0x1F800000) == 0x04000000 ) {
25.92 + addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
25.93 + }
25.94 +
25.95 + page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
25.96 + if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
25.97 + if( page == NULL ) {
25.98 + ERROR( "Attempted word read to missing page: %08X",
25.99 + addr );
25.100 + return 0;
25.101 + }
25.102 + return SIGNEXT16(io_rgn[(uint32_t)page]->io_read(addr&0xFFF));
25.103 + } else {
25.104 + return SIGNEXT16(*(int16_t *)(page+(addr&0xFFF)));
25.105 + }
25.106 +}
25.107 +
25.108 +int32_t sh4_read_long( uint32_t addr )
25.109 +{
25.110 + char *page;
25.111 +
25.112 + CHECK_READ_WATCH(addr,4);
25.113 +
25.114 + if( addr > 0xE0000000 ) /* P4 Area, handled specially */
25.115 + return sh4_read_p4( addr );
25.116 +
25.117 + if( (addr&0x1F800000) == 0x04000000 ) {
25.118 + addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
25.119 + }
25.120 +
25.121 + if( IS_MMU_ENABLED() ) {
25.122 + ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
25.123 + sh4_stop();
25.124 + return 0;
25.125 + }
25.126 +
25.127 + page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
25.128 + if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
25.129 + int32_t val;
25.130 + if( page == NULL ) {
25.131 + ERROR( "Attempted long read to missing page: %08X", addr );
25.132 + return 0;
25.133 + }
25.134 + val = io_rgn[(uint32_t)page]->io_read(addr&0xFFF);
25.135 + TRACE_IO( "Long read %08X <= %08X", page, (addr&0xFFF), val, addr );
25.136 + return val;
25.137 + } else {
25.138 + return *(int32_t *)(page+(addr&0xFFF));
25.139 + }
25.140 +}
25.141 +
25.142 +int32_t sh4_read_word( uint32_t addr )
25.143 +{
25.144 + char *page;
25.145 +
25.146 + CHECK_READ_WATCH(addr,2);
25.147 +
25.148 + if( addr > 0xE0000000 ) /* P4 Area, handled specially */
25.149 + return SIGNEXT16(sh4_read_p4( addr ));
25.150 +
25.151 + if( (addr&0x1F800000) == 0x04000000 ) {
25.152 + addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
25.153 + }
25.154 +
25.155 + if( IS_MMU_ENABLED() ) {
25.156 + ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
25.157 + sh4_stop();
25.158 + return 0;
25.159 + }
25.160 +
25.161 + page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
25.162 + if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
25.163 + int32_t val;
25.164 + if( page == NULL ) {
25.165 + ERROR( "Attempted word read to missing page: %08X", addr );
25.166 + return 0;
25.167 + }
25.168 + val = SIGNEXT16(io_rgn[(uint32_t)page]->io_read(addr&0xFFF));
25.169 + TRACE_IO( "Word read %04X <= %08X", page, (addr&0xFFF), val&0xFFFF, addr );
25.170 + return val;
25.171 + } else {
25.172 + return SIGNEXT16(*(int16_t *)(page+(addr&0xFFF)));
25.173 + }
25.174 +}
25.175 +
25.176 +int32_t sh4_read_byte( uint32_t addr )
25.177 +{
25.178 + char *page;
25.179 +
25.180 + CHECK_READ_WATCH(addr,1);
25.181 +
25.182 + if( addr > 0xE0000000 ) /* P4 Area, handled specially */
25.183 + return SIGNEXT8(sh4_read_p4( addr ));
25.184 + if( (addr&0x1F800000) == 0x04000000 ) {
25.185 + addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
25.186 + }
25.187 +
25.188 + if( IS_MMU_ENABLED() ) {
25.189 + ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
25.190 + sh4_stop();
25.191 + return 0;
25.192 + }
25.193 +
25.194 + page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
25.195 + if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
25.196 + int32_t val;
25.197 + if( page == NULL ) {
25.198 + ERROR( "Attempted byte read to missing page: %08X", addr );
25.199 + return 0;
25.200 + }
25.201 + val = SIGNEXT8(io_rgn[(uint32_t)page]->io_read(addr&0xFFF));
25.202 + TRACE_IO( "Byte read %02X <= %08X", page, (addr&0xFFF), val&0xFF, addr );
25.203 + return val;
25.204 + } else {
25.205 + return SIGNEXT8(*(int8_t *)(page+(addr&0xFFF)));
25.206 + }
25.207 +}
25.208 +
25.209 +void sh4_write_long( uint32_t addr, uint32_t val )
25.210 +{
25.211 + char *page;
25.212 +
25.213 + CHECK_WRITE_WATCH(addr,4,val);
25.214 +
25.215 + if( addr > 0xE0000000 ) {
25.216 + sh4_write_p4( addr, val );
25.217 + return;
25.218 + }
25.219 + if( (addr&0x1F800000) == 0x04000000 ) {
25.220 + addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
25.221 + }
25.222 +
25.223 + if( IS_MMU_ENABLED() ) {
25.224 + ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
25.225 + sh4_stop();
25.226 + return;
25.227 + }
25.228 + if( (addr&0x1FFFFFFF) < 0x200000 ) {
25.229 + ERROR( "Attempted write to read-only memory: %08X => %08X", val, addr);
25.230 + sh4_stop();
25.231 + return;
25.232 + }
25.233 + page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
25.234 + if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
25.235 + if( page == NULL ) {
25.236 + ERROR( "Long write to missing page: %08X => %08X", val, addr );
25.237 + return;
25.238 + }
25.239 + TRACE_IO( "Long write %08X => %08X", page, (addr&0xFFF), val, addr );
25.240 + io_rgn[(uint32_t)page]->io_write(addr&0xFFF, val);
25.241 + } else {
25.242 + *(uint32_t *)(page+(addr&0xFFF)) = val;
25.243 + }
25.244 +}
25.245 +
25.246 +void sh4_write_word( uint32_t addr, uint32_t val )
25.247 +{
25.248 + char *page;
25.249 +
25.250 + CHECK_WRITE_WATCH(addr,2,val);
25.251 +
25.252 + if( addr > 0xE0000000 ) {
25.253 + sh4_write_p4( addr, (int16_t)val );
25.254 + return;
25.255 + }
25.256 + if( (addr&0x1F800000) == 0x04000000 ) {
25.257 + addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
25.258 + }
25.259 + if( IS_MMU_ENABLED() ) {
25.260 + ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
25.261 + sh4_stop();
25.262 + return;
25.263 + }
25.264 + page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
25.265 + if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
25.266 + if( page == NULL ) {
25.267 + ERROR( "Attempted word write to missing page: %08X", addr );
25.268 + return;
25.269 + }
25.270 + TRACE_IO( "Word write %04X => %08X", page, (addr&0xFFF), val&0xFFFF, addr );
25.271 + io_rgn[(uint32_t)page]->io_write(addr&0xFFF, val);
25.272 + } else {
25.273 + *(uint16_t *)(page+(addr&0xFFF)) = val;
25.274 + }
25.275 +}
25.276 +
25.277 +void sh4_write_byte( uint32_t addr, uint32_t val )
25.278 +{
25.279 + char *page;
25.280 +
25.281 + CHECK_WRITE_WATCH(addr,1,val);
25.282 +
25.283 + if( addr > 0xE0000000 ) {
25.284 + sh4_write_p4( addr, (int8_t)val );
25.285 + return;
25.286 + }
25.287 + if( (addr&0x1F800000) == 0x04000000 ) {
25.288 + addr = TRANSLATE_VIDEO_64BIT_ADDRESS(addr);
25.289 + }
25.290 +
25.291 + if( IS_MMU_ENABLED() ) {
25.292 + ERROR( "user-mode & mmu translation not implemented, aborting", NULL );
25.293 + sh4_stop();
25.294 + return;
25.295 + }
25.296 + page = page_map[ (addr & 0x1FFFFFFF) >> 12 ];
25.297 + if( ((uint32_t)page) < MAX_IO_REGIONS ) { /* IO Region */
25.298 + if( page == NULL ) {
25.299 + ERROR( "Attempted byte write to missing page: %08X", addr );
25.300 + return;
25.301 + }
25.302 + TRACE_IO( "Byte write %02X => %08X", page, (addr&0xFFF), val&0xFF, addr );
25.303 + io_rgn[(uint32_t)page]->io_write( (addr&0xFFF), val);
25.304 + } else {
25.305 + *(uint8_t *)(page+(addr&0xFFF)) = val;
25.306 + }
25.307 +}
25.308 +
25.309 +
25.310 +
25.311 +/* FIXME: Handle all the many special cases when the range doesn't fall cleanly
25.312 + * into the same memory black
25.313 + */
25.314 +void mem_copy_from_sh4( char *dest, uint32_t srcaddr, size_t count ) {
25.315 + char *src = mem_get_region(srcaddr);
25.316 + memcpy( dest, src, count );
25.317 +}
25.318 +
25.319 +void mem_copy_to_sh4( uint32_t destaddr, char *src, size_t count ) {
25.320 + char *dest = mem_get_region(destaddr);
25.321 + memcpy( dest, src, count );
25.322 +}
26.1 --- a/src/sh4/sh4mmio.c Thu Dec 08 13:38:00 2005 +0000
26.2 +++ b/src/sh4/sh4mmio.c Sun Dec 11 05:15:36 2005 +0000
26.3 @@ -9,11 +9,16 @@
26.4
26.5 MMIO_REGION_READ_STUBFN( MMU )
26.6
26.7 +#define OCRAM_START (0x1C000000>>PAGE_BITS)
26.8 +#define OCRAM_END (0x20000000>>PAGE_BITS)
26.9 +
26.10 +static char *cache = NULL;
26.11 +
26.12 void mmio_region_MMU_write( uint32_t reg, uint32_t val )
26.13 {
26.14 switch(reg) {
26.15 case CCR:
26.16 - mem_set_cache_mode( val & (CCR_OIX|CCR_ORA) );
26.17 + mmu_set_cache_mode( val & (CCR_OIX|CCR_ORA) );
26.18 INFO( "Cache mode set to %08X", val );
26.19 break;
26.20 default:
26.21 @@ -23,6 +28,31 @@
26.22 }
26.23
26.24
26.25 +void mmu_init()
26.26 +{
26.27 + cache = mem_alloc_pages(2);
26.28 +}
26.29 +
26.30 +void mmu_set_cache_mode( int mode )
26.31 +{
26.32 + uint32_t i;
26.33 + switch( mode ) {
26.34 + case MEM_OC_INDEX0: /* OIX=0 */
26.35 + for( i=OCRAM_START; i<OCRAM_END; i++ )
26.36 + page_map[i] = cache + ((i&0x02)<<(PAGE_BITS-1));
26.37 + break;
26.38 + case MEM_OC_INDEX1: /* OIX=1 */
26.39 + for( i=OCRAM_START; i<OCRAM_END; i++ )
26.40 + page_map[i] = cache + ((i&0x02000000)>>(25-PAGE_BITS));
26.41 + break;
26.42 + default: /* disabled */
26.43 + for( i=OCRAM_START; i<OCRAM_END; i++ )
26.44 + page_map[i] = NULL;
26.45 + break;
26.46 + }
26.47 +}
26.48 +
26.49 +
26.50 /********************************* BSC *************************************/
26.51
26.52 uint16_t bsc_output_mask_lo = 0, bsc_output_mask_hi = 0;
27.1 --- a/src/sh4/sh4mmio.h Thu Dec 08 13:38:00 2005 +0000
27.2 +++ b/src/sh4/sh4mmio.h Sun Dec 11 05:15:36 2005 +0000
27.3 @@ -150,4 +150,37 @@
27.4 MMIO_REGION( SCIF )
27.5 MMIO_REGION_LIST_END
27.6
27.7 +/* mmucr register bits */
27.8 +#define MMUCR_AT 0x00000001 /* Address Translation enabled */
27.9 +#define MMUCR_TI 0x00000004 /* TLB invalidate (always read as 0) */
27.10 +#define MMUCR_SV 0x00000100 /* Single Virtual mode=1 / multiple virtual=0 */
27.11 +#define MMUCR_SQMD 0x00000200 /* Store queue mode bit (0=user, 1=priv only) */
27.12 +#define MMUCR_URC 0x0000FC00 /* UTLB access counter */
27.13 +#define MMUCR_URB 0x00FC0000 /* UTLB entry boundary */
27.14 +#define MMUCR_LRUI 0xFC000000 /* Least recently used ITLB */
27.15 +#define MMUCR_MASK 0xFCFCFF05
27.16 +#define MMUCR_RMASK 0xFCFCFF01 /* Read mask */
27.17 +
27.18 +#define IS_MMU_ENABLED() (MMIO_READ(MMU, MMUCR)&MMUCR_AT)
27.19 +
27.20 +/* ccr register bits */
27.21 +#define CCR_IIX 0x00008000 /* IC index enable */
27.22 +#define CCR_ICI 0x00000800 /* IC invalidation (always read as 0) */
27.23 +#define CCR_ICE 0x00000100 /* IC enable */
27.24 +#define CCR_OIX 0x00000080 /* OC index enable */
27.25 +#define CCR_ORA 0x00000020 /* OC RAM enable */
27.26 +#define CCR_OCI 0x00000008 /* OC invalidation (always read as 0) */
27.27 +#define CCR_CB 0x00000004 /* Copy-back (P1 area cache write mode) */
27.28 +#define CCR_WT 0x00000002 /* Write-through (P0,U0,P3 write mode) */
27.29 +#define CCR_OCE 0x00000001 /* OC enable */
27.30 +#define CCR_MASK 0x000089AF
27.31 +#define CCR_RMASK 0x000081A7 /* Read mask */
27.32 +
27.33 +#define MEM_OC_DISABLED 0
27.34 +#define MEM_OC_INDEX0 CCR_ORA
27.35 +#define MEM_OC_INDEX1 CCR_ORA|CCR_OIX
27.36 +
27.37 +void mmu_init(void);
27.38 +void mmu_set_cache_mode( int );
27.39 +
27.40 #endif
.