- fseek(tmpFile, 0x800, SEEK_SET);
- fread((void *)PSXM(SWAP32(tmpHead.t_addr)), SWAP32(tmpHead.t_size),1,tmpFile);
+ section_address = SWAP32(tmpHead.t_addr);
+ section_size = SWAP32(tmpHead.t_size);
+ mem = PSXM(section_address);
+ if (mem != NULL) {
+ fseek(tmpFile, 0x800, SEEK_SET);
+ fread(mem, section_size, 1, tmpFile);
+ psxCpu->Clear(section_address, section_size / 4);
+ }