Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐧] Mono work from fork #1441

Merged

Conversation

YoshiRulz
Copy link
Member

@YoshiRulz YoshiRulz commented Jan 11, 2019

The high addition count is from 73caa21. We've got fewer crashes, OpenGL graphics, OpenAL sound, and Controller support (as long as you don't sneeze and bump it).

edit: see #1438, a PR for the branch this was merged into

@Asnivor
Copy link
Contributor

Asnivor commented Jan 11, 2019

Re: gdi32.dll

As a test, if I go through GDIRenderer.cs and replace all the DllImports from gdi32.dll to an absolute path to ...wine/gdi32.dll.so, it still tries to use libgdiplus.so.0 to call GdipGetDC method and then errors:

Mono: DllImport attempting to load: '/usr/lib/x86_64-linux-gnu/wine/gdi32.dll.so'.
Mono: DllImport loaded library '/usr/lib/x86_64-linux-gnu/wine/gdi32.dll.so'.
Mono: DllImport searching in: '/usr/lib/x86_64-linux-gnu/wine/gdi32.dll.so' ('/usr/lib/x86_64-linux-gnu/wine/gdi32.dll.so').
Mono: Searching for 'SetBkMode'.
Mono: Probing 'SetBkMode'.
Mono: Found as 'SetBkMode'.
Mono: DllImport searching in: 'libgdiplus.so.0' ('/usr/lib/libgdiplus.so.0').
Mono: Searching for 'GdipGetDC'.
Mono: Probing 'GdipGetDC'.
Mono: Found as 'GdipGetDC'.
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) BizHawk.Client.EmuHawk.CustomControls.GDIRenderer.SetBkMode (intptr,BizHawk.Client.EmuHawk.CustomControls.GDIRenderer/BkModes) [0x0000a] in <1fe47c0cc0ad4bf7911ce5773295d349>:0
  at BizHawk.Client.EmuHawk.CustomControls.GDIRenderer.LockGraphics (System.Drawing.Graphics) [0x00014] in /home/asnivor/Repos/BizFork/BizHawk/BizHawk.Client.EmuHawk/CustomControls/GDIRenderer.cs:103

GdipGetDC does not exist anywhere within the bizhawk codebase, so there must be some internal mono-goings-on that require its gdiplus implementation. The only thing I can think of is that the wine wine gdi32 is not compatible with mono.

Not sure what to do next really. Unless we create a UnixGDIRenderer.cs that purely uses libgdiplus. Sounds like a big job :/

@YoshiRulz YoshiRulz changed the title [WIP] Mono collab stuff [WIP] [🐧] Mono collab stuff Jan 12, 2019
…options menu so that it opens without exception
… config dialog). On linux this requires the 'nvidia-cg-toolkit' dependency (either through your package manager, or direct from https://developer.nvidia.com/cg-toolkit-download)
@Asnivor
Copy link
Contributor

Asnivor commented Jan 15, 2019

196d51d now gives the working option of OpenGL (using the existing OpenTK implementation) in linux/mono:

image

Users will need the 'nvidia-cg-toolkit' dependency (as the windows version calls cgc.exe).

Pinging #1430
Also potentially useful for #1422 @nattthebear

@YoshiRulz YoshiRulz force-pushed the MoreUnixMonoCompatWork branch from 4f2ff14 to 1b03ecb Compare January 17, 2019 07:35
@Asnivor
Copy link
Contributor

Asnivor commented Jan 17, 2019

OpenTK controllers are now working on unix/mono. Pinging #1430 and #1422 and #1438

Note: some controllers require a button or axis pressed whilst emuhawk is first starting in order to be recognised.

@YoshiRulz YoshiRulz force-pushed the MoreUnixMonoCompatWork branch from 80c759a to 1b03ecb Compare January 17, 2019 15:07
* update reference version numbers and fix a null exception this causes (apparently something changes functionality-wise when the *.csproj references version 3.0.1.0 rather than the original 1.x.x.x (on windows at least) - which is interesting)
* Modified GTK_Gamepad to use OpenTK.Input.Gamepad
* use gamepad class if automap exists, otherwise use joystick class
* forgot GetFloats()
* fixed axis and hats - fixed GetFloats() so analog controls can be bound for cores that support it
* changed controller identifier from 'T' to 'J' (in the case of OpenTK.Input.Joystick) and 'X' (in the case of OpenTK.Input.GamePad). This means config defaults in most cases will work (where they worked before with directinput and xinput).
* fixed hat event detection when using OpenTK.Input.Joystick
* disabled forcing OpenTK controllers on windows
* unused variable cleanup
* testing changes
* another test
* other test
* revert previous tests
@Asnivor Asnivor added the re: Multiplatform Relating to the Linux and macOS ports (Mono Framework, and eventually .NET Core) label Jan 17, 2019
@Asnivor
Copy link
Contributor

Asnivor commented Jan 18, 2019

@YoshiRulz can you pull and test the last couple of commits?

To me it seems a fair enough solution (and works to kill off mono after BizHawk has disposed itself), but would like a second opinion as I am not really a linux guy :)

