BizHawk icon indicating copy to clipboard operation
BizHawk copied to clipboard

Arcade Top Landing ignores analog input

Open danylopez123 opened this issue 3 months ago • 7 comments

Summary

There are some MAME roms that throws an error trying to load them, most of the roms loads just fine even with the Multi-disk Bundler but only a few throws an Arcade error.

This problem happened to me with the following roms:

  • gtmr2.zip
  • hcrash.zip
  • topland.zip w/ clone toplandj.zip

[There's probably more but these are the roms i had]

Repro

  1. Try loading one of the roms mentioned above, they don't need to use the Multi-disk Bundler (Ecept for toplandj.zip)
  2. Throws the Arcade error

Output

Example from topland.zip

System.ArgumentOutOfRangeException: range end < start
Nombre del parámetro: endInclusive
Valor actual 2047.
   en BizHawk.Common.MutableRange`1.Overwrite(T start, T endInclusive) en /src/BizHawk.Common/Ranges.cs:línea 51
   en BizHawk.Emulation.Cores.Arcades.MAME.MAME.GetInputFields() en /src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs:línea 77
   en BizHawk.Emulation.Cores.Arcades.MAME.MAME.StartMAME(List`1 roms) en /src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs:línea 235
   en BizHawk.Emulation.Cores.Arcades.MAME.MAME..ctor(CoreLoadParameters`2 lp) en /src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs:línea 72
--- Fin del seguimiento de la pila de la ubicación anterior donde se produjo la excepción ---
   en System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   en BizHawk.Emulation.Cores.CoreInventory.Core.Create(ICoreInventoryParameters cip) en /src/BizHawk.Emulation.Cores/CoreInventory.cs:línea 144
   en BizHawk.Client.Common.RomLoader.MakeCoreFromCoreInventory(CoreInventoryParameters cip, String forcedCoreName) en /src/BizHawk.Client.Common/RomLoader.cs:línea 433

Host env.

  • BizHawk 2.11 (No DEV build); Win11 Home 24H2; NVIDIA
Image

danylopez123 avatar Oct 03 '25 13:10 danylopez123

this is what confuses me too. I am not all familiar with mame and emulating arcade games. Its very confusing to me, while some games work just fine. Others give me these kind of errors.

adviseore avatar Oct 03 '25 14:10 adviseore

This maybe? https://github.com/TASEmulators/BizHawk/blob/7a92ce78d8b7499cf6e23925a8c85b87a9375eb1/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.IInputPollable.cs#L75-L77

YoshiRulz avatar Oct 03 '25 14:10 YoshiRulz

For the first two, the issue is that two input axes have the same... name? (field value in the code).

Image

As you can see there are two "paddle"s with a different tag, but we're using the ioport_type as key, so you get a System.ArgumentException. The relevant input definitions for these games are here: hcrash and gtmr2.

For the third game, the input definitions seem incorrect. Maybe mame handles this correctly but it's not clear to me from the source code. The minimum and maximum values are defined as PORT_MINMAX(0x0800, 0x07ff) which resolves to 2048, 2047. I assume this is supposed to be -2048,2047 where bit 0x800 is negative. Source: https://github.com/mamedev/mame/blob/17324c3451e87146d3f18613cdfe77ef2f43ce8d/src/mame/taito/taitoio_yoke.cpp#L67-L76

Image

Morilli avatar Oct 03 '25 21:10 Morilli

Same name under different tags happened with dip switches iirc, I added tag to name to resolve it, could be done here too. Or even nicer, whenever dupes are found we could add tags to all of them.

vadosnaprimer avatar Oct 04 '25 08:10 vadosnaprimer

So I'm guessing based from @Morilli 's comment, the reason why it caused the load error, in short words: it's because of duplicates and incorrect handle of a certain control.

Also, for that third problem, seeing the comment from that Taito Yoke, 2 other games uses the same control type: Midnight Landing and Air Inferno, if i can't launch Top Landing because of that, then those other 2 games (mlanding and ainferno) should throw the load error as well, haven't tried them because i don't have the roms.

danylopez123 avatar Oct 04 '25 20:10 danylopez123

If I start decrementing those values in topland, they go from 4096 to 2048...

vadosnaprimer avatar Nov 09 '25 20:11 vadosnaprimer

SegaSonic the Hedgehog and Top Speed are kinda similar to this in that MAME ignores analog lua inputs, but it's hard to tell if the same fix will work for them all. Mentioning them here for posterity.

vadosnaprimer avatar Nov 23 '25 20:11 vadosnaprimer