[Linux] GUI discussion

Discussion of development and patch submission.
szadycbr
Posts: 182
Joined: Mon 21 Nov, 2016 6:23 pm

Re: [Linux] GUI discussion

Postby szadycbr » Mon 19 Jun, 2017 6:09 pm

It is too hot, also in Poole, ha ha.
bit
Posts: 98
Joined: Sun 19 Mar, 2017 7:04 pm

Re: [Linux] GUI discussion

Postby bit » Sun 25 Jun, 2017 7:05 pm

SarahWalker wrote:Revs 774-776 commit the patches attached to this thread, except for the configurable paths one - I need to look over that some more, and in the UK at present it's too hot to consider doing anything resembling thinking.

No problem, take your time. There's probably something there I haven't thought about or could've done better :)
It needs more testing in Windows/Allegro, since I pretty much only use the wx/SDL2-port on Linux.

It was very hot here for a while as well, finally getting a bit cooler.
basic2004
Posts: 118
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Linux] GUI discussion

Postby basic2004 » Sat 01 Jul, 2017 6:23 pm

I tried to build your latest revision, but failed.

Code: Select all

wx-sdl2-video-gl3.o:wx-sdl2-video-gl3.c:(.text+0x1d1b): undefined reference to `_imp__glActiveTexture@4'
wx-sdl2-video-gl3.o:wx-sdl2-video-gl3.c:(.text+0x2e72): undefined reference to `_imp__glActiveTexture@4'
collect2.exe: error: ld returned 1 exit status
make: *** [PCem-wx-SDL2.exe] Error 1

I tried to build Makefile.mingw-wx-sdl2 in Windows 10.
bit
Posts: 98
Joined: Sun 19 Mar, 2017 7:04 pm

Re: [Linux] GUI discussion

Postby bit » Sat 01 Jul, 2017 8:23 pm

basic2004 wrote:I tried to build your latest revision, but failed.

Code: Select all

wx-sdl2-video-gl3.o:wx-sdl2-video-gl3.c:(.text+0x1d1b): undefined reference to `_imp__glActiveTexture@4'
wx-sdl2-video-gl3.o:wx-sdl2-video-gl3.c:(.text+0x2e72): undefined reference to `_imp__glActiveTexture@4'
collect2.exe: error: ld returned 1 exit status
make: *** [PCem-wx-SDL2.exe] Error 1

I tried to build Makefile.mingw-wx-sdl2 in Windows 10.

Seems like it might be an old opengl32-library. Try the branch gl3-test and see if that builds for you.
basic2004
Posts: 118
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Linux] GUI discussion

Postby basic2004 » Sun 02 Jul, 2017 12:36 pm

bit wrote:Seems like it might be an old opengl32-library. Try the branch gl3-test and see if that builds for you.

I built gl3-test branch, this launched successful.
GL3 renderer with shader, crt-geom.glslp (from RetroArch.)
gl3-test.jpg
gl3-test.jpg (167.18 KiB) Viewed 1490 times
User avatar
leilei
Posts: 423
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Linux] GUI discussion

Postby leilei » Sun 02 Jul, 2017 6:39 pm

Looks nice. Could that be committed upstream too? PCem could use some shadery action... (and maybe have monitor "emulation" from it by picking a list of simulated monitors and maybe with appropriate edid emulation and the sync errors/phosphor trail buffer/fade in/color pollution)

EDIT: Compiled and tried it out. The virtual refresh rate is a nice idea, though i had keyboard input issues especially with the modifier keys sticking (especially alt). The shader manager also has a focus issue after applying a shader change so it would scroll back up to the top edit box

I've also noticed the text modes on the better video cards get clipped by CRT shaders' overscans
Attachments
crazycrtfun.jpg
crazycrtfun.jpg (254.92 KiB) Viewed 1440 times
ecksemmess
Posts: 122
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Linux] GUI discussion

Postby ecksemmess » Mon 03 Jul, 2017 3:48 pm

Excellent work going on here, loving this!
ecksemmess
Posts: 122
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Linux] GUI discussion

Postby ecksemmess » Mon 03 Jul, 2017 3:56 pm

leilei wrote:PCem could use some shadery action... (and maybe have monitor "emulation" from it by picking a list of simulated monitors and maybe with appropriate edid emulation and the sync errors/phosphor trail buffer/fade in/color pollution)


