1
0
Fork 0

Fix bineary memory dumps. (Ognjen Milic)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2553
This commit is contained in:
Peter Veenstra 2006-03-26 11:11:56 +00:00
parent 6a48704051
commit 0904221dfa

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: debug.cpp,v 1.75 2006-02-12 23:23:52 harekiet Exp $ */
/* $Id: debug.cpp,v 1.76 2006-03-26 11:11:56 qbix79 Exp $ */
#include <string.h>
#include <list>
@ -2112,14 +2112,15 @@ static void SaveMemory(Bitu seg, Bitu ofs1, Bit32u num)
};
static void SaveMemoryBin(Bitu seg, Bitu ofs1, Bit32u num) {
FILE* f = fopen("MEMDUMP.BIN","wt");
FILE* f = fopen("MEMDUMP.BIN","wb");
if (!f) {
DEBUG_ShowMsg("DEBUG: Memory binary dump failed.\n");
return;
}
for(Bitu x=0; x <num;x++) {
fprintf(f,"%c",mem_readb(GetAddress(seg,ofs1+x)));
for(Bitu x = 0; x < num;x++) {
Bit8u val = mem_readb(GetAddress(seg,ofs1+x));
fwrite(&val,1,1,f);
};
fclose(f);