Moderators: pcwzrd13, deluxux, VasiliyRS
Ro Magnus Larsson wrote:Hi: is it working on Dreamshell ?
Roareye wrote:Probably not as the first 256 bytes have unprintable characters.
Roareye wrote:megavolt85 wrote:GDEMU_SD crash if first 256 bytes of IP.BIN have not printable symbols
all not printable symbols need replace to space (0x20 in hex)
Is someone able to do this and re-upload? I don't know what counts as a "not printable symbol", and opening the file in Notepad just brings up a load of gibberish. I would assume the problem is the up arrows and yen symbols, but there are so many other odd symbols in there that I wouldn't know where to begin.
The first 256 characters inside IP.BIN are as follows;SEGA SEGAKATANA SEGA ENTERPRISES598F GD-ROM1/1 E 0799A10 T8118D 50V1.00120001003 1ST_READ.BIN SEGA LC-T-81 F355 CHALLENGE
Which symbol is GDEMU_SD not able to understand?
Code: Select all
#include <ctype.h>
#include <stdio.h>
int main(int argc, char **argv)
{
FILE *fp;
unsigned char buf[256];
int i, fix = 0;
if (!(fp = fopen("IP.BIN", "r+b")))
{
return -1;
}
fread((void *) buf, 1, 256, fp);
for (i = 0; i < 256; i++)
{
if(!isprint((int) buf[i]))
{
fix = 1;
buf[i] = 0x20;
}
}
if (fix)
{
fseek(fp, 0, SEEK_SET);
fwrite((void *) buf, 1, 256, fp);
}
fclose(fp);
return 0;
}
megavolt85 wrote:two errors, the first in the IP.BIN 4 Win program, which adds garbage to IP.BIN, the second problem in the GDEMU_SD program, it does not check the contents of IP.BIN
here is the simplest example that will solve this problemCode: Select all
#include <ctype.h>
#include <stdio.h>
int main(int argc, char **argv)
{
FILE *fp;
unsigned char buf[256];
int i, fix = 0;
if (!(fp = fopen("IP.BIN", "r+b")))
{
return -1;
}
fread((void *) buf, 1, 256, fp);
for (i = 0; i < 256; i++)
{
if(!isprint((int) buf[i]))
{
fix = 1;
buf[i] = 0x20;
}
}
if (fix)
{
fseek(fp, 0, SEEK_SET);
fwrite((void *) buf, 1, 256, fp);
}
fclose(fp);
return 0;
}
Users browsing this forum: No registered users