Yes, that would be incredible. I've always wanted to be able to capture the subtleties of different displays. For example, I used to have a lot of Trinitron-based CRTs. Those often had horizontal curvature without any vertical curvature. Are there any shader packages that offer that, or easy ways to hack it from an existing full-curvature implementation?
User avatar
leilei
Posts: 423
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Linux] GUI discussion

Postby leilei » Mon 03 Jul, 2017 7:44 pm

Most "tweaked shader packages" i've seen primarily deal with recreating NTSC CRT tvs much less monitors

Tweaking and sharing preferences might be close. Here's a preset which roughly approximate an early VGA monitor (from memory
(gausshackh and v are just blurs\blur-gauss-*.glsl with a "* 0.08" tacked after the pixel size to decrease the radius)

Code: Select all

[SDL2]
fullscreen = 1
fullscreen_mode = 0
scale = 1
scale_mode = 0
vsync = 0
focus_dim = 0
render_driver = gl3

[GL3]
input_scale = 1.000000
input_stretch = 0
simulated_refresh_rate = 60.000000

[GL3 Shaders]
shaders = 3
shader0 = shaders\blurs\gausshackh.glsl
shader1 = shaders\blurs\gausshackv.glsl
shader2 = shaders\crt\crt-easymode-halation.glslp

[GL3 Shaders - crt-easymode-halation.glslp]
GAMMA_INPUT = 2.870000
RETRO_PIXEL_SIZE = 0.000000
GAMMA_OUTPUT = 1.000000
SHARPNESS_H = 0.000000
SHARPNESS_V = 0.000000
MASK_TYPE = 6.000000
MASK_STRENGTH_MIN = 0.130000
MASK_STRENGTH_MAX = 0.240000
MASK_SIZE = 1.000000
SCANLINE_STRENGTH_MIN = 0.050000
SCANLINE_STRENGTH_MAX = 0.000000
SCANLINE_BEAM_MIN = 1.000000
SCANLINE_BEAM_MAX = 1.050000
GEOM_CURVATURE = 0.020000
GEOM_WARP = 0.020000
GEOM_CORNER_SIZE = 0.020000
GEOM_CORNER_SMOOTH = 500.000000
INTERLACING_TOGGLE = 0.000000
HALATION = 0.310000
DIFFUSION = 0.170000
BRIGHTNESS = 1.250000


Maybe refresh rate of the video mode could be exposed to shader for other tweaks? (i.e. scanline beam size reduction if higher on some monitors, and maybe a fake flicker effect more obvious on a lower refresh rate)
bit
Posts: 98
Joined: Sun 19 Mar, 2017 7:04 pm

Re: [Linux] GUI discussion

Postby bit » Mon 03 Jul, 2017 8:48 pm

basic2004 wrote:I built gl3-test branch, this launched successful.

Great! I've merged this branch into master.
leilei wrote:Looks nice. Could that be committed upstream too?

Thank you! I will provide a patch for it when it has been tested for a while.
leilei wrote:i had keyboard input issues especially with the modifier keys sticking (especially alt).

Yeah I'm aware of the modifier keys sticking, especially on Windows. It has been on my todo for a while now but I've been focusing more on the fun stuff, but I should probably look at it soon :)
ecksemmess wrote:Those often had horizontal curvature without any vertical curvature. Are there any shader packages that offer that

I think with crt-lottes* you can adjust the curvature independently.
leilei wrote:Maybe refresh rate of the video mode could be exposed to shader for other tweaks?

Thats a good idea. It should be possible to expose it as the simulated refresh rate, since that is the rate of which the frameCount-value will be updated in the shader.
basic2004
Posts: 118
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Linux] GUI discussion

Postby basic2004 » Tue 04 Jul, 2017 3:11 am

I testing fluidsynth branch in my Windows 10,
wxWidgets UI showing MIDI configuration correctly but Windows UI isn't.
This problem appeared on advanced configuration of Roland MT-32 emulation too.
CONFIG_FILE, CONFIG_SPINNER is missing on Windows UI.

pcem-wx.png
pcem-wx.png (40.84 KiB) Viewed 1347 times

