This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
acsim_toolbox_c [2006/08/01 20:27] audiocommander created v.0.0.5 |
acsim_toolbox_c [2007/11/17 16:48] (current) smashtv move acsim.zip to "acsim" namespace |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | This page is part of the [[mios_c_simulator_-_debugger]] | + | This page is part of the [[mios_c_simulator_-_debugger]] |
[[acsim_console_h|ACSim_console.h]]\\ | [[acsim_console_h|ACSim_console.h]]\\ | ||
[[acsim_console_c|ACSim_console.c]]\\ | [[acsim_console_c|ACSim_console.c]]\\ | ||
- | |||
- | **[[acsim_toolbox_c|ACSim_toolbox.c]]**\\ | ||
[[acsim_mios_h|ACSim_mios.h]]\\ | [[acsim_mios_h|ACSim_mios.h]]\\ | ||
[[acsim_mios_c|ACSim_mios.c]]\\ | [[acsim_mios_c|ACSim_mios.c]]\\ | ||
+ | [[acsim_toolbox_h|ACSim_toolbox.h]]\\ | ||
+ | **[[acsim_toolbox_c|ACSim_toolbox.c]]**\\ | ||
+ | [[acmididefines|ACMidiDefines.h]]\\ | ||
+ | \\ | ||
+ | This code is for viewing only and may not be up to date. You can download the files in a zip file {{acsim:acsim.zip}}. If you make any updates, please send them to stryd_one and he will update the zip for you. | ||
+ | \\ | ||
\\ | \\ | ||
<code c> | <code c> | ||
Line 35: | Line 39: | ||
- | #import <Stdio.h> | ||
+ | #import "ACSim_toolbox.h" | ||
- | #ifndef _ACSIM_TOOLBOX_C | + | #import "ACSim_console.h" |
- | #define _ACSIM_TOOLBOX_C | + | |
- | #pragma mark random numbers | ||
// generate some random numbers | // generate some random numbers | ||
unsigned char ACRandomBool(void) { return (random() % 2); } | unsigned char ACRandomBool(void) { return (random() % 2); } | ||
Line 55: | Line 57: | ||
- | #pragma mark HEXVIEW | ||
// hexview output | // hexview output | ||
- | #define HEXVIEW_COLUMNS 68 | + | // maybe configure defines in header! |
- | #define HEXVIEW_CHARS ((HEXVIEW_COLUMNS-1)/4) | + | |
void hexview(unsigned char *buf, int size) { | void hexview(unsigned char *buf, int size) { | ||
Line 68: | Line 68: | ||
int i; | int i; | ||
unsigned char c; | unsigned char c; | ||
+ | unsigned char r = 0; | ||
while (size>0) { | while (size>0) { | ||
+ | printf("%i:\t\t",(r*16)); | ||
for (i=0;i<HEXVIEW_CHARS;i++) { | for (i=0;i<HEXVIEW_CHARS;i++) { | ||
if (size-i>0) { | if (size-i>0) { | ||
Line 85: | Line 87: | ||
size-=HEXVIEW_CHARS; | size-=HEXVIEW_CHARS; | ||
printf("\n"); | printf("\n"); | ||
+ | r++; | ||
} | } | ||
} | } | ||
- | #endif /* _ACSIM_TOOLBOX_C */ | ||
</code> | </code> |