char insert_string[27] = "/* insert own data here */";
char insert_string2[23] = "; insert own data here";
char save_structure[17] = "Save structure: ";
char no_such_structure[20] = "No such structure.\n";
char filename_quest[11] = "Filename: ";
char even_string[6] = "\neven";
char comma[3] = ", ";
char ioname[]= "raw:0/0/640/200/SystemTracer V1.0 written by Guido Burkard";
char title[]="\n **** SYSTEM TRACER ****\nwritten in 1990 by Guido Burkard\n\n";
char user_break[]="*** user break\n";
char help_text1[]="Command help:\nn new(next) structure\np previous structure\nc close window(hit HELP to re-open)\no open library\ns system (hex/dec)\nl list structure\nw write structure to memory\nr read structure from mem\n";
char help_text2[]="e edit structure entry\nm monitor mem\nd disk operations\nf free structure mem\nt type string to mem\nu untype(free) string mem\nh,? help\nx,q exit\nuse CTRL to pause, SHIFT to break output\n\n";
case WORD: if (mode == HEXADECIMAL)sprintf(buffer,"$%08x $%04x %02d WORD %s[%02d] = $%04x\n",address,address-iaddress,c,entry[e].name,i,peekw(address));
if (mode == DECIMAL) sprintf(buffer,"$%08x $%04x %02d WORD %s[%02d] = %05d\n",address,address-iaddress,c,entry[e].name,i,peekw(address));
print();
address += 2;
break;
case UWORD: if (mode == HEXADECIMAL)sprintf(buffer,"$%08x $%04x %02d UWORD %s[%02d] = $%04x\n",address,address-iaddress,c,entry[e].name,i,peekw(address));
case LONG: if (mode == HEXADECIMAL)sprintf(buffer,"$%08x $%04x %02d LONG %s[%02d] = $%08x\n",address,address-iaddress,c,entry[e].name,i,peekl(address));
if (mode == DECIMAL) sprintf(buffer,"$%08x $%04x %02d LONG %s[%02d] = %010d\n",address,address-iaddress,c,entry[e].name,i,peekl(address));
print();
address += 4;
break;
case ULONG: if (mode == HEXADECIMAL)sprintf(buffer,"$%08x $%04x %02d ULONG %s[%02d] = $%08x\n",address,address-iaddress,c,entry[e].name,i,peekl(address));
case DECIMAL: switch(entry[structure[nr].first_entry+e].type)
{
case BYTE: if (idx>=0) sprintf(buffer,"$%08x BYTE %s[%d] = ",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x BYTE %s = ",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%d",&e_byte);
poke(address,e_byte);
break;
case UBYTE: if (idx>=0) sprintf(buffer,"$%08x UBYTE %s[%d] = ",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x UBYTE %s = ",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%d",&e_ubyte);
poke(address,e_ubyte);
break;
case WORD: if (idx>=0) sprintf(buffer,"$%08x WORD %s[%d] = ",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x WORD %s = ",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%d",&e_word);
pokew(address,e_word);
break;
case UWORD: if (idx>=0) sprintf(buffer,"$%08x UWORD %s[%d] = ",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x UWORD %s = ",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%d",&e_uword);
pokew(address,e_uword);
break;
case LONG: if (idx>=0) sprintf(buffer,"$%08x LONG %s[%d] = ",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x LONG %s = ",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%ld",&e_long);
pokel(address,e_long);
break;
case ULONG: if (idx>=0) sprintf(buffer,"$%08x ULONG %s[%d] = ",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x ULONG %s = ",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%ld",&e_ulong);
pokel(address,e_ulong);
break;
case STRUCTURE: if (idx>=0) sprintf(buffer,"$%08x STRUCTURE %s %s[%d] =\n",address,structure[entry[structure[nr].first_entry+e].pointer].name,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x STRUCTURE %s %s =\n",address,structure[entry[structure[nr].first_entry+e].pointer].name,entry[structure[nr].first_entry+e].name);
case 'a': sprintf(buffer,"Memory parameters= $");print();
InputStr(80,0,0); sscanf(string,"%lx",&e_ulong);
sprintf(buffer,"String length= ");print();
InputStr(80,0,0); sscanf(string,"%ld",&len);
if (!(e_long=AllocMem(len,e_ulong)))
{
sprintf(buffer,"Sorry, out of memory.\n");print();
break;
}
WriteString(len,e_long);
pokel(address,e_long);
break;
case 'o': sprintf(buffer,adrquest);print();
InputStr(80,0,0); sscanf(string,"%lx",&e_long);
WriteString(strlen(e_long),e_long);
pokel(address,e_long);
break;
case 'p': sprintf(buffer,adrquest);print();
InputStr(80,0,0); sscanf(string,"%lx",&e_long);
pokel(address,e_long);
break;
}
break;
}
break;
case HEXADECIMAL: switch(entry[structure[nr].first_entry+e].type)
{
case BYTE: if (idx>=0) sprintf(buffer,"$%08x BYTE %s[%d] = $",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x BYTE %s = $",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%x",&e_byte);
poke(address,e_byte);
break;
case UBYTE: if (idx>=0) sprintf(buffer,"$%08x UBYTE %s[%d] = $",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x UBYTE %s = $",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%x",&e_ubyte);
poke(address,e_ubyte);
break ;
case WORD: if (idx>=0) sprintf(buffer,"$%08x WORD %s[%d] = $",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x WORD %s = $",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%x",&e_word);
pokew(address,e_word);
break;
case UWORD: if (idx>=0) sprintf(buffer,"$%08x UWORD %s[%d] = $",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x UWORD %s = $",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%x",&e_uword);
pokew(address,e_uword);
break;
case LONG: if (idx>=0) sprintf(buffer,"$%08x LONG %s[%d] = $",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x LONG %s = $",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%lx",&e_long);
pokel(address,e_long);
break;
case ULONG: if (idx>=0) sprintf(buffer,"$%08x ULONG %s[%d] = $",address,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x ULONG %s = $",address,entry[structure[nr].first_entry+e].name);
print();
InputStr(80,0,0); sscanf(string,"%lx",&e_ulong);
pokel(address,e_ulong);
break;
case STRUCTURE: if (idx>=0) sprintf(buffer,"$%08x STRUCTURE %s %s[%d] =\n",address,structure[entry[structure[nr].first_entry+e].pointer].name,entry[structure[nr].first_entry+e].name,idx);
if (idx<0) sprintf(buffer,"$%08x STRUCTURE %s %s =\n",address,structure[entry[structure[nr].first_entry+e].pointer].name,entry[structure[nr].first_entry+e].name);