|
|
| version 1.4, 2003/12/08 00:55:30 | version 1.9, 2004/03/07 01:23:14 |
|---|---|
| Line 2 | Line 2 |
| #include "strres.h" | #include "strres.h" |
| #include "dosio.h" | #include "dosio.h" |
| #include "cpucore.h" | #include "cpucore.h" |
| #include "memory.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "debugsub.h" | #include "debugsub.h" |
| Line 60 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 109 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 130 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 169 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); |