Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Bgoulette

Pages: 1 2 [3] 4 5 ... 8
General / Re: AM hangs on exit from MAME
« on: January 17, 2019, 02:24:16 PM »
Thanks again, progets, but nothing there made a difference in my setup. So I just downloaded AM again and set up a new folder. And now things seem to be working. I must have screwed something up, but I have no idea what! At least it's working again! I appreciate your time.

General / Re: AM hangs on exit from MAME
« on: January 17, 2019, 03:19:52 AM »
Thanks, progets. Removing the exit_hotkey line did not fix things: in fact, whether it's because of that or not, removing that line seemed to prevent AM from showing up in Task Manager at all -- I had to restart my machine to get it to close!

I'm using AM 2.5.1, and I'm happy to provide any other files or info that might assist in figuring this out. Thanks again!

General / Re: AM hangs on exit from MAME
« on: January 16, 2019, 06:40:15 PM »
Me again. Still no idea what I need to do (or even try next) to fix this constant crashing after exiting from Mame. Has no one else run into this and managed to solve it? Thinking I might have to gut my AM install and start over. Ugh. :(

Scripting / Re: A few questions about do_nut and referencing tables
« on: January 15, 2019, 05:40:57 PM »
All right, read the Squirrel docs a little more carefully and discovered I was attempting to assign "slots" (which I still think of as properties or attributes) the wrong way. Changing things up to something like the following seems to work:

Code: [Select]
this.rom_1942 <- { btn1 = "Fire", btn2 = "Loop };

Still have no idea about add_transition_callback :(

Wrapping my function name in quotes. That's what I was missing. Wow. Seems to be working now!

Scripting / A few questions about do_nut and referencing tables
« on: January 15, 2019, 06:01:59 AM »
Hey everyone.

Some relevant history: I used to live my life in Flash, particularly ActionScript, so most of my [limited] coding experience stems from that bygone era. I mention that because I'm having some trouble figuring out how to do a few things.

I have a .nut in which I'm placing a bunch of objects -- tables in Squirrel-speak, right? When I place the following in my layout.nut: fe.do_nut(filename.nut), which contains a few tables, if I try to access those tables later in my layout, I get a message saying they don't exist. Am I misunderstanding how do_nut works?

Second, in this external file (and I've tried in the main layout.nut, too), my objects (tables?) have names like rom_1942 or rom_bgaregga. What I'm trying to do is, on transition (that's another bag of fun I haven't figured out), combine the prefix rom_ with the results of fe.game_info(Info.Name) to access the equivalent table and its slots (e.g., rom_1942.btn1). Is there a way to reference a table when its name is composited like that? In javascript, I could do something like this:

Code: [Select]
var rom_1942 = { "btn1": "Fire", "btn2": "Loop" };

var pref = "rom_";
var romname = "1942";

console.log(window[pref + romname].btn1); // Outputs "Fire"

I'm partially thinking out loud here, and I don't have access to my AM machine right now...I guess my question about accessing indeterminate objects is what's the right way to access them? Could I use fe[pref + romname] and read its properties that way?

And since I'm here and rambling, are there any good, initially simple examples of how to get fe.add_transition_callback() to work? I've done something like this with no results:

Code: [Select]
function doStuff (ttype, var, ttime) {
    print ("ttype: " + ttype); // Never fires?
    return false;



Clearly, I don't know what I'm doing. Thanks for any advice or insight!

General / Re: AM hangs on exit from MAME
« on: January 14, 2019, 04:40:12 PM »
I tried deleting attract.cfg and letting AM rebuild it, but I still get the hang on exit. Mame works fine when running it through the command line or through the ui: it appears to be something with the way Mame and AM interact.

Any other thoughts? Help, please! Thanks!

General / Re: AM hangs on exit from MAME
« on: January 13, 2019, 07:38:13 AM »
Thanks for the suggestion, but that doesn't seem to be it. (Unless there's more to turning it off than unchecking it?) I'm still getting the hang after exiting a game: the system doesn't return me to AM, it just sits there until I manually kill AM from Task Manager. Any other thoughts?

General / AM hangs on exit from MAME
« on: January 11, 2019, 09:56:57 AM »
Hey all,

I'm not sure what I did, but whereas AM used to work just fine when exiting from Mame, now, it hangs, and I have to open the task manager and kill AM. I'm almost positive I read something about this previously, but if I did, I can't remember the search terms, because I'm not seeing any results.

I'm running the latest AM with mame64 on Windows 10. AM is running in the default (fillscreen) window mode. But none of the modes work like they should -- even windowed hangs.

I'm attaching my mame.cfg and attract.cfg files, just in case someone can spot something weird in there, but they look pretty standard to me. Thanks for looking!

Scripting / Re: shader-module: First official release
« on: January 10, 2019, 11:07:22 PM »
Not sure if there's any use/interest in the following -- or if it's cool to use, since I largely stole it from Shadertoy and modified it to work in AM. (Attribution included in shader file, fwiw.) In any case, it's a simple radial blur filter:

Code: [Select]
// Radial blur (simplified) for AM
// Modified for AM based on "Radial Blur (simplified)" by hunter
// (, itself, per hunter's
// comment, "A simplified version of:"
uniform sampler2D sampleTex;
uniform float amount = float(80.0);      // 80
uniform vec2 start_pos = vec2(0.0, 0.0); // -1.0 to 1.0 for x, y
uniform vec2 rez;                        // typically fe.layout.width. fe.layout.height
uniform float g_punch = float(1.01);     // Subtle gamma boost (use < 1.0 for gamma reduction?) [Currently not user-defineable]

vec3 deform( in vec2 p )
    vec2 uv;
    uv.x = sin( 0.0 + 1.0 ) + p.x;
    uv.y = sin( 0.0 + 1.0 ) + p.y;
    return texture( sampleTex, uv * 0.5 ).xyz;

void main()
    vec2 position = -1.0 + 2.0 * gl_FragCoord.xy / rez.xy;
    vec2 current_step = position;
    vec2 direction = ( start_pos - position ) / amount;
    vec3 total = vec3( 0.0 );
    for( int i = 0; i < int( amount ); i++ )
        vec3 result = deform( current_step );
        result = smoothstep( 0.0, 1.0, result );
        total += result;
        current_step += direction;
    total /= amount;

gl_FragColor.rgb = vec4(total * g_punch, smoothstep(0.0, 1.0, b));

I even added a class for keilmillerjr's Shader module:

Code: [Select]
class RadialBlur {
// Accepts the following arguments (order matters!) (defaults are listed in parens):
// amount (100)
// origin (0.5, 0.5) [coords are 0, 0, to 1, 1]
// resolution (layout dimensions)

shader = null;

constructor(...) {
shader = fe.add_shader(Shader.Fragment, shadersDir + "radialBlur.fsh");
if (vargv.len() == 0) set_default();
if (vargv.len() == 1) set_default(vargv[0]);
if (vargv.len() == 3) set_default(vargv[0], vargv[1], vargv[2]);
if (vargv.len() == 5) set_default(vargv[0], vargv[1], vargv[2], vargv[3], vargv[4]);

function set_default(a=100, sx=0.5, sy=0.5, rx=::fe.layout.width, ry=::fe.layout.height) {
// Get normalized coords for blur origin (0.0~1.0 vs. -1.0~1.0):
// (Adjusting center introduces some weird edge stuff sometimes?)
sx=-((2 - (sx * 2)) - 1);
sy=((2 - (sy * 2)) - 1);

shader.set_param("amount", a);
shader.set_param("start_pos", sx, sy);
shader.set_param("rez", rx, ry);

And here's how I'm using it (after loading the Shader module and adding radialBlur.vsh to the shaders folder):

Code: [Select]
local radialBlur = RadialBlur(150, 0.31, 0.37);
paBackground.shader = radialBlur.shader;

I'm attaching the shader and an example image to this post. I'd like to try to introduce some more dynamism: on images (or videos) with large swaths of static content, it's not terribly impressive. Maybe introducing noise or something would spice it up some? The thing is, I only know enough about GLSL to usually muck things up! Part of learning, I guess! ;-) [Full disclosure: I was trying to get a 2-pass Gaussian blur filter to work, but I couldn't trick it into working!]

Scripting / Re: "Magic" Tokens and weird results [ toupper() ]
« on: January 09, 2019, 03:23:08 AM »
Something fishy is going on related to "\n" character: look at this simple layout:

I thought that, too, but even ditching the newline produces weird, arbitrary-looking results for me!

Here's the layout I'm working on. It's still a wip, but it exposes everything I'm doing, in case it's me screwing up (attached). Sometimes it looked like something in the expansion just gets tired and spits back the un-magic token. Or even just a part of it. Weird! Thanks for looking!

Scripting / "Magic" Tokens and weird results [ toupper() ]
« on: January 08, 2019, 09:18:46 PM »
This is really weird.

I want certain game details returned in uppercase text. I discovered the toupper() function, but when running magic token text through a magic token function (e.g., [!getTitle]), sometimes it looks like it works, other times it returns a bunch of weird junk: an odd mixture of "magic-less" token parts and who knows what else.

Here's what I've coded:

Code: [Select]
function getTitle () { return fe.game_info(Info.Title).toupper(); }
function getMfr () { return fe.game_info(Info.Manufacturer).toupper(); }
function getPlayedTime () { return fe.game_info(Info.PlayedTime).toupper(); }
function getName () { return fe.game_info(Info.Name).toupper(); }
function getEmu () { return fe.game_info(Info.Emulator).toupper(); }

function getStatus () {
    if (fe.game_info(Info.Status).len() < 1) {
        return "";
    else {
        return "; " + fe.game_info(Info.Status).toupper();

And here's the line where I'm trying to populate my text instance:

Code: [Select]
local _gameInfo = fe.add_text("[!getTitle]\n© [Year] [!getMfr]\n[Players] PLAYER(S)\nPLAYED FOR [!getPlayedTime]\n[!getName]; [!getEmu][!getStatus]", 228, 880, 704, 136);

I tried adjusting the line breaks, adding whitespace, etc., but the fact is, it just doesn't work as-is. I'm not sure if I'm missing something or if there's a hiccup with getting the "processed" text from the magic token function(s).

If there's a simpler way to do this, I'm all ears. I tried chaining .toupper() directly to my tokenized string, but that just returned an uppercase version of the untranslated tokens. :shrug:

Here's a pic of some of the results (attached). Thanks for any help!

General / Re: New user here and many questions.
« on: January 07, 2019, 11:03:55 AM »
It looks like what happened with my latest AM install: the romlist generator (I'm not at my PC right now: forgive misleading terms!) included all the devices and drivers in its mame.txt file: that's what it looks like you're seeing based on your screen shot.

Good point! I remember when I set up my MAME + AM system I put all the actual game roms in one folder and all the devices, bioses etc in another folder. Then MAME settings point to both folders, while AM ROM folder setting only points to the "actual games" ROM folder. In this way you should clean up the romlist from drivers etc

This is such a great idea, I'm ashamed I didn't consider it! Probably because I'm not sure how. I'm relatively new to mucking with mame.ini: is that where you point to the drivers, etc.? (in addition to the roms themselves?)


zpaolo11's suggestion sounds a lot less labor-intensive, but because I started with a small number of roms, it was a small matter to remove the items I recognized as devices/drivers and test anything else on a per-"rom" basis. With a full set...yeah, I wouldn't want to deal with that, either! I'd pursue zpaolo11's idea!

General / Re: New user here and many questions.
« on: January 07, 2019, 06:54:52 AM »
Hey Autotec,

It looks like what happened with my latest AM install: the romlist generator (I'm not at my PC right now: forgive misleading terms!) included all the devices and drivers in its mame.txt file: that's what it looks like you're seeing based on your screen shot. (Should be under attract/emulators/mame.txt, or something close to that.) I have a relatively small subset of games (no full romsets), so it wasn't too bad for me to go in and manually delete the offending lines. You can always comment out anything suspicious with a pound sign if you're not sure what it is.

Quote from: rand0m
Is there any reason you are not opting for Retroarch? It offers a lot of good things.

It's probably a lack of knowledge on my end. I'm mostly interested in arcade (vs. console) games, so I compiled MAME and goofed around with demul, and that handles most of my interests. RetroArch just seemed like immense overkill for my interests. That said, I just downloaded it. :)

Made a couple more tweaks:

Code: [Select]
#SingleInstance, force
SetTitleMatchMode, 1

ScreenW := A_ScreenWidth
ScreenH := A_ScreenHeight
FontSize := 64

SubTextY := (ScreenH - FontSize) / 2

; Move the mouse to the bottom right:
MouseMove % ScreenW, ScreenH, 0

; Display a single image as a SplashImage:
SplashImage, , b w%ScreenW% h%ScreenH% x0 y0 zw%ScreenW% zh%SubTextY% fs%FontSize% ctWhite cwBlack, Loading..., , demulSplashWindow, OneTwoPunchBB-Italic

RomName := A_Args[1]
Run %ComSpec% /c "demul.exe -run=naomi -rom=%RomName%", , Hide
; Run %ComSpec% /c "demul.exe -run=naomi -rom=mvsc2", , Hide

; When demul.exe loads a rom, its title changes to a string beginning with gpuDX11hw:
; (Could change dep. on DirectX ver., but just checking the process jumps the gun)
WinWaitActive, gpuDX11hw, , 10
SplashImage, Off
Send !{Enter}

#IfWinActive, ahk_exe demul.exe
    WinClose, A


No external image file needed: I didn't realize ahk's SplashImage can be left blank and a background color provided as an option. This works for me! (in conjunction with the following batch file):

Code: [Select]
@echo off
dfs.exe %1

Unrelated (well, partially), but Reicast: is it possible to use without retroarch? I'm really an emulation noob, so I apologize if that's a stupid question!

Pages: 1 2 [3] 4 5 ... 8