@YoshiRulz
Copy link
Member Author

oh yeah it does the same thing my one-liner did but on itself

@YoshiRulz YoshiRulz force-pushed the MoreUnixMonoCompatWork branch from 81cbfde to 901fdbd Compare January 20, 2019 05:50
YoshiRulz and others added 3 commits January 22, 2019 16:05
…ssues (#8)

(the Lua VirtualListView is still not functional on mono yet though)
Asnivor and others added 5 commits January 22, 2019 16:36
* TAStudio: refactored ready for GDI+ implementaton

* TAStudio GDI+: Implement DrawColumnBg

* TAStudio GDI+: implement DrawColumnText

* TAStudio GDI+: implement DrawBg

* TAStudio GDI+: Implemented remaining rendering methods

* TAStudio GDI+: Mitigate mono divide-by-zero errors (CellHeight is 0 for a while during instantiation)

* TASstudio GDI+: forgot uncomment for performance enhancing fun

* TAStudio GDI+: Implement option to switch inputroll renderer (on windows). Stored in global config and requires TAStudio restart to take effect

* TAStudio GDI+: fix renderer selection submenu for linux

* TAStudio GDI+: Fix alpha channel == 0 problems in GDIP_DrawCellBG()

* TAStudio GDI+: Modify renderer menu name...

... ala #7 (comment)

* InputRoll: GDI+ experiments with TextRenderer vs DrawString

* InputRoll GDI+: finish up appearance matching
* EmuHawk: Start of a new VirtualListView impl. This could go either way :/

* EmuHawk: PAVirtualListView - finish consuming InputRoll code, tidy and remove un-needed things (lagframes, horizontal rotation etc)

* PlatformAgnosticVirtualListView: started hooking up TraceLogger and debugging

* PlatformAgnosticListView: Some more work

* PlatformAgnosticVirtualListView: more public customization properties, working column re-ordering, and much other stuff I forget..

* PlatformAgnosticVirtualListView: Some more public appearance properties and control border

* EmuHawk: TraceLogger added AutoScroll menu option

* PAVLV: Added column resize functionality
@Asnivor
Copy link
Contributor

Asnivor commented Jan 25, 2019

@YoshiRulz merge this when you are ready in the fork, I am done there.

Looking forward to it not being pull requests all the way down :)

@YoshiRulz YoshiRulz changed the title [WIP] [🐧] Mono collab stuff [🐧] Mono work from fork Jan 26, 2019
@YoshiRulz YoshiRulz merged commit d9a69c0 into TASEmulators:MoreUnixMonoCompatWork Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: Multiplatform Relating to the Linux and macOS ports (Mono Framework, and eventually .NET Core)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants