port to 64bit. Some gcc 4.4 warning fixes

git-svn-id: file:///home/notaz/opt/svn/PicoDrive@835 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2009-12-06 17:03:58 +00:00
parent 71f68165b6
commit b8a1c09ad1
19 changed files with 102 additions and 80 deletions

View file

@ -464,25 +464,25 @@ int emu_reload_rom(char *rom_fname)
// check for both gmv and rom
int dummy;
FILE *movie_file = fopen(rom_fname, "rb");
if(!movie_file) {
if (!movie_file) {
me_update_msg("Failed to open movie.");
return 0;
}
fseek(movie_file, 0, SEEK_END);
movie_size = ftell(movie_file);
fseek(movie_file, 0, SEEK_SET);
if(movie_size < 64+3) {
if (movie_size < 64+3) {
me_update_msg("Invalid GMV file.");
fclose(movie_file);
return 0;
}
movie_data = malloc(movie_size);
if(movie_data == NULL) {
if (movie_data == NULL) {
me_update_msg("low memory.");
fclose(movie_file);
return 0;
}
fread(movie_data, 1, movie_size, movie_file);
dummy = fread(movie_data, 1, movie_size, movie_file);
fclose(movie_file);
if (strncmp((char *)movie_data, "Gens Movie TEST", 15) != 0) {
me_update_msg("Invalid GMV file.");
@ -1008,13 +1008,16 @@ int emu_save_load_game(int load, int sram)
sram_size = SRam.size;
sram_data = SRam.data;
}
if (!sram_data) return 0; // SRam forcefully disabled for this game
if (sram_data == NULL)
return 0; // SRam forcefully disabled for this game
if (load)
{
sramFile = fopen(saveFname, "rb");
if(!sramFile) return -1;
fread(sram_data, 1, sram_size, sramFile);
if (!sramFile)
return -1;
ret = fread(sram_data, 1, sram_size, sramFile);
ret = ret > 0 ? 0 : -1;
fclose(sramFile);
if ((PicoAHW & PAHW_MCD) && (PicoOpt&POPT_EN_MCD_RAMCART))
memcpy32((int *)Pico_mcd->bram, (int *)sram_data, 0x2000/4);