pcem-win.png
pcem-win.png (15.43 KiB) Viewed 1347 times


And no sound from FluidSynth, and MT-32 emulation only this branch too.
basic2004
Posts: 118
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Linux] GUI discussion

Postby basic2004 » Tue 04 Jul, 2017 3:24 am

basic2004 wrote:And no sound from FluidSynth, and MT-32 emulation only this branch too.

I modify cfg file manually, FluidSynth and MT-32 emulation plays correctly.
I think this was configuration problem.

[FluidSynth] and [Roland MT-32 Emulation]'s settings are turned to 0 after configuration.
and these device configuration aren't save when apply changes.
basic2004
Posts: 118
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Linux] GUI discussion

Postby basic2004 » Tue 04 Jul, 2017 3:32 am

I made a new config, and set FluidSynth.
this code is FluidSynth settings from config file.

Code: Select all

[FluidSynth]
sound_font = B:\kgs88.sf2
output_gain = 0
chorus = 0
chorus_voices = 0
chorus_level = 0
chorus_speed = 0
chorus_depth = 0
chorus_waveform = 0
reverb = 0
reverb_room_size = 0
reverb_damping = 0
reverb_width = 0
reverb_level = 0
interpolation = 2

and MT-32.

Code: Select all

[Roland MT-32 Emulation]
output_gain = 0
reverb = 1
reverb_output_gain = 0
reversed_stereo = 0
status_show_instruments = 0

CONFIG_SPINNER wasn't applied correctly.
bit
Posts: 98
Joined: Sun 19 Mar, 2017 7:04 pm

Re: [Linux] GUI discussion

Postby bit » Tue 04 Jul, 2017 10:03 am

@basic2004:
Yeah the FluidSynth branch is in early stages. I've only tested it on wx/SDL2 on Linux, but it's great that you tried it for Windows!
I think I know why the configuration for CONFIG_SPINNER isn't saved on Windows, I'll take a look at that.
The Windows UI configuration items will be added later.
basic2004
Posts: 118
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Linux] GUI discussion

Postby basic2004 » Wed 05 Jul, 2017 2:15 am

Thanks to Windows-specific fixing but I need to solve this.
Right click context menu don't disappear when clicking except this context menu,
Is this problem only Windows-specific?
bit
Posts: 98
Joined: Sun 19 Mar, 2017 7:04 pm

Re: [Linux] GUI discussion

Postby bit » Wed 05 Jul, 2017 5:59 am

Yes that is a Windows-specific problem. Unfortunately I'm not entirely sure how to fix it.
JosepMa
Posts: 69
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [Linux] GUI discussion

Postby JosepMa » Wed 05 Jul, 2017 7:22 pm

It is quite interesting how this is evolving.
I tried an older version (what is merged into pcem's official repo) and it gave me more instability (not completely sure if it was related to the source, the compiler the binary being built for 64bits , the virtual machine or something else).

As for the images, I would like to suggest something that should give that extra feeling of emulation, now that resizing and shaders can be used: Set the monitor size.
You know, up to now, pcem was resizing the screen according to the pixels of the emulated video. Then, there were the options to keep a 4:3 aspect ratio that have recently been possible also on windowed mode, and that, coupled to window resizing, has allowed to resize the window to a size to what a monitor of that time would correspond.

As such, I am suggesting a setting that could resize the window to the 14'' 4:3, 15.6'' 5:4, and the likes, determined by actual screen size, not by pixels.

I used a ruler to determine the width and height of the window, and I have it resized to what would correspond to a 15.6 monitor. With Direct3D, that gives quite a feeling of what such a monitor would show.
ecksemmess
Posts: 122
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Linux] GUI discussion

Postby ecksemmess » Wed 05 Jul, 2017 8:53 pm

That's actually not a half bad idea--in the config, we could have fields where the user enters the horizontal and vertical dimensions of their host system's screen in inches, and PCem could then use that to calculate the window dimensions in pixels that would correspond to various standard classic monitor sizes, and offer a selection from among them.
User avatar
leilei
Posts: 423
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Linux] GUI discussion

Postby leilei » Thu 06 Jul, 2017 9:33 am

A XT silpheed video in the shader stuff. Should really tweak and get the phosphor to persist a bit more in the darker range

