Diff for /np2/debugsub.c between versions 1.7 and 1.9

version 1.7, 2004/01/30 14:33:27 version 1.9, 2004/03/07 01:23:14
Line 59  static const char file_i286cs[] = "i286_ Line 59  static const char file_i286cs[] = "i286_
 static const char file_i286ds[] = "i286_ds.%.3u";  static const char file_i286ds[] = "i286_ds.%.3u";
 static const char file_i286es[] = "i286_es.%.3u";  static const char file_i286es[] = "i286_es.%.3u";
 static const char file_i286ss[] = "i286_ss.%.3u";  static const char file_i286ss[] = "i286_ss.%.3u";
 static const char file_i286txt[] = "i286txt.%.3u";  
 static const char file_memorybin[] = "memory.bin";  static const char file_memorybin[] = "memory.bin";
   
 static const char str_register[] =                                                                              \  static const char str_register[] =                                                                              \
Line 108  static char work[256]; Line 107  static char work[256];
         return(work);          return(work);
 }  }
   
   static void writeseg(const char *fname, UINT32 addr, UINT limit) {
   
           FILEH   fh;
           UINT    size;
           BYTE    buf[0x1000];
   
           fh = file_create_c(fname);
           if (fh == FILEH_INVALID) {
                   return;
           }
           limit = min(limit, 0xffff);
           limit++;
           while(limit) {
                   size = min(limit, sizeof(buf));
                   MEML_READ(addr, buf, size);
                   file_write(fh, buf, size);
                   addr += size;
                   limit -= size;
           }
           file_close(fh);
   }
   
 void debugsub_status(void) {  void debugsub_status(void) {
   
 static int      filenum = 0;  static int      filenum = 0;
Line 129  const char *p; Line 150  const char *p;
         }          }
   
         SPRINTF(work, file_i286cs, filenum);          SPRINTF(work, file_i286cs, filenum);
         fh = file_create_c(work);          writeseg(work, CS_BASE, 0xffff);
         if (fh != FILEH_INVALID) {  
                 file_write(fh, &mem[CS_BASE], 0x10000);  
                 file_close(fh);  
         }  
         SPRINTF(work, file_i286ds, filenum);          SPRINTF(work, file_i286ds, filenum);
         fh = file_create_c(work);          writeseg(work, DS_BASE, 0xffff);
         if (fh != FILEH_INVALID) {  
                 file_write(fh, &mem[DS_BASE], 0x10000);  
                 file_close(fh);  
         }  
         SPRINTF(work, file_i286es, filenum);          SPRINTF(work, file_i286es, filenum);
         fh = file_create_c(work);          writeseg(work, ES_BASE, 0xffff);
         if (fh != FILEH_INVALID) {  
                 file_write(fh, &mem[ES_BASE], 0x10000);  
                 file_close(fh);  
         }  
         SPRINTF(work, file_i286ss, filenum);          SPRINTF(work, file_i286ss, filenum);
         fh = file_create_c(work);          writeseg(work, SS_BASE, 0xffff);
         if (fh != FILEH_INVALID) {  
                 file_write(fh, &mem[SS_BASE], 0x10000);  
                 file_close(fh);  
         }  
         SPRINTF(work, file_i286txt, filenum);  
         fh = file_create_c(work);  
         if (fh != FILEH_INVALID) {  
                 file_write(fh, &mem[0xa0000], 0x4000);  
                 file_close(fh);  
         }  
         filenum++;          filenum++;
 }  }
   
Line 168  void debugsub_memorydump(void) { Line 167  void debugsub_memorydump(void) {
   
         fh = file_create_c(file_memorybin);          fh = file_create_c(file_memorybin);
         if (fh != FILEH_INVALID) {          if (fh != FILEH_INVALID) {
 //              for (i=0; i<34; i++) {                  for (i=0; i<34; i++)
                 for (i=0; i<64; i++) {  //              for (i=0; i<64; i++)
                   {
                         file_write(fh, mem + i*0x8000, 0x8000);                          file_write(fh, mem + i*0x8000, 0x8000);
                 }                  }
                 file_close(fh);                  file_close(fh);

Removed from v.1.7  
changed lines
  Added in v.1.9


RetroPC.NET-CVS <cvs@retropc.net>