Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Issues with MSVC 2015/Allegro 5.1.13

Reply to topic
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14688
  • Location: London
Reply with quote
Issues with MSVC 2015/Allegro 5.1.13
Post Posted: Mon Mar 21, 2016 10:30 am
I'm trying to compile Meka in VC 2015 (current latest MSVC). A defining feature of this version seems to be that the linker is very fussy about matching CRTs, which has lead me to build using the Allegro NuGet package. This is actually super nice - it is a pre-built set of libs and a nice UI for picking the addons, and there's no setting of paths or adding libs to be done. If you build monolithic, you get zlib for free. So that makes the Windows build super easy.

However, it seems to be more fussy than the 5.0.10 Meka is on - which is maybe why there's an aborted upgrade to 5.1.7 in the history. For one thing, it seems to now fail to load any bitmaps until after the display is created. The Allegro docs suggest this is heavily recommended against (as they then don't get put in video memory), but now it seems to fail. Reordering the startup fails due to ordering dependencies, but creating a dummy display gets the program running.

Next, I'm getting hangs when destroying displays - either my dummy one, or on shutdown, or when changing to fullscreen. I get occasional hangs with the official Meka build too, which may be related.

This is rather painful to debug - Allegro isn't very helpful when things go wrong, and I can't step into it. Has anyone else made more progress? Bock, when you recover from GDC, why did the previous upgrade fail? The NuGet package doesn't exist in older forms, and it's painful to build it myself...
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Mar 21, 2016 4:12 pm
I don't remember that I had tried a new version neither why I have reverted it, but I suppose I should just go and try to upgrade. I may upgrade to e.g. 2012 perhaps 2015 is a little too new?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14688
  • Location: London
Reply with quote
Post Posted: Mon Mar 21, 2016 6:54 pm
Newer is better :) or at least, it avoids me having to install another VS. The C compiler seems better in a few nice ways, and caught a few trivial bugs at least.

I'll keep persisting, I can at least run something, it just hangs on shutdown. Thus I can in theory make my PR to fix the cycle timings, which is how I got into this mess in the first place. I'll try to submit one for the NuGet part, so you can see what it does for you, but first I need to make it non destructive to the existing projects.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Mon Mar 21, 2016 7:42 pm
Looking at it now.
2012 is relatively new I don't expect issues using 2015 on a 2012-tested project.
Too new also means less accessible out of the box. Ideally should ditch .sln and get them generated.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14688
  • Location: London
Reply with quote
Post Posted: Mon Mar 21, 2016 9:08 pm
WLA DX has gone that way, using CMAKE. CMAKE seems the least worst option for cross platform builds - and it's pretty bad IMO. (Maybe OK if you come from a world of ./configure; ./make; ./make install etc but horrific for me.) It generates ugly MSVC projects, which hook in to check the underlying makefiles before building, but at least stuff builds.

Here's the Allegro tutorial on the NuGet part - I recommend having a go, as it changes it from a chore to trivial to get the dependencies:

https://wiki.allegro.cc/index.php?title=Windows,_Visual_Studio_2015_and_Nuget_Al...

...so long as it stays supported. Obviously you can fear having a remote item deleted and breaking your stuff. You can always take a copy of the .nupkg files as a backup.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Mar 22, 2016 10:29 am
Might use genie from https://github.com/bkaradzic/bx
Windows/OSX/Linux exe provided in bin/ (3 files)
+ Lua-ish configuration files
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Mar 22, 2016 11:08 am
Last edited by Bock on Tue Mar 22, 2016 11:12 am; edited 1 time in total
I have pushed a bunch of fixes to catch up and build/link with MSVC 2013
Having same problem as you with hangs on any call to al_destroy_display() right now :(

*EDIT* Interestingly it happens with both Directx and OpenGL backends
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Mar 22, 2016 11:10 am
Allegro is just an old crumbly library, we should ideally switch to GLFW perhaps SDL (also crumbly but much less so).

If I were to redo the GUI with ImGui it would remove a lot of the Allegro code (along with removing a lot of old horrible Meka GUI code and be much much efficient) so maybe that should be a step 1.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8644
  • Location: Paris, France
Reply with quote
Post Posted: Tue Mar 22, 2016 11:48 am
Fixed now, destroying all video bitmaps before destroying any display.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!