summaryrefslogtreecommitdiffstats
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 6df8f2f534..91746d2e58 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -193,6 +193,7 @@ bool dbg_mpeg_thread(void)
/* Tool function to calculate a CRC16 across some buffer */
unsigned short crc_16(unsigned char* buf, unsigned len)
{
+ /* CCITT standard polynomial 0x1021 */
static const unsigned short crc16_lookup[16] =
{ /* lookup table for 4 bits at a time is affordable */
0x0000, 0x1021, 0x2042, 0x3063,
@@ -1324,6 +1325,30 @@ bool dbg_save_roms(void)
return false;
}
+
+/* test code, to be removed later */
+extern union /* defined in main.c */
+{
+ unsigned char port8 [512];
+ unsigned short port16[256];
+ unsigned port32[128];
+} startup_io;
+
+bool dbg_save_io(void) /* dump the initial I/O space to disk */
+{
+ int fd;
+
+ fd = creat("/startup_io.bin", O_WRONLY);
+ if(fd >= 0)
+ {
+ write(fd, (void *)&startup_io, sizeof(startup_io));
+ close(fd);
+ }
+
+ return false;
+}
+/* end of test code */
+
bool debug_menu(void)
{
int m;
@@ -1331,6 +1356,7 @@ bool debug_menu(void)
struct menu_items items[] = {
{ "Dump ROM contents", dbg_save_roms },
+ { "Dump startup I/O", dbg_save_io },
{ "View I/O ports", dbg_ports },
#ifdef HAVE_LCD_BITMAP
#ifdef HAVE_RTC