the sdl2 input got really sticky during the recording for some reason. also numpad 4 doesn't work

i've also had a unexpected fullscreen alt-f4 incident which closed the emulator instead of performing a guest alt-f4
SarahWalker
Site Admin
Posts: 1314
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [Linux] GUI discussion

Postby SarahWalker » Thu 06 Jul, 2017 8:40 pm

Paths changes (finally) committed at rev 789.
Roman S
Posts: 6
Joined: Wed 31 May, 2017 5:18 pm

Re: [Linux] GUI discussion

Postby Roman S » Fri 07 Jul, 2017 4:19 pm

Does not compile for me:

Code: Select all

x86_64-pc-linux-gnu-gcc -DPACKAGE_NAME=\"PCem\" -DPACKAGE_TARNAME=\"pcem\" -DPACKAGE_VERSION=\"v12\" -DPACKAGE_STRING=\"PCem\ v12\" -DPACKAGE_BUGREPORT=\"Sarah\ Walker\ \<pcem@pcem-emulator.co.uk\>\" -DPACKAGE_URL=\"\" -DPACKAGE=\"pcem\" -DVERSION=\"v12\" -DHAVE_LIBOPENAL=1 -DHAVE_LIBALUT=1 -DHAVE_LIBPTHREAD=1 -I.    -I/usr/lib64/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I/usr/include/SDL2 -D_REENTRANT  -O3 -c -o pcem-acer386sx.o `test -f 'acer386sx.c' || echo './'`acer386sx.c
808x.c: In function ‘dumpregs’:
808x.c:511:15: error: ‘logs_path’ undeclared (first use in this function)
         chdir(logs_path);
               ^~~~~~~~~
808x.c:511:15: note: each undeclared identifier is reported only once for each function it appears in


[edit] path.c and path.h seems to be missing in the repository...
bit
Posts: 98
Joined: Sun 19 Mar, 2017 7:04 pm

Re: [Linux] GUI discussion

Postby bit » Sat 08 Jul, 2017 3:50 pm

SarahWalker wrote:Paths changes (finally) committed at rev 789.

Thanks! I hope you will find it useful. I use it when I work on the Windows-version when I work with two different sources at the same time, it makes it easy to share the same configs and roms.
But as Roman S said though, paths.c/h is missing.
basic2004 wrote:Right click context menu don't disappear when clicking except this context menu

leilei wrote:the sdl2 input got really sticky during the recording for some reason. also numpad 4 doesn't work

i've also had a unexpected fullscreen alt-f4 incident which closed the emulator instead of performing a guest alt-f4

I think you will like the latest commits to my GitHub/master. The wx/SDL2 Windows-version now uses much of the code from the D3D Windows-version, which means that there is now a menu bar and the keyboard should behave the same, so hopefully no stickiness or accidental ALT+F4. The rendering is still done through SDL2.
keen4.jpg
keen4.jpg (163.33 KiB) Viewed 1009 times

There might be some issues I haven't found so it would be great if as many Windows-users as possible could test it and see if it works properly.

EDIT: I should also mention that the Windows-version now requires SDL2 version 2.0.5+. The Linux-version still works with older versions.
basic2004
Posts: 118
Joined: Sun 08 Jan, 2017 5:59 pm

Re: [Linux] GUI discussion

Postby basic2004 » Sun 09 Jul, 2017 9:06 am

bit wrote:I think you will like the latest commits to my GitHub/master. The wx/SDL2 Windows-version now uses much of the code from the D3D Windows-version, which means that there is now a menu bar and the keyboard should behave the same, so hopefully no stickiness or accidental ALT+F4. The rendering is still done through SDL2.
keen4.jpg
There might be some issues I haven't found so it would be great if as many Windows-users as possible could test it and see if it works properly.

EDIT: I should also mention that the Windows-version now requires SDL2 version 2.0.5+. The Linux-version still works with older versions.

Thanks for patching, I watched wxWidgets in Windows to Windows UI, so right click don't appear context menu anymore.
but I found a problem, current version isn't doing time synchronization correctly both Windows, wxWidgets.

I found this problem in official development version(rev. 7742fe7) too.
User avatar
leilei
Posts: 423
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Linux] GUI discussion

Postby leilei » Sun 09 Jul, 2017 10:24 am

