-
Notifications
You must be signed in to change notification settings - Fork 10
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
Game info display #12
Comments
Hey that sounds awesome but I have no idea if it's possible and how 😆 |
Neither - I've done zero with Windows UI. May have a play, while Andy is fighting with his multi monitors :) |
This imo is the best part of the screensaver - it's amazing how many games I'd forgotten about or never tried and the screensaver reminded me... |
Just had a look at the docs - there is a command line |
What are you doing reading documentation?! 😉 I thought that flag was intended to overlay repeating CRT screen grilles etc.? Anyway, I'll see what can/can't be done. If that can be (mis)used, it might be a nice fallback. |
It looks like the approach is to hook into Direct3D to provide overlays. Marginally terrifying. |
@nullpainter the |
I haven't actively looked at it yet. I just have a sneaky feeling it tiles images and may assume images are in a MAME directory. Also, it seems cleaner to render text directly than to save to a temporary image first (which would then need cleaning up) |
Yeah, as suspected:
Not really fit for purpose, I think. |
But that's okay! Playing with Direct3D sounds fun 😀 |
Sure but then only if they are using the D3D renderer will it work, which is why I thought using mames built in artwork/overlay functionality might help. This seems to give some options - http://wiki.mamedev.org/index.php/LAY_File_Basics_-_Part_I although it implies dynamically creating these files for each game maybe... |
That is true. D3D is the default for MAME builds for Windows, but I take your point. Dynamically creating files is fine if there isn't a more elegant solution. I'm having a play with D3D overlays to see how straightforward it is with supporting libraries. |
🍀 Good luck man - doesn't look easy |
http://docs.mamedev.org/techspecs/luaengine.html also sounds promising:
(emphasis mine) |
Hey that's pretty cool! Seems all the functions are in https://github.com/mamedev/mame/blob/master/src/frontend/mame/luaengine.cpp - and yeah pretty barebones functions for writing text... |
Although - even this simple text is not too bad - could be a good phase 1 |
If you create a .bdf font and place it in the same directory as the mame executable, you can reference it via the command-line. Here's an example with a font nasty enough to demonstrate that it's picked it up 😆 I originally had visions of a smart and thin semi-opaque overlay spanning the screen, with bold and regular weight text for some typographic interest. Sigh. Finding a decent-enough font may indeed by a good starting point. Also of note is that the LUA dimensions are relative to the game itself (so, text is always overlaid on graphics) Unfortunately, the D3D overlay route seems remarkably fiddly, particularly for full-screen applications, and there doesn't appear to be any nice nuget package providing handy abstractions which work for non-windowed apps. The approach appears to be to create a new D3D dll, place it in the same folder as the executable so it's picked up instead of the system D3D dll, and use this to render what you need and also delegate to the real dll. 😶 |
This approach tentatively look promising, but I fear its limitations may be the death of it (the text is rotated 90 degrees for vertical games!) machine = manager:machine()
system = machine:system()
screen = machine.screens[":screen"]
text = system.description .. " / " .. system.manufacturer .. " (" .. system.year .. ")"
-- TODO consider using mame_manager:ui():get_line_height() to get font height to do
-- proper calculations (or find a way to get screen resolution either in LUA or injected)
xPos = 5
yPos = screen:height() - 10
function draw_hud()
-- FIXME need to work out a fix for rotated screens - tempest, for example, results in vertical text
screen:draw_text(xPos, yPos, text)
end
emu.register_frame_done(draw_hud, "frame") |
Yeah it could work as a simple notice or a stop gap - but if you want something fancier, maybe have another look at bezels, artworks and layouts - could be the answer since it allows you to create your own image... |
Of course it's probably not out of the question to ask the mame team to add missing functionality or send in a PR... |
I think I will. I've been resisting thus far as it didn't sound as elegant, but I think you're right.
Yes, I was intending to do that also. |
Good news! I've created a PoC which:
I've added a rotation attribute to The game name and details are displayed at the bottom of the screen and the layout scales the game slightly so the bezel doesn't overlap any game elements. The layouts and bezels are written to a temporary directory which is cleaned up after the screensaver exists. The Mame invocation adds an additional This all sound a reasonable direction? |
That sounds brilliant! Can't wait to check it out? Can you make a PR so thet appveyor can make a build? |
Yes! All finished! Just doing a final sanity check 😄 |
Done. I tried to keep the commits self-contained so you can see what I changed. I noticed that the |
Nah - I got 2017 too |
I was watching some games today, didn't know what they were and was thinking that instead of the current splash screen and its associated 10s delay, it may be far nicer to overlay the same details while each game is playing.
Is this something you had considered? What are your thoughts? I'm assuming it's possible...
The text was updated successfully, but these errors were encountered: