if (block != cso->block_in_buff)\r
{\r
if (read_pos != cso->fpos_in)\r
- { fseek(stream->file, read_pos, SEEK_SET); printf("seek %i\n", read_pos); }\r
+ fseek(stream->file, read_pos, SEEK_SET);\r
rret = fread(cso->in_buff, 1, read_len, stream->file);\r
cso->fpos_in = read_pos + rret;\r
if (rret != read_len) {\r
static unsigned char *cd_realloc(void *old, int filesize)\r
{\r
unsigned char *rom;\r
- dprintf("sizeof(mcd_state): %i", sizeof(mcd_state));\r
rom=realloc(old, sizeof(mcd_state));\r
if (rom) memset(rom+0x20000, 0, sizeof(mcd_state)-0x20000);\r
return rom;\r
alloc_size&=~0x7ffff; // use alloc size of multiples of 512K, so that memhandlers could be set up more efficiently\r
if((filesize&0x3fff)==0x200) alloc_size+=0x200;\r
else if(alloc_size-filesize < 4) alloc_size+=4; // padding for out-of-bound exec protection\r
- //dprintf("alloc_size: %x\n", alloc_size);\r
\r
// Allocate space for the rom plus padding\r
rom=(unsigned char *)malloc(alloc_size);\r
Pico.m.sram_reg |= 4;\r
} else {\r
// normal SRAM\r
- SRam.start = PicoRead32(0x1B4) & 0xFFFF00;\r
+ SRam.start = PicoRead32(0x1B4) & ~0xff;\r
SRam.end = PicoRead32(0x1B8) | 1;\r
sram_size = SRam.end - SRam.start + 1;\r
}\r
+ SRam.start &= ~0xff000000;\r
+ SRam.end &= ~0xff000000;\r
Pico.m.sram_reg |= 0x10; // SRAM was detected\r
}\r
if (sram_size <= 0)\r
// Unusual region 'code'\r
if (rom_strcmp(0x1f0, "EUROPE") == 0)\r
*(int *) (Pico.rom+0x1f0) = 0x20204520;\r
+\r
+ // SVP detection\r
+ if (name_cmp("Virtua Racing") == 0)\r
+ {\r
+ PicoSVPInit();\r
+ PicoRead16Hook = PicoSVPRead16;\r
+ PicoWrite8Hook = PicoSVPWrite8;\r
+ }\r
}\r
\r