diff -Nru fuse-emulator-1.2.0+dfsg1/ChangeLog fuse-emulator-1.2.1+dfsg1/ChangeLog --- fuse-emulator-1.2.0+dfsg1/ChangeLog 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/ChangeLog 2016-07-17 10:48:29.000000000 +0000 @@ -1,3 +1,33 @@ +2016-07-17 Philip Kendall + + * Fuse 1.2.1 released. + + * Emulation core improvements: + * Fix bugs when the detect loaders feature is being used (thanks, Lee + Tonks and windale) (Fredrick Meunier). + + * Debugger improvements: + * Remove the need for "%" when accessing system variables (Philip + Kendall). + * Add Z80 registers as debugger variables (Philip Kendall). + * Expose last byte written to the ULA, tstates since interrupt, + primary and secondary memory control ports as debugger system + variables (Philip Kendall). + * Make breakpoints on events honour lifetime (Sergio Baldoví). + * Extend breakpoints on paging events to more peripherals: Beta 128, + +D, Didaktik 80, DISCiPLE, Opus Discovery and SpeccyBoot (Sergio + Baldoví). + * Split +D memory sources into RAM and ROM sections (Sergio Baldoví). + * Coalesce +D and DISCiPLE RAM pages so they show as 8K pages (Sergio + Baldoví). + + * Miscellaneous improvements: + * Update GNOME .desktop file (Alberto Garcia). + * Add an emulator module startup manager to automatically handle + dependency issues (Philip Kendall). + * Fix crash on widget UIs when hitting the close icon on the title bar + several times (Sergio Baldoví). + 2016-06-06 Philip Kendall * Fuse 1.2.0 released. @@ -1295,4 +1325,4 @@ * Version 0.1.0 released. -$Id: ChangeLog 5594 2016-06-06 10:46:46Z fredm $ +$Id: ChangeLog 5686 2016-07-17 10:37:50Z fredm $ diff -Nru fuse-emulator-1.2.0+dfsg1/compat/Makefile.am fuse-emulator-1.2.1+dfsg1/compat/Makefile.am --- fuse-emulator-1.2.0+dfsg1/compat/Makefile.am 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/compat/Makefile.am 2016-07-17 10:48:32.000000000 +0000 @@ -2,7 +2,7 @@ ## Copyright (c) 2003-2013 Philip Kendall ## Copyright (c) 2015 Sergio Baldoví -## $Id: Makefile.am 5434 2016-05-01 04:22:45Z fredm $ +## $Id: Makefile.am 5677 2016-07-09 13:58:02Z fredm $ ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -32,10 +32,6 @@ fuse_SOURCES += compat/getopt.c compat/getopt1.c endif -if COMPAT_MKSTEMP -fuse_SOURCES += compat/mkstemp.c -endif - ## Amiga routines if COMPAT_AMIGA fuse_SOURCES += \ diff -Nru fuse-emulator-1.2.0+dfsg1/compat/mkstemp.c fuse-emulator-1.2.1+dfsg1/compat/mkstemp.c --- fuse-emulator-1.2.0+dfsg1/compat/mkstemp.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/compat/mkstemp.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,108 +0,0 @@ -/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - Modifications (c) 2003 Philip Kendall - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA. */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define uint64_t libspectrum_qword - -/* These are the characters used in temporary filenames. */ -static const char letters[] = -"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - -/* Generate a temporary file name based on TMPL. TMPL must match the - rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed - does not exist at the time of the call to __gen_tempname. TMPL is - overwritten with the result. - - We use a clever algorithm to get hard-to-predict names. */ -int -mkstemp (char *tmpl) -{ - int len; - char *XXXXXX; - static uint64_t value; - unsigned int count; - int fd = -1; - int save_errno = errno; - - /* A lower bound on the number of temporary files to attempt to - generate. The maximum total number of temporary file names that - can exist for a given template is 62**6. It should never be - necessary to try all these combinations. Instead if a reasonable - number of names is tried (we define reasonable as 62**3) fail to - give the system administrator the chance to remove the problems. */ - unsigned int attempts = 62 * 62 * 62; - - len = strlen (tmpl); - if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX")) - { - errno = EINVAL; - return -1; - } - - /* This is where the Xs start. */ - XXXXXX = &tmpl[len - 6]; - - /* Get some more or less random data. */ - value += time (NULL) ^ getpid (); - - for (count = 0; count < attempts; value += 7777, ++count) - { - uint64_t v = value; - - /* Fill in the random bits. */ - XXXXXX[0] = letters[v % 62]; - v /= 62; - XXXXXX[1] = letters[v % 62]; - v /= 62; - XXXXXX[2] = letters[v % 62]; - v /= 62; - XXXXXX[3] = letters[v % 62]; - v /= 62; - XXXXXX[4] = letters[v % 62]; - v /= 62; - XXXXXX[5] = letters[v % 62]; - - fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL | O_BINARY, S_IRUSR | S_IWUSR); - - if (fd >= 0) - { - errno = save_errno; - return fd; - } - else if (errno != EEXIST) - return -1; - } - - /* We got out of the loop because we ran out of combinations to try. */ - errno = EEXIST; - return -1; -} diff -Nru fuse-emulator-1.2.0+dfsg1/config.h.in fuse-emulator-1.2.1+dfsg1/config.h.in --- fuse-emulator-1.2.0+dfsg1/config.h.in 2016-06-06 11:03:52.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/config.h.in 2016-07-17 10:50:19.000000000 +0000 @@ -66,9 +66,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have the `mkstemp' function. */ -#undef HAVE_MKSTEMP - /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD diff -Nru fuse-emulator-1.2.0+dfsg1/configure fuse-emulator-1.2.1+dfsg1/configure --- fuse-emulator-1.2.0+dfsg1/configure 2016-06-06 11:03:53.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/configure 2016-07-17 10:50:20.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for fuse 1.2.0. +# Generated by GNU Autoconf 2.69 for fuse 1.2.1. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='fuse' PACKAGE_TARNAME='fuse' -PACKAGE_VERSION='1.2.0' -PACKAGE_STRING='fuse 1.2.0' +PACKAGE_VERSION='1.2.1' +PACKAGE_STRING='fuse 1.2.1' PACKAGE_BUGREPORT='http://sourceforge.net/p/fuse-emulator/bugs/' PACKAGE_URL='http://fuse-emulator.sourceforge.net/' @@ -658,8 +658,6 @@ COMPAT_LINUX_TRUE COMPAT_AMIGA_FALSE COMPAT_AMIGA_TRUE -COMPAT_MKSTEMP_FALSE -COMPAT_MKSTEMP_TRUE COMPAT_GETOPT_FALSE COMPAT_GETOPT_TRUE COMPAT_DIRNAME_FALSE @@ -1457,7 +1455,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures fuse 1.2.0 to adapt to many kinds of systems. +\`configure' configures fuse 1.2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1531,7 +1529,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of fuse 1.2.0:";; + short | recursive ) echo "Configuration of fuse 1.2.1:";; esac cat <<\_ACEOF @@ -1691,7 +1689,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -fuse configure 1.2.0 +fuse configure 1.2.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2060,7 +2058,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by fuse $as_me 1.2.0, which was +It was created by fuse $as_me 1.2.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2999,7 +2997,7 @@ # Define the identity of the package. PACKAGE='fuse' - VERSION='1.2.0' + VERSION='1.2.1' cat >>confdefs.h <<_ACEOF @@ -3090,7 +3088,7 @@ AM_BACKSLASH='\' -FUSE_FULL_VERSION=1.2.0.0 +FUSE_FULL_VERSION=1.2.1.0 FUSE_COPYRIGHT="(c) 1999-2016 Philip Kendall and others" FUSE_URL=http://fuse-emulator.sourceforge.net/ @@ -3098,7 +3096,7 @@ -$as_echo "#define FUSE_RC_VERSION 1,2,0,0" >>confdefs.h +$as_echo "#define FUSE_RC_VERSION 1,2,1,0" >>confdefs.h $as_echo "#define FUSE_COPYRIGHT \"(c) 1999-2016 Philip Kendall and others\"" >>confdefs.h @@ -12770,7 +12768,7 @@ esac -for ac_func in dirname geteuid getopt_long mkstemp fsync +for ac_func in dirname geteuid getopt_long fsync do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -18015,17 +18013,6 @@ COMPAT_GETOPT_FALSE= fi -if test "$ac_cv_func_mkstemp" = no; then - missing_routines="$missing_routines"'mkstemp ' -fi - if test "$ac_cv_func_mkstemp" = no; then - COMPAT_MKSTEMP_TRUE= - COMPAT_MKSTEMP_FALSE='#' -else - COMPAT_MKSTEMP_TRUE='#' - COMPAT_MKSTEMP_FALSE= -fi - if test "x$missing_routines" = x; then missing_routines='(none)' fi @@ -18486,10 +18473,6 @@ as_fn_error $? "conditional \"COMPAT_GETOPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${COMPAT_MKSTEMP_TRUE}" && test -z "${COMPAT_MKSTEMP_FALSE}"; then - as_fn_error $? "conditional \"COMPAT_MKSTEMP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${COMPAT_AMIGA_TRUE}" && test -z "${COMPAT_AMIGA_FALSE}"; then as_fn_error $? "conditional \"COMPAT_AMIGA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -18923,7 +18906,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by fuse $as_me 1.2.0, which was +This file was extended by fuse $as_me 1.2.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18994,7 +18977,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -fuse config.status 1.2.0 +fuse config.status 1.2.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru fuse-emulator-1.2.0+dfsg1/configure.ac fuse-emulator-1.2.1+dfsg1/configure.ac --- fuse-emulator-1.2.0+dfsg1/configure.ac 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/configure.ac 2016-07-17 10:48:28.000000000 +0000 @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $Id: configure.ac 5594 2016-06-06 10:46:46Z fredm $ +dnl $Id: configure.ac 5686 2016-07-17 10:37:50Z fredm $ dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -20,12 +20,12 @@ dnl E-mail: philip-fuse@shadowmagic.org.uk dnl Package version -m4_define([fuse_version], [1.2.0]) +m4_define([fuse_version], [1.2.1]) dnl Product full version m4_define([fuse_major_version], [1]) m4_define([fuse_minor_version], [2]) -m4_define([fuse_micro_version], [0]) +m4_define([fuse_micro_version], [1]) m4_define([fuse_nano_version], [0]) m4_define([fuse_full_version], [fuse_major_version.fuse_minor_version.fuse_micro_version.fuse_nano_version]) m4_define([fuse_rc_version], [fuse_major_version,fuse_minor_version,fuse_micro_version,fuse_nano_version]) @@ -104,7 +104,7 @@ AC_C_INLINE dnl Checks for library functions. -AC_CHECK_FUNCS(dirname geteuid getopt_long mkstemp fsync) +AC_CHECK_FUNCS(dirname geteuid getopt_long fsync) AC_CHECK_LIB([m],[cos]) dnl Allow the user to say that various libraries are in one place @@ -834,10 +834,6 @@ esac fi AM_CONDITIONAL(COMPAT_GETOPT, test "$compat_getopt" = yes) -if test "$ac_cv_func_mkstemp" = no; then - missing_routines="$missing_routines"'mkstemp ' -fi -AM_CONDITIONAL(COMPAT_MKSTEMP, test "$ac_cv_func_mkstemp" = no) if test "x$missing_routines" = x; then missing_routines='(none)' fi diff -Nru fuse-emulator-1.2.0+dfsg1/data/fuse.desktop.in fuse-emulator-1.2.1+dfsg1/data/fuse.desktop.in --- fuse-emulator-1.2.0+dfsg1/data/fuse.desktop.in 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/data/fuse.desktop.in 2016-07-17 10:48:30.000000000 +0000 @@ -2,9 +2,10 @@ Version=1.0 Type=Application Categories=Game;Emulator;GTK; -Name=Fuse Spectrum Emulator +Name=Fuse +GenericName=Spectrum Emulator Comment=Emulator of the 1980s ZX Spectrum home computer and its various clones MimeType=@MIME_TYPES@ Exec=fuse %f Icon=fuse - +Keywords=sinclair;zx;game;retro; diff -Nru fuse-emulator-1.2.0+dfsg1/debian/changelog fuse-emulator-1.2.1+dfsg1/debian/changelog --- fuse-emulator-1.2.0+dfsg1/debian/changelog 2016-06-07 22:48:15.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debian/changelog 2016-07-22 23:21:53.000000000 +0000 @@ -1,3 +1,19 @@ +fuse-emulator (1.2.1+dfsg1-1) unstable; urgency=medium + + * New upstream release. + * Refresh the following patches: + - compile-without-roms.patch + - disable-autoload.patch + - load-opense-rom.patch + - manpage-errors.patch + - missing-roms-help.patch + * debian/rules: + - Update sed rules for the new desktop file. + * debian/copyright: + - Remove reference to missing mkstemp.c file. + + -- Alberto Garcia Sat, 23 Jul 2016 01:21:48 +0200 + fuse-emulator (1.2.0+dfsg1-1) unstable; urgency=medium * New upstream release (Closes: #745402). diff -Nru fuse-emulator-1.2.0+dfsg1/debian/copyright fuse-emulator-1.2.1+dfsg1/debian/copyright --- fuse-emulator-1.2.0+dfsg1/debian/copyright 2016-06-07 22:48:15.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debian/copyright 2016-07-22 23:21:53.000000000 +0000 @@ -14,7 +14,6 @@ Files: compat/getopt.c compat/getopt.h compat/getopt1.c - compat/mkstemp.c Copyright: 1987-2001 Free Software Foundation, Inc. 2003 Philip Kendall License: LGPL-2.1+ diff -Nru fuse-emulator-1.2.0+dfsg1/debian/patches/compile-without-roms.patch fuse-emulator-1.2.1+dfsg1/debian/patches/compile-without-roms.patch --- fuse-emulator-1.2.0+dfsg1/debian/patches/compile-without-roms.patch 2016-06-07 22:48:15.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debian/patches/compile-without-roms.patch 2016-07-22 23:21:53.000000000 +0000 @@ -6,7 +6,7 @@ =================================================================== --- fuse-emulator.orig/Makefile.am +++ fuse-emulator/Makefile.am -@@ -176,7 +176,6 @@ include man/Makefile.am +@@ -177,7 +177,6 @@ include man/Makefile.am include peripherals/Makefile.am include perl/Makefile.am include pokefinder/Makefile.am diff -Nru fuse-emulator-1.2.0+dfsg1/debian/patches/disable-autoload.patch fuse-emulator-1.2.1+dfsg1/debian/patches/disable-autoload.patch --- fuse-emulator-1.2.0+dfsg1/debian/patches/disable-autoload.patch 2016-06-07 22:48:15.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debian/patches/disable-autoload.patch 2016-07-22 23:21:53.000000000 +0000 @@ -5,7 +5,7 @@ =================================================================== --- fuse-emulator.orig/tape.c +++ fuse-emulator/tape.c -@@ -146,6 +146,7 @@ tape_read_buffer( unsigned char *buffer, +@@ -166,6 +166,7 @@ tape_read_buffer( unsigned char *buffer, const char *filename, int autoload ) { int error; @@ -13,7 +13,7 @@ if( libspectrum_tape_present( tape ) ) { error = tape_close(); if( error ) return error; -@@ -157,7 +158,7 @@ tape_read_buffer( unsigned char *buffer, +@@ -177,7 +178,7 @@ tape_read_buffer( unsigned char *buffer, tape_modified = 0; ui_tape_browser_update( UI_TAPE_BROWSER_NEW_TAPE, NULL ); diff -Nru fuse-emulator-1.2.0+dfsg1/debian/patches/load-opense-rom.patch fuse-emulator-1.2.1+dfsg1/debian/patches/load-opense-rom.patch --- fuse-emulator-1.2.0+dfsg1/debian/patches/load-opense-rom.patch 2016-06-07 22:48:15.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debian/patches/load-opense-rom.patch 2016-07-22 23:21:53.000000000 +0000 @@ -5,7 +5,7 @@ =================================================================== --- fuse-emulator.orig/machine.c +++ fuse-emulator/machine.c -@@ -53,6 +53,7 @@ +@@ -54,6 +54,7 @@ fuse_machine_info **machine_types = NULL; /* Array of available machines */ int machine_count = 0; @@ -13,7 +13,7 @@ fuse_machine_info *machine_current = NULL; /* The currently selected machine */ static int machine_location; /* Where is the current machine in -@@ -275,6 +276,41 @@ machine_load_rom_bank_from_file( memory_ +@@ -277,6 +278,41 @@ machine_load_rom_bank_from_file( memory_ utils_file rom; error = utils_read_auxiliary_file( filename, &rom, UTILS_AUXILIARY_ROM ); @@ -59,7 +59,7 @@ =================================================================== --- fuse-emulator.orig/settings.pl +++ fuse-emulator/settings.pl -@@ -105,6 +105,7 @@ print hashline( __LINE__ ), << 'CODE'; +@@ -106,6 +106,7 @@ print hashline( __LINE__ ), << 'CODE'; /* The current settings of options, etc */ settings_info settings_current; @@ -67,7 +67,7 @@ /* The default settings of options, etc */ settings_info settings_default = { -@@ -193,6 +194,8 @@ read_config_file( settings_info *setting +@@ -194,6 +195,8 @@ read_config_file( settings_info *setting xmlFreeDoc( doc ); @@ -80,7 +80,7 @@ =================================================================== --- fuse-emulator.orig/settings.c +++ fuse-emulator/settings.c -@@ -65,6 +65,7 @@ +@@ -66,6 +66,7 @@ /* The current settings of options, etc */ settings_info settings_current; @@ -88,7 +88,7 @@ /* The default settings of options, etc */ settings_info settings_default = { -@@ -360,6 +361,8 @@ read_config_file( settings_info *setting +@@ -361,6 +362,8 @@ read_config_file( settings_info *setting xmlFreeDoc( doc ); diff -Nru fuse-emulator-1.2.0+dfsg1/debian/patches/manpage-errors.patch fuse-emulator-1.2.1+dfsg1/debian/patches/manpage-errors.patch --- fuse-emulator-1.2.0+dfsg1/debian/patches/manpage-errors.patch 2016-06-07 22:48:15.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debian/patches/manpage-errors.patch 2016-07-22 23:21:53.000000000 +0000 @@ -14,7 +14,7 @@ for further explanation. .br .IP \[bu] -@@ -3013,7 +3013,7 @@ Spectrum's power off, and then turning i +@@ -3023,7 +3023,7 @@ Spectrum's power off, and then turning i .RS Choose a type of Spectrum to emulate. An brief overview of the Sinclair, Amstrad and Timex can be found at @@ -23,7 +23,7 @@ while more technical information can be found at .IR "http://www.worldofspectrum.org/faq/reference/reference.htm" , and -@@ -4895,7 +4895,7 @@ Didaktik 80 and Didaktik 40 file formats +@@ -5007,7 +5007,7 @@ Didaktik 80 and Didaktik 40 file formats .I .TRD .RS TR-DOS disk image; for detailed information please see diff -Nru fuse-emulator-1.2.0+dfsg1/debian/patches/missing-roms-help.patch fuse-emulator-1.2.1+dfsg1/debian/patches/missing-roms-help.patch --- fuse-emulator-1.2.0+dfsg1/debian/patches/missing-roms-help.patch 2016-06-07 22:48:15.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debian/patches/missing-roms-help.patch 2016-07-22 23:21:53.000000000 +0000 @@ -8,7 +8,7 @@ =================================================================== --- fuse-emulator.orig/machine.c +++ fuse-emulator/machine.c -@@ -276,7 +276,7 @@ machine_load_rom_bank_from_file( memory_ +@@ -278,7 +278,7 @@ machine_load_rom_bank_from_file( memory_ error = utils_read_auxiliary_file( filename, &rom, UTILS_AUXILIARY_ROM ); if( error == -1 ) { diff -Nru fuse-emulator-1.2.0+dfsg1/debian/rules fuse-emulator-1.2.1+dfsg1/debian/rules --- fuse-emulator-1.2.0+dfsg1/debian/rules 2016-06-07 22:48:15.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debian/rules 2016-07-22 23:21:53.000000000 +0000 @@ -22,16 +22,14 @@ dh_auto_build -B$(BUILD_DIR_GTK) -- EXEEXT=-gtk cat $(BUILD_DIR_GTK)/data/fuse.desktop | \ sed -e 's,Exec=.*,Exec=/usr/bin/fuse-gtk %f,' \ - -e 's,Name=\(.*\),Name=\1 (GTK+ version),' \ - -e 's/^$$/Keywords=emulator;sinclair;spectrum;/' > \ + -e 's,^Name=\(.*\),Name=\1 (GTK+),' > \ $(BUILD_DIR_GTK)/fuse-gtk.desktop dh_auto_build -B$(BUILD_DIR_SDL) -- EXEEXT=-sdl cat $(BUILD_DIR_SDL)/data/fuse.desktop | \ sed -e 's,Exec=.*,Exec=/usr/bin/fuse-sdl %f,' \ - -e 's,Name=\(.*\),Name=\1 (SDL version),' \ - -e 's,GNOME;GTK;,,' \ - -e 's/^$$/Keywords=emulator;sinclair;spectrum;/' > \ + -e 's,^Name=\(.*\),Name=\1 (SDL),' \ + -e 's,;GTK,,' > \ $(BUILD_DIR_SDL)/fuse-sdl.desktop override_dh_auto_install: diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/command.c fuse-emulator-1.2.1+dfsg1/debugger/command.c --- fuse-emulator-1.2.0+dfsg1/debugger/command.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/command.c 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* command.c: Parse a debugger command Copyright (c) 2002-2015 Philip Kendall - $Id: command.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: command.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -95,51 +95,6 @@ } } -/* Convert a register name to a useful index value */ -int -debugger_register_hash( const char *name ) -{ - int hash = 0x0000, primed = 0; - size_t length; - const char *ptr; - - length = strlen( name ); - - if( name[ length - 1 ] == '\'' ) { primed = 1; length--; } - - for( ptr = name; ptr < name + length; ptr++ ) { - hash <<= 8; hash |= tolower( *ptr ); - } - - if( primed ) hash |= 0x8000; - - switch( hash ) { - case 0x0061: case 0x8061: /* A, A' */ - case 0x0066: case 0x8066: /* F, F' */ - case 0x0062: case 0x8062: /* B, B' */ - case 0x0063: case 0x8063: /* C, C' */ - case 0x0064: case 0x8064: /* D, D' */ - case 0x0065: case 0x8065: /* E, E' */ - case 0x0068: case 0x8068: /* H, H' */ - case 0x006c: case 0x806c: /* L, L' */ - case 0x0069: case 0x0072: /* I, R */ - case 0x6166: case 0xe166: /* AF, AF' */ - case 0x6263: case 0xe263: /* BC, BC' */ - case 0x6465: case 0xe465: /* DE, DE' */ - case 0x686c: case 0xe86c: /* HL, HL' */ - case 0x7370: /* SP */ - case 0x7063: /* PC */ - case 0x6978: /* IX */ - case 0x6979: /* IY */ - case 0x696d: /* IM */ - case 0x69666631: /* IFF1 */ - case 0x69666632: /* IFF2 */ - return hash; - - default: return -1; - } -} - /* Utility functions called by the bison parser */ /* The error callback if yyparse finds an error */ @@ -149,161 +104,13 @@ ui_error( UI_ERROR_ERROR, "Invalid debugger command: %s", s ); } -/* Get the value of a register */ -libspectrum_word -debugger_register_get( int which ) -{ - switch( which ) { - - /* 8-bit registers */ - case 0x0061: return A; - case 0x8061: return A_; - case 0x0066: return F; - case 0x8066: return F_; - case 0x0062: return B; - case 0x8062: return B_; - case 0x0063: return C; - case 0x8063: return C_; - case 0x0064: return D; - case 0x8064: return D_; - case 0x0065: return E; - case 0x8065: return E_; - case 0x0068: return H; - case 0x8068: return H_; - case 0x006c: return L; - case 0x806c: return L_; - - case 0x0069: return I; - case 0x0072: return ( R7 & 0x80 ) | ( R & 0x7f ); - - /* 16-bit registers */ - case 0x6166: return AF; - case 0xe166: return AF_; - case 0x6263: return BC; - case 0xe263: return BC_; - case 0x6465: return DE; - case 0xe465: return DE_; - case 0x686c: return HL; - case 0xe86c: return HL_; - - case 0x7370: return SP; - case 0x7063: return PC; - case 0x6978: return IX; - case 0x6979: return IY; - - /* interrupt flags */ - case 0x696d: return IM; - case 0x69666631: return IFF1; - case 0x69666632: return IFF2; - - default: - ui_error( UI_ERROR_ERROR, "attempt to get unknown register '%d'", which ); - return 0; - } -} - -/* Set the value of a register */ +/* Set the value of a register + + Now just a pass through to the appropriate system variable. + This function should be removed in Fuse 1.4 */ void -debugger_register_set( int which, libspectrum_word value ) +debugger_register_set( const char *which, libspectrum_word value ) { - switch( which ) { - - /* 8-bit registers */ - case 0x0061: A = value; break; - case 0x8061: A_ = value; break; - case 0x0066: F = value; break; - case 0x8066: F_ = value; break; - case 0x0062: B = value; break; - case 0x8062: B_ = value; break; - case 0x0063: C = value; break; - case 0x8063: C_ = value; break; - case 0x0064: D = value; break; - case 0x8064: D_ = value; break; - case 0x0065: E = value; break; - case 0x8065: E_ = value; break; - case 0x0068: H = value; break; - case 0x8068: H_ = value; break; - case 0x006c: L = value; break; - case 0x806c: L_ = value; break; - - case 0x0069: I = value; break; - case 0x0072: R = R7 = value; break; - - /* 16-bit registers */ - case 0x6166: AF = value; break; - case 0xe166: AF_ = value; break; - case 0x6263: BC = value; break; - case 0xe263: BC_ = value; break; - case 0x6465: DE = value; break; - case 0xe465: DE_ = value; break; - case 0x686c: HL = value; break; - case 0xe86c: HL_ = value; break; - - case 0x7370: SP = value; break; - case 0x7063: PC = value; break; - case 0x6978: IX = value; break; - case 0x6979: IY = value; break; - - /* interrupt flags */ - case 0x696d: if( value >= 0 && value <=2 ) IM = value; break; - case 0x69666631: IFF1 = !!value; break; - case 0x69666632: IFF2 = !!value; break; - - default: - ui_error( UI_ERROR_ERROR, "attempt to set unknown register '%d'", which ); - break; - } -} - -/* Get the textual representation of a register */ -const char * -debugger_register_text( int which ) -{ - switch( which ) { - - /* 8-bit registers */ - case 0x0061: return "A"; - case 0x8061: return "A'"; - case 0x0066: return "F"; - case 0x8066: return "F'"; - case 0x0062: return "B"; - case 0x8062: return "B'"; - case 0x0063: return "C"; - case 0x8063: return "C'"; - case 0x0064: return "D"; - case 0x8064: return "D'"; - case 0x0065: return "E"; - case 0x8065: return "E'"; - case 0x0068: return "H"; - case 0x8068: return "H'"; - case 0x006c: return "L"; - case 0x806c: return "L'"; - - case 0x0069: return "I"; - case 0x0072: return "R"; - - /* 16-bit registers */ - case 0x6166: return "AF"; - case 0xe166: return "AF'"; - case 0x6263: return "BC"; - case 0xe263: return "BC'"; - case 0x6465: return "DE"; - case 0xe465: return "DE'"; - case 0x686c: return "HL"; - case 0xe86c: return "HL'"; - - case 0x7370: return "SP"; - case 0x7063: return "PC"; - case 0x6978: return "IX"; - case 0x6979: return "IY"; - - /* interrupt flags */ - case 0x696d: return "IM"; - case 0x69666631: return "IFF1"; - case 0x69666632: return "IFF2"; - - default: - ui_error( UI_ERROR_ERROR, "attempt to get unknown register '%d'", which ); - return "(invalid)"; - } + debugger_system_variable_set( debugger_z80_system_variable_type, which, + value ); } diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/commandl.c fuse-emulator-1.2.1+dfsg1/debugger/commandl.c --- fuse-emulator-1.2.0+dfsg1/debugger/commandl.c 2016-06-06 11:04:23.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/commandl.c 2016-07-17 10:50:52.000000000 +0000 @@ -358,8 +358,8 @@ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 62 -#define YY_END_OF_BUFFER 63 +#define YY_NUM_RULES 58 +#define YY_END_OF_BUFFER 59 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -369,27 +369,27 @@ }; static yyconst flex_int16_t yy_accept[199] = { 0, - 0, 0, 0, 0, 60, 60, 63, 58, 56, 57, - 33, 58, 45, 29, 30, 43, 41, 42, 44, 53, - 53, 50, 37, 58, 38, 24, 24, 24, 24, 24, - 24, 58, 24, 27, 24, 14, 15, 16, 27, 20, - 21, 23, 31, 32, 46, 47, 34, 60, 61, 60, - 57, 36, 51, 51, 0, 48, 53, 0, 39, 35, - 40, 25, 54, 26, 0, 1, 26, 2, 6, 3, - 26, 8, 9, 10, 11, 26, 12, 13, 28, 27, - 27, 14, 15, 27, 16, 17, 18, 19, 27, 20, - 21, 22, 23, 49, 60, 60, 51, 55, 0, 52, - - 26, 1, 2, 6, 4, 3, 7, 54, 8, 9, - 10, 11, 54, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 59, 1, 2, 6, 4, 5, - 3, 7, 54, 8, 9, 10, 11, 13, 14, 16, + 0, 0, 0, 0, 56, 56, 59, 54, 52, 53, + 29, 54, 41, 25, 26, 39, 37, 38, 40, 49, + 49, 46, 33, 54, 34, 24, 24, 24, 24, 24, + 24, 50, 24, 24, 24, 14, 15, 16, 24, 20, + 21, 23, 27, 28, 42, 43, 30, 56, 57, 56, + 53, 32, 47, 47, 51, 44, 49, 0, 35, 31, + 36, 24, 50, 24, 0, 1, 24, 2, 6, 3, + 24, 8, 9, 10, 11, 24, 12, 13, 24, 24, + 24, 14, 15, 24, 16, 17, 18, 19, 24, 20, + 21, 22, 23, 45, 56, 56, 47, 51, 0, 48, + + 1, 2, 6, 4, 3, 7, 50, 8, 9, 10, + 11, 50, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 55, 1, 2, 6, 4, 5, 3, + 7, 50, 8, 9, 10, 11, 24, 13, 14, 16, 17, 18, 20, 21, 22, 23, 2, 6, 4, 5, - 54, 7, 54, 8, 9, 11, 13, 17, 21, 23, - 2, 4, 5, 3, 7, 54, 8, 11, 13, 21, - 2, 4, 5, 3, 54, 8, 8, 21, 2, 4, - 5, 3, 54, 54, 8, 21, 2, 5, 54, 54, - 21, 2, 8, 54, 21, 8, 21, 0 + 50, 7, 50, 8, 9, 11, 13, 17, 21, 23, + 2, 4, 5, 3, 7, 50, 8, 11, 13, 21, + 2, 4, 5, 3, 50, 8, 8, 21, 2, 4, + 5, 3, 50, 50, 8, 21, 2, 5, 50, 50, + 21, 2, 8, 50, 21, 8, 21, 0 } ; @@ -439,29 +439,29 @@ static yyconst flex_int16_t yy_base[206] = { 0, - 0, 0, 0, 0, 73, 74, 115, 807, 807, 111, - 90, 115, 103, 807, 807, 807, 807, 807, 807, 63, - 67, 807, 88, 86, 82, 78, 97, 117, 129, 104, + 0, 0, 0, 0, 73, 74, 115, 811, 811, 111, + 90, 115, 103, 811, 811, 811, 811, 811, 811, 63, + 67, 811, 88, 86, 82, 78, 97, 117, 129, 104, 96, 105, 138, 192, 109, 153, 116, 165, 167, 171, - 199, 195, 807, 807, 807, 28, 807, 0, 807, 51, - 95, 807, 0, 251, 50, 807, 73, 0, 807, 807, - 807, 807, 111, 184, 93, 185, 187, 233, 236, 247, + 199, 195, 811, 811, 811, 28, 811, 0, 811, 51, + 95, 811, 0, 251, 50, 811, 73, 0, 811, 811, + 811, 811, 111, 184, 93, 185, 187, 233, 236, 247, 237, 249, 265, 286, 278, 198, 300, 279, 202, 208, 245, 288, 282, 303, 304, 313, 314, 316, 310, 311, - 332, 338, 345, 807, 0, 67, 390, 48, 91, 0, + 332, 338, 345, 811, 0, 67, 390, 48, 91, 0, - 807, 327, 371, 373, 339, 421, 375, 387, 380, 389, - 391, 361, 432, 418, 426, 341, 442, 425, 445, 403, - 448, 449, 450, 460, 0, 452, 470, 473, 483, 476, - 484, 479, 494, 471, 508, 477, 506, 514, 515, 518, - 529, 521, 533, 536, 540, 544, 547, 542, 543, 552, - 550, 556, 567, 570, 553, 566, 581, 557, 594, 574, - 595, 609, 608, 613, 601, 618, 617, 620, 622, 633, - 638, 640, 625, 656, 639, 643, 668, 669, 667, 642, - 676, 645, 686, 694, 652, 688, 687, 700, 706, 715, - 705, 713, 714, 717, 718, 721, 723, 807, 785, 788, + 327, 371, 373, 339, 421, 375, 387, 380, 389, 391, + 361, 432, 418, 426, 341, 442, 425, 445, 403, 448, + 449, 450, 460, 0, 452, 470, 473, 483, 476, 484, + 479, 494, 471, 508, 477, 506, 514, 518, 515, 521, + 529, 532, 533, 542, 540, 544, 547, 543, 550, 553, + 560, 552, 566, 570, 556, 581, 595, 567, 594, 597, + 601, 608, 609, 611, 612, 618, 628, 616, 622, 623, + 636, 633, 638, 624, 639, 661, 669, 670, 674, 644, + 683, 681, 690, 691, 696, 697, 700, 703, 716, 718, + 717, 712, 719, 727, 722, 724, 725, 811, 789, 792, - 791, 797, 89, 800, 87 + 795, 801, 89, 804, 87 } ; static yyconst flex_int16_t yy_def[206] = @@ -477,9 +477,9 @@ 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 198, 202, 202, 204, 204, 198, 205, - 198, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, - 201, 201, 201, 201, 202, 201, 201, 201, 201, 201, + 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, + 201, 201, 201, 202, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, @@ -491,7 +491,7 @@ 198, 198, 198, 198, 198 } ; -static yyconst flex_int16_t yy_nxt[882] = +static yyconst flex_int16_t yy_nxt[886] = { 0, 8, 9, 10, 11, 12, 13, 8, 14, 15, 16, 17, 18, 19, 20, 21, 21, 21, 22, 23, 24, @@ -502,10 +502,10 @@ 32, 36, 37, 38, 39, 40, 41, 32, 32, 42, 32, 32, 46, 47, 49, 49, 57, 57, 57, 57, 57, 57, 57, 57, 62, 96, 57, 57, 57, 57, - 100, 125, 53, 98, 99, 63, 99, 51, 50, 50, + 100, 124, 53, 98, 99, 63, 99, 51, 50, 50, 94, 61, 62, 62, 64, 60, 58, 59, 56, 52, - 62, 198, 96, 51, 198, 62, 198, 198, 66, 125, + 62, 198, 96, 51, 198, 62, 198, 198, 66, 124, 67, 198, 198, 62, 65, 75, 50, 50, 53, 53, 53, 53, 64, 58, 68, 62, 54, 54, 54, 54, 54, 54, 65, 65, 62, 73, 66, 74, 67, 69, @@ -513,39 +513,39 @@ 198, 68, 65, 65, 54, 54, 54, 54, 54, 54, 76, 198, 73, 198, 74, 65, 69, 198, 82, 70, 198, 198, 71, 83, 65, 198, 72, 198, 84, 198, - 101, 198, 87, 101, 198, 198, 88, 76, 198, 65, + 62, 198, 87, 62, 198, 198, 88, 76, 198, 65, - 85, 198, 86, 198, 101, 198, 82, 89, 198, 198, + 85, 198, 86, 198, 62, 198, 82, 89, 198, 198, 90, 65, 198, 65, 198, 198, 84, 65, 77, 78, - 87, 91, 198, 102, 88, 79, 198, 85, 92, 86, + 87, 91, 198, 101, 88, 79, 198, 85, 92, 86, 65, 65, 93, 65, 89, 80, 81, 90, 65, 198, - 198, 65, 198, 101, 65, 65, 77, 78, 65, 91, - 102, 198, 79, 198, 65, 198, 92, 198, 103, 93, - 198, 104, 80, 81, 97, 97, 97, 97, 198, 107, - 108, 198, 97, 97, 97, 97, 97, 97, 198, 65, - 105, 106, 65, 65, 198, 198, 103, 109, 198, 104, - 110, 65, 198, 65, 198, 65, 107, 99, 108, 198, - - 97, 97, 97, 97, 97, 97, 198, 105, 106, 198, - 198, 65, 112, 114, 109, 111, 198, 198, 110, 198, - 198, 116, 198, 198, 65, 65, 113, 198, 65, 198, - 198, 115, 65, 198, 65, 119, 121, 198, 198, 112, - 114, 117, 118, 111, 198, 198, 65, 198, 116, 65, - 65, 198, 126, 198, 113, 120, 65, 65, 115, 65, - 65, 198, 65, 119, 121, 198, 198, 198, 117, 122, - 118, 123, 129, 65, 124, 198, 198, 198, 65, 198, - 126, 198, 120, 198, 65, 65, 198, 65, 198, 198, - 137, 65, 127, 198, 128, 198, 122, 198, 123, 129, - - 132, 134, 124, 97, 97, 97, 97, 65, 198, 198, - 198, 97, 97, 97, 97, 97, 97, 65, 137, 65, - 127, 65, 128, 135, 198, 133, 65, 198, 132, 134, - 136, 198, 198, 65, 198, 65, 99, 65, 198, 97, - 97, 97, 97, 97, 97, 130, 79, 79, 198, 65, - 135, 198, 133, 138, 198, 198, 198, 136, 198, 141, - 131, 198, 198, 198, 65, 139, 198, 65, 198, 142, - 198, 65, 65, 130, 144, 145, 198, 198, 65, 198, - 138, 140, 198, 198, 143, 198, 141, 131, 65, 198, + 198, 65, 198, 62, 65, 65, 77, 78, 65, 91, + 101, 198, 79, 198, 65, 198, 92, 198, 102, 93, + 198, 103, 80, 81, 97, 97, 97, 97, 198, 106, + 107, 198, 97, 97, 97, 97, 97, 97, 198, 65, + 104, 105, 65, 65, 198, 198, 102, 108, 198, 103, + 109, 65, 198, 65, 198, 65, 106, 99, 107, 198, + + 97, 97, 97, 97, 97, 97, 198, 104, 105, 198, + 198, 65, 111, 113, 108, 110, 198, 198, 109, 198, + 198, 115, 198, 198, 65, 65, 112, 198, 65, 198, + 198, 114, 65, 198, 65, 118, 120, 198, 198, 111, + 113, 116, 117, 110, 198, 198, 65, 198, 115, 65, + 65, 198, 125, 198, 112, 119, 65, 65, 114, 65, + 65, 198, 65, 118, 120, 198, 198, 198, 116, 121, + 117, 122, 128, 65, 123, 198, 198, 198, 65, 198, + 125, 198, 119, 198, 65, 65, 198, 65, 198, 198, + 136, 65, 126, 198, 127, 198, 121, 198, 122, 128, + + 131, 133, 123, 97, 97, 97, 97, 65, 198, 198, + 198, 97, 97, 97, 97, 97, 97, 65, 136, 65, + 126, 65, 127, 134, 198, 132, 65, 198, 131, 133, + 135, 198, 198, 65, 198, 65, 99, 65, 198, 97, + 97, 97, 97, 97, 97, 129, 137, 137, 198, 65, + 134, 198, 132, 138, 198, 198, 198, 135, 198, 141, + 130, 198, 198, 198, 65, 139, 198, 65, 198, 142, + 198, 65, 65, 129, 144, 145, 198, 198, 65, 198, + 138, 140, 198, 198, 143, 198, 141, 130, 65, 198, 198, 65, 139, 198, 65, 65, 65, 142, 65, 146, 198, 147, 144, 145, 149, 150, 65, 198, 140, 154, @@ -553,46 +553,46 @@ 198, 198, 65, 65, 198, 65, 146, 198, 147, 65, 65, 198, 149, 150, 198, 198, 154, 148, 198, 198, 65, 151, 198, 153, 156, 152, 198, 155, 198, 198, - 198, 157, 65, 198, 65, 198, 198, 159, 198, 198, - 65, 65, 198, 198, 65, 198, 198, 65, 158, 160, - 198, 156, 198, 198, 155, 65, 198, 162, 157, 65, - 198, 165, 65, 161, 164, 159, 65, 198, 65, 65, - 65, 163, 198, 65, 168, 158, 65, 160, 65, 65, - - 198, 198, 65, 65, 162, 166, 169, 198, 167, 165, - 161, 164, 65, 65, 198, 198, 65, 198, 163, 198, - 65, 198, 168, 198, 198, 170, 198, 65, 198, 198, - 171, 198, 166, 172, 169, 167, 198, 173, 198, 198, - 65, 65, 176, 198, 198, 198, 198, 65, 198, 198, - 177, 198, 170, 174, 65, 65, 175, 171, 198, 65, - 181, 172, 198, 65, 65, 173, 65, 179, 65, 178, - 176, 65, 183, 198, 198, 198, 184, 177, 180, 65, - 174, 182, 198, 175, 65, 65, 65, 181, 65, 65, - 185, 65, 198, 198, 198, 179, 178, 198, 65, 183, - - 198, 187, 65, 184, 186, 180, 198, 198, 189, 182, - 188, 198, 198, 65, 65, 65, 190, 191, 185, 198, - 198, 198, 65, 198, 198, 198, 192, 198, 187, 198, - 198, 186, 65, 65, 65, 198, 189, 188, 193, 195, - 65, 198, 196, 198, 190, 191, 65, 194, 198, 198, - 198, 65, 65, 192, 198, 198, 198, 197, 198, 65, - 65, 65, 198, 65, 65, 193, 195, 65, 198, 65, - 196, 198, 198, 198, 194, 198, 198, 198, 198, 198, - 198, 198, 198, 198, 197, 48, 48, 48, 48, 48, - 48, 55, 55, 63, 63, 63, 63, 95, 198, 95, + 198, 198, 65, 198, 65, 157, 198, 198, 198, 198, + 65, 65, 198, 159, 65, 198, 198, 65, 158, 160, + 198, 156, 198, 198, 155, 65, 198, 165, 65, 65, + 198, 198, 157, 161, 162, 198, 65, 198, 65, 65, + 65, 159, 163, 65, 164, 158, 65, 160, 65, 65, + + 198, 198, 65, 198, 166, 165, 65, 198, 167, 168, + 161, 162, 65, 65, 198, 198, 65, 198, 198, 163, + 169, 164, 198, 198, 198, 170, 198, 65, 198, 198, + 198, 166, 172, 198, 198, 167, 171, 168, 173, 198, + 65, 65, 198, 65, 198, 198, 198, 65, 169, 182, + 198, 174, 170, 176, 65, 65, 175, 65, 65, 178, + 172, 177, 65, 171, 65, 179, 173, 198, 65, 65, + 65, 180, 183, 181, 65, 198, 198, 182, 174, 65, + 198, 176, 65, 175, 65, 65, 178, 198, 177, 198, + 65, 185, 198, 179, 184, 198, 198, 198, 180, 183, + + 181, 198, 198, 198, 198, 186, 198, 65, 187, 198, + 198, 198, 189, 190, 198, 65, 65, 188, 198, 185, + 65, 184, 198, 198, 198, 198, 191, 65, 198, 65, + 198, 198, 186, 198, 198, 187, 65, 65, 198, 192, + 189, 190, 65, 65, 188, 198, 65, 198, 193, 65, + 194, 195, 196, 198, 191, 198, 198, 198, 65, 198, + 198, 197, 65, 65, 65, 65, 192, 198, 65, 198, + 65, 65, 198, 65, 198, 193, 198, 194, 195, 198, + 196, 198, 198, 198, 198, 198, 198, 198, 197, 48, + 48, 48, 48, 48, 48, 55, 55, 63, 63, 63, - 95, 95, 95, 98, 98, 98, 7, 198, 198, 198, - 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, + 63, 95, 198, 95, 95, 95, 95, 98, 98, 98, + 7, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198 + 198, 198, 198, 198, 198 } ; -static yyconst flex_int16_t yy_chk[882] = +static yyconst flex_int16_t yy_chk[886] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -630,59 +630,59 @@ 54, 54, 54, 54, 54, 54, 77, 70, 70, 84, 85, 73, 75, 78, 72, 74, 89, 90, 73, 86, 87, 83, 88, 0, 75, 78, 77, 0, 83, 0, - 0, 82, 74, 102, 82, 87, 90, 0, 91, 75, - 78, 85, 86, 74, 92, 105, 77, 116, 83, 84, - 85, 93, 102, 0, 77, 88, 89, 90, 82, 86, - 87, 0, 88, 87, 90, 0, 0, 112, 85, 91, - 86, 92, 105, 102, 93, 0, 0, 103, 91, 104, - 102, 107, 88, 0, 92, 105, 109, 116, 0, 0, - 112, 93, 103, 108, 104, 110, 91, 111, 92, 105, - - 107, 109, 93, 97, 97, 97, 97, 112, 0, 120, - 0, 97, 97, 97, 97, 97, 97, 103, 112, 104, - 103, 107, 104, 110, 114, 108, 109, 106, 107, 109, - 111, 118, 115, 108, 0, 110, 97, 111, 113, 97, - 97, 97, 97, 97, 97, 106, 113, 113, 117, 120, - 110, 119, 108, 114, 121, 122, 123, 111, 126, 118, - 106, 0, 0, 0, 114, 115, 124, 106, 0, 119, - 0, 118, 115, 106, 122, 123, 127, 134, 113, 128, - 114, 117, 130, 136, 121, 132, 118, 106, 117, 129, - 131, 119, 115, 0, 121, 122, 123, 119, 126, 124, - - 133, 127, 122, 123, 129, 130, 124, 0, 117, 134, - 128, 121, 137, 131, 135, 133, 127, 134, 132, 128, - 138, 139, 130, 136, 140, 132, 124, 142, 127, 129, - 131, 0, 129, 130, 0, 141, 134, 128, 0, 143, - 133, 131, 144, 133, 137, 132, 145, 135, 148, 149, - 146, 138, 137, 147, 135, 0, 151, 144, 150, 155, - 138, 139, 152, 158, 140, 0, 0, 142, 141, 146, - 0, 137, 156, 153, 135, 141, 154, 149, 138, 143, - 160, 152, 144, 147, 151, 144, 145, 157, 148, 149, - 146, 150, 0, 147, 156, 141, 151, 146, 150, 155, - - 159, 161, 152, 158, 149, 153, 157, 165, 154, 152, - 147, 151, 156, 153, 163, 162, 154, 0, 150, 164, - 160, 0, 156, 167, 166, 159, 168, 157, 169, 0, - 161, 173, 153, 162, 157, 154, 0, 163, 0, 170, - 159, 161, 167, 0, 171, 175, 172, 165, 180, 176, - 167, 182, 159, 164, 163, 162, 166, 161, 185, 164, - 173, 162, 174, 167, 166, 163, 168, 171, 169, 170, - 167, 173, 175, 179, 177, 178, 176, 167, 172, 170, - 164, 174, 181, 166, 171, 175, 172, 173, 180, 176, - 177, 182, 183, 187, 186, 171, 170, 0, 185, 175, - - 184, 179, 174, 176, 178, 172, 188, 0, 183, 174, - 181, 191, 189, 179, 177, 178, 184, 186, 177, 192, - 193, 190, 181, 194, 195, 0, 187, 196, 179, 197, - 0, 178, 183, 187, 186, 0, 183, 181, 189, 191, - 184, 0, 194, 0, 184, 186, 188, 190, 0, 0, - 0, 191, 189, 187, 0, 0, 0, 195, 0, 192, - 193, 190, 0, 194, 195, 189, 191, 196, 0, 197, - 194, 0, 0, 0, 190, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 195, 199, 199, 199, 199, 199, - 199, 200, 200, 201, 201, 201, 201, 202, 0, 202, + 0, 82, 74, 101, 82, 87, 90, 0, 91, 75, + 78, 85, 86, 74, 92, 104, 77, 115, 83, 84, + 85, 93, 101, 0, 77, 88, 89, 90, 82, 86, + 87, 0, 88, 87, 90, 0, 0, 111, 85, 91, + 86, 92, 104, 101, 93, 0, 0, 102, 91, 103, + 101, 106, 88, 0, 92, 104, 108, 115, 0, 0, + 111, 93, 102, 107, 103, 109, 91, 110, 92, 104, + + 106, 108, 93, 97, 97, 97, 97, 111, 0, 119, + 0, 97, 97, 97, 97, 97, 97, 102, 111, 103, + 102, 106, 103, 109, 113, 107, 108, 105, 106, 108, + 110, 117, 114, 107, 0, 109, 97, 110, 112, 97, + 97, 97, 97, 97, 97, 105, 112, 112, 116, 119, + 109, 118, 107, 113, 120, 121, 122, 110, 125, 117, + 105, 0, 0, 0, 113, 114, 123, 105, 0, 118, + 0, 117, 114, 105, 121, 122, 126, 133, 112, 127, + 113, 116, 129, 135, 120, 131, 117, 105, 116, 128, + 130, 118, 114, 0, 120, 121, 122, 118, 125, 123, + + 132, 126, 121, 122, 128, 129, 123, 0, 116, 133, + 127, 120, 136, 130, 134, 132, 126, 133, 131, 127, + 137, 139, 129, 135, 138, 131, 123, 140, 126, 128, + 130, 0, 128, 129, 0, 141, 133, 127, 142, 143, + 132, 130, 0, 132, 136, 131, 145, 134, 144, 148, + 146, 0, 136, 147, 134, 138, 149, 0, 152, 150, + 137, 139, 155, 144, 138, 0, 151, 140, 141, 146, + 0, 136, 153, 158, 134, 141, 154, 152, 142, 143, + 0, 0, 138, 147, 149, 0, 145, 156, 144, 148, + 146, 144, 150, 147, 151, 141, 149, 146, 152, 150, + + 159, 157, 155, 160, 153, 152, 151, 161, 154, 156, + 147, 149, 153, 158, 162, 163, 154, 164, 165, 150, + 157, 151, 168, 0, 166, 159, 0, 156, 169, 170, + 174, 153, 162, 0, 167, 154, 161, 156, 163, 172, + 159, 157, 171, 160, 173, 175, 0, 161, 157, 174, + 180, 164, 159, 167, 162, 163, 166, 164, 165, 170, + 162, 167, 168, 161, 166, 171, 163, 176, 169, 170, + 174, 172, 175, 173, 167, 177, 178, 174, 164, 172, + 179, 167, 171, 166, 173, 175, 170, 182, 167, 181, + 180, 177, 0, 171, 176, 0, 183, 184, 172, 175, + + 173, 0, 185, 186, 0, 178, 187, 176, 179, 188, + 0, 0, 183, 184, 0, 177, 178, 181, 192, 177, + 179, 176, 189, 191, 190, 193, 186, 182, 195, 181, + 196, 197, 178, 194, 0, 179, 183, 184, 0, 187, + 183, 184, 185, 186, 181, 0, 187, 0, 189, 188, + 190, 191, 194, 0, 186, 0, 0, 0, 192, 0, + 0, 195, 189, 191, 190, 193, 187, 0, 195, 0, + 196, 197, 0, 194, 0, 189, 0, 190, 191, 0, + 194, 0, 0, 0, 0, 0, 0, 0, 195, 199, + 199, 199, 199, 199, 199, 200, 200, 201, 201, 201, - 202, 202, 202, 204, 204, 204, 198, 198, 198, 198, + 201, 202, 0, 202, 202, 202, 202, 204, 204, 204, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, @@ -690,7 +690,7 @@ 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, - 198 + 198, 198, 198, 198, 198 } ; static yy_state_type yy_last_accepting_state; @@ -709,10 +709,10 @@ char *yytext; #line 1 "debugger/commandl.l" /* commandl.l: Debugger command lexical scanner - Copyright (c) 2002-2013 Philip Kendall + Copyright (c) 2002-2016 Philip Kendall Copyright (c) 2015 Sergio Baldoví - $Id: commandl.l 5539 2016-05-29 10:49:51Z fredm $ + $Id: commandl.l 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1002,7 +1002,7 @@ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 807 ); + while ( yy_base[yy_current_state] != 811 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1147,173 +1147,148 @@ case 24: YY_RULE_SETUP #line 86 "debugger/commandl.l" -{ yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 89 "debugger/commandl.l" { - yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } + yylval.string = mempool_strdup( debugger_memory_pool, yytext ); + return DEBUGGER_REGISTER; } YY_BREAK -case 26: -YY_RULE_SETUP -#line 93 "debugger/commandl.l" -{ - yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 97 "debugger/commandl.l" -{ yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 100 "debugger/commandl.l" -{ yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } - YY_BREAK -case 29: +case 25: YY_RULE_SETUP -#line 103 "debugger/commandl.l" +#line 90 "debugger/commandl.l" { return '('; } YY_BREAK -case 30: +case 26: YY_RULE_SETUP -#line 104 "debugger/commandl.l" +#line 91 "debugger/commandl.l" { return ')'; } YY_BREAK -case 31: +case 27: YY_RULE_SETUP -#line 106 "debugger/commandl.l" +#line 93 "debugger/commandl.l" { return '['; } YY_BREAK -case 32: +case 28: YY_RULE_SETUP -#line 107 "debugger/commandl.l" +#line 94 "debugger/commandl.l" { return ']'; } YY_BREAK -case 33: +case 29: YY_RULE_SETUP -#line 109 "debugger/commandl.l" +#line 96 "debugger/commandl.l" { yylval.token = '!'; return NEGATE; } YY_BREAK -case 34: +case 30: YY_RULE_SETUP -#line 110 "debugger/commandl.l" +#line 97 "debugger/commandl.l" { yylval.token = '~'; return NEGATE; } YY_BREAK /* The hex constants used here are the appropriate Unicode characters */ -case 35: +case 31: YY_RULE_SETUP -#line 114 "debugger/commandl.l" +#line 101 "debugger/commandl.l" { yylval.token = DEBUGGER_TOKEN_EQUAL_TO; return EQUALITY; } YY_BREAK -case 36: +case 32: YY_RULE_SETUP -#line 115 "debugger/commandl.l" +#line 102 "debugger/commandl.l" { yylval.token = DEBUGGER_TOKEN_NOT_EQUAL_TO; return EQUALITY; } YY_BREAK -case 37: +case 33: YY_RULE_SETUP -#line 118 "debugger/commandl.l" +#line 105 "debugger/commandl.l" { yylval.token = '<'; return COMPARISON; } YY_BREAK -case 38: +case 34: YY_RULE_SETUP -#line 119 "debugger/commandl.l" +#line 106 "debugger/commandl.l" { yylval.token = '>'; return COMPARISON; } YY_BREAK -case 39: +case 35: YY_RULE_SETUP -#line 120 "debugger/commandl.l" +#line 107 "debugger/commandl.l" { yylval.token = DEBUGGER_TOKEN_LESS_THAN_OR_EQUAL_TO; return COMPARISON; } YY_BREAK -case 40: +case 36: YY_RULE_SETUP -#line 122 "debugger/commandl.l" +#line 109 "debugger/commandl.l" { yylval.token = DEBUGGER_TOKEN_GREATER_THAN_OR_EQUAL_TO; return COMPARISON; } YY_BREAK -case 41: +case 37: YY_RULE_SETUP -#line 125 "debugger/commandl.l" +#line 112 "debugger/commandl.l" { return '+'; } YY_BREAK -case 42: +case 38: YY_RULE_SETUP -#line 126 "debugger/commandl.l" +#line 113 "debugger/commandl.l" { return '-'; } YY_BREAK -case 43: +case 39: YY_RULE_SETUP -#line 127 "debugger/commandl.l" +#line 114 "debugger/commandl.l" { return '*'; } YY_BREAK -case 44: +case 40: YY_RULE_SETUP -#line 128 "debugger/commandl.l" +#line 115 "debugger/commandl.l" { return '/'; } YY_BREAK -case 45: +case 41: YY_RULE_SETUP -#line 130 "debugger/commandl.l" +#line 117 "debugger/commandl.l" { return '&'; } YY_BREAK -case 46: +case 42: YY_RULE_SETUP -#line 131 "debugger/commandl.l" +#line 118 "debugger/commandl.l" { return '^'; } YY_BREAK -case 47: +case 43: YY_RULE_SETUP -#line 132 "debugger/commandl.l" +#line 119 "debugger/commandl.l" { return '|'; } YY_BREAK -case 48: +case 44: YY_RULE_SETUP -#line 134 "debugger/commandl.l" +#line 121 "debugger/commandl.l" { return LOGICAL_AND; } YY_BREAK -case 49: +case 45: YY_RULE_SETUP -#line 135 "debugger/commandl.l" +#line 122 "debugger/commandl.l" { return LOGICAL_OR; } YY_BREAK -case 50: +case 46: YY_RULE_SETUP -#line 137 "debugger/commandl.l" +#line 124 "debugger/commandl.l" { return ':'; } YY_BREAK -case 51: +case 47: YY_RULE_SETUP -#line 139 "debugger/commandl.l" +#line 126 "debugger/commandl.l" { yylval.integer = strtol( yytext+1, NULL, 16 ); if( YY_START == COMMANDSTATE1 ) BEGIN( COMMANDSTATE2 ); return NUMBER; } YY_BREAK -case 52: +case 48: YY_RULE_SETUP -#line 142 "debugger/commandl.l" +#line 129 "debugger/commandl.l" { yylval.integer = strtol( yytext+2, NULL, 16 ); if( YY_START == COMMANDSTATE1 ) BEGIN( COMMANDSTATE2 ); return NUMBER; } YY_BREAK -case 53: +case 49: YY_RULE_SETUP -#line 145 "debugger/commandl.l" +#line 132 "debugger/commandl.l" { yylval.integer = atoi( yytext ); if( YY_START == COMMANDSTATE1 ) BEGIN( COMMANDSTATE2 ); return NUMBER; } YY_BREAK -case 54: +case 50: YY_RULE_SETUP -#line 149 "debugger/commandl.l" +#line 136 "debugger/commandl.l" { char *dest, *source; yylval.string = mempool_malloc( debugger_memory_pool, strlen( yytext ) + 1 ); /* remove escape characters */ @@ -1328,54 +1303,54 @@ *dest = '\0'; return STRING; } YY_BREAK -case 55: +case 51: YY_RULE_SETUP -#line 163 "debugger/commandl.l" +#line 150 "debugger/commandl.l" { yylval.string = mempool_strdup( debugger_memory_pool, yytext + 1 ); return VARIABLE; } YY_BREAK -case 56: -/* rule 56 can match eol */ +case 52: +/* rule 52 can match eol */ YY_RULE_SETUP -#line 165 "debugger/commandl.l" +#line 152 "debugger/commandl.l" { return '\n'; } YY_BREAK -case 57: +case 53: YY_RULE_SETUP -#line 167 "debugger/commandl.l" +#line 154 "debugger/commandl.l" /* Swallow whitespace */ YY_BREAK -case 58: +case 54: YY_RULE_SETUP -#line 169 "debugger/commandl.l" +#line 156 "debugger/commandl.l" { if( 0 ) unput( '\0' ); /* Prevent warning about yyunput being defined and not used */ return DEBUGGER_ERROR; } YY_BREAK /* Debugger command parsing */ -case 59: +case 55: YY_RULE_SETUP -#line 177 "debugger/commandl.l" +#line 164 "debugger/commandl.l" { BEGIN(INITIAL); return DEBUGGER_END; } YY_BREAK -case 60: +case 56: YY_RULE_SETUP -#line 179 "debugger/commandl.l" +#line 166 "debugger/commandl.l" { yylval.string = mempool_strdup( debugger_memory_pool, yytext ); return STRING; } YY_BREAK -case 61: -/* rule 61 can match eol */ +case 57: +/* rule 57 can match eol */ YY_RULE_SETUP -#line 180 "debugger/commandl.l" +#line 167 "debugger/commandl.l" { return '\n'; } YY_BREAK -case 62: +case 58: YY_RULE_SETUP -#line 183 "debugger/commandl.l" +#line 170 "debugger/commandl.l" ECHO; YY_BREAK -#line 1379 "debugger/commandl.c" +#line 1354 "debugger/commandl.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMANDSTATE1): case YY_STATE_EOF(COMMANDSTATE2): @@ -2371,4 +2346,4 @@ #define YYTABLES_NAME "yytables" -#line 183 "debugger/commandl.l" +#line 170 "debugger/commandl.l" diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/commandl.l fuse-emulator-1.2.1+dfsg1/debugger/commandl.l --- fuse-emulator-1.2.0+dfsg1/debugger/commandl.l 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/commandl.l 2016-07-17 10:48:30.000000000 +0000 @@ -1,8 +1,8 @@ /* commandl.l: Debugger command lexical scanner - Copyright (c) 2002-2013 Philip Kendall + Copyright (c) 2002-2016 Philip Kendall Copyright (c) 2015 Sergio Baldoví - $Id: commandl.l 5539 2016-05-29 10:49:51Z fredm $ + $Id: commandl.l 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ %} -ID [a-z]([a-z0-9]|\\[ ])+ +ID [a-z]([a-z0-9]|\\[ ])* %option caseless @@ -83,22 +83,9 @@ ti|tim|time { return TIME; } w|wr|wri|writ|write { return WRITE; } -a|b|c|d|e|f|h|l { yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } - -"a'"|"b'"|"c'"|"d'"|"e'"|"f'"|"h'"|"l'" { - yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } - -af|bc|de|hl|"af\'"|"bc\'"|"de\'"|"hl\'" { - yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } - -sp|pc|ix|iy|i|r { yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } - -im|iff1|iff2 { yylval.reg = debugger_register_hash( yytext ); - return DEBUGGER_REGISTER; } +a|b|c|d|e|f|h|l|af|bc|de|hl|sp|pc|ix|iy|i|r|im|iff1|iff2|"a'"|"b'"|"c'"|"d'"|"e'"|"f'"|"h'"|"l'"|"af\'"|"bc\'"|"de\'"|"hl\'" { + yylval.string = mempool_strdup( debugger_memory_pool, yytext ); + return DEBUGGER_REGISTER; } "(" { return '('; } ")" { return ')'; } diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/commandy.c fuse-emulator-1.2.1+dfsg1/debugger/commandy.c --- fuse-emulator-1.2.0+dfsg1/debugger/commandy.c 2016-06-06 11:04:23.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/commandy.c 2016-07-17 10:50:52.000000000 +0000 @@ -202,7 +202,6 @@ int token; - int reg; libspectrum_dword integer; char *string; @@ -217,7 +216,7 @@ /* Line 387 of yacc.c */ -#line 221 "debugger/commandy.c" +#line 220 "debugger/commandy.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -245,7 +244,7 @@ /* Copy the second part of user declarations. */ /* Line 390 of yacc.c */ -#line 249 "debugger/commandy.c" +#line 248 "debugger/commandy.c" #ifdef short # undef short @@ -463,18 +462,18 @@ #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 44 +#define YYFINAL 46 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 259 +#define YYLAST 261 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 50 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 15 /* YYNRULES -- Number of rules. */ -#define YYNRULES 68 +#define YYNRULES 72 /* YYNRULES -- Number of states. */ -#define YYNSTATES 122 +#define YYNSTATES 134 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -525,11 +524,12 @@ { 0, 0, 3, 4, 6, 8, 12, 15, 20, 26, 31, 38, 45, 48, 54, 58, 60, 62, 65, 68, - 70, 72, 76, 78, 82, 85, 89, 93, 97, 99, - 101, 103, 104, 106, 108, 110, 114, 116, 122, 124, - 126, 127, 130, 131, 133, 134, 136, 138, 140, 142, - 144, 148, 152, 155, 158, 161, 165, 169, 173, 177, - 181, 185, 189, 193, 197, 201, 205, 207, 210 + 70, 72, 76, 78, 82, 85, 89, 93, 97, 103, + 109, 111, 113, 115, 116, 118, 120, 122, 126, 128, + 134, 136, 138, 139, 142, 143, 145, 146, 148, 150, + 152, 154, 158, 162, 164, 168, 172, 175, 178, 181, + 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, + 225, 227, 230 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -544,11 +544,13 @@ 15, -1, 15, 61, -1, 16, 61, -1, 19, -1, 20, -1, 22, 33, 61, -1, 23, -1, 24, 61, 33, -1, 26, 61, -1, 28, 33, 61, -1, 28, - 32, 61, -1, 28, 35, 61, -1, 29, -1, 9, - -1, 10, -1, -1, 27, -1, 31, -1, 61, -1, - 61, 45, 61, -1, 59, -1, 34, 45, 61, 45, - 61, -1, 27, -1, 31, -1, -1, 21, 62, -1, - -1, 61, -1, -1, 62, -1, 62, -1, 33, -1, + 32, 61, -1, 28, 35, 61, -1, 28, 34, 45, + 34, 61, -1, 28, 34, 45, 32, 61, -1, 29, + -1, 9, -1, 10, -1, -1, 27, -1, 31, -1, + 61, -1, 61, 45, 61, -1, 59, -1, 34, 45, + 61, 45, 61, -1, 27, -1, 31, -1, -1, 21, + 62, -1, -1, 61, -1, -1, 62, -1, 62, -1, + 33, -1, 32, -1, 34, 45, 34, -1, 34, 45, 32, -1, 35, -1, 46, 62, 47, -1, 48, 62, 49, -1, 40, 62, -1, 41, 62, -1, 7, 62, -1, 62, 40, 62, -1, 62, 41, 62, -1, 62, @@ -562,13 +564,14 @@ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 147, 147, 148, 149, 150, 153, 154, 158, 163, - 167, 171, 175, 176, 177, 180, 181, 182, 183, 184, - 185, 186, 189, 190, 191, 192, 193, 194, 195, 198, - 199, 202, 203, 204, 207, 208, 211, 212, 224, 225, - 228, 229, 232, 233, 236, 237, 240, 243, 246, 249, - 252, 253, 257, 258, 262, 266, 270, 274, 278, 282, - 286, 290, 294, 298, 302, 308, 316, 317, 322 + 0, 146, 146, 147, 148, 149, 152, 153, 157, 162, + 166, 170, 174, 175, 176, 179, 180, 181, 182, 183, + 184, 185, 188, 189, 190, 191, 192, 193, 194, 197, + 198, 201, 202, 205, 206, 207, 210, 211, 214, 215, + 227, 228, 231, 232, 235, 236, 239, 240, 243, 246, + 249, 252, 257, 260, 263, 264, 268, 269, 273, 277, + 281, 285, 289, 293, 297, 301, 305, 309, 313, 319, + 327, 328, 333 }; #endif @@ -610,11 +613,12 @@ { 0, 50, 51, 51, 51, 51, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 52, 52, 52, 53, - 53, 54, 54, 54, 55, 55, 56, 56, 57, 57, - 58, 58, 59, 59, 60, 60, 61, 62, 62, 62, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 53, 53, 54, 54, 54, 55, 55, 56, 56, + 57, 57, 58, 58, 59, 59, 60, 60, 61, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 63, 63, 64 + 63, 63, 64 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -622,11 +626,12 @@ { 0, 2, 0, 1, 1, 3, 2, 4, 5, 4, 6, 6, 2, 5, 3, 1, 1, 2, 2, 1, - 1, 3, 1, 3, 2, 3, 3, 3, 1, 1, - 1, 0, 1, 1, 1, 3, 1, 5, 1, 1, - 0, 2, 0, 1, 0, 1, 1, 1, 1, 1, - 3, 3, 2, 2, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 1, 2, 2 + 1, 3, 1, 3, 2, 3, 3, 3, 5, 5, + 1, 1, 1, 0, 1, 1, 1, 3, 1, 5, + 1, 1, 0, 2, 0, 1, 0, 1, 1, 1, + 1, 3, 3, 1, 3, 3, 2, 2, 2, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 1, 2, 2 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -634,123 +639,127 @@ means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 4, 0, 29, 30, 42, 0, 0, 15, 16, - 0, 19, 20, 0, 22, 0, 0, 0, 28, 0, - 3, 31, 0, 48, 47, 49, 0, 0, 0, 0, - 6, 46, 12, 43, 0, 44, 17, 18, 0, 0, - 24, 0, 0, 0, 1, 0, 0, 0, 32, 0, - 33, 42, 54, 52, 53, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 45, 21, 23, 26, 25, 27, 5, 0, 38, 39, - 0, 40, 0, 40, 36, 50, 51, 65, 64, 60, - 59, 63, 62, 61, 55, 56, 57, 58, 0, 0, - 66, 0, 40, 34, 0, 9, 0, 7, 68, 13, - 67, 40, 40, 8, 0, 41, 0, 10, 11, 35, - 0, 37 + 0, 4, 0, 31, 32, 44, 0, 0, 15, 16, + 0, 19, 20, 0, 22, 0, 0, 0, 30, 0, + 3, 33, 0, 50, 49, 0, 53, 0, 0, 0, + 0, 6, 48, 12, 45, 0, 46, 17, 18, 0, + 0, 24, 0, 0, 0, 0, 1, 0, 0, 0, + 34, 0, 35, 44, 58, 0, 56, 57, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 14, 47, 21, 23, 26, 25, 0, 27, + 5, 0, 40, 41, 0, 42, 0, 42, 38, 52, + 51, 54, 55, 69, 68, 64, 63, 67, 66, 65, + 59, 60, 61, 62, 0, 0, 70, 0, 0, 0, + 42, 36, 0, 9, 0, 7, 72, 13, 71, 29, + 28, 42, 42, 8, 0, 43, 50, 51, 0, 10, + 11, 37, 0, 39 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 19, 20, 21, 51, 102, 83, 80, 105, 32, - 69, 33, 31, 99, 100 + -1, 19, 20, 21, 53, 110, 87, 84, 113, 33, + 72, 34, 32, 105, 106 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -79 +#define YYPACT_NINF -32 static const yytype_int16 yypact[] = { - 72, -79, 82, -79, -79, 82, 82, -30, -79, 82, - 82, -79, -79, -24, -79, 82, 82, 11, -79, 1, - -79, 199, 82, -79, -79, -79, 82, 82, 82, 82, - -79, 130, -79, -79, -33, 82, -79, -79, 82, -8, - -79, 82, 82, 82, -79, 230, 3, -15, -79, 82, - -79, 118, -79, -79, -79, 102, 26, 82, 82, 82, - 82, 82, 82, 82, 82, 82, 82, 82, 4, -79, - 130, -79, -79, -79, -79, -79, -79, -19, -79, -79, - 82, 6, -10, 6, -79, -79, -79, 142, 149, 161, - 173, 155, 169, 194, -25, -25, -79, -79, 5, -11, - -79, -32, 6, -3, 82, -79, 82, -79, -79, -79, - -79, 6, 6, -79, 82, 130, 16, -79, -79, -79, - 82, -79 + 75, -32, 120, -32, -32, 120, 120, -23, -32, 120, + 120, -32, -32, -12, -32, 120, 120, 171, -32, 2, + -32, 93, 120, -32, -32, -21, -32, 120, 120, 120, + 120, -32, 174, -32, -32, -19, 120, -32, -32, 120, + 6, -32, 120, 120, -13, 120, -32, 232, 8, -22, + -32, 120, -32, 124, -32, -1, -32, -32, 104, 24, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 10, -32, 174, -32, -32, -32, -32, 4, -32, + -32, 3, -32, -32, 120, 26, 32, 26, -32, -32, + -32, -32, -32, 186, 157, 190, 95, 196, 29, 73, + -27, -27, -32, -32, 30, -11, -32, 120, 120, -31, + 26, 35, 120, -32, 141, -32, -32, -32, -32, -32, + -32, 26, 26, -32, 120, 174, 1, -21, 36, -32, + -32, -32, 120, -32 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { - -79, -79, 17, -79, -79, -79, -79, -79, -78, 19, - -79, -2, -7, -79, -51 + -32, -32, 45, -32, -32, -32, -32, -32, 97, 40, + -32, -2, -10, -32, -9 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -3 -static const yytype_int8 yytable[] = +#define YYTABLE_NINF -53 +static const yytype_int16 yytable[] = { - 30, 44, 111, 35, 34, 107, 109, 36, 37, 38, - 112, 68, 78, 39, 40, 52, 79, 66, 67, 53, - 54, 55, 56, 98, 113, 72, 101, 104, 70, 57, - 58, 59, 60, 117, 118, 106, 71, 77, 98, 73, - 74, 75, 114, 41, 42, 45, 43, 81, 110, 108, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 120, 76, 61, 62, 63, 64, 65, 66, 67, - 84, 0, -2, 1, 0, 86, 0, 0, 103, 0, - 2, 3, 4, 5, 6, 7, 8, 9, 10, 22, - 0, 11, 12, 0, 13, 14, 15, 115, 16, 0, - 17, 18, 0, 0, 116, 57, 58, 59, 60, 0, - 0, 0, 119, 0, 23, 24, -2, 25, 121, 0, - 0, 0, 26, 27, 0, 22, 0, 0, 28, 0, - 29, 0, 0, 57, 58, 59, 60, 0, 0, 61, - 62, 63, 64, 65, 66, 67, 58, 59, 60, 85, - 23, 24, 82, 25, 59, 60, 0, 0, 26, 27, - 59, 60, 0, 0, 28, 0, 29, 61, 62, 63, - 64, 65, 66, 67, 59, 60, 0, 0, 59, 61, - 62, 63, 64, 65, 66, 67, 61, 62, 63, 64, - 65, 66, 67, 62, 63, 64, 65, 66, 67, 59, - 60, 64, 65, 66, 67, 0, 0, 0, 63, 64, - 65, 66, 67, 64, 65, 66, 67, 46, 0, 0, - 0, 0, 0, 0, 47, 0, 48, 0, 0, 49, - 50, 0, 0, 0, 64, 65, 66, 67, 2, 3, - 4, 5, 6, 7, 8, 9, 10, 0, 0, 11, - 12, 0, 13, 14, 15, 0, 16, 0, 17, 18 + 31, -52, 46, 121, 35, 82, 117, 37, 38, 83, + 36, 122, 54, 40, 41, 69, 70, 56, 57, 58, + 59, 39, -52, 104, 55, 71, 73, 60, 61, 62, + 63, 89, 78, 90, 62, 63, 107, 74, 108, 75, + 76, 77, 81, 79, 104, -52, 47, 112, 109, 85, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 64, 65, 66, 67, 68, 69, 70, 66, 67, + 68, 69, 70, 92, 116, -2, 1, 114, 62, 63, + 124, 132, 111, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 80, 88, 11, 12, 118, 13, 14, 15, + 62, 16, 125, 17, 18, 119, 120, 60, 61, 62, + 63, 48, 128, 67, 68, 69, 70, 0, 49, -2, + 50, 0, 131, 51, 52, 0, 0, 22, 0, 0, + 133, 22, 0, 0, 0, 67, 68, 69, 70, 0, + 0, 64, 65, 66, 67, 68, 69, 70, 22, 0, + 0, 91, 23, 24, 25, 26, 23, 24, 86, 26, + 27, 28, 62, 63, 27, 28, 29, 0, 30, 0, + 29, 0, 30, 126, 24, 127, 26, 60, 61, 62, + 63, 27, 28, 0, 115, 0, 0, 29, 0, 30, + 61, 62, 63, 0, 64, 65, 66, 67, 68, 69, + 70, 62, 63, 42, 43, 44, 45, 123, 0, 0, + 0, 64, 65, 66, 67, 68, 69, 70, 129, 130, + 0, 0, 0, 64, 65, 66, 67, 68, 69, 70, + 67, 68, 69, 70, 65, 66, 67, 68, 69, 70, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, + 0, 11, 12, 0, 13, 14, 15, 0, 16, 0, + 17, 18 }; #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-79))) + (!!((Yystate) == (-32))) #define yytable_value_is_error(Yytable_value) \ YYID (0) -static const yytype_int8 yycheck[] = +static const yytype_int16 yycheck[] = { - 2, 0, 34, 33, 6, 83, 17, 9, 10, 33, - 42, 44, 27, 15, 16, 22, 31, 42, 43, 26, - 27, 28, 29, 34, 102, 33, 45, 21, 35, 3, - 4, 5, 6, 111, 112, 45, 38, 34, 34, 41, - 42, 43, 45, 32, 33, 44, 35, 49, 99, 44, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 45, 45, 37, 38, 39, 40, 41, 42, 43, - 51, -1, 0, 1, -1, 49, -1, -1, 80, -1, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 7, - -1, 19, 20, -1, 22, 23, 24, 104, 26, -1, - 28, 29, -1, -1, 106, 3, 4, 5, 6, -1, - -1, -1, 114, -1, 32, 33, 44, 35, 120, -1, - -1, -1, 40, 41, -1, 7, -1, -1, 46, -1, - 48, -1, -1, 3, 4, 5, 6, -1, -1, 37, - 38, 39, 40, 41, 42, 43, 4, 5, 6, 47, - 32, 33, 34, 35, 5, 6, -1, -1, 40, 41, - 5, 6, -1, -1, 46, -1, 48, 37, 38, 39, - 40, 41, 42, 43, 5, 6, -1, -1, 5, 37, - 38, 39, 40, 41, 42, 43, 37, 38, 39, 40, - 41, 42, 43, 38, 39, 40, 41, 42, 43, 5, - 6, 40, 41, 42, 43, -1, -1, -1, 39, 40, - 41, 42, 43, 40, 41, 42, 43, 18, -1, -1, - -1, -1, -1, -1, 25, -1, 27, -1, -1, 30, - 31, -1, -1, -1, 40, 41, 42, 43, 8, 9, - 10, 11, 12, 13, 14, 15, 16, -1, -1, 19, - 20, -1, 22, 23, 24, -1, 26, -1, 28, 29 + 2, 0, 0, 34, 6, 27, 17, 9, 10, 31, + 33, 42, 22, 15, 16, 42, 43, 27, 28, 29, + 30, 33, 21, 34, 45, 44, 36, 3, 4, 5, + 6, 32, 45, 34, 5, 6, 32, 39, 34, 33, + 42, 43, 34, 45, 34, 44, 44, 21, 45, 51, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 37, 38, 39, 40, 41, 42, 43, 39, 40, + 41, 42, 43, 49, 44, 0, 1, 45, 5, 6, + 45, 45, 84, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 47, 53, 19, 20, 105, 22, 23, 24, + 5, 26, 112, 28, 29, 107, 108, 3, 4, 5, + 6, 18, 114, 40, 41, 42, 43, -1, 25, 44, + 27, -1, 124, 30, 31, -1, -1, 7, -1, -1, + 132, 7, -1, -1, -1, 40, 41, 42, 43, -1, + -1, 37, 38, 39, 40, 41, 42, 43, 7, -1, + -1, 47, 32, 33, 34, 35, 32, 33, 34, 35, + 40, 41, 5, 6, 40, 41, 46, -1, 48, -1, + 46, -1, 48, 32, 33, 34, 35, 3, 4, 5, + 6, 40, 41, -1, 87, -1, -1, 46, -1, 48, + 4, 5, 6, -1, 37, 38, 39, 40, 41, 42, + 43, 5, 6, 32, 33, 34, 35, 110, -1, -1, + -1, 37, 38, 39, 40, 41, 42, 43, 121, 122, + -1, -1, -1, 37, 38, 39, 40, 41, 42, 43, + 40, 41, 42, 43, 38, 39, 40, 41, 42, 43, + 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, + -1, 19, 20, -1, 22, 23, 24, -1, 26, -1, + 28, 29 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -759,17 +768,18 @@ { 0, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 22, 23, 24, 26, 28, 29, 51, - 52, 53, 7, 32, 33, 35, 40, 41, 46, 48, - 61, 62, 59, 61, 61, 33, 61, 61, 33, 61, - 61, 32, 33, 35, 0, 44, 18, 25, 27, 30, - 31, 54, 62, 62, 62, 62, 62, 3, 4, 5, - 6, 37, 38, 39, 40, 41, 42, 43, 44, 60, - 62, 61, 33, 61, 61, 61, 52, 34, 27, 31, - 57, 61, 34, 56, 59, 47, 49, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 62, 34, 63, - 64, 45, 55, 61, 21, 58, 45, 58, 44, 17, - 64, 34, 42, 58, 45, 62, 61, 58, 58, 61, - 45, 61 + 52, 53, 7, 32, 33, 34, 35, 40, 41, 46, + 48, 61, 62, 59, 61, 61, 33, 61, 61, 33, + 61, 61, 32, 33, 34, 35, 0, 44, 18, 25, + 27, 30, 31, 54, 62, 45, 62, 62, 62, 62, + 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, + 43, 44, 60, 62, 61, 33, 61, 61, 45, 61, + 52, 34, 27, 31, 57, 61, 34, 56, 59, 32, + 34, 47, 49, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 34, 63, 64, 32, 34, 45, + 55, 61, 21, 58, 45, 58, 44, 17, 64, 61, + 61, 34, 42, 58, 45, 62, 32, 34, 61, 58, + 58, 61, 45, 61 }; #define yyerrok (yyerrstatus = 0) @@ -1571,13 +1581,13 @@ { case 6: /* Line 1792 of yacc.c */ -#line 153 "debugger/commandy.y" +#line 152 "debugger/commandy.y" { debugger_output_base = (yyvsp[(2) - (2)].integer); } break; case 7: /* Line 1792 of yacc.c */ -#line 154 "debugger/commandy.y" +#line 153 "debugger/commandy.y" { debugger_breakpoint_add_address( (yyvsp[(2) - (4)].bptype), (yyvsp[(3) - (4)].location).source, (yyvsp[(3) - (4)].location).page, (yyvsp[(3) - (4)].location).offset, 0, (yyvsp[(1) - (4)].bplife), (yyvsp[(4) - (4)].exp) ); @@ -1586,7 +1596,7 @@ case 8: /* Line 1792 of yacc.c */ -#line 158 "debugger/commandy.y" +#line 157 "debugger/commandy.y" { int mask = (yyvsp[(4) - (5)].port).mask; if( mask == 0 ) mask = ( (yyvsp[(4) - (5)].port).value < 0x100 ? 0x00ff : 0xffff ); @@ -1596,7 +1606,7 @@ case 9: /* Line 1792 of yacc.c */ -#line 163 "debugger/commandy.y" +#line 162 "debugger/commandy.y" { debugger_breakpoint_add_time( DEBUGGER_BREAKPOINT_TYPE_TIME, (yyvsp[(3) - (4)].integer), 0, (yyvsp[(1) - (4)].bplife), (yyvsp[(4) - (4)].exp) ); @@ -1605,7 +1615,7 @@ case 10: /* Line 1792 of yacc.c */ -#line 167 "debugger/commandy.y" +#line 166 "debugger/commandy.y" { debugger_breakpoint_add_event( DEBUGGER_BREAKPOINT_TYPE_EVENT, (yyvsp[(3) - (6)].string), (yyvsp[(5) - (6)].string), 0, (yyvsp[(1) - (6)].bplife), (yyvsp[(6) - (6)].exp) ); @@ -1614,7 +1624,7 @@ case 11: /* Line 1792 of yacc.c */ -#line 171 "debugger/commandy.y" +#line 170 "debugger/commandy.y" { debugger_breakpoint_add_event( DEBUGGER_BREAKPOINT_TYPE_EVENT, (yyvsp[(3) - (6)].string), "*", 0, (yyvsp[(1) - (6)].bplife), (yyvsp[(6) - (6)].exp) ); @@ -1623,19 +1633,19 @@ case 12: /* Line 1792 of yacc.c */ -#line 175 "debugger/commandy.y" +#line 174 "debugger/commandy.y" { debugger_breakpoint_clear( (yyvsp[(2) - (2)].integer) ); } break; case 13: /* Line 1792 of yacc.c */ -#line 176 "debugger/commandy.y" +#line 175 "debugger/commandy.y" { debugger_breakpoint_set_commands( (yyvsp[(2) - (5)].integer), (yyvsp[(4) - (5)].string) ); } break; case 14: /* Line 1792 of yacc.c */ -#line 177 "debugger/commandy.y" +#line 176 "debugger/commandy.y" { debugger_breakpoint_set_condition( (yyvsp[(2) - (3)].integer), (yyvsp[(3) - (3)].exp) ); } @@ -1643,43 +1653,43 @@ case 15: /* Line 1792 of yacc.c */ -#line 180 "debugger/commandy.y" +#line 179 "debugger/commandy.y" { debugger_run(); } break; case 16: /* Line 1792 of yacc.c */ -#line 181 "debugger/commandy.y" +#line 180 "debugger/commandy.y" { debugger_breakpoint_remove_all(); } break; case 17: /* Line 1792 of yacc.c */ -#line 182 "debugger/commandy.y" +#line 181 "debugger/commandy.y" { debugger_breakpoint_remove( (yyvsp[(2) - (2)].integer) ); } break; case 18: /* Line 1792 of yacc.c */ -#line 183 "debugger/commandy.y" +#line 182 "debugger/commandy.y" { ui_debugger_disassemble( (yyvsp[(2) - (2)].integer) ); } break; case 19: /* Line 1792 of yacc.c */ -#line 184 "debugger/commandy.y" +#line 183 "debugger/commandy.y" { debugger_exit_emulator(); } break; case 20: /* Line 1792 of yacc.c */ -#line 185 "debugger/commandy.y" +#line 184 "debugger/commandy.y" { debugger_breakpoint_exit(); } break; case 21: /* Line 1792 of yacc.c */ -#line 186 "debugger/commandy.y" +#line 185 "debugger/commandy.y" { debugger_breakpoint_ignore( (yyvsp[(2) - (3)].integer), (yyvsp[(3) - (3)].integer) ); } @@ -1687,97 +1697,109 @@ case 22: /* Line 1792 of yacc.c */ -#line 189 "debugger/commandy.y" +#line 188 "debugger/commandy.y" { debugger_next(); } break; case 23: /* Line 1792 of yacc.c */ -#line 190 "debugger/commandy.y" +#line 189 "debugger/commandy.y" { debugger_port_write( (yyvsp[(2) - (3)].integer), (yyvsp[(3) - (3)].integer) ); } break; case 24: /* Line 1792 of yacc.c */ -#line 191 "debugger/commandy.y" +#line 190 "debugger/commandy.y" { printf( "0x%x\n", (yyvsp[(2) - (2)].integer) ); } break; case 25: /* Line 1792 of yacc.c */ -#line 192 "debugger/commandy.y" +#line 191 "debugger/commandy.y" { debugger_poke( (yyvsp[(2) - (3)].integer), (yyvsp[(3) - (3)].integer) ); } break; case 26: /* Line 1792 of yacc.c */ -#line 193 "debugger/commandy.y" - { debugger_register_set( (yyvsp[(2) - (3)].reg), (yyvsp[(3) - (3)].integer) ); } +#line 192 "debugger/commandy.y" + { debugger_register_set( (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].integer) ); } break; case 27: /* Line 1792 of yacc.c */ -#line 194 "debugger/commandy.y" +#line 193 "debugger/commandy.y" { debugger_variable_set( (yyvsp[(2) - (3)].string), (yyvsp[(3) - (3)].integer) ); } break; case 28: /* Line 1792 of yacc.c */ -#line 195 "debugger/commandy.y" - { debugger_step(); } +#line 194 "debugger/commandy.y" + { debugger_system_variable_set( (yyvsp[(2) - (5)].string), (yyvsp[(4) - (5)].string), (yyvsp[(5) - (5)].integer) ); } break; case 29: /* Line 1792 of yacc.c */ -#line 198 "debugger/commandy.y" - { (yyval.bplife) = DEBUGGER_BREAKPOINT_LIFE_PERMANENT; } +#line 197 "debugger/commandy.y" + { debugger_system_variable_set( (yyvsp[(2) - (5)].string), (yyvsp[(4) - (5)].string), (yyvsp[(5) - (5)].integer) ); } break; case 30: /* Line 1792 of yacc.c */ -#line 199 "debugger/commandy.y" - { (yyval.bplife) = DEBUGGER_BREAKPOINT_LIFE_ONESHOT; } +#line 198 "debugger/commandy.y" + { debugger_step(); } break; case 31: /* Line 1792 of yacc.c */ -#line 202 "debugger/commandy.y" - { (yyval.bptype) = DEBUGGER_BREAKPOINT_TYPE_EXECUTE; } +#line 201 "debugger/commandy.y" + { (yyval.bplife) = DEBUGGER_BREAKPOINT_LIFE_PERMANENT; } break; case 32: /* Line 1792 of yacc.c */ -#line 203 "debugger/commandy.y" - { (yyval.bptype) = DEBUGGER_BREAKPOINT_TYPE_READ; } +#line 202 "debugger/commandy.y" + { (yyval.bplife) = DEBUGGER_BREAKPOINT_LIFE_ONESHOT; } break; case 33: /* Line 1792 of yacc.c */ -#line 204 "debugger/commandy.y" - { (yyval.bptype) = DEBUGGER_BREAKPOINT_TYPE_WRITE; } +#line 205 "debugger/commandy.y" + { (yyval.bptype) = DEBUGGER_BREAKPOINT_TYPE_EXECUTE; } break; case 34: /* Line 1792 of yacc.c */ -#line 207 "debugger/commandy.y" - { (yyval.port).mask = 0; (yyval.port).value = (yyvsp[(1) - (1)].integer); } +#line 206 "debugger/commandy.y" + { (yyval.bptype) = DEBUGGER_BREAKPOINT_TYPE_READ; } break; case 35: /* Line 1792 of yacc.c */ -#line 208 "debugger/commandy.y" - { (yyval.port).mask = (yyvsp[(1) - (3)].integer); (yyval.port).value = (yyvsp[(3) - (3)].integer); } +#line 207 "debugger/commandy.y" + { (yyval.bptype) = DEBUGGER_BREAKPOINT_TYPE_WRITE; } break; case 36: /* Line 1792 of yacc.c */ +#line 210 "debugger/commandy.y" + { (yyval.port).mask = 0; (yyval.port).value = (yyvsp[(1) - (1)].integer); } + break; + + case 37: +/* Line 1792 of yacc.c */ #line 211 "debugger/commandy.y" + { (yyval.port).mask = (yyvsp[(1) - (3)].integer); (yyval.port).value = (yyvsp[(3) - (3)].integer); } + break; + + case 38: +/* Line 1792 of yacc.c */ +#line 214 "debugger/commandy.y" { (yyval.location).source = memory_source_any; (yyval.location).offset = (yyvsp[(1) - (1)].integer); } break; - case 37: + case 39: /* Line 1792 of yacc.c */ -#line 212 "debugger/commandy.y" +#line 215 "debugger/commandy.y" { (yyval.location).source = memory_source_find( (yyvsp[(1) - (5)].string) ); if( (yyval.location).source == -1 ) { @@ -1791,207 +1813,223 @@ } break; - case 38: + case 40: /* Line 1792 of yacc.c */ -#line 224 "debugger/commandy.y" +#line 227 "debugger/commandy.y" { (yyval.bptype) = DEBUGGER_BREAKPOINT_TYPE_PORT_READ; } break; - case 39: + case 41: /* Line 1792 of yacc.c */ -#line 225 "debugger/commandy.y" +#line 228 "debugger/commandy.y" { (yyval.bptype) = DEBUGGER_BREAKPOINT_TYPE_PORT_WRITE; } break; - case 40: + case 42: /* Line 1792 of yacc.c */ -#line 228 "debugger/commandy.y" +#line 231 "debugger/commandy.y" { (yyval.exp) = NULL; } break; - case 41: + case 43: /* Line 1792 of yacc.c */ -#line 229 "debugger/commandy.y" +#line 232 "debugger/commandy.y" { (yyval.exp) = (yyvsp[(2) - (2)].exp); } break; - case 42: + case 44: /* Line 1792 of yacc.c */ -#line 232 "debugger/commandy.y" +#line 235 "debugger/commandy.y" { (yyval.integer) = PC; } break; - case 43: + case 45: /* Line 1792 of yacc.c */ -#line 233 "debugger/commandy.y" +#line 236 "debugger/commandy.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); } break; - case 44: + case 46: /* Line 1792 of yacc.c */ -#line 236 "debugger/commandy.y" +#line 239 "debugger/commandy.y" { (yyval.exp) = NULL; } break; - case 45: + case 47: /* Line 1792 of yacc.c */ -#line 237 "debugger/commandy.y" +#line 240 "debugger/commandy.y" { (yyval.exp) = (yyvsp[(1) - (1)].exp); } break; - case 46: + case 48: /* Line 1792 of yacc.c */ -#line 240 "debugger/commandy.y" +#line 243 "debugger/commandy.y" { (yyval.integer) = debugger_expression_evaluate( (yyvsp[(1) - (1)].exp) ); } break; - case 47: + case 49: /* Line 1792 of yacc.c */ -#line 243 "debugger/commandy.y" +#line 246 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_number( (yyvsp[(1) - (1)].integer), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 48: + case 50: /* Line 1792 of yacc.c */ -#line 246 "debugger/commandy.y" - { (yyval.exp) = debugger_expression_new_register( (yyvsp[(1) - (1)].reg), debugger_memory_pool ); +#line 249 "debugger/commandy.y" + { (yyval.exp) = debugger_expression_new_register( (yyvsp[(1) - (1)].string), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 49: + case 51: /* Line 1792 of yacc.c */ -#line 249 "debugger/commandy.y" +#line 252 "debugger/commandy.y" + { (yyval.exp) = debugger_expression_new_system_variable( (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].string), debugger_memory_pool ); + if( !(yyval.exp) ) YYABORT; + } + break; + + case 52: +/* Line 1792 of yacc.c */ +#line 257 "debugger/commandy.y" + { (yyval.exp) = debugger_expression_new_system_variable( (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].string), debugger_memory_pool ); + if( !(yyval.exp) ) YYABORT; + } + break; + + case 53: +/* Line 1792 of yacc.c */ +#line 260 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_variable( (yyvsp[(1) - (1)].string), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 50: + case 54: /* Line 1792 of yacc.c */ -#line 252 "debugger/commandy.y" +#line 263 "debugger/commandy.y" { (yyval.exp) = (yyvsp[(2) - (3)].exp); } break; - case 51: + case 55: /* Line 1792 of yacc.c */ -#line 253 "debugger/commandy.y" +#line 264 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_unaryop( DEBUGGER_TOKEN_DEREFERENCE, (yyvsp[(2) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 52: + case 56: /* Line 1792 of yacc.c */ -#line 257 "debugger/commandy.y" +#line 268 "debugger/commandy.y" { (yyval.exp) = (yyvsp[(2) - (2)].exp); } break; - case 53: + case 57: /* Line 1792 of yacc.c */ -#line 258 "debugger/commandy.y" +#line 269 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_unaryop( '-', (yyvsp[(2) - (2)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 54: + case 58: /* Line 1792 of yacc.c */ -#line 262 "debugger/commandy.y" +#line 273 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_unaryop( (yyvsp[(1) - (2)].token), (yyvsp[(2) - (2)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 55: + case 59: /* Line 1792 of yacc.c */ -#line 266 "debugger/commandy.y" +#line 277 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( '+', (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 56: + case 60: /* Line 1792 of yacc.c */ -#line 270 "debugger/commandy.y" +#line 281 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( '-', (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 57: + case 61: /* Line 1792 of yacc.c */ -#line 274 "debugger/commandy.y" +#line 285 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( '*', (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 58: + case 62: /* Line 1792 of yacc.c */ -#line 278 "debugger/commandy.y" +#line 289 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( '/', (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 59: + case 63: /* Line 1792 of yacc.c */ -#line 282 "debugger/commandy.y" +#line 293 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( (yyvsp[(2) - (3)].token), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 60: + case 64: /* Line 1792 of yacc.c */ -#line 286 "debugger/commandy.y" +#line 297 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( (yyvsp[(2) - (3)].token), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 61: + case 65: /* Line 1792 of yacc.c */ -#line 290 "debugger/commandy.y" +#line 301 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( '&', (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 62: + case 66: /* Line 1792 of yacc.c */ -#line 294 "debugger/commandy.y" +#line 305 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( '^', (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 63: + case 67: /* Line 1792 of yacc.c */ -#line 298 "debugger/commandy.y" +#line 309 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( '|', (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool ); if( !(yyval.exp) ) YYABORT; } break; - case 64: + case 68: /* Line 1792 of yacc.c */ -#line 302 "debugger/commandy.y" +#line 313 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( DEBUGGER_TOKEN_LOGICAL_AND, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool @@ -2000,9 +2038,9 @@ } break; - case 65: + case 69: /* Line 1792 of yacc.c */ -#line 308 "debugger/commandy.y" +#line 319 "debugger/commandy.y" { (yyval.exp) = debugger_expression_new_binaryop( DEBUGGER_TOKEN_LOGICAL_OR, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp), debugger_memory_pool @@ -2011,15 +2049,15 @@ } break; - case 66: + case 70: /* Line 1792 of yacc.c */ -#line 316 "debugger/commandy.y" +#line 327 "debugger/commandy.y" { (yyval.string) = (yyvsp[(1) - (1)].string); } break; - case 67: + case 71: /* Line 1792 of yacc.c */ -#line 317 "debugger/commandy.y" +#line 328 "debugger/commandy.y" { (yyval.string) = mempool_new( debugger_memory_pool, char, strlen( (yyvsp[(1) - (2)].string) ) + strlen( (yyvsp[(2) - (2)].string) ) + 2 ); sprintf( (yyval.string), "%s\n%s", (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].string) ); @@ -2028,7 +2066,7 @@ /* Line 1792 of yacc.c */ -#line 2032 "debugger/commandy.c" +#line 2070 "debugger/commandy.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2260,5 +2298,5 @@ /* Line 2055 of yacc.c */ -#line 324 "debugger/commandy.y" +#line 335 "debugger/commandy.y" diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/commandy.h fuse-emulator-1.2.1+dfsg1/debugger/commandy.h --- fuse-emulator-1.2.0+dfsg1/debugger/commandy.h 2016-06-06 11:04:23.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/commandy.h 2016-07-17 10:50:52.000000000 +0000 @@ -128,7 +128,6 @@ int token; - int reg; libspectrum_dword integer; char *string; @@ -143,7 +142,7 @@ /* Line 2058 of yacc.c */ -#line 147 "debugger/commandy.h" +#line 146 "debugger/commandy.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/commandy.y fuse-emulator-1.2.1+dfsg1/debugger/commandy.y --- fuse-emulator-1.2.0+dfsg1/debugger/commandy.y 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/commandy.y 2016-07-17 10:48:30.000000000 +0000 @@ -1,8 +1,8 @@ /* commandy.y: Parse a debugger command - Copyright (c) 2002-2015 Philip Kendall + Copyright (c) 2002-2016 Philip Kendall Copyright (c) 2015 Sergio Baldoví - $Id: commandy.y 5539 2016-05-29 10:49:51Z fredm $ + $Id: commandy.y 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,7 +47,6 @@ %union { int token; - int reg; libspectrum_dword integer; char *string; @@ -98,7 +97,7 @@ %token TIME %token WRITE -%token DEBUGGER_REGISTER +%token DEBUGGER_REGISTER %token NUMBER @@ -192,6 +191,10 @@ | SET NUMBER number { debugger_poke( $2, $3 ); } | SET DEBUGGER_REGISTER number { debugger_register_set( $2, $3 ); } | SET VARIABLE number { debugger_variable_set( $2, $3 ); } + | SET STRING ':' STRING number { debugger_system_variable_set( $2, $4, $5 ); } + /* Temporary hack while we deprecate the old unprefixed style + of register access. This should be removed in Fuse 1.4 */ + | SET STRING ':' DEBUGGER_REGISTER number { debugger_system_variable_set( $2, $4, $5 ); } | STEP { debugger_step(); } ; @@ -246,6 +249,14 @@ | DEBUGGER_REGISTER { $$ = debugger_expression_new_register( $1, debugger_memory_pool ); if( !$$ ) YYABORT; } + | STRING ':' STRING { $$ = debugger_expression_new_system_variable( $1, $3, debugger_memory_pool ); + if( !$$ ) YYABORT; + } + /* Temporary hack while we deprecate the old unprefixed style + of register access. This should be removed in Fuse 1.4 */ + | STRING ':' DEBUGGER_REGISTER { $$ = debugger_expression_new_system_variable( $1, $3, debugger_memory_pool ); + if( !$$ ) YYABORT; + } | VARIABLE { $$ = debugger_expression_new_variable( $1, debugger_memory_pool ); if( !$$ ) YYABORT; } diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/debugger.c fuse-emulator-1.2.1+dfsg1/debugger/debugger.c --- fuse-emulator-1.2.0+dfsg1/debugger/debugger.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/debugger.c 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* debugger.c: Fuse's monitor/debugger - Copyright (c) 2002-2011 Philip Kendall + Copyright (c) 2002-2016 Philip Kendall - $Id: debugger.c 4696 2012-05-07 02:05:13Z fredm $ + $Id: debugger.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ #include "debugger_internals.h" #include "event.h" #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "memory.h" #include "mempool.h" #include "periph.h" @@ -48,8 +49,11 @@ /* The event type used for time breakpoints */ int debugger_breakpoint_event; -void -debugger_init( void ) +/* The system variable type used for Z80 registers */ +const char *debugger_z80_system_variable_type = "z80"; + +static int +debugger_init( void *context ) { debugger_breakpoints = NULL; debugger_output_base = 16; @@ -59,8 +63,11 @@ debugger_breakpoint_event = event_register( debugger_breakpoint_time_fn, "Breakpoint" ); debugger_event_init(); + debugger_system_variable_init(); debugger_variable_init(); debugger_reset(); + + return 0; } void @@ -70,14 +77,26 @@ debugger_mode = DEBUGGER_MODE_INACTIVE; } -int +static void debugger_end( void ) { debugger_breakpoint_remove_all(); debugger_variable_end(); + debugger_system_variable_end(); debugger_event_end(); +} - return 0; +void +debugger_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_EVENT, + STARTUP_MANAGER_MODULE_MEMPOOL, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_DEBUGGER, dependencies, + ARRAY_SIZE( dependencies ), debugger_init, NULL, + debugger_end ); } /* Activate the debugger */ diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/debugger.h fuse-emulator-1.2.1+dfsg1/debugger/debugger.h --- fuse-emulator-1.2.0+dfsg1/debugger/debugger.h 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/debugger.h 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* debugger.h: Fuse's monitor/debugger - Copyright (c) 2002-2013 Philip Kendall + Copyright (c) 2002-2016 Philip Kendall - $Id: debugger.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: debugger.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,10 +49,9 @@ /* Which base should we display things in */ extern int debugger_output_base; -void debugger_init( void ); -void debugger_reset( void ); +void debugger_register_startup( void ); -int debugger_end( void ); +void debugger_reset( void ); int debugger_trap( void ); /* Activate the debugger */ @@ -85,4 +84,13 @@ /* Exit the emulator */ void debugger_exit_emulator( void ); +/* Debugger system variables */ +typedef libspectrum_dword (*debugger_get_system_variable_fn_t)( void ); +typedef void (*debugger_set_system_variable_fn_t)( libspectrum_dword value ); + +void debugger_system_variable_register( + const char *type, const char *detail, + debugger_get_system_variable_fn_t get, + debugger_set_system_variable_fn_t set ); + #endif /* #ifndef FUSE_DEBUGGER_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/debugger_internals.h fuse-emulator-1.2.1+dfsg1/debugger/debugger_internals.h --- fuse-emulator-1.2.0+dfsg1/debugger/debugger_internals.h 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/debugger_internals.h 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* debugger_internals.h: The internals of Fuse's monitor/debugger - Copyright (c) 2002-2011 Philip Kendall + Copyright (c) 2002-2016 Philip Kendall - $Id: debugger_internals.h 5518 2016-05-23 19:12:31Z pak21 $ + $Id: debugger_internals.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,6 +34,9 @@ /* The event type used to trigger time breakpoints */ extern int debugger_breakpoint_event; +/* The system variable type used for Z80 registers */ +extern const char *debugger_z80_system_variable_type; + void debugger_breakpoint_time_fn( libspectrum_dword tstates, int type, void *user_data ); int debugger_breakpoint_remove( size_t id ); @@ -49,10 +52,7 @@ int debugger_poke( libspectrum_word address, libspectrum_byte value ); int debugger_port_write( libspectrum_word address, libspectrum_byte value ); -int debugger_register_hash( const char *reg ); -libspectrum_word debugger_register_get( int which ); -void debugger_register_set( int which, libspectrum_word value ); -const char* debugger_register_text( int which ); +void debugger_register_set( const char *which, libspectrum_word value ); void debugger_exit_emulator( void ); @@ -85,13 +85,16 @@ debugger_expression* debugger_expression_new_number( libspectrum_dword number, int pool ); -debugger_expression* debugger_expression_new_register( int which, int pool ); +debugger_expression* debugger_expression_new_register( const char *which, int pool ); debugger_expression* debugger_expression_new_unaryop( int operation, debugger_expression *operand, int pool ); debugger_expression* debugger_expression_new_binaryop( int operation, debugger_expression *operand1, debugger_expression *operand2, int pool ); debugger_expression* +debugger_expression_new_system_variable( const char *type, const char *detail, + int pool ); +debugger_expression* debugger_expression_new_variable( const char *name, int pool ); debugger_expression* debugger_expression_copy( debugger_expression *src ); @@ -106,6 +109,17 @@ int debugger_event_is_registered( const char *type, const char *detail ); void debugger_event_end( void ); +/* System variables handling */ + +void debugger_system_variable_init( void ); +void debugger_system_variable_end( void ); +int debugger_system_variable_find( const char *type, const char *detail ); +libspectrum_dword debugger_system_variable_get( int system_variable ); +void debugger_system_variable_set( const char *type, const char *detail, + libspectrum_dword value ); +void debugger_system_variable_text( char *buffer, size_t length, + int system_variable ); + /* Variables handling */ void debugger_variable_init( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/event.c fuse-emulator-1.2.1+dfsg1/debugger/event.c --- fuse-emulator-1.2.0+dfsg1/debugger/event.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/event.c 2016-07-17 10:48:30.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 2008 Philip Kendall Copyright (c) 2015 Sergio Baldoví - $Id: event.c 5539 2016-05-29 10:49:51Z fredm $ + $Id: event.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -88,7 +88,10 @@ debugger_event( int event_code ) { debugger_event_t event; - GSList *ptr; + debugger_breakpoint *bp; + GSList *ptr, *ptr_next; + + int signal_breakpoints_updated = 0; if( event_code >= registered_events->len ) { ui_error( UI_ERROR_ERROR, "internal error: invalid debugger event %d", @@ -98,16 +101,28 @@ event = g_array_index( registered_events, debugger_event_t, event_code ); - for( ptr = debugger_breakpoints; ptr; ptr = ptr->next ) { - debugger_breakpoint *bp = ptr->data; + for( ptr = debugger_breakpoints; ptr; ptr = ptr_next ) { + + bp = ptr->data; + ptr_next = ptr->next; + if( bp->type != DEBUGGER_BREAKPOINT_TYPE_EVENT ) continue; if( event_matches( &bp->value.event, event.type, event.detail ) && debugger_breakpoint_trigger( bp ) ) { debugger_mode = DEBUGGER_MODE_HALTED; debugger_command_evaluate( bp->commands ); + + if( bp->life == DEBUGGER_BREAKPOINT_LIFE_ONESHOT ) { + debugger_breakpoints = g_slist_remove( debugger_breakpoints, bp ); + libspectrum_free( bp ); + signal_breakpoints_updated = 1; + } } } + + if( signal_breakpoints_updated ) + ui_breakpoints_updated(); } /* Tidy-up function called at end of emulation */ diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/expression.c fuse-emulator-1.2.1+dfsg1/debugger/expression.c --- fuse-emulator-1.2.0+dfsg1/debugger/expression.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/expression.c 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* expression.c: A numeric expression - Copyright (c) 2003-2015 Philip Kendall + Copyright (c) 2003-2016 Philip Kendall - $Id: expression.c 5585 2016-06-04 13:56:23Z fredm $ + $Id: expression.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,9 +38,9 @@ typedef enum expression_type { DEBUGGER_EXPRESSION_TYPE_INTEGER, - DEBUGGER_EXPRESSION_TYPE_REGISTER, DEBUGGER_EXPRESSION_TYPE_UNARYOP, DEBUGGER_EXPRESSION_TYPE_BINARYOP, + DEBUGGER_EXPRESSION_TYPE_SYSVAR, DEBUGGER_EXPRESSION_TYPE_VARIABLE, } expression_type; @@ -86,10 +86,10 @@ union { int integer; - int reg; struct unaryop_type unaryop; struct binaryop_type binaryop; char *variable; + int system_variable; } types; }; @@ -163,18 +163,15 @@ return exp; } +/* Create a new expression representing a Z80 register + + Now just a pass through to the appropriate system variable. + This function should be removed in Fuse 1.4 */ debugger_expression* -debugger_expression_new_register( int which, int pool ) +debugger_expression_new_register( const char *which, int pool ) { - debugger_expression *exp; - - exp = mempool_new( pool, debugger_expression, 1 ); - - exp->type = DEBUGGER_EXPRESSION_TYPE_REGISTER; - exp->precedence = PRECEDENCE_ATOMIC; - exp->types.reg = which; - - return exp; + return debugger_expression_new_system_variable( + debugger_z80_system_variable_type, which, pool ); } debugger_expression* @@ -195,7 +192,6 @@ return exp; } - debugger_expression* debugger_expression_new_unaryop( int operation, debugger_expression *operand, int pool ) @@ -214,6 +210,29 @@ } debugger_expression* +debugger_expression_new_system_variable( const char *type, const char *detail, + int pool ) +{ + debugger_expression *exp; + int system_variable; + + system_variable = debugger_system_variable_find( type, detail ); + if( system_variable == -1 ) { + ui_error( UI_ERROR_WARNING, "System variable %s:%s not known", type, + detail ); + return NULL; + } + + exp = mempool_new( pool, debugger_expression, 1 ); + + exp->type = DEBUGGER_EXPRESSION_TYPE_SYSVAR; + exp->precedence = PRECEDENCE_ATOMIC; + exp->types.system_variable = system_variable; + + return exp; +} + +debugger_expression* debugger_expression_new_variable( const char *name, int pool ) { debugger_expression *exp; @@ -233,7 +252,7 @@ switch( exp->type ) { case DEBUGGER_EXPRESSION_TYPE_INTEGER: - case DEBUGGER_EXPRESSION_TYPE_REGISTER: + case DEBUGGER_EXPRESSION_TYPE_SYSVAR: break; case DEBUGGER_EXPRESSION_TYPE_UNARYOP: @@ -270,10 +289,6 @@ dest->types.integer = src->types.integer; break; - case DEBUGGER_EXPRESSION_TYPE_REGISTER: - dest->types.reg = src->types.reg; - break; - case DEBUGGER_EXPRESSION_TYPE_UNARYOP: dest->types.unaryop.operation = src->types.unaryop.operation; dest->types.unaryop.op = debugger_expression_copy( src->types.unaryop.op ); @@ -300,10 +315,13 @@ } break; + case DEBUGGER_EXPRESSION_TYPE_SYSVAR: + dest->types.system_variable = src->types.system_variable; + break; + case DEBUGGER_EXPRESSION_TYPE_VARIABLE: dest->types.variable = utils_safe_strdup( src->types.variable ); break; - } return dest; @@ -317,15 +335,15 @@ case DEBUGGER_EXPRESSION_TYPE_INTEGER: return exp->types.integer; - case DEBUGGER_EXPRESSION_TYPE_REGISTER: - return debugger_register_get( exp->types.reg ); - case DEBUGGER_EXPRESSION_TYPE_UNARYOP: return evaluate_unaryop( &( exp->types.unaryop ) ); case DEBUGGER_EXPRESSION_TYPE_BINARYOP: return evaluate_binaryop( &( exp->types.binaryop ) ); + case DEBUGGER_EXPRESSION_TYPE_SYSVAR: + return debugger_system_variable_get( exp->types.system_variable ); + case DEBUGGER_EXPRESSION_TYPE_VARIABLE: return debugger_variable_get( exp->types.variable ); @@ -435,16 +453,16 @@ } return 0; - case DEBUGGER_EXPRESSION_TYPE_REGISTER: - snprintf( buffer, length, "%s", debugger_register_text( exp->types.reg ) ); - return 0; - case DEBUGGER_EXPRESSION_TYPE_UNARYOP: return deparse_unaryop( buffer, length, &( exp->types.unaryop ) ); case DEBUGGER_EXPRESSION_TYPE_BINARYOP: return deparse_binaryop( buffer, length, &( exp->types.binaryop ) ); + case DEBUGGER_EXPRESSION_TYPE_SYSVAR: + debugger_system_variable_text( buffer, length, exp->types.system_variable ); + return 0; + case DEBUGGER_EXPRESSION_TYPE_VARIABLE: snprintf( buffer, length, "$%s", exp->types.variable ); return 0; diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/Makefile.am fuse-emulator-1.2.1+dfsg1/debugger/Makefile.am --- fuse-emulator-1.2.0+dfsg1/debugger/Makefile.am 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/Makefile.am 2016-07-17 10:48:30.000000000 +0000 @@ -1,8 +1,8 @@ ## Process this file with automake to produce Makefile.in -## Copyright (c) 2001-2008 Philip Kendall +## Copyright (c) 2001-2016 Philip Kendall ## Copyright (c) 2015 Sergio Baldoví -## $Id: Makefile.am 5434 2016-05-01 04:22:45Z fredm $ +## $Id: Makefile.am 5677 2016-07-09 13:58:02Z fredm $ ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ debugger/disassemble.c \ debugger/event.c \ debugger/expression.c \ + debugger/system_variable.c \ debugger/variable.c debugger/commandl.c: debugger/commandy.c diff -Nru fuse-emulator-1.2.0+dfsg1/debugger/system_variable.c fuse-emulator-1.2.1+dfsg1/debugger/system_variable.c --- fuse-emulator-1.2.0+dfsg1/debugger/system_variable.c 1970-01-01 00:00:00.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/debugger/system_variable.c 2016-07-17 10:48:30.000000000 +0000 @@ -0,0 +1,160 @@ +/* event.c: Debugger system variables + Copyright (c) 2016 Philip Kendall + + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Author contact information: + + E-mail: philip-fuse@shadowmagic.org.uk + +*/ + +#include + +#include + +#ifdef HAVE_LIB_GLIB +#include +#endif /* #ifdef HAVE_LIB_GLIB */ + +#include + +#include "debugger_internals.h" +#include "fuse.h" +#include "ui/ui.h" +#include "utils.h" + +typedef struct system_variable_t { + char *type; + char *detail; + debugger_get_system_variable_fn_t get; + debugger_set_system_variable_fn_t set; +} system_variable_t; + +static GArray *system_variables; + +void +debugger_system_variable_init( void ) +{ + system_variables = g_array_new( FALSE, FALSE, sizeof( system_variable_t ) ); +} + +void +debugger_system_variable_register( const char *type, const char *detail, + debugger_get_system_variable_fn_t get, + debugger_set_system_variable_fn_t set ) +{ + system_variable_t sysvar; + + sysvar.type = utils_safe_strdup( type ); + sysvar.detail = utils_safe_strdup( detail ); + sysvar.get = get; + sysvar.set = set; + + g_array_append_val( system_variables, sysvar ); +} + +static int +system_variable_matches( system_variable_t *sysvar, const char *type, const char *detail ) +{ + return strcasecmp( type, sysvar->type ) == 0 && + strcasecmp( detail, sysvar->detail ) == 0; +} + +static int +find_system_variable( const char *type, const char *detail, system_variable_t *out ) +{ + size_t i; + + for( i = 0; i < system_variables->len; i++ ) { + system_variable_t sysvar = + g_array_index( system_variables, system_variable_t, i ); + + if( system_variable_matches( &sysvar, type, detail ) ) { + if( out != NULL ) *out = sysvar; + return i; + } + } + + return -1; +} + +int +debugger_system_variable_find( const char *type, const char *detail ) +{ + return find_system_variable( type, detail, NULL ); +} + +libspectrum_dword +debugger_system_variable_get( int system_variable ) +{ + system_variable_t sysvar = + g_array_index( system_variables, system_variable_t, system_variable ); + + return sysvar.get(); +} + +void +debugger_system_variable_set( const char *type, const char *detail, + libspectrum_dword value ) +{ + int index; + system_variable_t sysvar; + + index = find_system_variable( type, detail, &sysvar ); + if( index == -1 ) { + ui_error( UI_ERROR_ERROR, "Unknown system variable %s:%s", type, detail ); + return; + } + + if (sysvar.set == NULL) { + ui_error( UI_ERROR_ERROR, "System variable %s:%s cannot be set", type, + detail ); + return; + } + + sysvar.set( value ); +} + +void +debugger_system_variable_text( char *buffer, size_t length, + int system_variable ) +{ + system_variable_t sysvar = + g_array_index( system_variables, system_variable_t, system_variable ); + + snprintf( buffer, length, "%s:%s", sysvar.type, sysvar.detail ); +} + +/* Tidy-up function called at end of emulation */ +void +debugger_system_variable_end( void ) +{ + int i; + system_variable_t sysvar; + + if( !system_variables ) return; + + for( i = 0; i < system_variables->len; i++ ) { + sysvar = g_array_index( system_variables, system_variable_t, i ); + libspectrum_free( sysvar.detail ); + libspectrum_free( sysvar.type ); + } + + g_array_free( system_variables, TRUE ); + system_variables = NULL; +} diff -Nru fuse-emulator-1.2.0+dfsg1/display.c fuse-emulator-1.2.1+dfsg1/display.c --- fuse-emulator-1.2.0+dfsg1/display.c 2016-06-06 11:03:28.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/display.c 2016-07-17 10:48:28.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 1999-2015 Philip Kendall, Thomas Harte, Witold Filipczyk and Fredrick Meunier - $Id: display.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: display.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,8 +32,8 @@ #include #include "display.h" -#include "event.h" #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "movie.h" #include "peripherals/scld.h" @@ -207,6 +207,26 @@ return 0; } +static int +display_init_wrapper( void *context ) +{ + display_startup_context *typed_context = + (display_startup_context*) context; + + return display_init( typed_context->argc, typed_context->argv ); +} + +void +display_register_startup( display_startup_context *context ) +{ + /* The Wii has an explicit call to display_init for now */ +#ifndef GEKKO + startup_manager_register_no_dependencies( STARTUP_MANAGER_MODULE_DISPLAY, + display_init_wrapper, context, + NULL ); +#endif /* #ifndef GEKKO */ +} + /* Mark as 'dirty' the pixels which have been changed by a write to 'offset' within the RAM page containing the screen */ void diff -Nru fuse-emulator-1.2.0+dfsg1/display.h fuse-emulator-1.2.1+dfsg1/display.h --- fuse-emulator-1.2.0+dfsg1/display.h 2016-06-06 11:03:28.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/display.h 2016-07-17 10:48:28.000000000 +0000 @@ -1,7 +1,7 @@ /* display.h: Routines for printing the Spectrum's screen Copyright (c) 1999-2006 Philip Kendall - $Id: display.h 4664 2012-02-12 11:51:01Z fredm $ + $Id: display.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -75,7 +75,13 @@ extern libspectrum_word display_line_start[ DISPLAY_HEIGHT ]; extern libspectrum_word display_attr_start[ DISPLAY_HEIGHT ]; -int display_init(int *argc, char ***argv); +typedef struct display_startup_context { + int *argc; + char ***argv; +} display_startup_context; + +int display_init( int *argc, char ***argv ); +void display_register_startup( display_startup_context *context ); void display_line(void); typedef void (*display_dirty_fn)( libspectrum_word offset ); diff -Nru fuse-emulator-1.2.0+dfsg1/event.c fuse-emulator-1.2.1+dfsg1/event.c --- fuse-emulator-1.2.0+dfsg1/event.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/event.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* event.c: Routines needed for dealing with the event list Copyright (c) 2000-2015 Philip Kendall - $Id: event.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: event.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ #include #include "event.h" +#include "infrastructure/startup_manager.h" #include "fuse.h" #include "ui/ui.h" #include "utils.h" @@ -56,14 +57,16 @@ static GArray *registered_events; -void -event_init( void ) +static int +event_init( void *context ) { registered_events = g_array_new( FALSE, FALSE, sizeof( event_descriptor_t ) ); event_type_null = event_register( NULL, "[Deleted event]" ); event_next_event = event_no_events; + + return 0; } int @@ -272,9 +275,18 @@ } /* Tidy-up function called at end of emulation */ -void +static void event_end( void ) { event_reset(); registered_events_free(); } + +void +event_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_EVENT, dependencies, + ARRAY_SIZE( dependencies ), event_init, NULL, + event_end ); +} diff -Nru fuse-emulator-1.2.0+dfsg1/event.h fuse-emulator-1.2.1+dfsg1/event.h --- fuse-emulator-1.2.0+dfsg1/event.h 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/event.h 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* event.h: Routines needed for dealing with the event list Copyright (c) 2000-2004 Philip Kendall - $Id: event.h 4641 2012-01-21 13:42:51Z pak21 $ + $Id: event.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -48,9 +48,6 @@ /* When will the next event happen? */ extern libspectrum_dword event_next_event; -/* Set up the event list */ -void event_init( void ); - /* Register a new event type */ int event_register( event_fn_t fn, const char *description ); @@ -88,7 +85,7 @@ /* A textual representation of each event type */ const char *event_name( int type ); -/* Called on exit to clean up */ -void event_end( void ); +/* Register the init and end functions */ +void event_register_startup( void ); #endif /* #ifndef FUSE_EVENT_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/fuse.c fuse-emulator-1.2.1+dfsg1/fuse.c --- fuse-emulator-1.2.0+dfsg1/fuse.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/fuse.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* fuse.c: The Free Unix Spectrum Emulator - Copyright (c) 1999-2015 Philip Kendall and others + Copyright (c) 1999-2016 Philip Kendall and others - $Id: fuse.c 5568 2016-06-01 10:40:13Z fredm $ + $Id: fuse.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -59,6 +59,7 @@ #include "display.h" #include "event.h" #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "keyboard.h" #include "machine.h" #include "machines/machines_periph.h" @@ -145,9 +146,13 @@ } start_files_t; +/* Context for the display startup routine */ +static display_startup_context display_context; + static int fuse_init(int argc, char **argv); -static int creator_init( void ); +static void creator_register_startup( void ); + static void fuse_show_copyright(void); static void fuse_show_version( void ); static void fuse_show_help( void ); @@ -199,6 +204,139 @@ } +static int +fuse_libspectrum_init( void *context ) +{ + if( libspectrum_check_version( LIBSPECTRUM_MIN_VERSION ) ) { + if( libspectrum_init() ) return 1; + } else { + ui_error( UI_ERROR_ERROR, + "libspectrum version %s found, but %s required", + libspectrum_version(), LIBSPECTRUM_MIN_VERSION ); + return 1; + } + + return 0; +} + +static void +libspectrum_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DISPLAY + }; + startup_manager_register( STARTUP_MANAGER_MODULE_LIBSPECTRUM, dependencies, + ARRAY_SIZE( dependencies ), fuse_libspectrum_init, + NULL, NULL ); +} + +static int +libxml2_init( void *context ) +{ +#ifdef HAVE_LIB_XML2 + LIBXML_TEST_VERSION +#endif + + return 0; +} + +static void +libxml2_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_LIBXML2, dependencies, + ARRAY_SIZE( dependencies ), libxml2_init, NULL, + NULL ); +} + +static int +setuid_init( void *context ) +{ +#ifdef HAVE_GETEUID + int error; + + /* Drop root privs if we have them */ + if( !geteuid() ) { + error = setuid( getuid() ); + if( error ) { + ui_error( UI_ERROR_ERROR, "Could not drop root privileges" ); + return 1; + } + } +#endif /* #ifdef HAVE_GETEUID */ + + return 0; +} + +static void +setuid_register_startup() +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DISPLAY, + STARTUP_MANAGER_MODULE_LIBSPECTRUM, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_SETUID, dependencies, + ARRAY_SIZE( dependencies ), setuid_init, NULL, + NULL ); +} + +static int +run_startup_manager( int *argc, char ***argv ) +{ + startup_manager_init(); + + display_context.argc = argc; + display_context.argv = argv; + + /* Get every module to register its init function */ + ay_register_startup(); + beta_register_startup(); + creator_register_startup(); + debugger_register_startup(); + didaktik80_register_startup(); + disciple_register_startup(); + display_register_startup( &display_context ); + divide_register_startup(); + event_register_startup(); + fdd_register_startup(); + fuller_register_startup(); + if1_register_startup(); + if2_register_startup(); + kempmouse_register_startup(); + libspectrum_register_startup(); + libxml2_register_startup(); + machine_register_startup(); + machines_periph_register_startup(); + melodik_register_startup(); + memory_register_startup(); + mempool_register_startup(); + opus_register_startup(); + plusd_register_startup(); + printer_register_startup(); + profile_register_startup(); + psg_register_startup(); + rzx_register_startup(); + scld_register_startup(); + settings_register_startup(); + setuid_register_startup(); + simpleide_register_startup(); + slt_register_startup(); + sound_register_startup(); + speccyboot_register_startup(); + specdrum_register_startup(); + spectranet_register_startup(); + spectrum_register_startup(); + tape_register_startup(); + timer_register_startup(); + ula_register_startup(); + usource_register_startup(); + z80_register_startup(); + zxatasp_register_startup(); + zxcf_register_startup(); + + return startup_manager_run(); +} + static int fuse_init(int argc, char **argv) { int error, first_arg; @@ -241,96 +379,14 @@ fuse_show_copyright(); #endif - /* FIXME: order of these initialisation calls. Work out what depends on - what */ - /* FIXME FIXME 20030407: really do this soon. This is getting *far* too - hairy */ - fuse_joystick_init (); + fuse_joystick_init(); fuse_keyboard_init(); - event_init(); - -#ifndef GEKKO - if( display_init(&argc,&argv) ) return 1; -#endif - - if( libspectrum_check_version( LIBSPECTRUM_MIN_VERSION ) ) { - if( libspectrum_init() ) return 1; - } else { - ui_error( UI_ERROR_ERROR, - "libspectrum version %s found, but %s required", - libspectrum_version(), LIBSPECTRUM_MIN_VERSION ); - return 1; - } - - /* Must be called after libspectrum_init() so we can get the gcrypt - version */ - if( creator_init() ) return 1; - -#ifdef HAVE_GETEUID - /* Drop root privs if we have them */ - if( !geteuid() ) { - error = setuid( getuid() ); - if( error ) { - ui_error( UI_ERROR_ERROR, "Could not drop root privileges" ); - return 1; - } - } -#endif /* #ifdef HAVE_GETEUID */ - - mempool_init(); - memory_init(); - -#ifdef HAVE_LIB_XML2 -LIBXML_TEST_VERSION -#endif - - debugger_init(); - - spectrum_init(); - printer_init(); - rzx_init(); - psg_init(); - beta_init(); - opus_init(); - plusd_init(); - didaktik80_init(); - disciple_init(); - fdd_init_events(); - if( simpleide_init() ) return 1; - if( zxatasp_init() ) return 1; - if( zxcf_init() ) return 1; - if1_init(); - if2_init(); - if( divide_init() ) return 1; - scld_init(); - ula_init(); - ay_init(); - slt_init(); - profile_init(); - kempmouse_init(); - fuller_init(); - melodik_init(); - speccyboot_init(); - specdrum_init(); - spectranet_init(); - usource_init(); - machines_periph_init(); - - z80_init(); - - if( timer_init() ) return 1; - - error = timer_estimate_reset(); if( error ) return error; - - error = machine_init_machines(); - if( error ) return error; + if( run_startup_manager( &argc, &argv ) ) return 1; error = machine_select_id( settings_current.start_machine ); if( error ) return error; - tape_init(); - error = scaler_select_id( start_scaler ); libspectrum_free( start_scaler ); if( error ) return error; @@ -349,8 +405,8 @@ return 0; } -static -int creator_init( void ) +static int +creator_init( void *context ) { size_t i; unsigned int version[4] = { 0, 0, 0, 0 }; @@ -402,6 +458,21 @@ return 0; } +static void +creator_end( void ) +{ + libspectrum_creator_free( fuse_creator ); +} + +static void +creator_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_CREATOR, dependencies, + ARRAY_SIZE( dependencies ), creator_init, NULL, + creator_end ); +} + static void fuse_show_copyright(void) { printf( "\n" ); @@ -855,51 +926,19 @@ static int fuse_end(void) { movie_stop(); /* stop movie recording */ - /* Must happen before memory is deallocated as we read the character - set from memory for the text output */ - printer_end(); - - /* also required before memory is deallocated on Fuse for OS X where - settings need to look up machine names etc. */ - settings_end(); - - psg_end(); - rzx_end(); - tape_end(); - debugger_end(); - simpleide_end(); - zxatasp_end(); - zxcf_end(); - if1_end(); - divide_end(); - beta_end(); - opus_end(); - plusd_end(); - didaktik80_end(); - disciple_end(); - spectranet_end(); - speccyboot_end(); - usource_end(); - - machine_end(); - timer_end(); + startup_manager_run_end(); - sound_end(); - event_end(); periph_end(); fuse_keyboard_end(); fuse_joystick_end(); ui_end(); ui_media_drive_end(); - memory_end(); - mempool_end(); module_end(); pokemem_end(); svg_capture_end(); - libspectrum_creator_free( fuse_creator ); libspectrum_end(); return 0; diff -Nru fuse-emulator-1.2.0+dfsg1/infrastructure/Makefile.am fuse-emulator-1.2.1+dfsg1/infrastructure/Makefile.am --- fuse-emulator-1.2.0+dfsg1/infrastructure/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/infrastructure/Makefile.am 2016-07-17 10:48:29.000000000 +0000 @@ -0,0 +1,26 @@ +## Process this file with automake to produce Makefile.in +## Copyright (c) 2016 Philip Kendall + +## $Id$ + +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License along +## with this program; if not, write to the Free Software Foundation, Inc., +## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +## +## Author contact information: +## +## E-mail: philip-fuse@shadowmagic.org.uk + +fuse_SOURCES += infrastructure/startup_manager.c + +noinst_HEADERS += infrastructure/startup_manager.h diff -Nru fuse-emulator-1.2.0+dfsg1/infrastructure/startup_manager.c fuse-emulator-1.2.1+dfsg1/infrastructure/startup_manager.c --- fuse-emulator-1.2.0+dfsg1/infrastructure/startup_manager.c 1970-01-01 00:00:00.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/infrastructure/startup_manager.c 2016-07-17 10:48:29.000000000 +0000 @@ -0,0 +1,173 @@ +/* startup_manager.c: handle Fuse's startup routines + Copyright (c) 2016 Philip Kendall + + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Author contact information: + + E-mail: philip-fuse@shadowmagic.org.uk + +*/ + +#include + +#ifdef HAVE_LIB_GLIB +#include +#endif /* #ifdef HAVE_LIB_GLIB */ + +#include + +#include "startup_manager.h" +#include "ui/ui.h" + +typedef struct registered_module_t { + startup_manager_module module; + GArray *dependencies; + startup_manager_init_fn init_fn; + void *init_context; + startup_manager_end_fn end_fn; +} registered_module_t; + +static GArray *registered_modules; + +static GArray *end_functions; + +void +startup_manager_init( void ) +{ + registered_modules = + g_array_new( FALSE, FALSE, sizeof( registered_module_t ) ); + end_functions = + g_array_new( FALSE, FALSE, sizeof( startup_manager_end_fn ) ); +} + +void +startup_manager_register( + startup_manager_module module, startup_manager_module *dependencies, + size_t dependency_count, startup_manager_init_fn init_fn, + void *init_context, startup_manager_end_fn end_fn ) +{ + registered_module_t registered_module; + + registered_module.module = module; + registered_module.dependencies = + g_array_sized_new( FALSE, FALSE, sizeof( startup_manager_module ), + dependency_count ); + g_array_append_vals( registered_module.dependencies, dependencies, + dependency_count ); + registered_module.init_fn = init_fn; + registered_module.init_context = init_context; + registered_module.end_fn = end_fn; + + g_array_append_val( registered_modules, registered_module ); +} + +void +startup_manager_register_no_dependencies( + startup_manager_module module, startup_manager_init_fn init_fn, + void *init_context, startup_manager_end_fn end_fn ) +{ + startup_manager_register( module, NULL, 0, init_fn, init_context, end_fn ); +} + +static void +remove_dependency( startup_manager_module module ) +{ + guint i, j; + + for( i = 0; i < registered_modules->len; i++ ) { + registered_module_t *registered_module = + &g_array_index( registered_modules, registered_module_t, i ); + GArray *dependencies = registered_module->dependencies; + + for( j = 0; j < dependencies->len; j++ ) { + startup_manager_module dependency = + g_array_index( dependencies, startup_manager_module, j ); + + if( dependency == module ) { + g_array_remove_index_fast( dependencies, j ); + break; + } + } + } +} + +int +startup_manager_run( void ) +{ + int progress_made; + guint i; + int error; + + /* Loop until we can't make any more progress; this will either be because + we've called every function (good!) or because there's a logical error + in the dependency graph (bad!) */ + do { + i = 0; + progress_made = 0; + + while( i < registered_modules->len ) { + registered_module_t *registered_module = + &g_array_index( registered_modules, registered_module_t, i ); + + if( registered_module->dependencies->len == 0 ) { + + if( registered_module->init_fn ) { + error = registered_module->init_fn( + registered_module->init_context + ); + if( error ) return error; + } + + if( registered_module->end_fn ) + g_array_append_val( end_functions, registered_module->end_fn ); + + remove_dependency( registered_module->module ); + + g_array_free( registered_module->dependencies, TRUE ); + g_array_remove_index_fast( registered_modules, i ); + + progress_made = 1; + } else { + i++; + } + } + } while( progress_made && registered_modules->len ); + + /* If there are still any modules left to be called, then that's bad */ + if( registered_modules->len ) { + ui_error( UI_ERROR_ERROR, "%d startup modules could not be called", + registered_modules->len ); + return 1; + } + + return 0; +} + +void +startup_manager_run_end( void ) +{ + guint i; + + for( i = end_functions->len; i-- != 0; ) + { + startup_manager_end_fn end_fn = + g_array_index( end_functions, startup_manager_end_fn, i ); + + end_fn(); + } +} diff -Nru fuse-emulator-1.2.0+dfsg1/infrastructure/startup_manager.h fuse-emulator-1.2.1+dfsg1/infrastructure/startup_manager.h --- fuse-emulator-1.2.0+dfsg1/infrastructure/startup_manager.h 1970-01-01 00:00:00.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/infrastructure/startup_manager.h 2016-07-17 10:48:29.000000000 +0000 @@ -0,0 +1,105 @@ +/* startup_manager.h: handle Fuse's startup routines + Copyright (c) 2016 Philip Kendall + + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Author contact information: + + E-mail: philip-fuse@shadowmagic.org.uk + +*/ + +#ifndef FUSE_STARTUP_MANAGER_H +#define FUSE_STARTUP_MANAGER_H + +/* The modules the startup manager knows about */ +typedef enum startup_manager_module { + + STARTUP_MANAGER_MODULE_AY, + STARTUP_MANAGER_MODULE_BETA, + STARTUP_MANAGER_MODULE_CREATOR, + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_DIDAKTIK, + STARTUP_MANAGER_MODULE_DISCIPLE, + STARTUP_MANAGER_MODULE_DISPLAY, + STARTUP_MANAGER_MODULE_DIVIDE, + STARTUP_MANAGER_MODULE_EVENT, + STARTUP_MANAGER_MODULE_FDD, + STARTUP_MANAGER_MODULE_FULLER, + STARTUP_MANAGER_MODULE_IF1, + STARTUP_MANAGER_MODULE_IF2, + STARTUP_MANAGER_MODULE_KEMPMOUSE, + STARTUP_MANAGER_MODULE_LIBSPECTRUM, + STARTUP_MANAGER_MODULE_LIBXML2, + STARTUP_MANAGER_MODULE_MACHINE, + STARTUP_MANAGER_MODULE_MACHINES_PERIPH, + STARTUP_MANAGER_MODULE_MELODIK, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_MEMPOOL, + STARTUP_MANAGER_MODULE_OPUS, + STARTUP_MANAGER_MODULE_PLUSD, + STARTUP_MANAGER_MODULE_PRINTER, + STARTUP_MANAGER_MODULE_PROFILE, + STARTUP_MANAGER_MODULE_PSG, + STARTUP_MANAGER_MODULE_RZX, + STARTUP_MANAGER_MODULE_SCLD, + STARTUP_MANAGER_MODULE_SETTINGS_END, + STARTUP_MANAGER_MODULE_SETUID, + STARTUP_MANAGER_MODULE_SIMPLEIDE, + STARTUP_MANAGER_MODULE_SLT, + STARTUP_MANAGER_MODULE_SOUND, + STARTUP_MANAGER_MODULE_SPECCYBOOT, + STARTUP_MANAGER_MODULE_SPECDRUM, + STARTUP_MANAGER_MODULE_SPECTRANET, + STARTUP_MANAGER_MODULE_SPECTRUM, + STARTUP_MANAGER_MODULE_TAPE, + STARTUP_MANAGER_MODULE_TIMER, + STARTUP_MANAGER_MODULE_ULA, + STARTUP_MANAGER_MODULE_USOURCE, + STARTUP_MANAGER_MODULE_Z80, + STARTUP_MANAGER_MODULE_ZXATASP, + STARTUP_MANAGER_MODULE_ZXCF, + +} startup_manager_module; + +/* Callback for each module's init function */ +typedef int (*startup_manager_init_fn)( void *context ); + +/* Callback for each module's end function */ +typedef void (*startup_manager_end_fn)( void ); + +/* Initialise the startup manager itself */ +void startup_manager_init( void ); + +/* Register an module with the startup manager */ +void startup_manager_register( + startup_manager_module module, startup_manager_module *dependencies, + size_t dependency_count, startup_manager_init_fn init_fn, + void *init_context, startup_manager_end_fn end_fn ); + +/* Register an module with no dependencies with the startup manager */ +void startup_manager_register_no_dependencies( + startup_manager_module module, startup_manager_init_fn init_fn, + void *init_context, startup_manager_end_fn end_fn ); + +/* Run all the registered init functions in the right order */ +int startup_manager_run( void ); + +/* Run all the end functions in inverse order of the init functions */ +void startup_manager_run_end( void ); + +#endif /* #ifndef FUSE_STARTUP_MANAGER_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/machine.c fuse-emulator-1.2.1+dfsg1/machine.c --- fuse-emulator-1.2.0+dfsg1/machine.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/machine.c 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* machine.c: Routines for handling the various machine types Copyright (c) 1999-2015 Philip Kendall - $Id: machine.c 5514 2016-05-23 11:48:32Z fredm $ + $Id: machine.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ #include "event.h" #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "machines/machines.h" #include "machines/scorpion.h" @@ -63,7 +64,8 @@ static void machine_set_const_timings( fuse_machine_info *machine ); static void machine_set_variable_timings( fuse_machine_info *machine ); -int machine_init_machines( void ) +static int +machine_init_machines( void *context ) { int error; @@ -305,7 +307,7 @@ int custom = 0; int retval; - if( fallback ) custom = strcmp( filename, fallback ); + if( fallback ) custom = !!strcmp( filename, fallback ); retval = machine_load_rom_bank_from_file( bank_map, page_num, filename, expected_length, custom ); @@ -419,7 +421,8 @@ } } -int machine_end( void ) +static void +machine_end( void ) { int i; @@ -429,6 +432,13 @@ } libspectrum_free( machine_types ); +} - return 0; +void +machine_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_MACHINE, dependencies, + ARRAY_SIZE( dependencies ), machine_init_machines, + NULL, machine_end ); } diff -Nru fuse-emulator-1.2.0+dfsg1/machine.h fuse-emulator-1.2.1+dfsg1/machine.h --- fuse-emulator-1.2.0+dfsg1/machine.h 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/machine.h 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* machine.h: Routines for handling the various machine types Copyright (c) 1999-2011 Philip Kendall - $Id: machine.h 4624 2012-01-09 20:59:35Z pak21 $ + $Id: machine.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -92,7 +92,7 @@ extern fuse_machine_info *machine_current; /* The currently selected machine */ -int machine_init_machines( void ); +void machine_register_startup( void ); int machine_select( libspectrum_machine type ); int machine_select_id( const char *id ); @@ -106,6 +106,5 @@ size_t expected_length ); int machine_reset( int hard_reset ); -int machine_end( void ); #endif /* #ifndef FUSE_MACHINE_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/machines/machines_periph.c fuse-emulator-1.2.1+dfsg1/machines/machines_periph.c --- fuse-emulator-1.2.0+dfsg1/machines/machines_periph.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/machines/machines_periph.c 2016-07-17 10:48:30.000000000 +0000 @@ -1,9 +1,9 @@ /* machines_periph.c: various machine-specific peripherals - Copyright (c) 2011 Philip Kendall + Copyright (c) 2011-2016 Philip Kendall Copyright (c) 2015 Stuart Brady Copyright (c) 2015 Gergely Szasz - $Id: machines_periph.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: machines_periph.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ #include #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "machines_periph.h" #include "pentagon.h" #include "periph.h" @@ -152,8 +153,8 @@ NULL }; -void -machines_periph_init( void ) +static int +machines_periph_init( void *context ) { periph_register( PERIPH_TYPE_128_MEMORY, &spec128_memory ); periph_register( PERIPH_TYPE_PLUS3_MEMORY, &plus3_memory ); @@ -163,6 +164,17 @@ periph_register( PERIPH_TYPE_BETA128_PENTAGON, &beta128_pentagon ); periph_register( PERIPH_TYPE_BETA128_PENTAGON_LATE, &beta128_pentagon_late ); periph_register( PERIPH_TYPE_PENTAGON1024_MEMORY, &pentagon1024_memory ); + + return 0; +} + +void +machines_periph_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_MACHINES_PERIPH, + dependencies, ARRAY_SIZE( dependencies ), + machines_periph_init, NULL, NULL ); } /* Peripherals generally available on all machines; the Timex machines and diff -Nru fuse-emulator-1.2.0+dfsg1/machines/machines_periph.h fuse-emulator-1.2.1+dfsg1/machines/machines_periph.h --- fuse-emulator-1.2.0+dfsg1/machines/machines_periph.h 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/machines/machines_periph.h 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* machines_periph.h: various machine-specific peripherals - Copyright (c) 2011 Philip Kendall + Copyright (c) 2011-2016 Philip Kendall - $Id: machines_periph.h 4775 2012-11-26 23:03:36Z sbaldovi $ + $Id: machines_periph.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ #ifndef FUSE_MACHINES_PERIPH_H #define FUSE_MACHINES_PERIPH_H -void machines_periph_init( void ); +void machines_periph_register_startup( void ); void machines_periph_48( void ); void machines_periph_128( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/Makefile.am fuse-emulator-1.2.1+dfsg1/Makefile.am --- fuse-emulator-1.2.0+dfsg1/Makefile.am 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/Makefile.am 2016-07-17 10:48:32.000000000 +0000 @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in ## Copyright (c) 1999-2015 Philip Kendall -## $Id: Makefile.am 5537 2016-05-29 06:17:00Z sbaldovi $ +## $Id: Makefile.am 5677 2016-07-09 13:58:02Z fredm $ ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -170,6 +170,7 @@ include data/Makefile.am include debugger/Makefile.am include hacking/Makefile.am +include infrastructure/Makefile.am include lib/Makefile.am include machines/Makefile.am include man/Makefile.am diff -Nru fuse-emulator-1.2.0+dfsg1/Makefile.in fuse-emulator-1.2.1+dfsg1/Makefile.in --- fuse-emulator-1.2.0+dfsg1/Makefile.in 2016-06-06 11:03:53.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/Makefile.in 2016-07-17 10:50:20.000000000 +0000 @@ -88,19 +88,20 @@ DIST_COMMON = $(srcdir)/compat/Makefile.am $(srcdir)/data/Makefile.am \ $(srcdir)/data/win32/distribution.mk \ $(srcdir)/debugger/Makefile.am $(srcdir)/hacking/Makefile.am \ - $(srcdir)/lib/Makefile.am $(srcdir)/machines/Makefile.am \ - $(srcdir)/man/Makefile.am $(srcdir)/peripherals/Makefile.am \ - $(srcdir)/perl/Makefile.am $(srcdir)/pokefinder/Makefile.am \ - $(srcdir)/roms/Makefile.am $(srcdir)/sound/Makefile.am \ - $(srcdir)/timer/Makefile.am $(srcdir)/ui/Makefile.am \ - $(srcdir)/ui/fb/Makefile.am $(srcdir)/ui/gtk/Makefile.am \ - $(srcdir)/ui/scaler/Makefile.am $(srcdir)/ui/sdl/Makefile.am \ - $(srcdir)/ui/svga/Makefile.am $(srcdir)/ui/widget/Makefile.am \ - $(srcdir)/ui/wii/Makefile.am $(srcdir)/ui/win32/Makefile.am \ - $(srcdir)/ui/xlib/Makefile.am $(srcdir)/unittests/Makefile.am \ - $(srcdir)/z80/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(srcdir)/config.h.in \ + $(srcdir)/infrastructure/Makefile.am $(srcdir)/lib/Makefile.am \ + $(srcdir)/machines/Makefile.am $(srcdir)/man/Makefile.am \ + $(srcdir)/peripherals/Makefile.am $(srcdir)/perl/Makefile.am \ + $(srcdir)/pokefinder/Makefile.am $(srcdir)/roms/Makefile.am \ + $(srcdir)/sound/Makefile.am $(srcdir)/timer/Makefile.am \ + $(srcdir)/ui/Makefile.am $(srcdir)/ui/fb/Makefile.am \ + $(srcdir)/ui/gtk/Makefile.am $(srcdir)/ui/scaler/Makefile.am \ + $(srcdir)/ui/sdl/Makefile.am $(srcdir)/ui/svga/Makefile.am \ + $(srcdir)/ui/widget/Makefile.am $(srcdir)/ui/wii/Makefile.am \ + $(srcdir)/ui/win32/Makefile.am $(srcdir)/ui/xlib/Makefile.am \ + $(srcdir)/unittests/Makefile.am $(srcdir)/z80/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in \ $(top_srcdir)/data/win32/fuse.manifest.in \ $(top_srcdir)/data/win32/installer.nsi.in debugger/commandl.c \ debugger/commandy.c depcomp ylwrap \ @@ -118,78 +119,77 @@ config.sub install-sh missing ltmain.sh @COMPAT_DIRNAME_TRUE@am__append_4 = compat/dirname.c @COMPAT_GETOPT_TRUE@am__append_5 = compat/getopt.c compat/getopt1.c -@COMPAT_MKSTEMP_TRUE@am__append_6 = compat/mkstemp.c -@COMPAT_AMIGA_TRUE@am__append_7 = \ +@COMPAT_AMIGA_TRUE@am__append_6 = \ @COMPAT_AMIGA_TRUE@ compat/unix/dir.c \ @COMPAT_AMIGA_TRUE@ compat/unix/file.c \ @COMPAT_AMIGA_TRUE@ compat/amiga/osname.c \ @COMPAT_AMIGA_TRUE@ compat/amiga/paths.c \ @COMPAT_AMIGA_TRUE@ compat/unix/timer.c -@COMPAT_LINUX_TRUE@am__append_8 = \ +@COMPAT_LINUX_TRUE@am__append_7 = \ @COMPAT_LINUX_TRUE@ compat/unix/dir.c \ @COMPAT_LINUX_TRUE@ compat/unix/file.c \ @COMPAT_LINUX_TRUE@ compat/unix/osname.c \ @COMPAT_LINUX_TRUE@ compat/linux/paths.c \ @COMPAT_LINUX_TRUE@ compat/unix/timer.c -@COMPAT_LINUX_TRUE@@HAVE_SOCKETS_TRUE@am__append_9 = compat/unix/socket.c -@COMPAT_MORPHOS_TRUE@am__append_10 = \ +@COMPAT_LINUX_TRUE@@HAVE_SOCKETS_TRUE@am__append_8 = compat/unix/socket.c +@COMPAT_MORPHOS_TRUE@am__append_9 = \ @COMPAT_MORPHOS_TRUE@ compat/unix/dir.c \ @COMPAT_MORPHOS_TRUE@ compat/unix/file.c \ @COMPAT_MORPHOS_TRUE@ compat/morphos/osname.c \ @COMPAT_MORPHOS_TRUE@ compat/amiga/paths.c \ @COMPAT_MORPHOS_TRUE@ compat/unix/timer.c -@COMPAT_UNIX_TRUE@am__append_11 = \ +@COMPAT_UNIX_TRUE@am__append_10 = \ @COMPAT_UNIX_TRUE@ compat/unix/dir.c \ @COMPAT_UNIX_TRUE@ compat/unix/file.c \ @COMPAT_UNIX_TRUE@ compat/unix/osname.c \ @COMPAT_UNIX_TRUE@ compat/unix/paths.c \ @COMPAT_UNIX_TRUE@ compat/unix/timer.c -@COMPAT_UNIX_TRUE@@HAVE_SOCKETS_TRUE@am__append_12 = compat/unix/socket.c -@COMPAT_WII_TRUE@am__append_13 = \ +@COMPAT_UNIX_TRUE@@HAVE_SOCKETS_TRUE@am__append_11 = compat/unix/socket.c +@COMPAT_WII_TRUE@am__append_12 = \ @COMPAT_WII_TRUE@ compat/wii/dir.c \ @COMPAT_WII_TRUE@ compat/unix/file.c \ @COMPAT_WII_TRUE@ compat/wii/osname.c \ @COMPAT_WII_TRUE@ compat/wii/paths.c \ @COMPAT_WII_TRUE@ compat/wii/timer.c -@COMPAT_WIN32_TRUE@am__append_14 = \ +@COMPAT_WIN32_TRUE@am__append_13 = \ @COMPAT_WIN32_TRUE@ compat/unix/dir.c \ @COMPAT_WIN32_TRUE@ compat/unix/file.c \ @COMPAT_WIN32_TRUE@ compat/win32/osname.c \ @COMPAT_WIN32_TRUE@ compat/win32/paths.c \ @COMPAT_WIN32_TRUE@ compat/win32/timer.c -@COMPAT_WIN32_TRUE@@HAVE_SOCKETS_TRUE@am__append_15 = compat/win32/socket.c -@HAVE_TUNTAP_TRUE@am__append_16 = compat/unix/tuntap.c -@BUILD_SPECCYBOOT_TRUE@am__append_17 = peripherals/nic/enc28j60.c -@BUILD_SPECTRANET_TRUE@am__append_18 = \ +@COMPAT_WIN32_TRUE@@HAVE_SOCKETS_TRUE@am__append_14 = compat/win32/socket.c +@HAVE_TUNTAP_TRUE@am__append_15 = compat/unix/tuntap.c +@BUILD_SPECCYBOOT_TRUE@am__append_16 = peripherals/nic/enc28j60.c +@BUILD_SPECTRANET_TRUE@am__append_17 = \ @BUILD_SPECTRANET_TRUE@ peripherals/flash/am29f010.c \ @BUILD_SPECTRANET_TRUE@ peripherals/nic/w5100.c \ @BUILD_SPECTRANET_TRUE@ peripherals/nic/w5100_socket.c -@UI_FB_TRUE@am__append_19 = $(ui_fb_files) -@UI_FB_TRUE@am__append_20 = $(ui_fb_built) -@UI_GTK_TRUE@am__append_21 = $(ui_gtk_files) -@UI_GTK_TRUE@am__append_22 = $(ui_gtk_built) -@UI_GTK_TRUE@am__append_23 = ui/gtk/menu_data.ui -@HAVE_GTK2_TRUE@am__append_24 = ui/gtk/gtkcompat.c -@UI_SDL_TRUE@am__append_25 = $(ui_sdl_files) -@UI_SDL_TRUE@am__append_26 = $(ui_sdl_built) -@UI_SVGA_TRUE@am__append_27 = $(ui_svga_files) -@UI_SVGA_TRUE@am__append_28 = $(ui_svga_built) -@USE_WIDGET_TRUE@am__append_29 = $(ui_widget_files) -@USE_WIDGET_TRUE@am__append_30 = $(ui_widget_built) -@USE_WIDGET_TRUE@am__append_31 = ui/widget/fuse.font -@UI_WII_TRUE@am__append_32 = $(ui_wii_files) -@UI_WII_TRUE@am__append_33 = $(ui_wii_built) -@UI_WIN32_TRUE@am__append_34 = $(ui_win32_files) -@UI_WIN32_TRUE@am__append_35 = $(ui_win32_built) -@UI_X_TRUE@am__append_36 = $(ui_xlib_files) -@UI_X_TRUE@am__append_37 = $(ui_xlib_built) +@UI_FB_TRUE@am__append_18 = $(ui_fb_files) +@UI_FB_TRUE@am__append_19 = $(ui_fb_built) +@UI_GTK_TRUE@am__append_20 = $(ui_gtk_files) +@UI_GTK_TRUE@am__append_21 = $(ui_gtk_built) +@UI_GTK_TRUE@am__append_22 = ui/gtk/menu_data.ui +@HAVE_GTK2_TRUE@am__append_23 = ui/gtk/gtkcompat.c +@UI_SDL_TRUE@am__append_24 = $(ui_sdl_files) +@UI_SDL_TRUE@am__append_25 = $(ui_sdl_built) +@UI_SVGA_TRUE@am__append_26 = $(ui_svga_files) +@UI_SVGA_TRUE@am__append_27 = $(ui_svga_built) +@USE_WIDGET_TRUE@am__append_28 = $(ui_widget_files) +@USE_WIDGET_TRUE@am__append_29 = $(ui_widget_built) +@USE_WIDGET_TRUE@am__append_30 = ui/widget/fuse.font +@UI_WII_TRUE@am__append_31 = $(ui_wii_files) +@UI_WII_TRUE@am__append_32 = $(ui_wii_built) +@UI_WIN32_TRUE@am__append_33 = $(ui_win32_files) +@UI_WIN32_TRUE@am__append_34 = $(ui_win32_built) +@UI_X_TRUE@am__append_35 = $(ui_xlib_files) +@UI_X_TRUE@am__append_36 = $(ui_xlib_built) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \ @@ -224,18 +224,19 @@ periph.c profile.c psg.c rectangle.c rzx.c screenshot.c \ settings.c slt.c snapshot.c sound.c spectrum.c svg.c tape.c \ ui.c uidisplay.c uimedia.c utils.c windres.rc compat/dirname.c \ - compat/getopt.c compat/getopt1.c compat/mkstemp.c \ - compat/unix/dir.c compat/unix/file.c compat/amiga/osname.c \ - compat/amiga/paths.c compat/unix/timer.c compat/unix/osname.c \ - compat/linux/paths.c compat/unix/socket.c \ - compat/morphos/osname.c compat/unix/paths.c compat/wii/dir.c \ - compat/wii/osname.c compat/wii/paths.c compat/wii/timer.c \ - compat/win32/osname.c compat/win32/paths.c \ - compat/win32/timer.c compat/win32/socket.c \ - compat/unix/tuntap.c debugger/breakpoint.c debugger/command.c \ - debugger/commandl.l debugger/commandy.y debugger/debugger.c \ - debugger/disassemble.c debugger/event.c debugger/expression.c \ - debugger/variable.c machines/machines_periph.c \ + compat/getopt.c compat/getopt1.c compat/unix/dir.c \ + compat/unix/file.c compat/amiga/osname.c compat/amiga/paths.c \ + compat/unix/timer.c compat/unix/osname.c compat/linux/paths.c \ + compat/unix/socket.c compat/morphos/osname.c \ + compat/unix/paths.c compat/wii/dir.c compat/wii/osname.c \ + compat/wii/paths.c compat/wii/timer.c compat/win32/osname.c \ + compat/win32/paths.c compat/win32/timer.c \ + compat/win32/socket.c compat/unix/tuntap.c \ + debugger/breakpoint.c debugger/command.c debugger/commandl.l \ + debugger/commandy.y debugger/debugger.c debugger/disassemble.c \ + debugger/event.c debugger/expression.c \ + debugger/system_variable.c debugger/variable.c \ + infrastructure/startup_manager.c machines/machines_periph.c \ machines/pentagon.c machines/pentagon512.c \ machines/pentagon1024.c machines/scorpion.c machines/spec128.c \ machines/spec16.c machines/spec48.c machines/spec48_ntsc.c \ @@ -304,59 +305,59 @@ ui/win32/win32ui.c ui/xlib/keysyms.c ui/xlib/xdisplay.c \ ui/xlib/xdisplay.h ui/xlib/xerror.c ui/xlib/xjoystick.c \ ui/xlib/xkeyboard.c ui/xlib/xkeyboard.h ui/xlib/xui.c \ - ui/xlib/xui.h unittests/unittests.c z80/z80.c z80/z80_ops.c + ui/xlib/xui.h unittests/unittests.c z80/z80.c \ + z80/z80_debugger_variables.c z80/z80_ops.c am__objects_1 = am__dirstamp = $(am__leading_dot)dirstamp @COMPAT_DIRNAME_TRUE@am__objects_2 = compat/dirname.$(OBJEXT) @COMPAT_GETOPT_TRUE@am__objects_3 = compat/getopt.$(OBJEXT) \ @COMPAT_GETOPT_TRUE@ compat/getopt1.$(OBJEXT) -@COMPAT_MKSTEMP_TRUE@am__objects_4 = compat/mkstemp.$(OBJEXT) -@COMPAT_AMIGA_TRUE@am__objects_5 = compat/unix/dir.$(OBJEXT) \ +@COMPAT_AMIGA_TRUE@am__objects_4 = compat/unix/dir.$(OBJEXT) \ @COMPAT_AMIGA_TRUE@ compat/unix/file.$(OBJEXT) \ @COMPAT_AMIGA_TRUE@ compat/amiga/osname.$(OBJEXT) \ @COMPAT_AMIGA_TRUE@ compat/amiga/paths.$(OBJEXT) \ @COMPAT_AMIGA_TRUE@ compat/unix/timer.$(OBJEXT) -@COMPAT_LINUX_TRUE@am__objects_6 = compat/unix/dir.$(OBJEXT) \ +@COMPAT_LINUX_TRUE@am__objects_5 = compat/unix/dir.$(OBJEXT) \ @COMPAT_LINUX_TRUE@ compat/unix/file.$(OBJEXT) \ @COMPAT_LINUX_TRUE@ compat/unix/osname.$(OBJEXT) \ @COMPAT_LINUX_TRUE@ compat/linux/paths.$(OBJEXT) \ @COMPAT_LINUX_TRUE@ compat/unix/timer.$(OBJEXT) -@COMPAT_LINUX_TRUE@@HAVE_SOCKETS_TRUE@am__objects_7 = compat/unix/socket.$(OBJEXT) -@COMPAT_MORPHOS_TRUE@am__objects_8 = compat/unix/dir.$(OBJEXT) \ +@COMPAT_LINUX_TRUE@@HAVE_SOCKETS_TRUE@am__objects_6 = compat/unix/socket.$(OBJEXT) +@COMPAT_MORPHOS_TRUE@am__objects_7 = compat/unix/dir.$(OBJEXT) \ @COMPAT_MORPHOS_TRUE@ compat/unix/file.$(OBJEXT) \ @COMPAT_MORPHOS_TRUE@ compat/morphos/osname.$(OBJEXT) \ @COMPAT_MORPHOS_TRUE@ compat/amiga/paths.$(OBJEXT) \ @COMPAT_MORPHOS_TRUE@ compat/unix/timer.$(OBJEXT) -@COMPAT_UNIX_TRUE@am__objects_9 = compat/unix/dir.$(OBJEXT) \ +@COMPAT_UNIX_TRUE@am__objects_8 = compat/unix/dir.$(OBJEXT) \ @COMPAT_UNIX_TRUE@ compat/unix/file.$(OBJEXT) \ @COMPAT_UNIX_TRUE@ compat/unix/osname.$(OBJEXT) \ @COMPAT_UNIX_TRUE@ compat/unix/paths.$(OBJEXT) \ @COMPAT_UNIX_TRUE@ compat/unix/timer.$(OBJEXT) -@COMPAT_UNIX_TRUE@@HAVE_SOCKETS_TRUE@am__objects_10 = compat/unix/socket.$(OBJEXT) -@COMPAT_WII_TRUE@am__objects_11 = compat/wii/dir.$(OBJEXT) \ +@COMPAT_UNIX_TRUE@@HAVE_SOCKETS_TRUE@am__objects_9 = compat/unix/socket.$(OBJEXT) +@COMPAT_WII_TRUE@am__objects_10 = compat/wii/dir.$(OBJEXT) \ @COMPAT_WII_TRUE@ compat/unix/file.$(OBJEXT) \ @COMPAT_WII_TRUE@ compat/wii/osname.$(OBJEXT) \ @COMPAT_WII_TRUE@ compat/wii/paths.$(OBJEXT) \ @COMPAT_WII_TRUE@ compat/wii/timer.$(OBJEXT) -@COMPAT_WIN32_TRUE@am__objects_12 = compat/unix/dir.$(OBJEXT) \ +@COMPAT_WIN32_TRUE@am__objects_11 = compat/unix/dir.$(OBJEXT) \ @COMPAT_WIN32_TRUE@ compat/unix/file.$(OBJEXT) \ @COMPAT_WIN32_TRUE@ compat/win32/osname.$(OBJEXT) \ @COMPAT_WIN32_TRUE@ compat/win32/paths.$(OBJEXT) \ @COMPAT_WIN32_TRUE@ compat/win32/timer.$(OBJEXT) -@COMPAT_WIN32_TRUE@@HAVE_SOCKETS_TRUE@am__objects_13 = compat/win32/socket.$(OBJEXT) -@HAVE_TUNTAP_TRUE@am__objects_14 = compat/unix/tuntap.$(OBJEXT) -@BUILD_SPECCYBOOT_TRUE@am__objects_15 = \ +@COMPAT_WIN32_TRUE@@HAVE_SOCKETS_TRUE@am__objects_12 = compat/win32/socket.$(OBJEXT) +@HAVE_TUNTAP_TRUE@am__objects_13 = compat/unix/tuntap.$(OBJEXT) +@BUILD_SPECCYBOOT_TRUE@am__objects_14 = \ @BUILD_SPECCYBOOT_TRUE@ peripherals/nic/enc28j60.$(OBJEXT) -@BUILD_SPECTRANET_TRUE@am__objects_16 = \ +@BUILD_SPECTRANET_TRUE@am__objects_15 = \ @BUILD_SPECTRANET_TRUE@ peripherals/flash/am29f010.$(OBJEXT) \ @BUILD_SPECTRANET_TRUE@ peripherals/nic/w5100.$(OBJEXT) \ @BUILD_SPECTRANET_TRUE@ peripherals/nic/w5100_socket.$(OBJEXT) -am__objects_17 = ui/fb/fbdisplay.$(OBJEXT) ui/fb/fbjoystick.$(OBJEXT) \ +am__objects_16 = ui/fb/fbdisplay.$(OBJEXT) ui/fb/fbjoystick.$(OBJEXT) \ ui/fb/fbkeyboard.$(OBJEXT) ui/fb/fbmouse.$(OBJEXT) \ ui/fb/fbui.$(OBJEXT) ui/fb/keysyms.$(OBJEXT) -@UI_FB_TRUE@am__objects_18 = $(am__objects_17) -@HAVE_GTK2_TRUE@am__objects_19 = ui/gtk/gtkcompat.$(OBJEXT) -am__objects_20 = ui/gtk/binary.$(OBJEXT) ui/gtk/browse.$(OBJEXT) \ +@UI_FB_TRUE@am__objects_17 = $(am__objects_16) +@HAVE_GTK2_TRUE@am__objects_18 = ui/gtk/gtkcompat.$(OBJEXT) +am__objects_19 = ui/gtk/binary.$(OBJEXT) ui/gtk/browse.$(OBJEXT) \ ui/gtk/confirm.$(OBJEXT) ui/gtk/debugger.$(OBJEXT) \ ui/gtk/fileselector.$(OBJEXT) ui/gtk/gtkdisplay.$(OBJEXT) \ ui/gtk/gtkjoystick.$(OBJEXT) ui/gtk/gtkkeyboard.$(OBJEXT) \ @@ -367,17 +368,17 @@ ui/gtk/pokefinder.$(OBJEXT) ui/gtk/pokemem.$(OBJEXT) \ ui/gtk/rollback.$(OBJEXT) ui/gtk/roms.$(OBJEXT) \ ui/gtk/statusbar.$(OBJEXT) ui/gtk/stock.$(OBJEXT) \ - $(am__objects_19) -@UI_GTK_TRUE@am__objects_21 = $(am__objects_20) -am__objects_22 = ui/sdl/sdldisplay.$(OBJEXT) \ + $(am__objects_18) +@UI_GTK_TRUE@am__objects_20 = $(am__objects_19) +am__objects_21 = ui/sdl/sdldisplay.$(OBJEXT) \ ui/sdl/sdljoystick.$(OBJEXT) ui/sdl/sdlkeyboard.$(OBJEXT) \ ui/sdl/sdlui.$(OBJEXT) ui/sdl/keysyms.$(OBJEXT) -@UI_SDL_TRUE@am__objects_23 = $(am__objects_22) -am__objects_24 = ui/svga/keysyms.$(OBJEXT) \ +@UI_SDL_TRUE@am__objects_22 = $(am__objects_21) +am__objects_23 = ui/svga/keysyms.$(OBJEXT) \ ui/svga/svgadisplay.$(OBJEXT) ui/svga/svgajoystick.$(OBJEXT) \ ui/svga/svgakeyboard.$(OBJEXT) ui/svga/svgaui.$(OBJEXT) -@UI_SVGA_TRUE@am__objects_25 = $(am__objects_24) -am__objects_26 = ui/widget/browse.$(OBJEXT) \ +@UI_SVGA_TRUE@am__objects_24 = $(am__objects_23) +am__objects_25 = ui/widget/browse.$(OBJEXT) \ ui/widget/debugger.$(OBJEXT) ui/widget/error.$(OBJEXT) \ ui/widget/filesel.$(OBJEXT) ui/widget/memory.$(OBJEXT) \ ui/widget/menu.$(OBJEXT) ui/widget/menu_data.$(OBJEXT) \ @@ -386,12 +387,12 @@ ui/widget/query.$(OBJEXT) ui/widget/roms.$(OBJEXT) \ ui/widget/select.$(OBJEXT) ui/widget/text.$(OBJEXT) \ ui/widget/widget.$(OBJEXT) -@USE_WIDGET_TRUE@am__objects_27 = $(am__objects_26) -am__objects_28 = ui/wii/keysyms.$(OBJEXT) ui/wii/wiidisplay.$(OBJEXT) \ +@USE_WIDGET_TRUE@am__objects_26 = $(am__objects_25) +am__objects_27 = ui/wii/keysyms.$(OBJEXT) ui/wii/wiidisplay.$(OBJEXT) \ ui/wii/wiijoystick.$(OBJEXT) ui/wii/wiikeyboard.$(OBJEXT) \ ui/wii/wiimouse.$(OBJEXT) ui/wii/wiiui.$(OBJEXT) -@UI_WII_TRUE@am__objects_29 = $(am__objects_28) -am__objects_30 = ui/win32/about.$(OBJEXT) ui/win32/binary.$(OBJEXT) \ +@UI_WII_TRUE@am__objects_28 = $(am__objects_27) +am__objects_29 = ui/win32/about.$(OBJEXT) ui/win32/binary.$(OBJEXT) \ ui/win32/browse.$(OBJEXT) ui/win32/confirm.$(OBJEXT) \ ui/win32/debugger.$(OBJEXT) ui/win32/fileselector.$(OBJEXT) \ ui/win32/hyperlinks.$(OBJEXT) ui/win32/keysyms.$(OBJEXT) \ @@ -403,11 +404,11 @@ ui/win32/win32joystick.$(OBJEXT) \ ui/win32/win32keyboard.$(OBJEXT) ui/win32/win32mouse.$(OBJEXT) \ ui/win32/win32ui.$(OBJEXT) -@UI_WIN32_TRUE@am__objects_31 = $(am__objects_30) -am__objects_32 = ui/xlib/keysyms.$(OBJEXT) ui/xlib/xdisplay.$(OBJEXT) \ +@UI_WIN32_TRUE@am__objects_30 = $(am__objects_29) +am__objects_31 = ui/xlib/keysyms.$(OBJEXT) ui/xlib/xdisplay.$(OBJEXT) \ ui/xlib/xerror.$(OBJEXT) ui/xlib/xjoystick.$(OBJEXT) \ ui/xlib/xkeyboard.$(OBJEXT) ui/xlib/xui.$(OBJEXT) -@UI_X_TRUE@am__objects_33 = $(am__objects_32) +@UI_X_TRUE@am__objects_32 = $(am__objects_31) am_fuse_OBJECTS = display.$(OBJEXT) event.$(OBJEXT) fuse.$(OBJEXT) \ input.$(OBJEXT) keyboard.$(OBJEXT) loader.$(OBJEXT) \ machine.$(OBJEXT) memory.$(OBJEXT) mempool.$(OBJEXT) \ @@ -422,11 +423,12 @@ $(am__objects_5) $(am__objects_6) $(am__objects_7) \ $(am__objects_8) $(am__objects_9) $(am__objects_10) \ $(am__objects_11) $(am__objects_12) $(am__objects_13) \ - $(am__objects_14) debugger/breakpoint.$(OBJEXT) \ - debugger/command.$(OBJEXT) debugger/commandl.$(OBJEXT) \ - debugger/commandy.$(OBJEXT) debugger/debugger.$(OBJEXT) \ - debugger/disassemble.$(OBJEXT) debugger/event.$(OBJEXT) \ - debugger/expression.$(OBJEXT) debugger/variable.$(OBJEXT) \ + debugger/breakpoint.$(OBJEXT) debugger/command.$(OBJEXT) \ + debugger/commandl.$(OBJEXT) debugger/commandy.$(OBJEXT) \ + debugger/debugger.$(OBJEXT) debugger/disassemble.$(OBJEXT) \ + debugger/event.$(OBJEXT) debugger/expression.$(OBJEXT) \ + debugger/system_variable.$(OBJEXT) debugger/variable.$(OBJEXT) \ + infrastructure/startup_manager.$(OBJEXT) \ machines/machines_periph.$(OBJEXT) machines/pentagon.$(OBJEXT) \ machines/pentagon512.$(OBJEXT) machines/pentagon1024.$(OBJEXT) \ machines/scorpion.$(OBJEXT) machines/spec128.$(OBJEXT) \ @@ -455,14 +457,15 @@ peripherals/ide/divide.$(OBJEXT) peripherals/ide/ide.$(OBJEXT) \ peripherals/ide/simpleide.$(OBJEXT) \ peripherals/ide/zxatasp.$(OBJEXT) \ - peripherals/ide/zxcf.$(OBJEXT) $(am__objects_15) \ - $(am__objects_16) pokefinder/pokefinder.$(OBJEXT) \ + peripherals/ide/zxcf.$(OBJEXT) $(am__objects_14) \ + $(am__objects_15) pokefinder/pokefinder.$(OBJEXT) \ pokefinder/pokemem.$(OBJEXT) sound/blipbuffer.$(OBJEXT) \ - timer/timer.$(OBJEXT) $(am__objects_18) $(am__objects_21) \ - ui/scaler/scaler.$(OBJEXT) $(am__objects_23) $(am__objects_25) \ - $(am__objects_27) $(am__objects_29) $(am__objects_31) \ - $(am__objects_33) unittests/unittests.$(OBJEXT) \ - z80/z80.$(OBJEXT) z80/z80_ops.$(OBJEXT) + timer/timer.$(OBJEXT) $(am__objects_17) $(am__objects_20) \ + ui/scaler/scaler.$(OBJEXT) $(am__objects_22) $(am__objects_24) \ + $(am__objects_26) $(am__objects_28) $(am__objects_30) \ + $(am__objects_32) unittests/unittests.$(OBJEXT) \ + z80/z80.$(OBJEXT) z80/z80_debugger_variables.$(OBJEXT) \ + z80/z80_ops.$(OBJEXT) fuse_OBJECTS = $(am_fuse_OBJECTS) am__DEPENDENCIES_1 = AM_V_lt = $(am__v_lt_@AM_V@) @@ -807,10 +810,11 @@ $(am__append_5) $(am__append_6) $(am__append_7) \ $(am__append_8) $(am__append_9) $(am__append_10) \ $(am__append_11) $(am__append_12) $(am__append_13) \ - $(am__append_14) $(am__append_15) $(am__append_16) \ - debugger/breakpoint.c debugger/command.c debugger/commandl.l \ - debugger/commandy.y debugger/debugger.c debugger/disassemble.c \ - debugger/event.c debugger/expression.c debugger/variable.c \ + $(am__append_14) $(am__append_15) debugger/breakpoint.c \ + debugger/command.c debugger/commandl.l debugger/commandy.y \ + debugger/debugger.c debugger/disassemble.c debugger/event.c \ + debugger/expression.c debugger/system_variable.c \ + debugger/variable.c infrastructure/startup_manager.c \ machines/machines_periph.c machines/pentagon.c \ machines/pentagon512.c machines/pentagon1024.c \ machines/scorpion.c machines/spec128.c machines/spec16.c \ @@ -831,12 +835,13 @@ peripherals/disk/wd_fdc.c peripherals/ide/divide.c \ peripherals/ide/ide.c peripherals/ide/simpleide.c \ peripherals/ide/zxatasp.c peripherals/ide/zxcf.c \ - $(am__append_17) $(am__append_18) pokefinder/pokefinder.c \ + $(am__append_16) $(am__append_17) pokefinder/pokefinder.c \ pokefinder/pokemem.c sound/blipbuffer.c timer/timer.c \ - $(am__append_19) $(am__append_21) ui/scaler/scaler.c \ - $(am__append_25) $(am__append_27) $(am__append_29) \ - $(am__append_32) $(am__append_34) $(am__append_36) \ - unittests/unittests.c z80/z80.c z80/z80_ops.c + $(am__append_18) $(am__append_20) ui/scaler/scaler.c \ + $(am__append_24) $(am__append_26) $(am__append_28) \ + $(am__append_31) $(am__append_33) $(am__append_35) \ + unittests/unittests.c z80/z80.c z80/z80_debugger_variables.c \ + z80/z80_ops.c fuse_LDADD = $(PTHREAD_LIBS) $(LIBSPEC_LIBS) $(GTK_LIBS) $(GLIB_LIBS) \ $(PNG_LIBS) $(SDL_LIBS) $(X_LIBS) $(XML_LIBS) $(am__append_2) \ $(SOUND_LIBS) $(SOUND_LIBADD) $(TIMER_LIBADD) \ @@ -848,10 +853,10 @@ sound/nullsound.c sound/osssound.c sound/sdlsound.c \ sound/sfifo.c sound/sunsound.c sound/wiisound.c \ sound/win32sound.c timer/native.c timer/sdl.c $(ui_xlib_files) -BUILT_SOURCES = options.h settings.c settings.h $(am__append_20) \ - $(am__append_22) $(am__append_26) $(am__append_28) \ - $(am__append_30) $(am__append_33) $(am__append_35) \ - $(am__append_37) z80/opcodes_base.c z80/z80_cb.c \ +BUILT_SOURCES = options.h settings.c settings.h $(am__append_19) \ + $(am__append_21) $(am__append_25) $(am__append_27) \ + $(am__append_29) $(am__append_32) $(am__append_34) \ + $(am__append_36) z80/opcodes_base.c z80/z80_cb.c \ z80/z80_ddfd.c z80/z80_ddfdcb.c z80/z80_ed.c AM_CPPFLAGS = \ $(GLIB_CFLAGS) \ @@ -870,11 +875,12 @@ spectrum.h svg.h tape.h utils.h options.h profile.h \ compat/getopt.h debugger/breakpoint.h debugger/commandy.h \ debugger/debugger.h debugger/debugger_internals.h \ - machines/machines.h machines/machines_periph.h \ - machines/pentagon.h machines/scorpion.h machines/spec128.h \ - machines/spec48.h machines/specplus3.h machines/tc2068.h \ - peripherals/ay.h peripherals/dck.h peripherals/fuller.h \ - peripherals/if1.h peripherals/if2.h peripherals/joystick.h \ + infrastructure/startup_manager.h machines/machines.h \ + machines/machines_periph.h machines/pentagon.h \ + machines/scorpion.h machines/spec128.h machines/spec48.h \ + machines/specplus3.h machines/tc2068.h peripherals/ay.h \ + peripherals/dck.h peripherals/fuller.h peripherals/if1.h \ + peripherals/if2.h peripherals/joystick.h \ peripherals/kempmouse.h peripherals/melodik.h \ peripherals/printer.h peripherals/scld.h \ peripherals/speccyboot.h peripherals/specdrum.h \ @@ -893,7 +899,7 @@ sound/blipbuffer.h sound/sfifo.h timer/timer.h ui/ui.h \ ui/uidisplay.h ui/uijoystick.h ui/uimedia.h ui/scaler/scaler.h \ ui/scaler/scaler_internals.h unittests/unittests.h z80/z80.h \ - z80/z80_checks.h z80/z80_macros.h + z80/z80_checks.h z80/z80_internals.h z80/z80_macros.h EXTRA_DIST = AUTHORS INSTALL PORTING README THANKS keysyms.dat \ keysyms.pl m4/ax_create_stdint_h.m4 m4/ax_pthread.m4 \ m4/glib-2.0.m4 m4/gtk-2.0.m4 m4/libxml.m4 m4/pkg.m4 m4/sdl.m4 \ @@ -946,7 +952,7 @@ z80/z80_ed.c DISTCLEANFILES = pkgdata_DATA = $(lib_@AUTOLOAD_SNAPS@_snaps) $(lib_files) $(ROMS) \ - $(am__append_23) $(am__append_31) + $(am__append_22) $(am__append_30) @DESKTOP_INTEGRATION_TRUE@fusemimedir = $(DESKTOP_DATADIR)/mime/packages @DESKTOP_INTEGRATION_TRUE@fusemime_DATA = data/fuse.xml @DESKTOP_INTEGRATION_TRUE@appdatadir = $(DESKTOP_DATADIR)/applications @@ -1090,7 +1096,7 @@ ui/gtk/options.c ui/gtk/picture.c ui/gtk/pixmaps.c \ ui/gtk/pokefinder.c ui/gtk/pokemem.c ui/gtk/rollback.c \ ui/gtk/roms.c ui/gtk/statusbar.c ui/gtk/stock.c \ - $(am__append_24) + $(am__append_23) ui_gtk_built = \ ui/gtk/keysyms.c \ ui/gtk/menu_data.c \ @@ -1248,7 +1254,7 @@ .SUFFIXES: .c .l .lo .o .obj .y am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/compat/Makefile.am $(srcdir)/data/Makefile.am $(srcdir)/data/win32/distribution.mk $(srcdir)/debugger/Makefile.am $(srcdir)/hacking/Makefile.am $(srcdir)/lib/Makefile.am $(srcdir)/machines/Makefile.am $(srcdir)/man/Makefile.am $(srcdir)/peripherals/Makefile.am $(srcdir)/perl/Makefile.am $(srcdir)/pokefinder/Makefile.am $(srcdir)/roms/Makefile.am $(srcdir)/sound/Makefile.am $(srcdir)/timer/Makefile.am $(srcdir)/ui/Makefile.am $(srcdir)/ui/fb/Makefile.am $(srcdir)/ui/gtk/Makefile.am $(srcdir)/ui/scaler/Makefile.am $(srcdir)/ui/sdl/Makefile.am $(srcdir)/ui/svga/Makefile.am $(srcdir)/ui/widget/Makefile.am $(srcdir)/ui/wii/Makefile.am $(srcdir)/ui/win32/Makefile.am $(srcdir)/ui/xlib/Makefile.am $(srcdir)/unittests/Makefile.am $(srcdir)/z80/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/compat/Makefile.am $(srcdir)/data/Makefile.am $(srcdir)/data/win32/distribution.mk $(srcdir)/debugger/Makefile.am $(srcdir)/hacking/Makefile.am $(srcdir)/infrastructure/Makefile.am $(srcdir)/lib/Makefile.am $(srcdir)/machines/Makefile.am $(srcdir)/man/Makefile.am $(srcdir)/peripherals/Makefile.am $(srcdir)/perl/Makefile.am $(srcdir)/pokefinder/Makefile.am $(srcdir)/roms/Makefile.am $(srcdir)/sound/Makefile.am $(srcdir)/timer/Makefile.am $(srcdir)/ui/Makefile.am $(srcdir)/ui/fb/Makefile.am $(srcdir)/ui/gtk/Makefile.am $(srcdir)/ui/scaler/Makefile.am $(srcdir)/ui/sdl/Makefile.am $(srcdir)/ui/svga/Makefile.am $(srcdir)/ui/widget/Makefile.am $(srcdir)/ui/wii/Makefile.am $(srcdir)/ui/win32/Makefile.am $(srcdir)/ui/xlib/Makefile.am $(srcdir)/unittests/Makefile.am $(srcdir)/z80/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -1271,7 +1277,7 @@ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; -$(srcdir)/compat/Makefile.am $(srcdir)/data/Makefile.am $(srcdir)/data/win32/distribution.mk $(srcdir)/debugger/Makefile.am $(srcdir)/hacking/Makefile.am $(srcdir)/lib/Makefile.am $(srcdir)/machines/Makefile.am $(srcdir)/man/Makefile.am $(srcdir)/peripherals/Makefile.am $(srcdir)/perl/Makefile.am $(srcdir)/pokefinder/Makefile.am $(srcdir)/roms/Makefile.am $(srcdir)/sound/Makefile.am $(srcdir)/timer/Makefile.am $(srcdir)/ui/Makefile.am $(srcdir)/ui/fb/Makefile.am $(srcdir)/ui/gtk/Makefile.am $(srcdir)/ui/scaler/Makefile.am $(srcdir)/ui/sdl/Makefile.am $(srcdir)/ui/svga/Makefile.am $(srcdir)/ui/widget/Makefile.am $(srcdir)/ui/wii/Makefile.am $(srcdir)/ui/win32/Makefile.am $(srcdir)/ui/xlib/Makefile.am $(srcdir)/unittests/Makefile.am $(srcdir)/z80/Makefile.am: +$(srcdir)/compat/Makefile.am $(srcdir)/data/Makefile.am $(srcdir)/data/win32/distribution.mk $(srcdir)/debugger/Makefile.am $(srcdir)/hacking/Makefile.am $(srcdir)/infrastructure/Makefile.am $(srcdir)/lib/Makefile.am $(srcdir)/machines/Makefile.am $(srcdir)/man/Makefile.am $(srcdir)/peripherals/Makefile.am $(srcdir)/perl/Makefile.am $(srcdir)/pokefinder/Makefile.am $(srcdir)/roms/Makefile.am $(srcdir)/sound/Makefile.am $(srcdir)/timer/Makefile.am $(srcdir)/ui/Makefile.am $(srcdir)/ui/fb/Makefile.am $(srcdir)/ui/gtk/Makefile.am $(srcdir)/ui/scaler/Makefile.am $(srcdir)/ui/sdl/Makefile.am $(srcdir)/ui/svga/Makefile.am $(srcdir)/ui/widget/Makefile.am $(srcdir)/ui/wii/Makefile.am $(srcdir)/ui/win32/Makefile.am $(srcdir)/ui/xlib/Makefile.am $(srcdir)/unittests/Makefile.am $(srcdir)/z80/Makefile.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -1370,8 +1376,6 @@ compat/$(DEPDIR)/$(am__dirstamp) compat/getopt1.$(OBJEXT): compat/$(am__dirstamp) \ compat/$(DEPDIR)/$(am__dirstamp) -compat/mkstemp.$(OBJEXT): compat/$(am__dirstamp) \ - compat/$(DEPDIR)/$(am__dirstamp) compat/unix/$(am__dirstamp): @$(MKDIR_P) compat/unix @: > compat/unix/$(am__dirstamp) @@ -1468,8 +1472,19 @@ debugger/$(DEPDIR)/$(am__dirstamp) debugger/expression.$(OBJEXT): debugger/$(am__dirstamp) \ debugger/$(DEPDIR)/$(am__dirstamp) +debugger/system_variable.$(OBJEXT): debugger/$(am__dirstamp) \ + debugger/$(DEPDIR)/$(am__dirstamp) debugger/variable.$(OBJEXT): debugger/$(am__dirstamp) \ debugger/$(DEPDIR)/$(am__dirstamp) +infrastructure/$(am__dirstamp): + @$(MKDIR_P) infrastructure + @: > infrastructure/$(am__dirstamp) +infrastructure/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) infrastructure/$(DEPDIR) + @: > infrastructure/$(DEPDIR)/$(am__dirstamp) +infrastructure/startup_manager.$(OBJEXT): \ + infrastructure/$(am__dirstamp) \ + infrastructure/$(DEPDIR)/$(am__dirstamp) machines/$(am__dirstamp): @$(MKDIR_P) machines @: > machines/$(am__dirstamp) @@ -1885,6 +1900,8 @@ @$(MKDIR_P) z80/$(DEPDIR) @: > z80/$(DEPDIR)/$(am__dirstamp) z80/z80.$(OBJEXT): z80/$(am__dirstamp) z80/$(DEPDIR)/$(am__dirstamp) +z80/z80_debugger_variables.$(OBJEXT): z80/$(am__dirstamp) \ + z80/$(DEPDIR)/$(am__dirstamp) z80/z80_ops.$(OBJEXT): z80/$(am__dirstamp) \ z80/$(DEPDIR)/$(am__dirstamp) sound/alsasound.$(OBJEXT): sound/$(am__dirstamp) \ @@ -1938,6 +1955,7 @@ -rm -f compat/wii/*.$(OBJEXT) -rm -f compat/win32/*.$(OBJEXT) -rm -f debugger/*.$(OBJEXT) + -rm -f infrastructure/*.$(OBJEXT) -rm -f machines/*.$(OBJEXT) -rm -f peripherals/*.$(OBJEXT) -rm -f peripherals/disk/*.$(OBJEXT) @@ -1994,7 +2012,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/dirname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/getopt1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@compat/$(DEPDIR)/mkstemp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@compat/amiga/$(DEPDIR)/osname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@compat/amiga/$(DEPDIR)/paths.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@compat/linux/$(DEPDIR)/paths.Po@am__quote@ @@ -2022,7 +2039,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@debugger/$(DEPDIR)/disassemble.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@debugger/$(DEPDIR)/event.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@debugger/$(DEPDIR)/expression.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@debugger/$(DEPDIR)/system_variable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@debugger/$(DEPDIR)/variable.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@infrastructure/$(DEPDIR)/startup_manager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@machines/$(DEPDIR)/machines_periph.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@machines/$(DEPDIR)/pentagon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@machines/$(DEPDIR)/pentagon1024.Po@am__quote@ @@ -2186,6 +2205,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@z80/$(DEPDIR)/z80.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@z80/$(DEPDIR)/z80_coretest-coretest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@z80/$(DEPDIR)/z80_coretest-z80.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@z80/$(DEPDIR)/z80_debugger_variables.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@z80/$(DEPDIR)/z80_ops.Po@am__quote@ .c.o: @@ -2906,6 +2926,8 @@ -rm -f compat/win32/$(am__dirstamp) -rm -f debugger/$(DEPDIR)/$(am__dirstamp) -rm -f debugger/$(am__dirstamp) + -rm -f infrastructure/$(DEPDIR)/$(am__dirstamp) + -rm -f infrastructure/$(am__dirstamp) -rm -f machines/$(DEPDIR)/$(am__dirstamp) -rm -f machines/$(am__dirstamp) -rm -f peripherals/$(DEPDIR)/$(am__dirstamp) @@ -2963,7 +2985,7 @@ distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) compat/amiga/$(DEPDIR) compat/linux/$(DEPDIR) compat/morphos/$(DEPDIR) compat/unix/$(DEPDIR) compat/wii/$(DEPDIR) compat/win32/$(DEPDIR) debugger/$(DEPDIR) machines/$(DEPDIR) peripherals/$(DEPDIR) peripherals/disk/$(DEPDIR) peripherals/flash/$(DEPDIR) peripherals/ide/$(DEPDIR) peripherals/nic/$(DEPDIR) pokefinder/$(DEPDIR) sound/$(DEPDIR) timer/$(DEPDIR) ui/fb/$(DEPDIR) ui/gtk/$(DEPDIR) ui/scaler/$(DEPDIR) ui/sdl/$(DEPDIR) ui/svga/$(DEPDIR) ui/widget/$(DEPDIR) ui/wii/$(DEPDIR) ui/win32/$(DEPDIR) ui/xlib/$(DEPDIR) unittests/$(DEPDIR) z80/$(DEPDIR) + -rm -rf ./$(DEPDIR) compat/$(DEPDIR) compat/amiga/$(DEPDIR) compat/linux/$(DEPDIR) compat/morphos/$(DEPDIR) compat/unix/$(DEPDIR) compat/wii/$(DEPDIR) compat/win32/$(DEPDIR) debugger/$(DEPDIR) infrastructure/$(DEPDIR) machines/$(DEPDIR) peripherals/$(DEPDIR) peripherals/disk/$(DEPDIR) peripherals/flash/$(DEPDIR) peripherals/ide/$(DEPDIR) peripherals/nic/$(DEPDIR) pokefinder/$(DEPDIR) sound/$(DEPDIR) timer/$(DEPDIR) ui/fb/$(DEPDIR) ui/gtk/$(DEPDIR) ui/scaler/$(DEPDIR) ui/sdl/$(DEPDIR) ui/svga/$(DEPDIR) ui/widget/$(DEPDIR) ui/wii/$(DEPDIR) ui/win32/$(DEPDIR) ui/xlib/$(DEPDIR) unittests/$(DEPDIR) z80/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags @@ -3019,7 +3041,7 @@ maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./$(DEPDIR) compat/$(DEPDIR) compat/amiga/$(DEPDIR) compat/linux/$(DEPDIR) compat/morphos/$(DEPDIR) compat/unix/$(DEPDIR) compat/wii/$(DEPDIR) compat/win32/$(DEPDIR) debugger/$(DEPDIR) machines/$(DEPDIR) peripherals/$(DEPDIR) peripherals/disk/$(DEPDIR) peripherals/flash/$(DEPDIR) peripherals/ide/$(DEPDIR) peripherals/nic/$(DEPDIR) pokefinder/$(DEPDIR) sound/$(DEPDIR) timer/$(DEPDIR) ui/fb/$(DEPDIR) ui/gtk/$(DEPDIR) ui/scaler/$(DEPDIR) ui/sdl/$(DEPDIR) ui/svga/$(DEPDIR) ui/widget/$(DEPDIR) ui/wii/$(DEPDIR) ui/win32/$(DEPDIR) ui/xlib/$(DEPDIR) unittests/$(DEPDIR) z80/$(DEPDIR) + -rm -rf ./$(DEPDIR) compat/$(DEPDIR) compat/amiga/$(DEPDIR) compat/linux/$(DEPDIR) compat/morphos/$(DEPDIR) compat/unix/$(DEPDIR) compat/wii/$(DEPDIR) compat/win32/$(DEPDIR) debugger/$(DEPDIR) infrastructure/$(DEPDIR) machines/$(DEPDIR) peripherals/$(DEPDIR) peripherals/disk/$(DEPDIR) peripherals/flash/$(DEPDIR) peripherals/ide/$(DEPDIR) peripherals/nic/$(DEPDIR) pokefinder/$(DEPDIR) sound/$(DEPDIR) timer/$(DEPDIR) ui/fb/$(DEPDIR) ui/gtk/$(DEPDIR) ui/scaler/$(DEPDIR) ui/sdl/$(DEPDIR) ui/svga/$(DEPDIR) ui/widget/$(DEPDIR) ui/wii/$(DEPDIR) ui/win32/$(DEPDIR) ui/xlib/$(DEPDIR) unittests/$(DEPDIR) z80/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff -Nru fuse-emulator-1.2.0+dfsg1/man/fuse.1 fuse-emulator-1.2.1+dfsg1/man/fuse.1 --- fuse-emulator-1.2.0+dfsg1/man/fuse.1 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/man/fuse.1 2016-07-17 10:48:29.000000000 +0000 @@ -23,7 +23,7 @@ .\" E-mail: philip-fuse@shadowmagic.org.uk .\" .\" -.TH fuse 1 "6th June, 2016" "Version 1.2.0" "Emulators" +.TH fuse 1 "17th July, 2016" "Version 1.2.1" "Emulators" .\" .\"------------------------------------------------------------------ .\" @@ -1681,6 +1681,16 @@ option. .RE .PP +.B \-\-unittests +.RS +This option runs a testing framework that automatically checks portions +of code, comparing actual results with expected ones. It is meant to detect +broken code before a release. There is not graphical mode, the program +just ends with exit code 0 if all tests are good or prints error +messages to stdout and ends with exit code greater than 0 if there are +failed tests. +.RE +.PP .B \-\-usource .RS Emulate a \(mcSource interface. Same as the General Peripherals Options dialog's @@ -4299,51 +4309,93 @@ .I condition evaluates to true. The events which can be caught are: .PP +beta128:page +.br +beta128:unpage +.RS +The Beta\ 128 interface is paged into or out of memory respectively. +.RE +.br +didaktik80:page +.br +didaktik80:unpage +.RS +The Didaktik\ 80 interface is paged into or out of memory respectively. +.RE +.br +disciple:page +.br +disciple:unpage +.RS +The DISCiPLE interface is paged into or out of memory respectively. +.RE +.br divide:page .br divide:unpage .RS -The DivIDE interface is paged into or out of memory respectively +The DivIDE interface is paged into or out of memory respectively. .RE .br if1:page .br if1:unpage .RS -The Interface\ 1 shadow ROM is paged into or out of memory +The Interface\ 1 shadow ROM is paged into or out of memory. +.RE +.br +opus:page +.br +opus:unpage +.RS +The Opus Discovery is paged into or out of memory respectively. +.RE +.br +plusd:page +.br +plusd:unpage +.RS +The +D interface is paged into or out of memory respectively. .RE .br rzx:end .RS -An RZX recording finishes playing +An RZX recording finishes playing. +.RE +.br +speccyboot:page +.br +speccyboot:unpage +.RS +The SpeccyBoot interface is paged into or out of memory. .RE .br spectranet:page .br spectranet:unpage .RS -The Spectranet interface is paged into or out of memory +The Spectranet interface is paged into or out of memory. .RE .br tape:play .br tape:stop .RS -The emulated tape starts or stops playing +The emulated tape starts or stops playing. .RE .br zxatasp:page .br zxatasp:unpage .RS -The ZXATASP interface is paged into or out of memory +The ZXATASP interface is paged into or out of memory. .RE .br zxcf:page .br zxcf:unpage .RS -The ZXCF interface is paged into or out of memory +The ZXCF interface is paged into or out of memory. .RE .PP In all cases, the event can be specified as @@ -4507,6 +4559,17 @@ .IR value . .RE .PP +se{t} +.IR area : detail +.I value +.RS +Set the value of the system variable +.IR area : detail +to +.IR value . +The available system variables are listed below. +.RE +.PP s{tep} .RS Equivalent to the @@ -4549,7 +4612,8 @@ .RI ` If2 "'," .RI ` "Opus RAM" "'," .RI ` "Opus ROM" "'," -.RI ` PlusD "'," +.RI ` "PlusD RAM" "'," +.RI ` "PlusD ROM" "'," .RI ` SpeccyBoot "'," .RI ` Spectranet "'," .RI ` "Timex Dock" "'," @@ -4570,14 +4634,62 @@ which uses a restricted version of C's syntax; exactly the same syntax is used for conditional breakpoints, with `0' being false and any other value being true. In numeric expressions, you can use integer -constants (all calculations are done in integers), register names -(which simply evaluate to the value of the register), debugger -variables, parentheses, the standard four numeric operations (`+', -`\-', `*' and `/'), the (non-)equality operators `==' and `!=', the -comparison operators `>', `<', `>=' and `<=', bitwise and (`&'), or +constants (all calculations are done in integers), system variables, +debugger variables, parentheses, the standard four numeric operations +(`+', `\-', `*' and `/'), the (non-)equality operators `==' and `!=', +the comparison operators `>', `<', `>=' and `<=', bitwise and (`&'), or (`|') and exclusive or (`^') and logical and (`&&') and or (`||'). Square brackets (`[' and `]') can be used to dereference a value; for example `[0x4000]' will give the value of the first byte of the screen. +.PP +System variables are specified via an +.RI ` area : detail ' +syntax. The available system variables are: +.PP +ay:current +.RS +The current AY-3-8912 register. +.RE +ula:last +.RS +The last byte written to the ULA. Note that this variable can only +be read, not written to. +.RE +ula:mem1ffd +.RS +The last byte written to memory control port used by the ZX Spectrum +2A/3; +normally addressed at 0x1ffd, hence the name. +.RE +ula:mem7ffd +.RS +The last byte written to primary memory control port used by the ZX Spectrum +128 and later; normally addressed at 0x7ffd, hence the name. +.RE +ula:tstates +.RS +The number of tstates since the last interrupt. +.RE +z80: +.I register name +.RS +The value of the specified register. Both 8-bit registers and 16-bit +register pairs are supported. +.RE +z80:im +.RS +The current interrupt mode of the Z80. +.RE +z80:iff1 +.br +z80:iff2 +.RS +1 if the specified interrupt flip-flop is currently set, or 0 if it is +not set. +.RE +.PP +The Z80 registers, interrupt mode and interrupt flip-flops can also be +specified without the `z80:' prefix, but this syntax is deprecated and +will be removed in Fuse 1.4. .\" .\"------------------------------------------------------------------ .\" diff -Nru fuse-emulator-1.2.0+dfsg1/memory.c fuse-emulator-1.2.1+dfsg1/memory.c --- fuse-emulator-1.2.0+dfsg1/memory.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/memory.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,9 +1,9 @@ /* memory.c: Routines for accessing memory - Copyright (c) 1999-2015 Philip Kendall + Copyright (c) 1999-2016 Philip Kendall Copyright (c) 2015 Stuart Brady Copyright (c) 2016 Fredrick Meunier - $Id: memory.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: memory.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,6 +34,7 @@ #include "debugger/debugger.h" #include "display.h" #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "machines/pentagon.h" #include "machines/spec128.h" #include "memory.h" @@ -98,8 +99,8 @@ /* Set up the information about the normal page mappings. Memory contention and usable pages vary from machine to machine and must be set in the appropriate _reset function */ -void -memory_init( void ) +static int +memory_init( void *context ) { size_t i, j; @@ -134,6 +135,8 @@ } module_register( &memory_module_info ); + + return 0; } static void @@ -145,7 +148,7 @@ } /* Tidy-up function called at end of emulation */ -void +static void memory_end( void ) { int i; @@ -170,6 +173,15 @@ } } +void +memory_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_MEMORY, dependencies, + ARRAY_SIZE( dependencies ), memory_init, NULL, + memory_end ); +} + int memory_source_register( const char *description ) { diff -Nru fuse-emulator-1.2.0+dfsg1/memory.h fuse-emulator-1.2.1+dfsg1/memory.h --- fuse-emulator-1.2.0+dfsg1/memory.h 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/memory.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* memory.h: memory access routines - Copyright (c) 2003-2011 Philip Kendall + Copyright (c) 2003-2016 Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: memory.h 5466 2016-05-08 09:46:20Z fredm $ + $Id: memory.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -117,8 +117,7 @@ /* Which bits to look at when working out where the screen is */ extern libspectrum_word memory_screen_mask; -void memory_init( void ); -void memory_end( void ); +void memory_register_startup( void ); libspectrum_byte *memory_pool_allocate( size_t length ); libspectrum_byte *memory_pool_allocate_persistent( size_t length, int persistent ); diff -Nru fuse-emulator-1.2.0+dfsg1/mempool.c fuse-emulator-1.2.1+dfsg1/mempool.c --- fuse-emulator-1.2.0+dfsg1/mempool.c 2016-06-06 11:03:28.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/mempool.c 2016-07-17 10:48:28.000000000 +0000 @@ -1,7 +1,7 @@ /* mempool.c: pooled system memory - Copyright (c) 2008-2015 Philip Kendall + Copyright (c) 2008-2016 Philip Kendall - $Id: mempool.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: mempool.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,16 +34,19 @@ #include #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "mempool.h" static GArray *memory_pools; const int MEMPOOL_UNTRACKED = -1; -void -mempool_init( void ) +static int +mempool_init( void *context ) { memory_pools = g_array_new( FALSE, FALSE, sizeof( GArray* ) ); + + return 0; } int @@ -117,7 +120,7 @@ } /* Tidy-up function called at end of emulation */ -void +static void mempool_end( void ) { int i; @@ -135,6 +138,15 @@ memory_pools = NULL; } +void +mempool_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_MEMPOOL, dependencies, + ARRAY_SIZE( dependencies ), mempool_init, NULL, + mempool_end ); +} + /* Unit test helper routines */ int diff -Nru fuse-emulator-1.2.0+dfsg1/mempool.h fuse-emulator-1.2.1+dfsg1/mempool.h --- fuse-emulator-1.2.0+dfsg1/mempool.h 2016-06-06 11:03:28.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/mempool.h 2016-07-17 10:48:28.000000000 +0000 @@ -1,7 +1,7 @@ /* mempool.c: pooled system memory - Copyright (c) 2008-2015 Philip Kendall + Copyright (c) 2008-2016 Philip Kendall - $Id: mempool.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: mempool.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,13 +28,12 @@ extern const int MEMPOOL_UNTRACKED; -void mempool_init( void ); +void mempool_register_startup( void ); int mempool_register_pool( void ); void* mempool_malloc( int pool, size_t size ); void* mempool_malloc_n( int pool, size_t nmemb, size_t size ); char* mempool_strdup( int pool, const char *string ); void mempool_free( int pool ); -void mempool_end( void ); #define mempool_new( pool, type, count ) \ ( ( type * ) mempool_malloc_n( (pool), (count), sizeof( type ) ) ) diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ay.c fuse-emulator-1.2.1+dfsg1/peripherals/ay.c --- fuse-emulator-1.2.0+dfsg1/peripherals/ay.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ay.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* ay.c: AY-8-3912 routines - Copyright (c) 1999-2009 Philip Kendall + Copyright (c) 1999-2016 Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: ay.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: ay.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,8 @@ #include #include "compat.h" +#include "debugger/debugger.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "module.h" #include "periph.h" @@ -48,6 +50,8 @@ static void ay_reset( int hard_reset ); static void ay_from_snapshot( libspectrum_snap *snap ); static void ay_to_snapshot( libspectrum_snap *snap ); +static libspectrum_dword get_current_register( void ); +static void set_current_register( libspectrum_dword value ); static module_info_t ay_module_info = { @@ -111,14 +115,35 @@ /* .activate = */ NULL, }; -void -ay_init( void ) +/* Debugger system variables */ +static const char * const debugger_type_string = "ay"; +static const char * const current_register_detail_string = "current"; + +static int +ay_init( void *context ) { module_register( &ay_module_info ); periph_register( PERIPH_TYPE_AY, &ay_periph ); periph_register( PERIPH_TYPE_AY_PLUS3, &ay_periph_plus3 ); periph_register( PERIPH_TYPE_AY_FULL_DECODE, &ay_periph_full_decode ); periph_register( PERIPH_TYPE_AY_TIMEX, &ay_periph_timex ); + + debugger_system_variable_register( + debugger_type_string, current_register_detail_string, get_current_register, + set_current_register ); + + return 0; +} + +void +ay_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_AY, dependencies, + ARRAY_SIZE( dependencies ), ay_init, NULL, NULL ); } static void @@ -167,7 +192,7 @@ void ay_registerport_write( libspectrum_word port GCC_UNUSED, libspectrum_byte b ) { - machine_current->ay.current_register = (b & 15); + set_current_register( b ); } /* What happens when the AY data port (traditionally 0xbffd on the 128K @@ -223,3 +248,15 @@ libspectrum_snap_set_ay_registers( snap, i, machine_current->ay.registers[i] ); } + +static libspectrum_dword +get_current_register( void ) +{ + return machine_current->ay.current_register; +} + +static void +set_current_register( libspectrum_dword value ) +{ + machine_current->ay.current_register = (value & 0x0f); +} diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ay.h fuse-emulator-1.2.1+dfsg1/peripherals/ay.h --- fuse-emulator-1.2.0+dfsg1/peripherals/ay.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ay.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* ay.h: AY-8-3912 routines - Copyright (c) 1999-2009 Philip Kendall + Copyright (c) 1999-2016 Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: ay.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: ay.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ libspectrum_byte registers[ AY_REGISTERS ]; } ayinfo; -void ay_init( void ); +void ay_register_startup( void ); libspectrum_byte ay_registerport_read( libspectrum_word port, libspectrum_byte *attached ); void ay_registerport_write( libspectrum_word port, libspectrum_byte b ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/beta.c fuse-emulator-1.2.1+dfsg1/peripherals/disk/beta.c --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/beta.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/beta.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* beta.c: Routines for handling the Beta disk interface Copyright (c) 2004-2016 Stuart Brady, Philip Kendall, Gergely Szasz - $Id: beta.c 5504 2016-05-21 07:06:21Z fredm $ + $Id: beta.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,7 +43,9 @@ #include "beta.h" #include "compat.h" +#include "debugger/debugger.h" #include "event.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "module.h" #include "settings.h" @@ -89,6 +91,10 @@ /* .activate = */ NULL, }; +/* Debugger events */ +static const char * const event_type_string = "beta128"; +static int page_event, unpage_event; + static void beta_reset( int hard_reset ); static void beta_memory_map( void ); static void beta_enabled_snapshot( libspectrum_snap *snap ); @@ -114,6 +120,7 @@ beta_active = 1; machine_current->ram.romcs = 1; machine_current->memory_map(); + debugger_event( page_event ); } void @@ -122,6 +129,7 @@ beta_active = 0; machine_current->ram.romcs = 0; machine_current->memory_map(); + debugger_event( unpage_event ); } static void @@ -143,8 +151,8 @@ } } -void -beta_init( void ) +static int +beta_init( void *context ) { int i; fdd_t *d; @@ -177,6 +185,11 @@ beta_ui_drives[ i ].fdd = &beta_drives[ i ]; ui_media_drive_register( &beta_ui_drives[ i ] ); } + + periph_register_paging_events( event_type_string, &page_event, + &unpage_event ); + + return 0; } static void @@ -237,13 +250,26 @@ } -void +static void beta_end( void ) { beta_available = 0; libspectrum_free( beta_fdc ); } +void +beta_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_BETA, dependencies, + ARRAY_SIZE( dependencies ), beta_init, NULL, + beta_end ); +} + libspectrum_byte beta_sr_read( libspectrum_word port GCC_UNUSED, libspectrum_byte *attached ) { diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/beta.h fuse-emulator-1.2.1+dfsg1/peripherals/disk/beta.h --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/beta.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/beta.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* beta.h: Routines for handling the Beta disk interface - Copyright (c) 2003-2013 Fredrick Meunier, Philip Kendall + Copyright (c) 2003-2016 Fredrick Meunier, Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: beta.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: beta.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,9 +44,7 @@ extern libspectrum_word beta_pc_mask; /* Bits to mask in PC for enable check */ extern libspectrum_word beta_pc_value; /* Value to compare masked PC against */ -void beta_init( void ); - -void beta_end( void ); +void beta_register_startup( void ); void beta_page( void ); void beta_unpage( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/didaktik.c fuse-emulator-1.2.1+dfsg1/peripherals/disk/didaktik.c --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/didaktik.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/didaktik.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,10 +1,10 @@ /* didaktik.c: Routines for handling the Didaktik 40/80 disk interface - Copyright (c) 2015-2016 Gergely Szasz + Copyright (c) 2015-2016 Gergely Szasz, Philip Kendall Copyright (c) 2015 Stuart Brady Copyright (c) 2016 Sergio Baldoví Copyright (c) 2016 Fredrick Meunier - $Id: didaktik.c 5487 2016-05-14 12:41:16Z fredm $ + $Id: didaktik.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,7 +33,9 @@ #include #include "compat.h" +#include "debugger/debugger.h" #include "didaktik.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "module.h" #include "peripherals/printer.h" @@ -125,12 +127,17 @@ /* .activate = */ NULL, }; +/* Debugger events */ +static const char * const event_type_string = "didaktik80"; +static int page_event, unpage_event; + void didaktik80_page( void ) { didaktik80_active = 1; machine_current->ram.romcs = 1; machine_current->memory_map(); + debugger_event( page_event ); } void @@ -139,6 +146,7 @@ didaktik80_active = 0; machine_current->ram.romcs = 0; machine_current->memory_map(); + debugger_event( unpage_event ); } static void @@ -168,8 +176,8 @@ event_add( 0, z80_nmi_event ); } -void -didaktik80_init( void ) +static int +didaktik80_init( void *context ) { int i; fdd_t *d; @@ -206,6 +214,11 @@ didaktik_ui_drives[ i ].fdd = &didaktik_drives[ i ]; ui_media_drive_register( &didaktik_ui_drives[ i ] ); } + + periph_register_paging_events( event_type_string, &page_event, + &unpage_event ); + + return 0; } static void @@ -262,13 +275,26 @@ } -void +static void didaktik80_end( void ) { didaktik80_available = 0; libspectrum_free( didaktik_fdc ); } +void +didaktik80_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_DIDAKTIK, dependencies, + ARRAY_SIZE( dependencies ), didaktik80_init, NULL, + didaktik80_end ); +} + static libspectrum_byte didaktik_sr_read( libspectrum_word port GCC_UNUSED, libspectrum_byte *attached ) { @@ -370,6 +396,28 @@ return &( didaktik_drives[ which ] ); } +int +didaktik80_unittest( void ) +{ + int r = 0; + + didaktik80_page(); + + r += unittests_assert_8k_page( 0x0000, didaktik_rom_memory_source, 0 ); + r += unittests_assert_4k_page( 0x2000, didaktik_rom_memory_source, 0 ); + r += unittests_assert_2k_page( 0x3000, didaktik_rom_memory_source, 0 ); + r += unittests_assert_2k_page( 0x3800, didaktik_ram_memory_source, 0 ); + r += unittests_assert_16k_ram_page( 0x4000, 5 ); + r += unittests_assert_16k_ram_page( 0x8000, 2 ); + r += unittests_assert_16k_ram_page( 0xc000, 0 ); + + didaktik80_unpage(); + + r += unittests_paging_test_48( 2 ); + + return r; +} + static int ui_drive_is_available( void ) { diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/didaktik.h fuse-emulator-1.2.1+dfsg1/peripherals/disk/didaktik.h --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/didaktik.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/didaktik.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* didaktik.h: Routines for handling the Didaktik 40/80 disk interface Copyright (c) 2015 Gergely Szasz - $Id: didaktik.h 5248 2015-05-11 02:10:39Z zubzero $ + $Id: didaktik.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,8 +42,7 @@ extern int didaktik80_active; /* D80/D40 enabled? */ extern int didaktik80_snap; /* SNAPshot pressed */ -void didaktik80_init( void ); -void didaktik80_end( void ); +void didaktik80_register_startup( void ); void didaktik80_page( void ); void didaktik80_unpage( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/disciple.c fuse-emulator-1.2.1+dfsg1/peripherals/disk/disciple.c --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/disciple.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/disciple.c 2016-07-17 10:48:29.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 1999-2016 Stuart Brady, Fredrick Meunier, Philip Kendall, Dmitry Sanarin, Darren Salt, Gergely Szasz - $Id: disciple.c 5480 2016-05-11 12:18:40Z fredm $ + $Id: disciple.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,7 +33,9 @@ #include #include "compat.h" +#include "debugger/debugger.h" #include "disciple.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "module.h" #include "peripherals/printer.h" @@ -113,6 +115,10 @@ }; +/* Debugger events */ +static const char * const event_type_string = "disciple"; +static int page_event, unpage_event; + static libspectrum_byte disciple_control_register; void @@ -121,6 +127,7 @@ disciple_active = 1; machine_current->ram.romcs = 1; machine_current->memory_map(); + debugger_event( page_event ); } void @@ -129,6 +136,7 @@ disciple_active = 0; machine_current->ram.romcs = 0; machine_current->memory_map(); + debugger_event( unpage_event ); } void @@ -184,8 +192,8 @@ /* .activate = */ disciple_activate, }; -void -disciple_init( void ) +static int +disciple_init( void *context ) { int i; fdd_t *d; @@ -229,6 +237,31 @@ disciple_ui_drives[ i ].fdd = &disciple_drives[ i ]; ui_media_drive_register( &disciple_ui_drives[ i ] ); } + + periph_register_paging_events( event_type_string, &page_event, + &unpage_event ); + + return 0; +} + +static void +disciple_end( void ) +{ + disciple_available = 0; + libspectrum_free( disciple_fdc ); +} + +void +disciple_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_DISCIPLE, dependencies, + ARRAY_SIZE( dependencies ), disciple_init, NULL, + disciple_end ); } static void @@ -252,8 +285,11 @@ return; } - for( i = 0; i < MEMORY_PAGES_IN_8K; i++ ) - disciple_memory_map_romcs_ram[ i ].page = &disciple_ram[ i * MEMORY_PAGE_SIZE ]; + for( i = 0; i < MEMORY_PAGES_IN_8K; i++ ) { + struct memory_page *page = &disciple_memory_map_romcs_ram[ i ]; + page->page = &disciple_ram[ i * MEMORY_PAGE_SIZE ]; + page->offset = i * MEMORY_PAGE_SIZE; + } machine_current->ram.romcs = 1; @@ -290,13 +326,6 @@ disciple_inhibited = 1; } -void -disciple_end( void ) -{ - disciple_available = 0; - libspectrum_free( disciple_fdc ); -} - static libspectrum_byte disciple_sr_read( libspectrum_word port GCC_UNUSED, libspectrum_byte *attached ) { diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/disciple.h fuse-emulator-1.2.1+dfsg1/peripherals/disk/disciple.h --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/disciple.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/disciple.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* disciple.h: Routines for handling the DISCiPLE interface Copyright (c) 2005-2015 Stuart Brady - $Id: disciple.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: disciple.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,8 +43,7 @@ extern int disciple_available; /* Is the DISCiPLE available for use? */ extern int disciple_active; /* DISCiPLE enabled? */ -void disciple_init( void ); -void disciple_end( void ); +void disciple_register_startup( void ); void disciple_page( void ); void disciple_unpage( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/fdd.c fuse-emulator-1.2.1+dfsg1/peripherals/disk/fdd.c --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/fdd.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/fdd.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,9 +1,9 @@ /* fdd.c: Routines for emulating floppy disk drives - Copyright (c) 2007-2016 Gergely Szasz + Copyright (c) 2007-2016 Gergely Szasz, Philip Kendall Copyright (c) 2015 Stuart Brady Copyright (c) 2016 BogDan Vatra - $Id: fdd.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: fdd.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ #include "compat.h" #include "event.h" #include "fdd.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "spectrum.h" #include "settings.h" @@ -76,14 +77,28 @@ static int fdd_motor = 0; /* to manage 'disk' icon */ -void -fdd_init_events( void ) +static int +fdd_init_events( void *context ) { motor_event = event_register( fdd_event, "FDD motor on" ); index_event = event_register( fdd_event, "FDD index" ); upd_fdc_init_events(); wd_fdc_init_events(); + + return 0; +} + +void +fdd_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_EVENT, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_FDD, dependencies, + ARRAY_SIZE( dependencies ), fdd_init_events, NULL, + NULL ); } const char * diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/fdd.h fuse-emulator-1.2.1+dfsg1/peripherals/disk/fdd.h --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/fdd.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/fdd.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* fdd.h: Routines for emulating floppy disk drives - Copyright (c) 2007-2015 Gergely Szasz + Copyright (c) 2007-2016 Gergely Szasz, Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: fdd.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: fdd.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -119,8 +119,7 @@ extern const fdd_params_t fdd_params[]; -/* initialize the event codes */ -void fdd_init_events( void ); +void fdd_register_startup( void ); const char *fdd_strerror( int error ); /* initialize the fdd_t struct, and set fdd_heads and cylinders (e.g. 2/83 ) */ diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/opus.c fuse-emulator-1.2.1+dfsg1/peripherals/disk/opus.c --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/opus.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/opus.c 2016-07-17 10:48:29.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 1999-2016 Stuart Brady, Fredrick Meunier, Philip Kendall, Dmitry Sanarin, Darren Salt, Michael D Wynne, Gergely Szasz - $Id: opus.c 5504 2016-05-21 07:06:21Z fredm $ + $Id: opus.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,6 +33,8 @@ #include #include "compat.h" +#include "debugger/debugger.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "module.h" #include "opus.h" @@ -93,12 +95,17 @@ /* .activate = */ NULL, }; +/* Debugger events */ +static const char * const event_type_string = "opus"; +static int page_event, unpage_event; + void opus_page( void ) { opus_active = 1; machine_current->ram.romcs = 1; machine_current->memory_map(); + debugger_event( page_event ); } void @@ -107,6 +114,7 @@ opus_active = 0; machine_current->ram.romcs = 0; machine_current->memory_map(); + debugger_event( unpage_event ); } static void @@ -125,8 +133,8 @@ event_add( 0, z80_nmi_event ); } -void -opus_init( void ) +static int +opus_init( void *context ) { int i; fdd_t *d; @@ -161,6 +169,31 @@ opus_ui_drives[ i ].fdd = &opus_drives[ i ]; ui_media_drive_register( &opus_ui_drives[ i ] ); } + + periph_register_paging_events( event_type_string, &page_event, + &unpage_event ); + + return 0; +} + +static void +opus_end( void ) +{ + opus_available = 0; + libspectrum_free( opus_fdc ); +} + +void +opus_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_OPUS, dependencies, + ARRAY_SIZE( dependencies ), opus_init, NULL, + opus_end ); } static void @@ -219,13 +252,6 @@ machine_current->memory_map(); } -void -opus_end( void ) -{ - opus_available = 0; - libspectrum_free( opus_fdc ); -} - /* * opus_6821_access( reg, data, dir ) * @@ -464,7 +490,6 @@ memcpy( buffer + i * MEMORY_PAGE_SIZE, opus_memory_map_romcs_rom[ i ].page, MEMORY_PAGE_SIZE ); - if( !buffer ) return; libspectrum_snap_set_opus_rom( snap, 0, buffer ); if( opus_memory_map_romcs_rom[0].save_to_snapshot ) @@ -472,7 +497,6 @@ buffer = libspectrum_new( libspectrum_byte, OPUS_RAM_SIZE ); memcpy( buffer, opus_ram, OPUS_RAM_SIZE ); - if( !buffer ) return; libspectrum_snap_set_opus_ram( snap, 0, buffer ); drive_count++; /* Drive 1 is not removable */ diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/opus.h fuse-emulator-1.2.1+dfsg1/peripherals/disk/opus.h --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/opus.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/opus.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* opus.h: Routines for handling the Opus Discovery interface Copyright (c) 2005-2013 Stuart Brady, Fredrick Meunier - $Id: opus.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: opus.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,8 +43,7 @@ extern int opus_available; /* Is the Opus available for use? */ extern int opus_active; /* Opus enabled? */ -void opus_init( void ); -void opus_end( void ); +void opus_register_startup( void ); void opus_page( void ); void opus_unpage( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/plusd.c fuse-emulator-1.2.1+dfsg1/peripherals/disk/plusd.c --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/plusd.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/plusd.c 2016-07-17 10:48:29.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 1999-2016 Stuart Brady, Fredrick Meunier, Philip Kendall, Dmitry Sanarin, Darren Salt, 2014 Gergely Szasz - $Id: plusd.c 5504 2016-05-21 07:06:21Z fredm $ + $Id: plusd.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,6 +33,8 @@ #include #include "compat.h" +#include "debugger/debugger.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "module.h" #include "peripherals/printer.h" @@ -53,7 +55,8 @@ /* Two 8KB memory chunks accessible by the Z80 when /ROMCS is low */ static memory_page plusd_memory_map_romcs_rom[ MEMORY_PAGES_IN_8K ]; static memory_page plusd_memory_map_romcs_ram[ MEMORY_PAGES_IN_8K ]; -static int plusd_memory_source; +static int plusd_memory_source_rom; +static int plusd_memory_source_ram; int plusd_available = 0; int plusd_active = 0; @@ -98,6 +101,10 @@ }; +/* Debugger events */ +static const char * const event_type_string = "plusd"; +static int page_event, unpage_event; + static libspectrum_byte plusd_control_register; void @@ -106,6 +113,7 @@ plusd_active = 1; machine_current->ram.romcs = 1; machine_current->memory_map(); + debugger_event( page_event ); } void @@ -114,6 +122,7 @@ plusd_active = 0; machine_current->ram.romcs = 0; machine_current->memory_map(); + debugger_event( unpage_event ); } static void @@ -152,8 +161,8 @@ /* .activate = */ plusd_activate, }; -void -plusd_init( void ) +static int +plusd_init( void *context ) { int i; fdd_t *d; @@ -176,11 +185,12 @@ module_register( &plusd_module_info ); - plusd_memory_source = memory_source_register( "PlusD" ); + plusd_memory_source_rom = memory_source_register( "PlusD ROM" ); + plusd_memory_source_ram = memory_source_register( "PlusD RAM" ); for( i = 0; i < MEMORY_PAGES_IN_8K; i++ ) - plusd_memory_map_romcs_rom[ i ].source = plusd_memory_source; + plusd_memory_map_romcs_rom[ i ].source = plusd_memory_source_rom; for( i = 0; i < MEMORY_PAGES_IN_8K; i++ ) - plusd_memory_map_romcs_ram[ i ].source = plusd_memory_source; + plusd_memory_map_romcs_ram[ i ].source = plusd_memory_source_ram; periph_register( PERIPH_TYPE_PLUSD, &plusd_periph ); @@ -188,6 +198,31 @@ plusd_ui_drives[ i ].fdd = &plusd_drives[ i ]; ui_media_drive_register( &plusd_ui_drives[ i ] ); } + + periph_register_paging_events( event_type_string, &page_event, + &unpage_event ); + + return 0; +} + +static void +plusd_end( void ) +{ + plusd_available = 0; + libspectrum_free( plusd_fdc ); +} + +void +plusd_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_PLUSD, dependencies, + ARRAY_SIZE( dependencies ), plusd_init, NULL, + plusd_end ); } static void @@ -213,8 +248,10 @@ machine_current->ram.romcs = 0; for( i = 0; i < MEMORY_PAGES_IN_8K; i++ ) { - plusd_memory_map_romcs_ram[ i ].page = &plusd_ram[ i * MEMORY_PAGE_SIZE ]; - plusd_memory_map_romcs_ram[ i ].writable = 1; + struct memory_page *page = &plusd_memory_map_romcs_ram[ i ]; + page->page = &plusd_ram[ i * MEMORY_PAGE_SIZE ]; + page->offset = i * MEMORY_PAGE_SIZE; + page->writable = 1; } plusd_available = 1; @@ -236,13 +273,6 @@ } -void -plusd_end( void ) -{ - plusd_available = 0; - libspectrum_free( plusd_fdc ); -} - static libspectrum_byte plusd_sr_read( libspectrum_word port GCC_UNUSED, libspectrum_byte *attached ) { @@ -437,7 +467,6 @@ for( i = 0; i < MEMORY_PAGES_IN_8K; i++ ) memcpy( buffer + i * MEMORY_PAGE_SIZE, plusd_memory_map_romcs_rom[ i ].page, MEMORY_PAGE_SIZE ); - if( !buffer ) return; libspectrum_snap_set_plusd_rom( snap, 0, buffer ); if( plusd_memory_map_romcs_rom[ 0 ].save_to_snapshot ) @@ -445,7 +474,6 @@ buffer = libspectrum_new( libspectrum_byte, RAM_SIZE ); memcpy( buffer, plusd_ram, RAM_SIZE ); - if( !buffer ) return; libspectrum_snap_set_plusd_ram( snap, 0, buffer ); drive_count++; /* Drive 1 is not removable */ @@ -477,7 +505,8 @@ plusd_page(); - r += unittests_assert_16k_page( 0x0000, plusd_memory_source, 0 ); + r += unittests_assert_8k_page( 0x0000, plusd_memory_source_rom, 0 ); + r += unittests_assert_8k_page( 0x2000, plusd_memory_source_ram, 0 ); r += unittests_assert_16k_ram_page( 0x4000, 5 ); r += unittests_assert_16k_ram_page( 0x8000, 2 ); r += unittests_assert_16k_ram_page( 0xc000, 0 ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/disk/plusd.h fuse-emulator-1.2.1+dfsg1/peripherals/disk/plusd.h --- fuse-emulator-1.2.0+dfsg1/peripherals/disk/plusd.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/disk/plusd.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* plusd.h: Routines for handling the +D interface - Copyright (c) 2005-2015 Stuart Brady + Copyright (c) 2005-2016 Stuart Brady, Philip Kendall - $Id: plusd.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: plusd.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,8 +43,7 @@ extern int plusd_available; /* Is the +D available for use? */ extern int plusd_active; /* +D enabled? */ -void plusd_init( void ); -void plusd_end( void ); +void plusd_register_startup( void ); void plusd_page( void ); void plusd_unpage( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/fuller.c fuse-emulator-1.2.1+dfsg1/peripherals/fuller.c --- fuse-emulator-1.2.0+dfsg1/peripherals/fuller.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/fuller.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* fuller.c: Routines for handling the Fuller Box - Copyright (c) 2007-2011 Stuart Brady, Fredrick Meunier, Philip Kendall + Copyright (c) 2007-2016 Stuart Brady, Fredrick Meunier, Philip Kendall - $Id: fuller.c 5251 2015-05-11 17:34:37Z zubzero $ + $Id: fuller.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ #include "ay.h" #include "compat.h" #include "fuller.h" +#include "infrastructure/startup_manager.h" #include "joystick.h" #include "module.h" #include "periph.h" @@ -84,9 +85,20 @@ libspectrum_snap_set_fuller_box_active( snap, active ); } -void -fuller_init( void ) +static int +fuller_init( void *context ) { module_register( &fuller_module_info ); periph_register( PERIPH_TYPE_FULLER, &fuller_periph ); + + return 0; +} + +void +fuller_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_FULLER, dependencies, + ARRAY_SIZE( dependencies ), fuller_init, NULL, + NULL ); } diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/fuller.h fuse-emulator-1.2.1+dfsg1/peripherals/fuller.h --- fuse-emulator-1.2.0+dfsg1/peripherals/fuller.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/fuller.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* fuller.h: Routines for handling the Fuller Box - Copyright (c) 2007-2011 Stuart Brady, Fredrick Meunier, Philip Kendall + Copyright (c) 2007-2016 Stuart Brady, Fredrick Meunier, Philip Kendall - $Id: fuller.h 5228 2015-05-05 21:29:49Z sbaldovi $ + $Id: fuller.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,6 +28,6 @@ #ifndef FUSE_FULLER_H #define FUSE_FULLER_H -void fuller_init( void ); +void fuller_register_startup( void ); #endif /* #ifndef FUSE_FULLER_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ide/divide.c fuse-emulator-1.2.1+dfsg1/peripherals/ide/divide.c --- fuse-emulator-1.2.0+dfsg1/peripherals/ide/divide.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ide/divide.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* divide.c: DivIDE interface routines - Copyright (c) 2005-2015 Matthew Westcott, Philip Kendall + Copyright (c) 2005-2016 Matthew Westcott, Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: divide.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: divide.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ #include "debugger/debugger.h" #include "ide.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "module.h" #include "periph.h" @@ -113,8 +114,8 @@ /* Housekeeping functions */ -int -divide_init( void ) +static int +divide_init( void *context ) { int error, i, j; @@ -164,15 +165,25 @@ return 0; } -int +static void divide_end( void ) { - int error; - - error = libspectrum_ide_free( divide_idechn0 ); - error = libspectrum_ide_free( divide_idechn1 ) || error; + libspectrum_ide_free( divide_idechn0 ); + libspectrum_ide_free( divide_idechn1 ); +} - return error; +void +divide_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_DISPLAY, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_DIVIDE, dependencies, + ARRAY_SIZE( dependencies ), divide_init, NULL, + divide_end ); } /* DivIDE does not page in immediately on a reset condition (we do that by diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ide/divide.h fuse-emulator-1.2.1+dfsg1/peripherals/ide/divide.h --- fuse-emulator-1.2.0+dfsg1/peripherals/ide/divide.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ide/divide.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* divide.h: DivIDE interface routines - Copyright (c) 2005 Matthew Westcott + Copyright (c) 2005-2016 Matthew Westcott, Philip Kendall - $Id: divide.h 5392 2016-04-24 13:39:50Z fredm $ + $Id: divide.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -41,8 +41,7 @@ re-evaluate whether paging will actually happen */ void divide_refresh_page_state( void ); -int divide_init( void ); -int divide_end( void ); +void divide_register_startup( void ); int divide_insert( const char *filename, libspectrum_ide_unit unit ); int divide_commit( libspectrum_ide_unit unit ); int divide_eject( libspectrum_ide_unit unit ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ide/simpleide.c fuse-emulator-1.2.1+dfsg1/peripherals/ide/simpleide.c --- fuse-emulator-1.2.0+dfsg1/peripherals/ide/simpleide.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ide/simpleide.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,11 +1,9 @@ /* simpleide.c: Simple 8-bit IDE interface routines - Copyright (c) 2003-2004 Garry Lancaster, - 2004 Philip Kendall, - 2008 Fredrick Meunier + Copyright (c) 2003-2016 Garry Lancaster, Philip Kendall, Fredrick Meunier Copyright (c) 2015 Stuart Brady Copyright (c) 2016 Sergio Baldoví - $Id: simpleide.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: simpleide.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +30,7 @@ #include #include "ide.h" +#include "infrastructure/startup_manager.h" #include "module.h" #include "periph.h" #include "settings.h" @@ -74,8 +73,8 @@ /* Housekeeping functions */ -int -simpleide_init( void ) +static int +simpleide_init( void *context ) { int error; @@ -104,10 +103,22 @@ return 0; } -int +static void simpleide_end( void ) { - return libspectrum_ide_free( simpleide_idechn ); + libspectrum_ide_free( simpleide_idechn ); +} + +void +simpleide_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DISPLAY, + STARTUP_MANAGER_MODULE_SETUID + }; + startup_manager_register( STARTUP_MANAGER_MODULE_SIMPLEIDE, dependencies, + ARRAY_SIZE( dependencies ), simpleide_init, NULL, + simpleide_end ); } void diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ide/simpleide.h fuse-emulator-1.2.1+dfsg1/peripherals/ide/simpleide.h --- fuse-emulator-1.2.0+dfsg1/peripherals/ide/simpleide.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ide/simpleide.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* simpleide.h: Simple 8-bit IDE interface routines - Copyright (c) 2003-2004 Garry Lancaster + Copyright (c) 2003-2016 Garry Lancaster, Philip Kendall - $Id: simpleide.h 5392 2016-04-24 13:39:50Z fredm $ + $Id: simpleide.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,8 +26,7 @@ #include -int simpleide_init( void ); -int simpleide_end( void ); +void simpleide_register_startup( void ); void simpleide_reset( int hard_reset ); int simpleide_insert( const char *filename, libspectrum_ide_unit unit ); int simpleide_commit( libspectrum_ide_unit unit ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ide/zxatasp.c fuse-emulator-1.2.1+dfsg1/peripherals/ide/zxatasp.c --- fuse-emulator-1.2.0+dfsg1/peripherals/ide/zxatasp.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ide/zxatasp.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,9 +1,9 @@ /* zxatasp.c: ZXATASP interface routines - Copyright (c) 2003-2015 Garry Lancaster and Philip Kendall + Copyright (c) 2003-2016 Garry Lancaster, Philip Kendall Copyright (c) 2015 Stuart Brady Copyright (c) 2016 Sergio Baldoví - $Id: zxatasp.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: zxatasp.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ #include "debugger/debugger.h" #include "ide.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "memory.h" #include "module.h" @@ -168,8 +169,8 @@ /* Housekeeping functions */ -int -zxatasp_init( void ) +static int +zxatasp_init( void *context ) { int error, i; @@ -206,15 +207,25 @@ return 0; } -int +static void zxatasp_end( void ) { - int error; - - error = libspectrum_ide_free( zxatasp_idechn0 ); - error = libspectrum_ide_free( zxatasp_idechn1 ) || error; + libspectrum_ide_free( zxatasp_idechn0 ); + libspectrum_ide_free( zxatasp_idechn1 ); +} - return error; +void +zxatasp_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_DISPLAY, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_ZXATASP, dependencies, + ARRAY_SIZE( dependencies ), zxatasp_init, NULL, + zxatasp_end ); } static void diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ide/zxatasp.h fuse-emulator-1.2.1+dfsg1/peripherals/ide/zxatasp.h --- fuse-emulator-1.2.0+dfsg1/peripherals/ide/zxatasp.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ide/zxatasp.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,7 @@ /* zxatasp.h: ZXATASP interface routines - Copyright (c) 2003-2004 Garry Lancaster, - 2004 Philip Kendall + Copyright (c) 2003-2016 Garry Lancaster, Philip Kendall - $Id: zxatasp.h 5392 2016-04-24 13:39:50Z fredm $ + $Id: zxatasp.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,8 +28,7 @@ #include -int zxatasp_init( void ); -int zxatasp_end( void ); +void zxatasp_register_startup( void ); int zxatasp_insert( const char *filename, libspectrum_ide_unit unit ); int zxatasp_commit( libspectrum_ide_unit unit ); int zxatasp_eject( libspectrum_ide_unit unit ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ide/zxcf.c fuse-emulator-1.2.1+dfsg1/peripherals/ide/zxcf.c --- fuse-emulator-1.2.0+dfsg1/peripherals/ide/zxcf.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ide/zxcf.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,9 +1,9 @@ /* zxcf.c: ZXCF interface routines - Copyright (c) 2003-2015 Garry Lancaster and Philip Kendall + Copyright (c) 2003-2016 Garry Lancaster, Philip Kendall Copyright (c) 2015 Stuart Brady Copyright (c) 2016 Sergio Baldoví - $Id: zxcf.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: zxcf.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ #include "debugger/debugger.h" #include "ide.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "memory.h" #include "module.h" @@ -110,8 +111,8 @@ /* Housekeeping functions */ -int -zxcf_init( void ) +static int +zxcf_init( void *context ) { int error, i; @@ -141,10 +142,24 @@ return 0; } -int +static void zxcf_end( void ) { - return libspectrum_ide_free( zxcf_idechn ); + libspectrum_ide_free( zxcf_idechn ); +} + +void +zxcf_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_DISPLAY, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_ZXCF, dependencies, + ARRAY_SIZE( dependencies ), zxcf_init, NULL, + zxcf_end ); } static void diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ide/zxcf.h fuse-emulator-1.2.1+dfsg1/peripherals/ide/zxcf.h --- fuse-emulator-1.2.0+dfsg1/peripherals/ide/zxcf.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ide/zxcf.h 2016-07-17 10:48:29.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 2003-2004 Garry Lancaster, 2004 Philip Kendall - $Id: zxcf.h 5392 2016-04-24 13:39:50Z fredm $ + $Id: zxcf.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,8 +29,7 @@ #include -int zxcf_init( void ); -int zxcf_end( void ); +void zxcf_register_startup( void ); int zxcf_insert( const char *filename ); int zxcf_commit( void ); int zxcf_eject( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/if1.c fuse-emulator-1.2.1+dfsg1/peripherals/if1.c --- fuse-emulator-1.2.0+dfsg1/peripherals/if1.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/if1.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* if1.c: Interface 1 handling routines - Copyright (c) 2004-2015 Gergely Szasz, Philip Kendall + Copyright (c) 2004-2016 Gergely Szasz, Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: if1.c 5504 2016-05-21 07:06:21Z fredm $ + $Id: if1.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,6 +37,7 @@ #include "compat.h" #include "debugger/debugger.h" #include "if1.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "memory.h" #include "module.h" @@ -302,8 +303,8 @@ } } -void -if1_init( void ) +static int +if1_init( void *context ) { int m, i; @@ -351,9 +352,11 @@ periph_register( PERIPH_TYPE_INTERFACE1, &if1_periph ); periph_register_paging_events( event_type_string, &page_event, &unpage_event ); + + return 0; } -libspectrum_error +static void if1_end( void ) { int m; @@ -361,10 +364,21 @@ for( m = 0; m < 8; m++ ) { libspectrum_error error = libspectrum_microdrive_free( microdrive[m].cartridge ); - if( error ) return error; + if( error ) return; } +} - return LIBSPECTRUM_ERROR_NONE; +void +if1_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_IF1, dependencies, + ARRAY_SIZE( dependencies ), if1_init, NULL, + if1_end ); } void diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/if1.h fuse-emulator-1.2.1+dfsg1/peripherals/if1.h --- fuse-emulator-1.2.0+dfsg1/peripherals/if1.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/if1.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* if1.h: Interface 1 handling routines - Copyright (c) 2004-2011 Gergely Szasz, Philip Kendall + Copyright (c) 2004-2016 Gergely Szasz, Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: if1.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: if1.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,8 +33,7 @@ extern int if1_active; extern int if1_available; -void if1_init( void ); -libspectrum_error if1_end( void ); +void if1_register_startup( void ); void if1_page( void ); void if1_unpage( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/if2.c fuse-emulator-1.2.1+dfsg1/peripherals/if2.c --- fuse-emulator-1.2.0+dfsg1/peripherals/if2.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/if2.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* if2.c: Interface 2 cartridge handling routines - Copyright (c) 2003-2015 Darren Salt, Fredrick Meunier, Philip Kendall + Copyright (c) 2003-2016 Darren Salt, Fredrick Meunier, Philip Kendall - $Id: if2.c 5504 2016-05-21 07:06:21Z fredm $ + $Id: if2.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include #include "if2.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "memory.h" #include "module.h" @@ -70,8 +71,8 @@ /* .activate = */ NULL, }; -void -if2_init( void ) +static int +if2_init( void *context ) { int i; int if2_source; @@ -83,6 +84,19 @@ if2_memory_map_romcs[i].source = if2_source; periph_register( PERIPH_TYPE_INTERFACE2, &if2_periph ); + + return 0; +} + +void +if2_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_IF2, dependencies, + ARRAY_SIZE( dependencies ), if2_init, NULL, NULL ); } int diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/if2.h fuse-emulator-1.2.1+dfsg1/peripherals/if2.h --- fuse-emulator-1.2.0+dfsg1/peripherals/if2.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/if2.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* if2.h: Interface 2 cartridge handling routines - Copyright (c) 2004 Fredrick Meunier + Copyright (c) 2004-2016 Fredrick Meunier, Philip Kendall - $Id: if2.h 4835 2012-12-31 15:35:45Z zubzero $ + $Id: if2.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ /* IF2 cart inserted? */ extern int if2_active; -void if2_init( void ); +void if2_register_startup( void ); int if2_insert( const char *filename ); void if2_eject( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/joystick.c fuse-emulator-1.2.1+dfsg1/peripherals/joystick.c --- fuse-emulator-1.2.0+dfsg1/peripherals/joystick.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/joystick.c 2016-07-17 10:48:29.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 2001-2011 Russell Marks, Darren Salt, Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: joystick.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: joystick.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -280,7 +280,7 @@ ui_error( UI_ERROR_INFO, "Ignoring unsupported joystick in snapshot %s", libspectrum_joystick_name( libspectrum_snap_joystick_list( snap, i ) )); continue; - }; + } if( settings_current.joystick_keyboard_output != fuse_type && settings_current.joystick_1_output != fuse_type && diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/kempmouse.c fuse-emulator-1.2.1+dfsg1/peripherals/kempmouse.c --- fuse-emulator-1.2.0+dfsg1/peripherals/kempmouse.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/kempmouse.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,9 +1,9 @@ /* kempmouse.c: Kempston mouse emulation - Copyright (c) 2004-2008 Darren Salt, Fredrick Meunier + Copyright (c) 2004-2016 Darren Salt, Fredrick Meunier, Philip Kendall Copyright (c) 2015 Stuart Brady Copyright (c) 2016 Sergio Baldoví - $Id: kempmouse.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: kempmouse.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ #include +#include "infrastructure/startup_manager.h" #include "kempmouse.h" #include "module.h" #include "periph.h" @@ -79,11 +80,22 @@ /* .activate = */ NULL, }; -void -kempmouse_init( void ) +static int +kempmouse_init( void *context ) { module_register( &kempmouse_module_info ); periph_register( PERIPH_TYPE_KEMPSTON_MOUSE, &kempmouse_periph ); + + return 0; +} + +void +kempmouse_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_KEMPMOUSE, dependencies, + ARRAY_SIZE( dependencies ), kempmouse_init, NULL, + NULL ); } void diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/kempmouse.h fuse-emulator-1.2.1+dfsg1/peripherals/kempmouse.h --- fuse-emulator-1.2.0+dfsg1/peripherals/kempmouse.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/kempmouse.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* kempmouse.h: Kempston mouse emulation - Copyright (c) 2004-2008 Darren Salt, Fredrick Meunier + Copyright (c) 2004-2016 Darren Salt, Fredrick Meunier, Philip Kendall - $Id: kempmouse.h 4924 2013-05-05 07:40:02Z sbaldovi $ + $Id: kempmouse.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ #ifndef FUSE_KEMPMOUSE_H #define FUSE_KEMPMOUSE_H -void kempmouse_init( void ); +void kempmouse_register_startup( void ); void kempmouse_update( int dx, int dy, int button, int down ); #endif diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/melodik.c fuse-emulator-1.2.1+dfsg1/peripherals/melodik.c --- fuse-emulator-1.2.0+dfsg1/peripherals/melodik.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/melodik.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* melodik.c: Routines for handling the Melodik interface - Copyright (c) 2009-2011 Fredrick Meunier, Philip Kendall + Copyright (c) 2009-2016 Fredrick Meunier, Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: melodik.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: melodik.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,6 +30,7 @@ #include "ay.h" #include "compat.h" +#include "infrastructure/startup_manager.h" #include "melodik.h" #include "module.h" #include "periph.h" @@ -83,9 +84,20 @@ libspectrum_snap_set_melodik_active( snap, active ); } -void -melodik_init( void ) +static int +melodik_init( void *context ) { module_register( &melodik_module_info ); periph_register( PERIPH_TYPE_MELODIK, &melodik_periph ); + + return 0; +} + +void +melodik_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_MELODIK, dependencies, + ARRAY_SIZE( dependencies ), melodik_init, NULL, + NULL ); } diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/melodik.h fuse-emulator-1.2.1+dfsg1/peripherals/melodik.h --- fuse-emulator-1.2.0+dfsg1/peripherals/melodik.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/melodik.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* melodik.h: Routines for handling the Melodik interface - Copyright (c) 2009-2011 Fredrick Meunier, Philip Kendall + Copyright (c) 2009-2016 Fredrick Meunier, Philip Kendall - $Id: melodik.h 5228 2015-05-05 21:29:49Z sbaldovi $ + $Id: melodik.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,6 @@ #ifndef FUSE_MELODIK_H #define FUSE_MELODIK_H -void melodik_init( void ); +void melodik_register_startup( void ); #endif /* #ifndef FUSE_MELODIK_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/printer.c fuse-emulator-1.2.1+dfsg1/peripherals/printer.c --- fuse-emulator-1.2.0+dfsg1/peripherals/printer.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/printer.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,10 +1,10 @@ /* printer.c: Printer support - Copyright (c) 2001-2004 Ian Collier, Russell Marks, Philip Kendall + Copyright (c) 2001-2016 Ian Collier, Russell Marks, Philip Kendall Copyright (c) 2015 Stuart Brady Copyright (c) 2015 Fredrick Meunier Copyright (c) 2016 Sergio Baldoví - $Id: printer.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: printer.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,6 +37,7 @@ #include #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "memory.h" #include "module.h" @@ -708,21 +709,35 @@ parallel_data=b; } - -void printer_init(void) +static int +printer_init( void *context ) { -printer_graphics_enabled=printer_text_enabled=1; -printer_graphics_file=printer_text_file=NULL; + printer_graphics_enabled=printer_text_enabled = 1; + printer_graphics_file=printer_text_file = NULL; + + printer_zxp_init(); + printer_text_init(); -printer_zxp_init(); -printer_text_init(); + return 0; } +static void +printer_end( void ) +{ + printer_text_end(); + printer_zxp_end(); +} -void printer_end(void) +void +printer_register_startup( void ) { -printer_text_end(); -printer_zxp_end(); + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_MACHINE, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_PRINTER, dependencies, + ARRAY_SIZE( dependencies ), printer_init, NULL, + printer_end ); } static void zx_printer_snapshot_enabled( libspectrum_snap *snap ) diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/printer.h fuse-emulator-1.2.1+dfsg1/peripherals/printer.h --- fuse-emulator-1.2.0+dfsg1/peripherals/printer.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/printer.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* printer.h: Printer support - Copyright (c) 2001-2004 Ian Collier, Russell Marks, Philip Kendall + Copyright (c) 2001-2016 Ian Collier, Russell Marks, Philip Kendall - $Id: printer.h 4635 2012-01-19 23:39:04Z pak21 $ + $Id: printer.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,6 @@ void printer_serial_write( libspectrum_byte b ); void printer_parallel_strobe_write( int on ); void printer_parallel_write( libspectrum_word port, libspectrum_byte b ); -void printer_init( void ); -void printer_end( void ); +void printer_register_startup( void ); #endif /* #ifndef FUSE_PRINTER_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/scld.c fuse-emulator-1.2.1+dfsg1/peripherals/scld.c --- fuse-emulator-1.2.0+dfsg1/peripherals/scld.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/scld.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* scld.c: Routines for handling the Timex SCLD - Copyright (c) 2002-2015 Fredrick Meunier, Philip Kendall, Witold Filipczyk + Copyright (c) 2002-2016 Fredrick Meunier, Philip Kendall, Witold Filipczyk Copyright (c) 2015 Stuart Brady - $Id: scld.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: scld.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ #include "compat.h" #include "dck.h" #include "display.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "memory.h" #include "module.h" @@ -82,11 +83,22 @@ /* .activate = */ NULL, }; -void -scld_init( void ) +static int +scld_init( void *context ) { module_register( &scld_module_info ); periph_register( PERIPH_TYPE_SCLD, &scld_periph ); + + return 0; +} + +void +scld_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_SCLD, dependencies, + ARRAY_SIZE( dependencies ), scld_init, NULL, + NULL ); } static libspectrum_byte diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/scld.h fuse-emulator-1.2.1+dfsg1/peripherals/scld.h --- fuse-emulator-1.2.0+dfsg1/peripherals/scld.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/scld.h 2016-07-17 10:48:29.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 2002-2004 Fredrick Meunier, Witold Filipczyk Copyright (c) 2015 Fredrick Meunier - $Id: scld.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: scld.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -125,7 +125,7 @@ extern memory_page timex_exrom[MEMORY_PAGES_IN_64K]; extern memory_page timex_dock[MEMORY_PAGES_IN_64K]; -void scld_init( void ); +void scld_register_startup( void ); void scld_dec_write( libspectrum_word port, libspectrum_byte b ); void scld_hsr_write( libspectrum_word port, libspectrum_byte b ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/speccyboot.c fuse-emulator-1.2.1+dfsg1/peripherals/speccyboot.c --- fuse-emulator-1.2.0+dfsg1/peripherals/speccyboot.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/speccyboot.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,10 +1,10 @@ /* speccyboot.c: SpeccyBoot Ethernet emulation See http://patrikpersson.github.io/speccyboot/ - Copyright (c) 2009-2011 Patrik Persson, Philip Kendall + Copyright (c) 2009-2016 Patrik Persson, Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: speccyboot.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: speccyboot.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,8 @@ #include #include "compat.h" +#include "debugger/debugger.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "memory.h" #include "nic/enc28j60.h" @@ -96,6 +98,10 @@ /* .activate = */ NULL, }; +/* Debugger events */ +static const char * const event_type_string = "speccyboot"; +static int page_event, unpage_event; + /* --------------------------------------------------------------------------- * ROM paging state * ------------------------------------------------------------------------ */ @@ -105,6 +111,24 @@ static memory_page speccyboot_memory_map_romcs[ MEMORY_PAGES_IN_8K ]; static void +speccyboot_page( void ) +{ + speccyboot_rom_active = 1; + machine_current->ram.romcs = 1; + machine_current->memory_map(); + debugger_event( page_event ); +} + +static void +speccyboot_unpage( void ) +{ + speccyboot_rom_active = 0; + machine_current->ram.romcs = 0; + machine_current->memory_map(); + debugger_event( unpage_event ); +} + +static void speccyboot_memory_map( void ) { if( !speccyboot_rom_active ) return; @@ -187,20 +211,16 @@ /* Update ROM paging status when the ROM_CS bit is cleared or set */ if( GONE_LO( out_register_state, val, OUT_BIT_ROM_CS ) ) { - speccyboot_rom_active = 1; - machine_current->ram.romcs = 1; - machine_current->memory_map(); + speccyboot_page(); } else if( GONE_HI( out_register_state, val, OUT_BIT_ROM_CS ) ) { - speccyboot_rom_active = 0; - machine_current->ram.romcs = 0; - machine_current->memory_map(); + speccyboot_unpage(); } out_register_state = val; } -void -speccyboot_init( void ) +static int +speccyboot_init( void *context ) { int i; @@ -213,21 +233,38 @@ speccyboot_memory_map_romcs[i].source = speccyboot_memory_source; periph_register( PERIPH_TYPE_SPECCYBOOT, &speccyboot_periph ); + + periph_register_paging_events( event_type_string, &page_event, + &unpage_event ); + + return 0; } -void +static void speccyboot_end( void ) { nic_enc28j60_free( nic ); } +void +speccyboot_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_SPECCYBOOT, dependencies, + ARRAY_SIZE( dependencies ), speccyboot_init, NULL, + speccyboot_end ); +} + int speccyboot_unittest( void ) { int r = 0; - speccyboot_rom_active = 1; - speccyboot_memory_map(); + speccyboot_page(); r += unittests_assert_8k_page( 0x0000, speccyboot_memory_source, 0 ); r += unittests_assert_8k_page( 0x2000, memory_source_rom, 0 ); @@ -235,8 +272,7 @@ r += unittests_assert_16k_ram_page( 0x8000, 2 ); r += unittests_assert_16k_ram_page( 0xc000, 0 ); - speccyboot_rom_active = 0; - machine_current->memory_map(); + speccyboot_unpage(); r += unittests_paging_test_48( 2 ); @@ -248,12 +284,7 @@ /* No speccyboot support */ void -speccyboot_init( void ) -{ -} - -void -speccyboot_end( void ) +speccyboot_register_startup( void ) { } diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/speccyboot.h fuse-emulator-1.2.1+dfsg1/peripherals/speccyboot.h --- fuse-emulator-1.2.0+dfsg1/peripherals/speccyboot.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/speccyboot.h 2016-07-17 10:48:29.000000000 +0000 @@ -11,9 +11,9 @@ SpeccyBoot: http://patrikpersson.github.io/speccyboot/ - Copyright (c) 2009-2011 Patrik Persson, Philip Kendall + Copyright (c) 2009-2016 Patrik Persson, Philip Kendall - $Id: speccyboot.h 5353 2016-01-06 00:17:54Z sbaldovi $ + $Id: speccyboot.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,9 +38,7 @@ #ifndef FUSE_SPECCYBOOT_H #define FUSE_SPECCYBOOT_H -void speccyboot_init( void ); - -void speccyboot_end( void ); +void speccyboot_register_startup( void ); int speccyboot_unittest( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/specdrum.c fuse-emulator-1.2.1+dfsg1/peripherals/specdrum.c --- fuse-emulator-1.2.0+dfsg1/peripherals/specdrum.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/specdrum.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* specdrum.c: Routines for handling the Specdrum Drum Kit - Copyright (c) 2011 Jon Mitchell + Copyright (c) 2011-2016 Jon Mitchell, Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: specdrum.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: specdrum.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include #include "compat.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "module.h" #include "periph.h" @@ -66,11 +67,22 @@ /* .activate = */ NULL, }; -void -specdrum_init( void ) +static int +specdrum_init( void *context ) { module_register( &specdrum_module_info ); periph_register( PERIPH_TYPE_SPECDRUM, &specdrum_periph ); + + return 0; +} + +void +specdrum_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_SPECDRUM, dependencies, + ARRAY_SIZE( dependencies ), specdrum_init, NULL, + NULL ); } static void diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/specdrum.h fuse-emulator-1.2.1+dfsg1/peripherals/specdrum.h --- fuse-emulator-1.2.0+dfsg1/peripherals/specdrum.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/specdrum.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* specdrum.h: Routines for handling the Specdrum Drum Kit - Copyright (c) 2011 Jon Mitchell + Copyright (c) 2011-2016 Jon Mitchell, Philip Kendall - $Id: specdrum.h 5300 2015-06-13 10:30:38Z fredm $ + $Id: specdrum.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ libspectrum_signed_byte specdrum_dac; /* Current byte in the SpecDrum 8bit DAC */ } specdrum_info; -void specdrum_init( void ); +void specdrum_register_startup( void ); void specdrum_write( libspectrum_word port, libspectrum_byte val ); #endif /* #ifndef FUSE_SPECRUM_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/spectranet.c fuse-emulator-1.2.1+dfsg1/peripherals/spectranet.c --- fuse-emulator-1.2.0+dfsg1/peripherals/spectranet.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/spectranet.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* spectranet.c: Spectranet emulation - Copyright (c) 2011-2015 Philip Kendall + Copyright (c) 2011-2016 Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: spectranet.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: spectranet.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include "compat.h" #include "debugger/debugger.h" #include "flash/am29f010.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "memory.h" #include "module.h" @@ -441,8 +442,8 @@ /* .activate = */ spectranet_activate, }; -void -spectranet_init( void ) +static int +spectranet_init( void *context ) { module_register( &spectranet_module_info ); spectranet_source = memory_source_register( "Spectranet" ); @@ -452,15 +453,30 @@ w5100 = nic_w5100_alloc(); flash_rom = flash_am29f010_alloc(); + + return 0; } -void +static void spectranet_end( void ) { nic_w5100_free( w5100 ); flash_am29f010_free( flash_rom ); } +void +spectranet_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_SPECTRANET, dependencies, + ARRAY_SIZE( dependencies ), spectranet_init, NULL, + spectranet_end ); +} + static libspectrum_word get_w5100_register( memory_page *page, libspectrum_word address ) { @@ -502,12 +518,7 @@ /* No spectranet support */ void -spectranet_init( void ) -{ -} - -void -spectranet_end( void ) +spectranet_register_startup( void ) { } diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/spectranet.h fuse-emulator-1.2.1+dfsg1/peripherals/spectranet.h --- fuse-emulator-1.2.0+dfsg1/peripherals/spectranet.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/spectranet.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* spectranet.h: Spectranet emulation - Copyright (c) 2011-2015 Philip Kendall + Copyright (c) 2011-2016 Philip Kendall - $Id: spectranet.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: spectranet.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,8 +26,7 @@ #ifndef FUSE_SPECTRANET_H #define FUSE_SPECTRANET_H -void spectranet_init( void ); -void spectranet_end( void ); +void spectranet_register_startup( void ); void spectranet_page( int via_io ); void spectranet_nmi( void ); void spectranet_unpage( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ula.c fuse-emulator-1.2.1+dfsg1/peripherals/ula.c --- fuse-emulator-1.2.0+dfsg1/peripherals/ula.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ula.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,9 +1,9 @@ /* ula.c: ULA routines - Copyright (c) 1999-2011 Philip Kendall, Darren Salt + Copyright (c) 1999-2016 Philip Kendall, Darren Salt Copyright (c) 2015 Stuart Brady Copyright (c) 2016 Fredrick Meunier - $Id: ula.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: ula.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,9 +30,13 @@ #include #include "compat.h" +#include "debugger/debugger.h" #include "keyboard.h" +#include "infrastructure/startup_manager.h" #include "loader.h" #include "machine.h" +#include "machines/spec128.h" +#include "machines/specplus3.h" #include "module.h" #include "periph.h" #include "settings.h" @@ -90,15 +94,88 @@ /* .activate = */ NULL, }; -void -ula_init( void ) +/* Debugger system variables */ +static const char * const debugger_type_string = "ula"; +static const char * const last_byte_detail_string = "last"; +static const char * const tstates_detail_string = "tstates"; +static const char * const mem7ffd_detail_string = "mem7ffd"; +static const char * const mem1ffd_detail_string = "mem1ffd"; + +/* Adapter just to get the return type to be what the debugger is expecting */ +static libspectrum_dword +get_last_byte( void ) +{ + return ula_last_byte(); +} + +static libspectrum_dword +get_tstates( void ) +{ + return tstates; +} + +static void +set_tstates( libspectrum_dword value ) +{ + tstates = value; +} + +static libspectrum_dword +get_7ffd( void ) +{ + return machine_current->ram.last_byte; +} + +static void +set_7ffd( libspectrum_dword value ) +{ + spec128_memoryport_write( 0, value ); +} + +static libspectrum_dword +get_1ffd( void ) +{ + return machine_current->ram.last_byte2; +} + +static void +set_1ffd( libspectrum_dword value ) +{ + specplus3_memoryport2_write( 0, value ); +} + +static int +ula_init( void *context ) { module_register( &ula_module_info ); periph_register( PERIPH_TYPE_ULA, &ula_periph ); periph_register( PERIPH_TYPE_ULA_FULL_DECODE, &ula_periph_full_decode ); + debugger_system_variable_register( + debugger_type_string, last_byte_detail_string, get_last_byte, NULL ); + debugger_system_variable_register( + debugger_type_string, tstates_detail_string, get_tstates, set_tstates ); + debugger_system_variable_register( + debugger_type_string, mem7ffd_detail_string, get_7ffd, set_7ffd ); + debugger_system_variable_register( + debugger_type_string, mem1ffd_detail_string, get_1ffd, set_1ffd ); + ula_default_value = 0xff; + + return 0; +} + +void +ula_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_ULA, dependencies, + ARRAY_SIZE( dependencies ), ula_init, NULL, + NULL ); } static libspectrum_byte diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/ula.h fuse-emulator-1.2.1+dfsg1/peripherals/ula.h --- fuse-emulator-1.2.0+dfsg1/peripherals/ula.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/ula.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* ula.h: ULA routines - Copyright (c) 1999-2004 Philip Kendall, Darren Salt + Copyright (c) 1999-2016 Philip Kendall, Darren Salt - $Id: ula.h 4640 2012-01-21 13:26:35Z pak21 $ + $Id: ula.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ /* And how much when it is inactive */ extern libspectrum_byte ula_contention_no_mreq[ ULA_CONTENTION_SIZE ]; -void ula_init( void ); +void ula_register_startup( void ); libspectrum_byte ula_last_byte( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/usource.c fuse-emulator-1.2.1+dfsg1/peripherals/usource.c --- fuse-emulator-1.2.0+dfsg1/peripherals/usource.c 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/usource.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,8 +1,8 @@ /* usource.c: Routines for handling the Currah uSource interface - Copyright (c) 2007,2011,2015 Stuart Brady + Copyright (c) 2007-2016 Stuart Brady, Philip Kendall Copyright (c) 2016 Fredrick Meunier - $Id: usource.c 5450 2016-05-03 11:05:12Z fredm $ + $Id: usource.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ #include #include "compat.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "memory.h" #include "module.h" @@ -83,8 +84,8 @@ /* .activate = */ NULL, }; -int -usource_init( void ) +static int +usource_init( void *context ) { int i; @@ -99,12 +100,24 @@ return 0; } -void +static void usource_end( void ) { usource_available = 0; } +void +usource_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_MEMORY, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_USOURCE, dependencies, + ARRAY_SIZE( dependencies ), usource_init, NULL, + usource_end ); +} + static void usource_reset( int hard_reset GCC_UNUSED ) { diff -Nru fuse-emulator-1.2.0+dfsg1/peripherals/usource.h fuse-emulator-1.2.1+dfsg1/peripherals/usource.h --- fuse-emulator-1.2.0+dfsg1/peripherals/usource.h 2016-06-06 11:03:29.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/peripherals/usource.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* usource.h: Routines for handling the Currah uSource interface - Copyright (c) 2007,2011 Stuart Brady + Copyright (c) 2007-2016 Stuart Brady, Philip Kendall - $Id: usource.h 5210 2015-04-28 08:51:57Z zubzero $ + $Id: usource.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,8 +31,7 @@ extern int usource_active; extern int usource_available; -int usource_init( void ); -void usource_end( void ); +void usource_register_startup( void ); void usource_toggle( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/profile.c fuse-emulator-1.2.1+dfsg1/profile.c --- fuse-emulator-1.2.0+dfsg1/profile.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/profile.c 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* profile.c: Z80 profiler - Copyright (c) 2005 Philip Kendall + Copyright (c) 2005-2016 Philip Kendall - $Id: profile.c 4640 2012-01-21 13:26:35Z pak21 $ + $Id: profile.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include #include "event.h" +#include "infrastructure/startup_manager.h" #include "fuse.h" #include "module.h" #include "profile.h" @@ -55,10 +56,21 @@ }; -void -profile_init( void ) +static int +profile_init( void *context ) { module_register( &profile_module_info ); + + return 0; +} + +void +profile_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_PROFILE, dependencies, + ARRAY_SIZE( dependencies ), profile_init, NULL, + NULL ); } static void diff -Nru fuse-emulator-1.2.0+dfsg1/profile.h fuse-emulator-1.2.1+dfsg1/profile.h --- fuse-emulator-1.2.0+dfsg1/profile.h 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/profile.h 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* profile.h: Z80 profiler - Copyright (c) 2005 Philip Kendall + Copyright (c) 2005-2016 Philip Kendall - $Id: profile.h 4640 2012-01-21 13:26:35Z pak21 $ + $Id: profile.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ extern int profile_active; -void profile_init( void ); +void profile_register_startup( void ); void profile_start( void ); void profile_map( libspectrum_word pc ); void profile_frame( libspectrum_dword frame_length ); diff -Nru fuse-emulator-1.2.0+dfsg1/psg.c fuse-emulator-1.2.1+dfsg1/psg.c --- fuse-emulator-1.2.0+dfsg1/psg.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/psg.c 2016-07-17 10:48:32.000000000 +0000 @@ -1,7 +1,7 @@ /* psg.c: recording AY chip output to .psg files - Copyright (c) 2003 Matthew Westcott, Philip Kendall + Copyright (c) 2003-2016 Matthew Westcott, Philip Kendall - $Id: psg.c 4635 2012-01-19 23:39:04Z pak21 $ + $Id: psg.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include +#include "infrastructure/startup_manager.h" #include "psg.h" #include "ui/ui.h" @@ -45,10 +46,12 @@ static int write_frame_separator( void ); -void -psg_init( void ) +static int +psg_init( void *context ) { psg_recording = 0; + + return 0; } int @@ -163,9 +166,17 @@ return 0; } -int +static void psg_end( void ) { - if( psg_recording ) return psg_stop_recording(); - return 0; + if( psg_recording ) psg_stop_recording(); +} + +void +psg_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_PSG, dependencies, + ARRAY_SIZE( dependencies ), psg_init, NULL, + psg_end ); } diff -Nru fuse-emulator-1.2.0+dfsg1/psg.h fuse-emulator-1.2.1+dfsg1/psg.h --- fuse-emulator-1.2.0+dfsg1/psg.h 2016-06-06 11:03:28.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/psg.h 2016-07-17 10:48:28.000000000 +0000 @@ -1,7 +1,7 @@ /* psg.h: recording AY chip output to .psg files - Copyright (c) 2003 Matthew Westcott, Philip Kendall + Copyright (c) 2003-2016 Matthew Westcott, Philip Kendall - $Id: psg.h 4635 2012-01-19 23:39:04Z pak21 $ + $Id: psg.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ /* Are we currently recording a .psg file? */ extern int psg_recording; -void psg_init( void ); +void psg_register_startup( void ); int psg_start_recording( const char *filename ); int psg_stop_recording( void ); @@ -40,6 +40,4 @@ int psg_write_register( libspectrum_byte reg, libspectrum_byte value ); -int psg_end( void ); - #endif /* #ifndef FUSE_PSG_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/README fuse-emulator-1.2.1+dfsg1/README --- fuse-emulator-1.2.0+dfsg1/README 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/README 2016-07-17 10:48:32.000000000 +0000 @@ -1,4 +1,4 @@ -The Free Unix Spectrum Emulator (Fuse) 1.2.0 +The Free Unix Spectrum Emulator (Fuse) 1.2.1 ============================================ Fuse (the Free Unix Spectrum Emulator) was originally, and somewhat @@ -108,6 +108,6 @@ . Philip Kendall -6th June, 2016 +17th July, 2016 -$Id: README 5594 2016-06-06 10:46:46Z fredm $ +$Id: README 5686 2016-07-17 10:37:50Z fredm $ diff -Nru fuse-emulator-1.2.0+dfsg1/rzx.c fuse-emulator-1.2.1+dfsg1/rzx.c --- fuse-emulator-1.2.0+dfsg1/rzx.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/rzx.c 2016-07-17 10:48:32.000000000 +0000 @@ -1,9 +1,9 @@ /* rzx.c: .rzx files - Copyright (c) 2002-2015 Philip Kendall + Copyright (c) 2002-2016 Philip Kendall Copyright (c) 2014 Sergio Baldoví Copyright (c) 2015 Stuart Brady - $Id: rzx.c 5567 2016-06-01 09:57:10Z fredm $ + $Id: rzx.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,6 +38,7 @@ #include "debugger/debugger.h" #include "event.h" #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "movie.h" #include "peripherals/ula.h" @@ -119,8 +120,8 @@ static int sentinel_event; -void -rzx_init( void ) +static int +rzx_init( void *context ) { rzx_recording = rzx_playback = 0; @@ -130,6 +131,8 @@ sentinel_event = event_register( rzx_sentinel, "RZX sentinel" ); end_event = debugger_event_register( event_type_string, end_event_detail_string ); + + return 0; } static int @@ -741,12 +744,25 @@ return 0; } -int rzx_end( void ) +static void +rzx_end( void ) { - if( rzx_recording ) return rzx_stop_recording(); - if( rzx_playback ) return rzx_stop_playback( 0 ); + if( rzx_recording ) rzx_stop_recording(); + if( rzx_playback ) rzx_stop_playback( 0 ); +} - return 0; +void +rzx_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_EVENT, + STARTUP_MANAGER_MODULE_MACHINE, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_RZX, dependencies, + ARRAY_SIZE( dependencies ), rzx_init, NULL, + rzx_end ); } static GSList* diff -Nru fuse-emulator-1.2.0+dfsg1/rzx.h fuse-emulator-1.2.1+dfsg1/rzx.h --- fuse-emulator-1.2.0+dfsg1/rzx.h 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/rzx.h 2016-07-17 10:48:32.000000000 +0000 @@ -1,7 +1,7 @@ /* rzx.h: .rzx files - Copyright (c) 2002-2014 Philip Kendall + Copyright (c) 2002-2016 Philip Kendall - $Id: rzx.h 5065 2014-01-12 23:58:05Z sbaldovi $ + $Id: rzx.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -59,7 +59,7 @@ /* The actual RZX data */ extern libspectrum_rzx *rzx; -void rzx_init( void ); +void rzx_register_startup( void ); int rzx_start_recording( const char *filename, int embed_snapshot ); int rzx_stop_recording( void ); @@ -76,8 +76,6 @@ int rzx_store_byte( libspectrum_byte value ); -int rzx_end( void ); - int rzx_rollback( void ); int rzx_rollback_to( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/settings.c fuse-emulator-1.2.1+dfsg1/settings.c --- fuse-emulator-1.2.0+dfsg1/settings.c 2016-06-06 11:04:16.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/settings.c 2016-07-17 10:50:52.000000000 +0000 @@ -50,6 +50,7 @@ #endif /* #ifdef HAVE_LIB_XML2 */ #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "settings.h" #include "spectrum.h" @@ -286,7 +287,7 @@ /* zxcf_pri_file */ (char *)NULL, /* zxcf_upload */ 0, /* zxprinter */ 1, -#line 123"./settings.pl" +#line 124"./settings.pl" /* show_help */ 0, /* show_version */ 0, }; @@ -2020,7 +2021,7 @@ xmlFree( xmlstring ); } } else -#line 259"./settings.pl" +#line 260"./settings.pl" if( !strcmp( (const char*)node->name, "text" ) ) { /* Do nothing */ } else { @@ -2425,7 +2426,7 @@ xmlNewTextChild( root, NULL, (const xmlChar*)"zxcfcffile", (const xmlChar*)settings->zxcf_pri_file ); xmlNewTextChild( root, NULL, (const xmlChar*)"zxcfupload", (const xmlChar*)(settings->zxcf_upload ? "1" : "0") ); xmlNewTextChild( root, NULL, (const xmlChar*)"zxprinter", (const xmlChar*)(settings->zxprinter ? "1" : "0") ); -#line 316"./settings.pl" +#line 317"./settings.pl" xmlSaveFormatFile( path, doc, 1 ); @@ -3436,7 +3437,7 @@ while( ( cpos < ( file->buffer + file->length ) ) && ( *cpos == '\r' || *cpos == '\n' ) ) cpos++; -#line 461"./settings.pl" +#line 462"./settings.pl" } return 0; @@ -4146,7 +4147,7 @@ if( settings_boolean_write( doc, "zxprinter", settings->zxprinter ) ) goto error; -#line 553"./settings.pl" +#line 554"./settings.pl" compat_file_close( doc ); @@ -4452,7 +4453,7 @@ { "no-zxcf-upload", 0, &(settings->zxcf_upload), 0 }, { "zxprinter", 0, &(settings->zxprinter), 1 }, { "no-zxprinter", 0, &(settings->zxprinter), 0 }, -#line 608"./settings.pl" +#line 609"./settings.pl" { "help", 0, NULL, 'h' }, { "version", 0, NULL, 'V' }, @@ -4635,7 +4636,7 @@ case 402: settings_set_string( &settings->zxatasp_master_file, optarg ); break; case 403: settings_set_string( &settings->zxatasp_slave_file, optarg ); break; case 404: settings_set_string( &settings->zxcf_pri_file, optarg ); break; -#line 658"./settings.pl" +#line 659"./settings.pl" case 'h': settings->show_help = 1; break; case 'V': settings->show_version = 1; break; @@ -5203,7 +5204,7 @@ } dest->zxcf_upload = src->zxcf_upload; dest->zxprinter = src->zxprinter; -#line 705"./settings.pl" +#line 706"./settings.pl" } /* Copy one settings object to another */ @@ -5397,12 +5398,12 @@ if( settings->zxatasp_master_file ) libspectrum_free( settings->zxatasp_master_file ); if( settings->zxatasp_slave_file ) libspectrum_free( settings->zxatasp_slave_file ); if( settings->zxcf_pri_file ) libspectrum_free( settings->zxcf_pri_file ); -#line 800"./settings.pl" +#line 801"./settings.pl" return 0; } -int +static void settings_end( void ) { if( settings_current.autosave_settings ) @@ -5413,6 +5414,21 @@ #ifdef HAVE_LIB_XML2 xmlCleanupParser(); #endif /* #ifdef HAVE_LIB_XML2 */ +} - return 0; +void +settings_register_startup( void ) +{ + /* settings_init not yet managed by the startup manager */ + + startup_manager_module dependencies[] = { + /* Fuse for OS X requires that settings_end is called before memory is + deallocated as settings need to look up machine names etc */ + /* STARTUP_MANAGER_MODULE_MEMORY, */ + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_SETTINGS_END, dependencies, + ARRAY_SIZE( dependencies ), NULL, NULL, + settings_end ); } + diff -Nru fuse-emulator-1.2.0+dfsg1/settings.h fuse-emulator-1.2.1+dfsg1/settings.h --- fuse-emulator-1.2.0+dfsg1/settings.h 2016-06-06 11:04:16.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/settings.h 2016-07-17 10:50:52.000000000 +0000 @@ -274,6 +274,6 @@ int settings_write_config( settings_info *settings ); -int settings_end( void ); +void settings_register_startup( void ); #endif /* #ifndef FUSE_SETTINGS_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/settings-header.pl fuse-emulator-1.2.1+dfsg1/settings-header.pl --- fuse-emulator-1.2.0+dfsg1/settings-header.pl 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/settings-header.pl 2016-07-17 10:48:32.000000000 +0000 @@ -4,7 +4,7 @@ # Copyright (c) 2002-2003 Philip Kendall # Copyright (c) 2015 Stuart Brady -# $Id: settings-header.pl 5434 2016-05-01 04:22:45Z fredm $ +# $Id: settings-header.pl 5677 2016-07-09 13:58:02Z fredm $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -116,7 +116,7 @@ int settings_write_config( settings_info *settings ); -int settings_end( void ); +void settings_register_startup( void ); #endif /* #ifndef FUSE_SETTINGS_H */ CODE diff -Nru fuse-emulator-1.2.0+dfsg1/settings.pl fuse-emulator-1.2.1+dfsg1/settings.pl --- fuse-emulator-1.2.0+dfsg1/settings.pl 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/settings.pl 2016-07-17 10:48:32.000000000 +0000 @@ -4,7 +4,7 @@ # Copyright (c) 2002-2015 Philip Kendall # Copyright (c) 2016 BogDan Vatra -# $Id: settings.pl 5525 2016-05-23 21:53:48Z sbaldovi $ +# $Id: settings.pl 5677 2016-07-09 13:58:02Z fredm $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -90,6 +90,7 @@ #endif /* #ifdef HAVE_LIB_XML2 */ #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "settings.h" #include "spectrum.h" @@ -801,7 +802,7 @@ return 0; } -int +static void settings_end( void ) { if( settings_current.autosave_settings ) @@ -812,7 +813,22 @@ #ifdef HAVE_LIB_XML2 xmlCleanupParser(); #endif /* #ifdef HAVE_LIB_XML2 */ +} - return 0; +void +settings_register_startup( void ) +{ + /* settings_init not yet managed by the startup manager */ + + startup_manager_module dependencies[] = { + /* Fuse for OS X requires that settings_end is called before memory is + deallocated as settings need to look up machine names etc */ + /* STARTUP_MANAGER_MODULE_MEMORY, */ + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_SETTINGS_END, dependencies, + ARRAY_SIZE( dependencies ), NULL, NULL, + settings_end ); } + CODE diff -Nru fuse-emulator-1.2.0+dfsg1/slt.c fuse-emulator-1.2.1+dfsg1/slt.c --- fuse-emulator-1.2.0+dfsg1/slt.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/slt.c 2016-07-17 10:48:29.000000000 +0000 @@ -1,9 +1,9 @@ /* slt.c: SLT data handling routines - Copyright (c) 2004 Philip Kendall + Copyright (c) 2004-2016 Philip Kendall Copyright (c) 2015 Stuart Brady Copyright (c) 2015 Fredrick Meunier - $Id: slt.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: slt.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include +#include "infrastructure/startup_manager.h" #include "module.h" #include "settings.h" #include "slt.h" @@ -59,10 +60,20 @@ }; -void -slt_init( void ) +static int +slt_init( void *context ) { module_register( &slt_module_info ); + + return 0; +} + +void +slt_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_SLT, dependencies, + ARRAY_SIZE( dependencies ), slt_init, NULL, NULL ); } int diff -Nru fuse-emulator-1.2.0+dfsg1/slt.h fuse-emulator-1.2.1+dfsg1/slt.h --- fuse-emulator-1.2.0+dfsg1/slt.h 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/slt.h 2016-07-17 10:48:29.000000000 +0000 @@ -1,7 +1,7 @@ /* slt.h: SLT data handling routines - Copyright (c) 2004 Philip Kendall + Copyright (c) 2004-2016 Philip Kendall - $Id: slt.h 4640 2012-01-21 13:26:35Z pak21 $ + $Id: slt.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include -void slt_init( void ); +void slt_register_startup( void ); int slt_trap( libspectrum_word address, libspectrum_byte level ); diff -Nru fuse-emulator-1.2.0+dfsg1/sound/alsasound.c fuse-emulator-1.2.1+dfsg1/sound/alsasound.c --- fuse-emulator-1.2.0+dfsg1/sound/alsasound.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/sound/alsasound.c 2016-07-17 10:48:30.000000000 +0000 @@ -1,7 +1,7 @@ /* alsasound.c: ALSA (Linux) sound I/O Copyright (c) 2006 Gergely Szasz - $Id: alsasound.c 4031 2009-06-08 00:33:53Z fredm $ + $Id: alsasound.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,7 +23,9 @@ /* This is necessary to prevent warnings from the calls to snd_pcm_[hs]w_params_alloca() */ +#ifndef NDEBUG #define NDEBUG +#endif #include #include diff -Nru fuse-emulator-1.2.0+dfsg1/sound.c fuse-emulator-1.2.1+dfsg1/sound.c --- fuse-emulator-1.2.0+dfsg1/sound.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/sound.c 2016-07-17 10:48:31.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 2000-2016 Russell Marks, Matan Ziv-Av, Philip Kendall, Fredrick Meunier, Patrik Rak - $Id: sound.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: sound.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "machine.h" #include "movie.h" #include "options.h" @@ -339,6 +340,14 @@ } } +void +sound_register_startup( void ) +{ + startup_manager_module dependencies[] = { STARTUP_MANAGER_MODULE_SETUID }; + startup_manager_register( STARTUP_MANAGER_MODULE_SOUND, dependencies, + ARRAY_SIZE( dependencies ), NULL, NULL, sound_end ); +} + static inline void ay_do_tone( int level, unsigned int tone_count, int *var, int chan ) { diff -Nru fuse-emulator-1.2.0+dfsg1/sound.h fuse-emulator-1.2.1+dfsg1/sound.h --- fuse-emulator-1.2.0+dfsg1/sound.h 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/sound.h 2016-07-17 10:48:31.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 2000-2004 Russell Marks, Matan Ziv-Av, Philip Kendall Copyright (c) 2016 Fredrick Meunier - $Id: sound.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: sound.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,8 @@ #include +void sound_register_startup( void ); + void sound_init( const char *device ); void sound_pause( void ); void sound_unpause( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/spectrum.c fuse-emulator-1.2.1+dfsg1/spectrum.c --- fuse-emulator-1.2.0+dfsg1/spectrum.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/spectrum.c 2016-07-17 10:48:32.000000000 +0000 @@ -1,7 +1,7 @@ /* spectrum.c: Generic Spectrum routines - Copyright (c) 1999-2013 Philip Kendall, Darren Salt + Copyright (c) 1999-2016 Philip Kendall, Darren Salt - $Id: spectrum.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: spectrum.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ #include "display.h" #include "event.h" #include "keyboard.h" +#include "infrastructure/startup_manager.h" #include "loader.h" #include "machine.h" #include "memory.h" @@ -55,9 +56,6 @@ precisely, since the ULA last pulled the /INT line to the Z80 low) */ libspectrum_dword tstates; -/* The last byte written to the ULA */ -libspectrum_byte spectrum_last_ula; - /* Contention patterns */ static int contention_pattern_65432100[] = { 5, 4, 3, 2, 1, 0, 0, 6 }; static int contention_pattern_76543210[] = { 5, 4, 3, 2, 1, 0, 7, 6 }; @@ -81,11 +79,25 @@ ui_error_frame(); } -void -spectrum_init( void ) +static int +spectrum_init( void *context ) { spectrum_frame_event = event_register( spectrum_frame_event_fn, "End of frame" ); + + return 0; +} + +void +spectrum_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_EVENT, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_SPECTRUM, dependencies, + ARRAY_SIZE( dependencies ), spectrum_init, NULL, + NULL ); } int diff -Nru fuse-emulator-1.2.0+dfsg1/spectrum.h fuse-emulator-1.2.1+dfsg1/spectrum.h --- fuse-emulator-1.2.0+dfsg1/spectrum.h 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/spectrum.h 2016-07-17 10:48:32.000000000 +0000 @@ -1,7 +1,7 @@ /* spectrum.h: Spectrum 48K specific routines - Copyright (c) 1999-2011 Philip Kendall, Darren Salt + Copyright (c) 1999-2016 Philip Kendall, Darren Salt - $Id: spectrum.h 4638 2012-01-21 12:52:14Z fredm $ + $Id: spectrum.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -81,7 +81,7 @@ extern int spectrum_frame_event; -void spectrum_init( void ); +void spectrum_register_startup( void ); int spectrum_frame( void ); #endif /* #ifndef FUSE_SPECTRUM_H */ diff -Nru fuse-emulator-1.2.0+dfsg1/tape.c fuse-emulator-1.2.1+dfsg1/tape.c --- fuse-emulator-1.2.0+dfsg1/tape.c 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/tape.c 2016-07-17 10:48:30.000000000 +0000 @@ -1,9 +1,9 @@ /* tape.c: tape handling routines - Copyright (c) 1999-2015 Philip Kendall, Darren Salt, Witold Filipczyk + Copyright (c) 1999-2016 Philip Kendall, Darren Salt, Witold Filipczyk Copyright (c) 2015 UB880D Copyright (c) 2016 Fredrick Meunier - $Id: tape.c 5587 2016-06-04 14:05:57Z fredm $ + $Id: tape.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,6 +37,7 @@ #include "debugger/debugger.h" #include "event.h" #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "loader.h" #include "machine.h" #include "memory.h" @@ -79,6 +80,8 @@ static int record_event; static int tape_mic_off_event; +static libspectrum_dword next_tape_edge_tstates; + /* Function prototypes */ static int tape_autoload( libspectrum_machine hardware ); @@ -93,8 +96,8 @@ /* Function definitions */ -void -tape_init( void ) +static int +tape_init( void *context ) { tape = libspectrum_tape_alloc(); @@ -114,15 +117,32 @@ so we can't update the statusbar */ tape_playing = 0; tape_microphone = 0; + + next_tape_edge_tstates = 0; + + return 0; } -void +static void tape_end( void ) { libspectrum_tape_free( tape ); tape = NULL; } +void +tape_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_EVENT, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_TAPE, dependencies, + ARRAY_SIZE( dependencies ), tape_init, NULL, + tape_end ); +} + int tape_open( const char *filename, int autoload ) { utils_file file; @@ -321,7 +341,6 @@ libspectrum_free( buffer ); return 0; - } int tape_can_autoload( void ) @@ -567,6 +586,8 @@ tape_autoplay = autoplay; tape_microphone = 0; + event_remove_type( tape_mic_off_event ); + /* Update the status bar */ ui_statusbar_update( UI_STATUSBAR_ITEM_TAPE, UI_STATUSBAR_STATE_ACTIVE ); @@ -575,7 +596,8 @@ loader_tape_play(); - tape_next_edge( tstates, 0, NULL ); + event_add( tstates + next_tape_edge_tstates, tape_edge_event ); + next_tape_edge_tstates = 0; debugger_event( play_event ); @@ -601,7 +623,24 @@ } } -int tape_stop( void ) +static void +save_next_tape_edge( gpointer data, gpointer user_data ) +{ + event_t *ptr = data; + + if( ptr->type == tape_edge_event ) { + next_tape_edge_tstates = ptr->tstates - tstates; + } +} + +static void +tape_save_next_edge( void ) +{ + event_foreach( save_next_tape_edge, NULL ); +} + +int +tape_stop( void ) { if( tape_playing ) { @@ -616,6 +655,7 @@ timer_estimate_reset(); } + tape_save_next_edge(); event_remove_type( tape_edge_event ); /* Turn off any lingering MIC level in a second (some loaders like Alkatraz diff -Nru fuse-emulator-1.2.0+dfsg1/tape.h fuse-emulator-1.2.1+dfsg1/tape.h --- fuse-emulator-1.2.0+dfsg1/tape.h 2016-06-06 11:03:30.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/tape.h 2016-07-17 10:48:30.000000000 +0000 @@ -1,8 +1,8 @@ /* tape.h: tape handling routines - Copyright (c) 1999-2004 Philip Kendall + Copyright (c) 1999-2016 Philip Kendall Copyright (c) 2015 Sergio Baldoví - $Id: tape.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: tape.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,8 +29,7 @@ #include -void tape_init( void ); -void tape_end( void ); +void tape_register_startup( void ); int tape_open( const char *filename, int autoload ); diff -Nru fuse-emulator-1.2.0+dfsg1/timer/timer.c fuse-emulator-1.2.1+dfsg1/timer/timer.c --- fuse-emulator-1.2.0+dfsg1/timer/timer.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/timer/timer.c 2016-07-17 10:48:31.000000000 +0000 @@ -1,7 +1,7 @@ /* timer.c: Speed routines for Fuse Copyright (c) 1999-2008 Philip Kendall, Marek Januszewski, Fredrick Meunier - $Id: timer.c 4664 2012-02-12 11:51:01Z fredm $ + $Id: timer.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #include #include "event.h" +#include "infrastructure/startup_manager.h" #include "movie.h" #include "settings.h" #include "sound.h" @@ -108,8 +109,8 @@ return 0; } -int -timer_init( void ) +static int +timer_init( void *context ) { start_time = timer_get_time(); if( start_time < 0 ) return 1; @@ -117,15 +118,27 @@ event_add( 0, timer_event ); - return 0; + return timer_estimate_reset(); } -void +static void timer_end( void ) { event_remove_type( timer_event ); } +void +timer_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_EVENT, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_TIMER, dependencies, + ARRAY_SIZE( dependencies ), timer_init, NULL, + timer_end ); +} + #ifdef SOUND_FIFO /* Callback-style sound based timer */ diff -Nru fuse-emulator-1.2.0+dfsg1/timer/timer.h fuse-emulator-1.2.1+dfsg1/timer/timer.h --- fuse-emulator-1.2.0+dfsg1/timer/timer.h 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/timer/timer.h 2016-07-17 10:48:31.000000000 +0000 @@ -1,7 +1,7 @@ /* timer.h: Speed routines for Fuse Copyright (c) 1999-2008 Philip Kendall - $Id: timer.h 3934 2009-01-06 13:01:37Z pak21 $ + $Id: timer.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,8 +31,7 @@ int timer_estimate_reset( void ); int timer_estimate_speed( void ); -int timer_init(void); -void timer_end( void ); +void timer_register_startup( void ); extern float current_speed; extern int timer_event; diff -Nru fuse-emulator-1.2.0+dfsg1/ui/widget/menu.c fuse-emulator-1.2.1+dfsg1/ui/widget/menu.c --- fuse-emulator-1.2.0+dfsg1/ui/widget/menu.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/ui/widget/menu.c 2016-07-17 10:48:32.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 2001-2015 Philip Kendall Copyright (c) 2015 Sergio Baldoví - $Id: menu.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: menu.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -426,12 +426,23 @@ void menu_file_exit( int action ) { - if( widget_do_query( "Exit Fuse?" ) || !widget_query.confirm ) + static int menu_exit_open = 0; + + if( menu_exit_open ) return; + + menu_exit_open = 1; + if( widget_do_query( "Exit Fuse?" ) || !widget_query.confirm ) { + menu_exit_open = 0; return; + } - if( menu_check_media_changed() ) return; + if( menu_check_media_changed() ) { + menu_exit_open = 0; + return; + } fuse_exiting = 1; + menu_exit_open = 0; widget_end_all( WIDGET_FINISHED_OK ); } diff -Nru fuse-emulator-1.2.0+dfsg1/ui/widget/query.c fuse-emulator-1.2.1+dfsg1/ui/widget/query.c --- fuse-emulator-1.2.0+dfsg1/ui/widget/query.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/ui/widget/query.c 2016-07-17 10:48:32.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 2004-2008 Darren Salt, Fredrick Meunier Copyright (c) 2015 Stuart Brady - $Id: query.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: query.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -322,6 +322,8 @@ free( message_lines[i] ); } free( message_lines ); + message_lines = NULL; + num_message_lines = 0; return 0; } diff -Nru fuse-emulator-1.2.0+dfsg1/unittests/unittests.c fuse-emulator-1.2.1+dfsg1/unittests/unittests.c --- fuse-emulator-1.2.0+dfsg1/unittests/unittests.c 2016-06-06 11:03:28.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/unittests/unittests.c 2016-07-17 10:48:28.000000000 +0000 @@ -2,7 +2,7 @@ Copyright (c) 2008-2016 Philip Kendall Copyright (c) 2015 Stuart Brady - $Id: unittests.c 5489 2016-05-17 20:34:24Z pak21 $ + $Id: unittests.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,6 +33,7 @@ #include "mempool.h" #include "periph.h" #include "peripherals/disk/beta.h" +#include "peripherals/disk/didaktik.h" #include "peripherals/disk/disciple.h" #include "peripherals/disk/opus.h" #include "peripherals/disk/plusd.h" @@ -758,6 +759,7 @@ r += usource_unittest(); r += beta_unittest(); + r += didaktik80_unittest(); r += disciple_unittest(); r += opus_unittest(); r += plusd_unittest(); diff -Nru fuse-emulator-1.2.0+dfsg1/utils.c fuse-emulator-1.2.1+dfsg1/utils.c --- fuse-emulator-1.2.0+dfsg1/utils.c 2016-06-06 11:03:28.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/utils.c 2016-07-17 10:48:28.000000000 +0000 @@ -6,7 +6,7 @@ Copyright (c) 2016 BogDan Vatra Copyright (c) 2016 Sergio Baldoví - $Id: utils.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: utils.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -390,52 +390,6 @@ return 0; } - -/* Make a copy of a file in a temporary file */ -int -utils_make_temp_file( int *fd, char *tempfilename, const char *filename, - const char *template ) -{ - int error; - utils_file file; - ssize_t bytes_written; - -#if defined AMIGA || defined __MORPHOS__ - snprintf( tempfilename, PATH_MAX, "%s%s", compat_get_temp_path(), template ); -#else - snprintf( tempfilename, PATH_MAX, "%s" FUSE_DIR_SEP_STR "%s", - compat_get_temp_path(), template ); -#endif - - *fd = mkstemp( tempfilename ); - if( *fd == -1 ) { - ui_error( UI_ERROR_ERROR, "couldn't create temporary file: %s", - strerror( errno ) ); - return 1; - } - - error = utils_read_file( filename, &file ); - if( error ) { close( *fd ); unlink( tempfilename ); return error; } - - bytes_written = write( *fd, file.buffer, file.length ); - if( bytes_written != file.length ) { - if( bytes_written == -1 ) { - ui_error( UI_ERROR_ERROR, "error writing to temporary file '%s': %s", - tempfilename, strerror( errno ) ); - } else { - ui_error( UI_ERROR_ERROR, - "could write only %lu of %lu bytes to temporary file '%s'", - (unsigned long)bytes_written, (unsigned long)file.length, - tempfilename ); - } - utils_close_file( &file ); close( *fd ); unlink( tempfilename ); - return 1; - } - - utils_close_file( &file ); - - return 0; -} int utils_read_auxiliary_file( const char *filename, utils_file *file, diff -Nru fuse-emulator-1.2.0+dfsg1/utils.h fuse-emulator-1.2.1+dfsg1/utils.h --- fuse-emulator-1.2.0+dfsg1/utils.h 2016-06-06 11:03:28.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/utils.h 2016-07-17 10:48:28.000000000 +0000 @@ -1,7 +1,7 @@ /* utils.h: some useful helper functions Copyright (c) 1999-2012 Philip Kendall - $Id: utils.h 4738 2012-10-03 13:15:31Z fredm $ + $Id: utils.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -49,8 +49,6 @@ int utils_write_file( const char *filename, const unsigned char *buffer, size_t length ); -int utils_make_temp_file( int *fd, char *tempfilename, const char *filename, - const char *template ); int utils_find_file_path( const char *filename, char *path, utils_aux_type type ); diff -Nru fuse-emulator-1.2.0+dfsg1/z80/coretest.c fuse-emulator-1.2.1+dfsg1/z80/coretest.c --- fuse-emulator-1.2.0+dfsg1/z80/coretest.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/z80/coretest.c 2016-07-17 10:48:31.000000000 +0000 @@ -1,7 +1,7 @@ /* coretest.c: Test program for Fuse's Z80 core Copyright (c) 2003-2015 Philip Kendall - $Id: coretest.c 5434 2016-05-01 04:22:45Z fredm $ + $Id: coretest.c 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,6 +47,7 @@ #include "tape.h" #include "event.h" +#include "infrastructure/startup_manager.h" #include "module.h" #include "spectrum.h" #include "ui/ui.h" @@ -93,7 +94,7 @@ if( init_dummies() ) return 1; /* Initialise the tables used by the Z80 core */ - z80_init(); + z80_init( NULL ); f = fopen( testsfile, "r" ); if( !f ) { @@ -424,6 +425,13 @@ abort(); } +void debugger_system_variable_register( + const char *type, const char *detail, + debugger_get_system_variable_fn_t get, + debugger_set_system_variable_fn_t set ) +{ +} + int debugger_trap( void ) { @@ -567,6 +575,14 @@ return 0; } +void +startup_manager_register( startup_manager_module module, + startup_manager_module *dependencies, size_t dependency_count, + startup_manager_init_fn init_fn, void *init_context, + startup_manager_end_fn end_fn ) +{ +} + int svg_capture_active = 0; /* SVG capture enabled? */ void @@ -600,6 +616,11 @@ return 0; } +void +z80_debugger_variables_init( void ) +{ +} + fuse_machine_info *machine_current; static fuse_machine_info dummy_machine; diff -Nru fuse-emulator-1.2.0+dfsg1/z80/Makefile.am fuse-emulator-1.2.1+dfsg1/z80/Makefile.am --- fuse-emulator-1.2.0+dfsg1/z80/Makefile.am 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/z80/Makefile.am 2016-07-17 10:48:31.000000000 +0000 @@ -2,7 +2,7 @@ ## Copyright (c) 2001-2003 Philip Kendall ## Copyright (c) 2015-2016 Sergio Baldoví -## $Id: Makefile.am 5589 2016-06-05 22:14:19Z sbaldovi $ +## $Id: Makefile.am 5677 2016-07-09 13:58:02Z fredm $ ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -24,6 +24,7 @@ fuse_SOURCES += \ z80/z80.c \ + z80/z80_debugger_variables.c \ z80/z80_ops.c BUILT_SOURCES += \ @@ -56,6 +57,7 @@ noinst_HEADERS += \ z80/z80.h \ z80/z80_checks.h \ + z80/z80_internals.h \ z80/z80_macros.h EXTRA_DIST += \ diff -Nru fuse-emulator-1.2.0+dfsg1/z80/z80.c fuse-emulator-1.2.1+dfsg1/z80/z80.c --- fuse-emulator-1.2.0+dfsg1/z80/z80.c 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/z80/z80.c 2016-07-17 10:48:31.000000000 +0000 @@ -1,7 +1,9 @@ /* z80.c: z80 supplementary functions - Copyright (c) 1999-2013 Philip Kendall + Copyright (c) 1999-2016 Philip Kendall Copyright (c) 2015 Stuart Brady + $Id: z80.c 5677 2016-07-09 13:58:02Z fredm $ + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -26,8 +28,10 @@ #include +#include "debugger/debugger.h" #include "event.h" #include "fuse.h" +#include "infrastructure/startup_manager.h" #include "memory.h" #include "module.h" #include "peripherals/scld.h" @@ -37,6 +41,7 @@ #include "spectrum.h" #include "ui/ui.h" #include "z80.h" +#include "z80_internals.h" #include "z80_macros.h" /* Whether a half carry occurred or not can be determined by looking at @@ -97,8 +102,8 @@ } /* Set up the z80 emulation */ -void -z80_init( void ) +int +z80_init( void *context ) { z80_init_tables(); @@ -108,6 +113,22 @@ z80_nmos_iff2_event = event_register( NULL, "IFF2 update dummy event" ); module_register( &z80_module_info ); + + z80_debugger_variables_init(); + + return 0; +} + +void +z80_register_startup( void ) +{ + startup_manager_module dependencies[] = { + STARTUP_MANAGER_MODULE_DEBUGGER, + STARTUP_MANAGER_MODULE_EVENT, + STARTUP_MANAGER_MODULE_SETUID, + }; + startup_manager_register( STARTUP_MANAGER_MODULE_Z80, dependencies, + ARRAY_SIZE( dependencies ), z80_init, NULL, NULL ); } /* Initalise the tables used to set flags */ diff -Nru fuse-emulator-1.2.0+dfsg1/z80/z80_debugger_variables.c fuse-emulator-1.2.1+dfsg1/z80/z80_debugger_variables.c --- fuse-emulator-1.2.0+dfsg1/z80/z80_debugger_variables.c 1970-01-01 00:00:00.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/z80/z80_debugger_variables.c 2016-07-17 10:48:31.000000000 +0000 @@ -0,0 +1,246 @@ +/* z80_debugger_variables.c: routines to expose Z80 registers to the debugger + Copyright (c) 2016 Philip Kendall + + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Author contact information: + + E-mail: philip-fuse@shadowmagic.org.uk + +*/ + +#include + +#include + +#include "debugger/debugger.h" +#include "z80.h" +#include "z80_macros.h" + +static const char * const debugger_type_string = "z80"; + +static const char * const a_detail_string = "a"; +static const char * const b_detail_string = "b"; +static const char * const c_detail_string = "c"; +static const char * const d_detail_string = "d"; +static const char * const e_detail_string = "e"; +static const char * const f_detail_string = "f"; +static const char * const h_detail_string = "h"; +static const char * const l_detail_string = "l"; + +static const char * const a__detail_string = "a'"; +static const char * const b__detail_string = "b'"; +static const char * const c__detail_string = "c'"; +static const char * const d__detail_string = "d'"; +static const char * const e__detail_string = "e'"; +static const char * const f__detail_string = "f'"; +static const char * const h__detail_string = "h'"; +static const char * const l__detail_string = "l'"; + +static const char * const af_detail_string = "af"; +static const char * const bc_detail_string = "bc"; +static const char * const de_detail_string = "de"; +static const char * const hl_detail_string = "hl"; + +static const char * const af__detail_string = "af'"; +static const char * const bc__detail_string = "bc'"; +static const char * const de__detail_string = "de'"; +static const char * const hl__detail_string = "hl'"; + +static const char * const sp_detail_string = "sp"; +static const char * const pc_detail_string = "pc"; +static const char * const ix_detail_string = "ix"; +static const char * const iy_detail_string = "iy"; + +static const char * const i_detail_string = "i"; +static const char * const r_detail_string = "r"; + +static const char * const im_detail_string = "im"; +static const char * const iff1_detail_string = "iff1"; +static const char * const iff2_detail_string = "iff2"; + +#define DEBUGGER_CALLBACKS(reg) static libspectrum_dword \ +get_##reg( void ) \ +{ \ + return reg; \ +} \ +\ +static void \ +set_##reg( libspectrum_dword value ) \ +{ \ + reg = value; \ +} + +DEBUGGER_CALLBACKS(A) +DEBUGGER_CALLBACKS(B) +DEBUGGER_CALLBACKS(C) +DEBUGGER_CALLBACKS(D) +DEBUGGER_CALLBACKS(E) +DEBUGGER_CALLBACKS(F) +DEBUGGER_CALLBACKS(H) +DEBUGGER_CALLBACKS(L) + +DEBUGGER_CALLBACKS(A_) +DEBUGGER_CALLBACKS(B_) +DEBUGGER_CALLBACKS(C_) +DEBUGGER_CALLBACKS(D_) +DEBUGGER_CALLBACKS(E_) +DEBUGGER_CALLBACKS(F_) +DEBUGGER_CALLBACKS(H_) +DEBUGGER_CALLBACKS(L_) + +DEBUGGER_CALLBACKS(AF) +DEBUGGER_CALLBACKS(BC) +DEBUGGER_CALLBACKS(DE) +DEBUGGER_CALLBACKS(HL) + +DEBUGGER_CALLBACKS(AF_) +DEBUGGER_CALLBACKS(BC_) +DEBUGGER_CALLBACKS(DE_) +DEBUGGER_CALLBACKS(HL_) + +DEBUGGER_CALLBACKS(SP) +DEBUGGER_CALLBACKS(PC) +DEBUGGER_CALLBACKS(IX) +DEBUGGER_CALLBACKS(IY) + +DEBUGGER_CALLBACKS(I) + +static libspectrum_dword +get_R( void ) +{ + return ( R7 & 0x80 ) | ( R & 0x7f ); +} + +static void +set_R( libspectrum_dword value ) +{ + R = R7 = value; +} + +static libspectrum_dword +get_IM( void ) +{ + return IM; +} + +static void +set_IM( libspectrum_dword value ) +{ + if( value >= 0 && value <= 2 ) IM = value; +} + +static libspectrum_dword +get_IFF1( void ) +{ + return IFF1; +} + +static void +set_IFF1( libspectrum_dword value ) +{ + IFF1 = !!value; +} + +static libspectrum_dword +get_IFF2( void ) +{ + return IFF2; +} + +static void +set_IFF2( libspectrum_dword value ) +{ + IFF2 = !!value; +} + +void +z80_debugger_variables_init( void ) +{ + debugger_system_variable_register( debugger_type_string, a_detail_string, + get_A, set_A ); + debugger_system_variable_register( debugger_type_string, b_detail_string, + get_B, set_B ); + debugger_system_variable_register( debugger_type_string, c_detail_string, + get_C, set_C ); + debugger_system_variable_register( debugger_type_string, d_detail_string, + get_D, set_D ); + debugger_system_variable_register( debugger_type_string, e_detail_string, + get_E, set_E ); + debugger_system_variable_register( debugger_type_string, f_detail_string, + get_F, set_F ); + debugger_system_variable_register( debugger_type_string, h_detail_string, + get_H, set_H ); + debugger_system_variable_register( debugger_type_string, l_detail_string, + get_L, set_L ); + + debugger_system_variable_register( debugger_type_string, a__detail_string, + get_A_, set_A_ ); + debugger_system_variable_register( debugger_type_string, b__detail_string, + get_B_, set_B_ ); + debugger_system_variable_register( debugger_type_string, c__detail_string, + get_C_, set_C_ ); + debugger_system_variable_register( debugger_type_string, d__detail_string, + get_D_, set_D_ ); + debugger_system_variable_register( debugger_type_string, e__detail_string, + get_E_, set_E_ ); + debugger_system_variable_register( debugger_type_string, f__detail_string, + get_F_, set_F_ ); + debugger_system_variable_register( debugger_type_string, h__detail_string, + get_H_, set_H_ ); + debugger_system_variable_register( debugger_type_string, l__detail_string, + get_L_, set_L_ ); + + debugger_system_variable_register( debugger_type_string, af_detail_string, + get_AF, set_AF ); + debugger_system_variable_register( debugger_type_string, bc_detail_string, + get_BC, set_BC ); + debugger_system_variable_register( debugger_type_string, de_detail_string, + get_DE, set_DE ); + debugger_system_variable_register( debugger_type_string, hl_detail_string, + get_HL, set_HL ); + + debugger_system_variable_register( debugger_type_string, af__detail_string, + get_AF_, set_AF_ ); + debugger_system_variable_register( debugger_type_string, bc__detail_string, + get_BC_, set_BC_ ); + debugger_system_variable_register( debugger_type_string, de__detail_string, + get_DE_, set_DE_ ); + debugger_system_variable_register( debugger_type_string, hl__detail_string, + get_HL_, set_HL_ ); + + debugger_system_variable_register( debugger_type_string, sp_detail_string, + get_SP, set_SP ); + debugger_system_variable_register( debugger_type_string, pc_detail_string, + get_PC, set_PC ); + debugger_system_variable_register( debugger_type_string, ix_detail_string, + get_IX, set_IX ); + debugger_system_variable_register( debugger_type_string, iy_detail_string, + get_IY, set_IY ); + + debugger_system_variable_register( debugger_type_string, i_detail_string, + get_I, set_I ); + debugger_system_variable_register( debugger_type_string, r_detail_string, + get_R, set_R ); + + debugger_system_variable_register( debugger_type_string, im_detail_string, + get_IM, set_IM ); + debugger_system_variable_register( debugger_type_string, iff1_detail_string, + get_IFF1, set_IFF1 ); + debugger_system_variable_register( debugger_type_string, iff2_detail_string, + get_IFF2, set_IFF2 ); +} diff -Nru fuse-emulator-1.2.0+dfsg1/z80/z80.h fuse-emulator-1.2.1+dfsg1/z80/z80.h --- fuse-emulator-1.2.0+dfsg1/z80/z80.h 2016-06-06 11:03:31.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/z80/z80.h 2016-07-17 10:48:31.000000000 +0000 @@ -1,7 +1,7 @@ /* z80.h: z80 emulation core Copyright (c) 1999-2015 Philip Kendall - $Id: z80.h 5434 2016-05-01 04:22:45Z fredm $ + $Id: z80.h 5677 2016-07-09 13:58:02Z fredm $ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,7 +56,8 @@ } processor; -void z80_init( void ); +void z80_register_startup( void ); +int z80_init( void *context ); void z80_reset( int hard_reset ); int z80_interrupt( void ); diff -Nru fuse-emulator-1.2.0+dfsg1/z80/z80_internals.h fuse-emulator-1.2.1+dfsg1/z80/z80_internals.h --- fuse-emulator-1.2.0+dfsg1/z80/z80_internals.h 1970-01-01 00:00:00.000000000 +0000 +++ fuse-emulator-1.2.1+dfsg1/z80/z80_internals.h 2016-07-17 10:48:31.000000000 +0000 @@ -0,0 +1,31 @@ +/* z80_internals.h: routines which are internal to the Z80 core + Copyright (c) 2016 Philip Kendall + + $Id$ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + Author contact information: + + E-mail: philip-fuse@shadowmagic.org.uk + +*/ + +#ifndef FUSE_Z80_INTERNALS_H +#define FUSE_Z80_INTERNALS_H + +void z80_debugger_variables_init(); + +#endif /* #ifndef FUSE_Z80_INTERNALS */