Main > Main Forum

Marble Madness trackball settings in MAME

Pages: << < (3/3)

mimic:

I somehow totally disregarded the links... ooops?

Anyway just tested the Crystal Castles the 29 doesn't work more like double that works nicely.

My head hurts from all of it. I need others to figure out these kind of things for me. That's why I'm not a rocket scientist. I'm gonna take a break now.

knightrdrx:

what feels right to me is playing with a NES controller. That's how I played it growing up and I got very good at keeping the ball straight.
I tried with a trackball and it is tiring! Plus I don't think there's a turbo speed button like the NES version has?  Or maybe there is and I never looked at the mapping.

DarthMarino:


--- Quote from: knightrdrx on June 14, 2015, 11:11:31 pm ---what feels right to me is playing with a NES controller. That's how I played it growing up and I got very good at keeping the ball straight.
I tried with a trackball and it is tiring! Plus I don't think there's a turbo speed button like the NES version has?  Or maybe there is and I never looked at the mapping.

--- End quote ---

The turbo button = roll the ball faster. They had to add the button on many of the ports like NES so you could have more control with a digital d-pad.  It's not necessary with a trackball.

p1mrx:


--- Quote from: knightrdrx on June 14, 2015, 11:11:31 pm ---what feels right to me is playing with a NES controller. [...] Plus I don't think there's a turbo speed button like the NES version has?

--- End quote ---

In order to play Marble Madness on my MAME cabinet with 8-way sticks, I wrote this Lua script that adds fast and slow buttons:


--- Code: ----- mame marble -autoboot_script marble.lua
-- Set all Analog inputs to "None" in the menu.

players = {
  {x_port = ":IN0", x_field = "Trackball X",
   y_port = ":IN1", y_field = "Trackball Y",
   prefix = "JOYCODE_1_",
   xv = 0, yv = 0, text = ""},
  {x_port = ":IN2", x_field = "Trackball X 2",
   y_port = ":IN3", y_field = "Trackball Y 2",
   prefix = "JOYCODE_2_",
   xv = 0, yv = 0, text = ""}
}

function process_input(p)
  local x_port = manager.machine.ioport.ports[p.x_port].fields[p.x_field]
  local y_port = manager.machine.ioport.ports[p.y_port].fields[p.y_field]
  local input = manager.machine.input

  local delta = 16
  p.text = "normal"

  if input:code_pressed(input:code_from_token(p.prefix .. "BUTTON1")) then
    delta = 64
    p.text = "fast"
  elseif input:code_pressed(input:code_from_token(p.prefix .. "BUTTON2")) then
    delta = 4
    p.text = "slow"
  end

  if input:code_pressed(input:code_from_token(p.prefix .. "XAXIS_LEFT_SWITCH")) then
    p.xv = (p.xv + delta) % 256
    x_port:set_value(p.xv)
  end
  if input:code_pressed(input:code_from_token(p.prefix .. "XAXIS_RIGHT_SWITCH")) then
    p.xv = (p.xv - delta) % 256
    x_port:set_value(p.xv)
  end
  if input:code_pressed(input:code_from_token(p.prefix .. "YAXIS_UP_SWITCH")) then
    p.yv = (p.yv - delta) % 256
    y_port:set_value(p.yv)
  end
  if input:code_pressed(input:code_from_token(p.prefix .. "YAXIS_DOWN_SWITCH")) then
    p.yv = (p.yv + delta) % 256
    y_port:set_value(p.yv)
  end
end

frame_sub = emu.add_machine_frame_notifier(function()
  process_input(players[1])
  process_input(players[2])
end)

emu.register_frame_done(function()
  local s = manager.machine.screens[":screen"]
  s:draw_text(280, 5,
              "P1: " .. players[1].text .. "\nP2: " .. players[2].text,
              0xFFFFFFFF, 0xFF000000)
end)

--- End code ---

The same technique can control any game with analog inputs.  I briefly experimented with a script for Super Off Road where you spin the stick to emulate a steering wheel, but that was too ridiculous to be practical.

KenToad:

http://forum.arcadecontrols.com/index.php/topic,164121.msg1729123.html#msg1729123

That thread has all the settings for trackball games in MAME and an explanation of the methodology.

Pages: << < (3/3)

Go to full version