I've also noticed the encoding of the window title is briefly chinese for a second.

Middleclick can't unlock the mouse and I also had a situation where an always on top window (i.e. a media player) catching focus from the locked mouse cursor would still keep the mouse cursor locked with no way to alt-tab back or use the unlock hotkey. Had to Ctrl-Alt-Del then taskmanager end the media player to be able to click on the pcem window to regain proper focus so it could unlock the mouse
JosepMa
Posts: 69
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [Linux] GUI discussion

Postby JosepMa » Sun 09 Jul, 2017 12:15 pm

I am with leilei that the middleclick feature should be restored.

As I understand, it was removed in order to add support for middle click for emulated applications, but that was already present, when switching to a Microsoft intellimouse. Serial and PS/2 modes are meant for 2-button setups, and there, middleclick can be used for unlocking the mouse. (At much, if 3-button is needed for serial and/or ps/2, then add an additional setup option for them).
teppic
Posts: 21
Joined: Tue 20 Jun, 2017 12:31 pm

Re: [Linux] GUI discussion

Postby teppic » Sun 09 Jul, 2017 12:21 pm

I'm not able to compile under Arch linux, I get errors from allegro4:

Code: Select all

allegro-midi.c:22:6: error: conflicting types for ‘plat_midi_play_msg’
 void plat_midi_play_msg(uint8_t* val)
      ^~~~~~~~~~~~~~~~~~
bit
Posts: 98
Joined: Sun 19 Mar, 2017 7:04 pm

Re: [Linux] GUI discussion

Postby bit » Sun 09 Jul, 2017 1:17 pm

Oki, I've added middle-click to release the mouse in windowed mode :)
I'll see if I can reproduce the focus issue. EDIT: I tried an always on top countdown timer that stole focus when the timer reached zero but I couldn't reproduce the problem. I did some changes anyway, let's see if it happens again.

teppic wrote:I'm not able to compile under Arch linux, I get errors from allegro4:

Code: Select all

allegro-midi.c:22:6: error: conflicting types for ‘plat_midi_play_msg’
 void plat_midi_play_msg(uint8_t* val)
      ^~~~~~~~~~~~~~~~~~

I've added the missing MIDI-changes to the Allegro-version. However if you want to use the wxWidgets-UI you need to run configure with --enable-wx
Last edited by bit on Sun 09 Jul, 2017 1:56 pm, edited 1 time in total.
teppic
Posts: 21
Joined: Tue 20 Jun, 2017 12:31 pm

Re: [Linux] GUI discussion

Postby teppic » Sun 09 Jul, 2017 1:32 pm

bit wrote:I've added the missing MIDI-changes to the Allegro-version. However if you want to use the wxWidgets-UI you need to run configure with --enable-wx


Ah I was probably compiling it with the wrong config option then. It fails to link now though, same with and without the wx option :)

Code: Select all

pcem-hdd.o:(.data.rel+0x200): undefined reference to `wd1007vse1_device'
pcem-hdd_esdi.o: In function `esdi_close':
hdd_esdi.c:(.text+0x2f): undefined reference to `hdd_close'
hdd_esdi.c:(.text+0x3b): undefined reference to `hdd_close'
pcem-hdd_esdi.o: In function `esdi_init':
hdd_esdi.c:(.text+0x13b): undefined reference to `hdd_load'
hdd_esdi.c:(.text+0x153): undefined reference to `hdd_load'
pcem-hdd_esdi.o: In function `esdi_callback':
hdd_esdi.c:(.text+0x886): undefined reference to `hdd_read_sectors'
hdd_esdi.c:(.text+0xdec): undefined reference to `hdd_write_sectors'
bit
Posts: 98
Joined: Sun 19 Mar, 2017 7:04 pm

Re: [Linux] GUI discussion

Postby bit » Sun 09 Jul, 2017 1:49 pm

teppic wrote:It fails to link now though, same with and without the wx option :)

Fixed :)
teppic
Posts: 21
Joined: Tue 20 Jun, 2017 12:31 pm

Re: [Linux] GUI discussion

Postby teppic » Sun 09 Jul, 2017 2:54 pm

Builds fine now :) I can't test it at the moment (did a remote build) but will check it out later.

Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests