Uzem ported to SDL2

The Uzebox now have a fully functional emulator! Download and discuss it here.
User avatar
Artcfox
Posts: 945
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to SDL2

Post by Artcfox » Mon Sep 28, 2015 1:08 am

Okay, I submitted the pull request.

User avatar
uze6666
Site Admin
Posts: 4449
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzem ported to SDL2

Post by uze6666 » Tue Sep 29, 2015 2:12 am

Doing the merge but I have some build error under Windows. I'm fixing them right now. Btw, just to confirm,you didn't build it under Windows right?

Edit: Ok found it. A "#include <stdio.h>" in gdbserver.h was moved in a conditional block for non windows platforms.

Edit 2: Well, it compiles, but it crashes right away. :(

User avatar
uze6666
Site Admin
Posts: 4449
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzem ported to SDL2

Post by uze6666 » Tue Sep 29, 2015 2:59 am

I fixed the crash issue. It runs, but I'm underwhelmed to say the least...it currently runs even slower than before on my machine and the sound it terrible and stutters like crazy. It can't even emulate 28Mhz! :cry: If it only runs fine on linux, we've got a problem. At this point I don't like the idea of pushing that to the branch until we can figure out why it is so slow.

Edit: I have created a tag on the branch so I can go back. So I'll push the changes. Attached is a build with SDL2 if you guys on windows could give it a try and report on the performances.
Attachments
uzem140_sdl2.zip
(791.52 KiB) Downloaded 114 times

User avatar
Artcfox
Posts: 945
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to SDL2

Post by Artcfox » Tue Sep 29, 2015 3:34 am

I did not test it under Windows, and I find that very surprising! :(

The first thing I'd try is removing the

Code: Select all

SDL_RENDERER_PRESENTVSYNC
flag from the call to CreateWindow. With that flag, when you tell the renderer to "present," it will wait for your monitor's vsync to avoid tearing.

Which version of Windows are you using, and do you have hardware rendering support?

I ask because the help for uzem says this:
--hwsurface -w Use SDL hardware surface (probably slower)
which I did not find to be true.

You could also try replacing the flag:

Code: Select all

SDL_RENDERER_ACCELERATED
with the software fallback:

Code: Select all

SDL_RENDERER_SOFTWARE
The other option that you could try is there are additional flags that you can pass to SDL2 to specify whether you want to use the OpenGL or Direct3D backend, but by default it should pick the best one for the platform you are on.

But I suspect that something weird is going on if software rendering is actually faster for you than using the GPU.

I'll see if I can borrow a Windows computer and try it for myself.

User avatar
Artcfox
Posts: 945
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to SDL2

Post by Artcfox » Tue Sep 29, 2015 3:46 am

I just realized that my wife has a computer that runs Windows! :lol:

So, I tried the build that you posted, and it runs great on Windows 7. 100% full speed emulation, even when I ran it in the "windowed" mode and then maximized the window to cover the entire 1080p display minus the title bar.

Her computer doesn't even have a video card in it, so it's just using the on-board Intel graphics for this.

I'm not sure what's going on with your computer, Uze.

User avatar
uze6666
Site Admin
Posts: 4449
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzem ported to SDL2

Post by uze6666 » Tue Sep 29, 2015 4:07 am

I'm not sure what's going on with your computer, Uze.
Geez, I don't know either. I have pretty old but beefy Nvidia graphics card but I don't know why I have all these issues. :(

Now, I don't know why, it just crashes all the time all I got is:

Code: Select all

C:\work\uzebox\git\tools\uzem>uzem SOLITAIR.HEX
EEPROM file not found, continuing with emulation.
Loading Hex Image...

Using HEX path for SD emulation: ./
SD Emulation of following files:

So I'll have to debug what is going on with the SD loading. :|

User avatar
Artcfox
Posts: 945
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to SDL2

Post by Artcfox » Tue Sep 29, 2015 4:09 am

What if you rename that hex file to all lowercase?

Edit: With the Windows version, I tried one with all lowercase, and all uppercase, and they both work.

User avatar
uze6666
Site Admin
Posts: 4449
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzem ported to SDL2

Post by uze6666 » Tue Sep 29, 2015 4:13 am

Nope, still crash. Don't bother, I'll trace that tomorrow.

User avatar
uze6666
Site Admin
Posts: 4449
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzem ported to SDL2

Post by uze6666 » Wed Sep 30, 2015 4:31 am

I disabled the vsync flag, no luck. In fact I'm testing with ghosty ghost. When at the menu, the music is fine, no drop. As soon as it scrolls, CPU emulation speed drops and sound stutters! Just to be sure can test with that game?

User avatar
Artcfox
Posts: 945
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to SDL2

Post by Artcfox » Wed Sep 30, 2015 8:30 am

uze6666 wrote:I disabled the vsync flag, no luck. In fact I'm testing with ghosty ghost. When at the menu, the music is fine, no drop. As soon as it scrolls, CPU emulation speed drops and sound stutters! Just to be sure can test with that game?
I just tested Ghosty Ghost on both my 5 year old Linux laptop, and on a 3 year old Windows box, and it runs perfectly @ 28.636 MHz.

I would see if you can find an upgrade for your video card drivers, or try switching to your on-board graphics card if you have one.

BTW: What a challenging game! The best score I could manage was 7. :oops:

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests