N7Alpha / UnrealLibretro

A Libretro Frontend for Unreal Engine
MIT License
25 stars 8 forks source link

Can't get DOSBOX working #4

Closed masterkyodai closed 3 years ago

masterkyodai commented 3 years ago

Hi there,

been trying to get DOSBOX working. At first I got crashes with "RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY failed" since I didn't understand DOSBOX was using a seperate DOS subdirectory in the ROMS folder.

Fixed that, now I don't get any more crashes, just a blank screen - no matter what game i try to load. Any pointers? No idea how I can debug this when I don't get any error or crash.

N7Alpha commented 3 years ago

That's a bit weird. I've had a similar black screen issue before with mupen64plus_next the issue was in that case that it was infinitely looping in my retro_audio_sample_batch_t callback because I forgot to return samples I buffered. So if you're trying to debug in this case I'd check if its constantly looping in any of the callbacks. I would suspect it might be the core_environment callback so you might want to put a breakpoint there after launching the core.

Which dosbox core are you using btw? I noticed that there are four on the libretro project github .

I managed to get DOOM.EXE to boot with this one. For some reason this isn't built by the build-bot so you'll need to build it manually or you can just use the one I just built. Still though I don't have a method for handling keyboard input so you'll have a hard time using the core even if you get it to boot. I will look into adding support for this though and will eventually try to get one of the dosbox cores that the build-bot builds working.

Also make sure you're using the latest commit and if you fix any bugs please submit a PR.

masterkyodai commented 3 years ago

I tried the 3 DOSBOX dlls that are in the nightly built folder, but no luck so far.

Tried the one you posted and I got a crash again.

Unhandled Exception: 0xe06d7363

KERNELBASE VCRUNTIME140 msvcp140 UE4Editor_UnrealLibretro!std::_Xlen_string() [C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\INCLUDE\xstring:2275] UE4Editor_UnrealLibretro!std::basic_string<char,std::char_traits,std::allocator >::assign() [C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\INCLUDE\xstring:3052] UE4Editor_UnrealLibretro!LibretroContext::core_environment() [C:\Users\User\Documents\Unreal Projects\TV\Plugins\UnrealLibretro\Source\UnrealLibretro\Private\sdlarch.cpp:413] 14AE7DD3437FBE947C7D1780B7E7D7F3 UE4Editor_UnrealLibretro!LibretroContext::load() [C:\Users\User\Documents\Unreal Projects\TV\Plugins\UnrealLibretro\Source\UnrealLibretro\Private\sdlarch.cpp:599] UE4Editor_UnrealLibretro!::operator()() [C:\Users\User\Documents\Unreal Projects\TV\Plugins\UnrealLibretro\Source\UnrealLibretro\Private\sdlarch.cpp:816] UE4Editor_UnrealLibretro!FLambdaRunnable::Run() [C:\Users\User\Documents\Unreal Projects\TV\Plugins\UnrealLibretro\Source\UnrealLibretro\Private\LambdaRunnable.cpp:42] UE4Editor_Core UE4Editor_Core kernel32 ntdll

Not sure what causes this. Using the example map from your built that is in the plugin and just set the core and put a default dosbox.conf (No autoexec, so it should show the DOSBOX prompt).

Either I get a crash or just a grey screen.

Do you think you could upload the whole doom sample project so I can check if I am doing something wrong? If your example - that works on your machine - crashes I'd prolly just re-install my Windows 10. What puzzles me though is that nestopia with Zelda works absolutely fine, so I still think maybe I messed up something else.

Edit: last 4 lines in log are these:

[2021.04.20-17.39.43:965][225]Libretro: Warning: Called function 'Shutdown' before Libretro Core 'dosboxFinal.dll' was launched. This has no effect [2021.04.20-17.39.43:968][225]PIE: Server logged in [2021.04.20-17.39.43:969][225]PIE: Play in editor total start time 0,051 seconds. [2021.04.20-17.39.43:978][225]Libretro: Warning: Unhandled env #18

So I guess something with the RETRO_ENVIRONMENT

N7Alpha commented 3 years ago

Thanks for the detailed info. This was my bad sorry. The crash you had was related to a bug I had fixed in my local repo. I've since committed the fix though so you can try that and let me know how it goes. I tested with a clean repo so it should work now hopefully. So just git pull and run setup.sh or just try this build artifact.

Not sure what causes this. Using the example map from your built that is in the plugin and just set the core and put a default dosbox.conf (No autoexec, so it should show the DOSBOX prompt).

Either I get a crash or just a grey screen.

This should work too on the build I linked I just tested it.

The framerate seems really low for some reason, and I'm looking into keyboard input handling right now. You'd only really be able to just get it to boot for now.

masterkyodai commented 3 years ago

Edit 2 : OK now made a completely new project and I finally got the DOSBOX prompt. Thanks so much, man. No idea what crashed earlier, but with the blank project it works. :)

N7Alpha commented 3 years ago

No problem. Good to hear its working. I'll just leave this issue open though until I get keyboard input working and probably one of the other dosbox cores working.

masterkyodai commented 3 years ago

You're the best, man! If you get keyboard working that would be so awesome.

N7Alpha commented 3 years ago

Thanks. The keyboard input should be working now and dosbox_svn core from the buildbot seems to be working now as of the latest build artifact and this commit.