From 53a7dd242c21003a38e2d51a205dd926ead84d57 Mon Sep 17 00:00:00 2001 From: Felix Arends Date: Wed, 1 May 2002 09:34:55 +0000 Subject: [PATCH] added debug and panic support for the simulator git-svn-id: svn://svn.rockbox.org/rockbox/trunk@357 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/win32/debug-win32.c | 38 ++++++++++++++++++++++++++++ uisimulator/win32/panic-win32.c | 43 ++++++++++++++++++++++++++++++++ uisimulator/win32/uisw32.sln | 4 +-- uisimulator/win32/uisw32.suo | Bin 11264 -> 12800 bytes uisimulator/win32/uisw32.vcproj | 28 +++++++++++++++++---- 5 files changed, 106 insertions(+), 7 deletions(-) create mode 100644 uisimulator/win32/debug-win32.c create mode 100644 uisimulator/win32/panic-win32.c diff --git a/uisimulator/win32/debug-win32.c b/uisimulator/win32/debug-win32.c new file mode 100644 index 0000000000..6a65f4fcd3 --- /dev/null +++ b/uisimulator/win32/debug-win32.c @@ -0,0 +1,38 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Felix Arends + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include + +char debugmembuf[100]; +char debugbuf[200]; + +void debug( const char *message ) +{ + OutputDebugString (message); +} + +void debugf(char *fmt, ...) +{ + va_list ap; + + va_start( ap, fmt ); + wsprintf( debugmembuf, fmt, ap ); + va_end( ap ); + debug ( debugmembuf ); +} \ No newline at end of file diff --git a/uisimulator/win32/panic-win32.c b/uisimulator/win32/panic-win32.c new file mode 100644 index 0000000000..c4592d5906 --- /dev/null +++ b/uisimulator/win32/panic-win32.c @@ -0,0 +1,43 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 by Felix Arends + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include +#include "debug.h" + +char panic_buf[128]; + +// panic +// whatever it says ;) +void panic( char *message ) +{ + debug( message ); + PostQuitMessage (-1); +} + + +// panicf +// formatted panic +void panicf( char *fmt, ...) +{ + va_list ap; + va_start( ap, fmt ); + wsprintf( panic_buf, fmt, ap ); + va_end( ap ); + panic( panic_buf ); +} \ No newline at end of file diff --git a/uisimulator/win32/uisw32.sln b/uisimulator/win32/uisw32.sln index 855bb2f214..ada5e11e7c 100644 --- a/uisimulator/win32/uisw32.sln +++ b/uisimulator/win32/uisw32.sln @@ -9,8 +9,8 @@ Global GlobalSection(ProjectDependencies) = postSolution EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution - {A81A8EFA-647A-427A-BD04-F6B469752E7A}.Debug.ActiveCfg = Release|Win32 - {A81A8EFA-647A-427A-BD04-F6B469752E7A}.Debug.Build.0 = Release|Win32 + {A81A8EFA-647A-427A-BD04-F6B469752E7A}.Debug.ActiveCfg = Debug|Win32 + {A81A8EFA-647A-427A-BD04-F6B469752E7A}.Debug.Build.0 = Debug|Win32 {A81A8EFA-647A-427A-BD04-F6B469752E7A}.Release.ActiveCfg = Release|Win32 {A81A8EFA-647A-427A-BD04-F6B469752E7A}.Release.Build.0 = Release|Win32 EndGlobalSection diff --git a/uisimulator/win32/uisw32.suo b/uis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--git a/uisimulator/win32/uisw32.vcproj b/uisimulator/win32/uisw32.vcproj index 4419bef715..64bf277453 100644 --- a/uisimulator/win32/uisw32.vcproj +++ b/uisimulator/win32/uisw32.vcproj @@ -19,7 +19,7 @@ - - + + + + + + @@ -128,7 +134,16 @@ RelativePath="..\..\firmware\drivers\lcd.c"> + RelativePath="panic-win32.c"> + + + + + + @@ -137,6 +152,9 @@ + +