libretro / blueMSX-libretro

Port of blueMSX to the libretro API.
Other
45 stars 68 forks source link

Reset issues #59

Closed Tatsuya79 closed 6 years ago

Tatsuya79 commented 6 years ago

When doing a reset from Quickmenu: -Sega games stay on a black screen -MSX games have no sound -Coleco are fine

Also special mappers are lost. I have an Aleste 2 cart made from the floppies version and it needs ASCII16 mapper to run. I saved that as game opt override but it's lost on reset (it shows a blinking blue screen, the same as when the mapper is wrong).

I tried an old compiled core from 2015-03, the MSX sound loss on reset was there too. On really rare occasion the sound can work after a reset. (win7 x64)

meepingsnesroms commented 6 years ago

I cannot reproduce this, have you updated since yesterday there was a bug causing a random memory write that could be corrupting things.

I used a regular msx game(aleste 1) and set it to an invalid mapper and then reset and it still would not load meaning that the custom mapper stuck even after reset.(It loads on auto mapper so I know its not a broken game)

There was a buffer overflow, it corrupts whatever variable is placed after the array in my case it was the framebuffer pointer so it crashed on first render and was easy to catch.

Tatsuya79 commented 6 years ago

I updated the core, same as before on windows.

I tried on my android phone and indeed the sound still works on restart for MSX2 games.

The cart mapper core option was applied too but not in the case of using a opt override. Even if I had set ascii16 in default core options, aleste 2 didn't reboot with it if the opt override was there... really strange.

meepingsnesroms commented 6 years ago

mapper_auto is checked in retro_load_game I dont know if game specific config is applied before or after game load so mapper_auto may be using an outdated value.

Are you running the game from a playlist, cmd/terminal or from the file browser?

Tatsuya79 commented 6 years ago

I do playlist or file browser usually. The result seems to be the same. (it works the 1st launch, fails on restart)

Tatsuya79 commented 6 years ago

MSX games audio doesn't stop on restart if I have "Pause when menu activated" set to OFF. (I usually have it ON) Doesn't change anything for Sega games black screen.

(on win7)

meepingsnesroms commented 6 years ago

I have none of these issues, audio and sega sg1000 reboot are fine too.

Any and all information would be helpful.

I am on a Mac with RetroArch 1.6.7

The only difference is Windows as far as I can see, have you tried all the audio drivers?

Tatsuya79 commented 6 years ago

Oh I was using direct sound and, now that I changed it to xaudio, the sound still works after a reset.

About Sega I always get a black screen on reset. I tried to force machine + mapper but that's the same. I wonder what it is...

Something particular with Sega machines: I had to enable one by default here. If I didn't do that, it would give me a black screen too when using the new auto machine option.

Tatsuya79 commented 6 years ago

I think I got around those problems. (except for direct sound I'll just leave aside) https://github.com/libretro/blueMSX-libretro/pull/60

Tatsuya79 commented 6 years ago

Just noticed something now, when I reset The Castle on SG1000 I got "Castle, The (Japan).sram" that gets created on the root on my hdd. I went into retroarch/save and found no sram for any game I ran into bluemsx recently. Is there something wrong for windows save path? Does my commit create sram out of the save folder for you on Mac?

meepingsnesroms commented 6 years ago

No, I dont see a save file at all.

I will try to fix this today.

andres-asm commented 6 years ago

void *retro_get_memory_data(unsigned id){return NULL;} size_t retro_get_memory_size(unsigned id){return 0;}

You need to implement those and stub out the core saving

OR

use RETRO_ENVIRONMENT_GET_SAVE_DIR to get a hint of the dir you should use.

meepingsnesroms commented 6 years ago

Ok I fixed an undefined variable with @Tatsuya79 fix and set quicksave directory, I still dont get a .sram file though.

meepingsnesroms commented 6 years ago

I just set quicksave dir to RETRO_ENVIRONMENT_GET_SAVE_DIR. Also merged the bool removal from Tatsuya79.

So for a fresh test could you delete the file and test it again with the new core.

meepingsnesroms commented 6 years ago

Used boardSetDirectory to set the save path, I now have a save file in my save path.

The root directory issue should be fixed.

Tatsuya79 commented 6 years ago

What happens now is: -first boot with The Castle on Sega SG1000, no sram anywhere -hit "restart" in quickmenu, "Castle, The (Japan).sram" gets created in my save folder

I'm using that game as it's the only one I found that leaves a sram file.

meepingsnesroms commented 6 years ago

I think that the core is not shut down properly, so a save is only created on reset, but that game actually has its own mapper so it may be the only sg1000 game that uses sram.