Post subject: Bizhawk Common Lua Functions
CoolHandMike
He/Him
Editor, Judge, Experienced player (895)
Joined: 3/9/2019
Posts: 696
Video tutorial that shows commonly used Lua functions. Commonly Used Lua Functions File: http://tasvideos.org/userfiles/info/67950971431478997 Link to video
discord: CoolHandMike#0352
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
TAS Tutorial - Making Your First TAS, by The8bitbeast https://www.youtube.com/playlist?list=PLlJzD6wWmoXmihK13itZJ-mzjK3SD1EaM
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Post subject: BizHawk Lua Tutorial Recreate Inventory Menu
CoolHandMike
He/Him
Editor, Judge, Experienced player (895)
Joined: 3/9/2019
Posts: 696
BizHawk Lua Tutorial Recreate Inventory Menu From Zelda 2 Link to video Tutorial on using Lua to recreate an inventory screen in Bizhawk. Lua folder below. Remove the ".lua" extension then extract. That was a workaround to upload it. https://tasvideos.org/UserFiles/Info/637879278660691914 Custom NES Font link https://fontstruct.com/fontstructions/show/406653 Feedback is appreciated.
discord: CoolHandMike#0352
Editor, Skilled player (1536)
Joined: 7/9/2010
Posts: 1319
Posting this also here, since it's more fitting for BizHawk. Link to video
Favorite animal: STOCK Gt(ROSA)26Sortm1.1(rtTA,EGFP)Nagy Grm7Tg(SMN2)89Ahmb Smn1tm1Msd Tg(SMN2*delta7)4299Ahmb Tg(tetO-SMN2,-luc)#aAhmb/J YouTube Twitch
Post subject: TASing with Stylus in TAS Studio (Bizhawk emu for Melon, Ds)
C99
Joined: 5/22/2022
Posts: 1
Hi my speedruning community and I have been attempting to TAS a Ds game, but we can't work out how to move the stylus with TAS Studio. The tutorials I have been looking for didn't clarify it, and most of us are amateurs on TASing. Maybe we just missed the tutorial with said info clumsily, but anyhow, we haven't found it. How exactly can I move the Stylus? Beyond pressing the T, for Touch, we don't know how to move the stylus somewhere different than the center of the screen.
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
C99 wrote:
Hi my speedruning community and I have been attempting to TAS a Ds game, but we can't work out how to move the stylus with TAS Studio. The tutorials I have been looking for didn't clarify it, and most of us are amateurs on TASing. Maybe we just missed the tutorial with said info clumsily, but anyhow, we haven't found it. How exactly can I move the Stylus? Beyond pressing the T, for Touch, we don't know how to move the stylus somewhere different than the center of the screen.
Does this help? https://github.com/TASEmulators/BizHawk#analog-controls
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Post subject: Arcade (MAME) in Bizhawk Tutorial Idea Topics
CoolHandMike
He/Him
Editor, Judge, Experienced player (895)
Joined: 3/9/2019
Posts: 696
I want to make a tutorial(s) for using MAME in BizHawk. This post will list some ideas below. In a separate post then write up a subtitle script since those can be used with other languages. If there are any other ideas for how to explain or what to include for this please post below. 1) What is MAME. 2) What a MAME arcade game zip contains. 3) Difference between merged and unmerged game zips. Explain importance of making sure the rom files are from the same MAME rom set version. 4) How to determine if a game is good or not. 5) How to determine if a MAME arcade game zip needs extra files and how to put to together a zip that is missing contents. 6) Where to access dipswitches in Bizhawk 7) Show TasStudio input buttons like Coin and the unusual "!" inputs and explain those will have to be tested for functionality. 8) Show example of a multiplayer game. I have Megaman Power Battle 2 example. 9) Show analog controls. I could show Cyber Sled example. 10) How to use the multidisk bundler for multi disk games.. Show two examples of arcade games that require other files like chd files. Show how it works in MAME first. *Note still have not been able to use the other method of zipping with the same game name successfully. Might skip this unless someone else has a video of this working which I could just drop into this section. 11) Briefly show Ram watch. Explain to only use RAM areas. Do not use SystemBus since it may change values and cause a desync. 12) Briefly show Lua script that shows slowdown. I have a script that works for Karnov that does this. 13) ????? Anything else ????? Not sure if there should be anything else. Especially for troubleshooting.
discord: CoolHandMike#0352
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
CoolHandMike wrote:
I want to make a tutorial(s) for using MAME in BizHawk.
Thanks!!!
CoolHandMike wrote:
Note still have not been able to use the other method of zipping with the same game name successfully. Might skip this unless someone else has a video of this working which I could just drop into this section.
Just describe the steps you're doing and I'll check what's missing.
CoolHandMike wrote:
Do not use SystemBus since it may change values and cause a desync.
In such cases poke me so I add them to https://tasvideos.org/Bizhawk/MAME How does it happen in that one case?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Post subject: MAME Arcade Games in Bizhawk Video Tutorial + Readable Script
CoolHandMike
He/Him
Editor, Judge, Experienced player (895)
Joined: 3/9/2019
Posts: 696
Link to video https://www.youtube.com/watch?v=jHSa0JS9pf4&feature=youtu.be SRT file for the video https://tasvideos.org/UserFiles/Info/638460479306444404 Organized for readability but basically the script from the tutorial video. 1) What is MAME. MAME is a multi arcade machine emulator that emulates arcade machines, computer systems, and more. The user must supply the roms, software, and any other files needed like bios or extra data files such as chd. You can view the main MAME site at https://mamedev.org/ or for more documentation and resources from https://docs.mamedev.org/. However the main site I recommend for this tutorial is from http://adb.arcadeitalia.net/. Arcade Italia has a search for the games and will list the status and the files needed to run them along with other useful information. 2) What a MAME arcade game zip contains. MAME arcade zips will contain all the necessary files that completes the romset. Separate files in the form of chd files or bios files may be needed as well. 3) Difference between merged and unmerged game zips. Romsets for arcade games come in two main flavors, merged and unmerged. Merged romsets will combine the files together such that files are not duplicated. Non merged zips have all the files duplicated and this is what BizHawk needs. adb.arcadeitalia.net lists out the necessary files needed to create an unmerged zip if you are unable to find a nonmerged zip for your game. Keep in mind that MAME is updated frequently and many romsets change over time. It is important to get a romset from the same version to test. Otherwise the game might not work. 4) Game Status In Arcade Italia, Searching the title and looking at the game status is usually enough to determine if a game will run well.
  • Green means Good and should always work.
  • Yellow means Imperfect. There can be minor issues.
  • Red means Preliminary. This means that the rom may not work at all. You will have play through it to the end to check for play ability. These may not boot or may crash at certain points, or have minor graphical issues.
Make sure to always avoid games that have a "bad dumb" status. *If the save state shows not supported or imperfect BizHawk should still be able to use save states with the game perfectly. The way MAME is implemented in BizHawk would make the save states work regardless. *In BizHawk after loading the game there a clickable icon on the bottom left that will open up a popup with dump info. If the dump is good the icon will be a green checkmark if the game works perfectly or a red exclamation point. A question mark icon will be shown if the status of the loaded file is unknown. The question mark may appear when loading through xml. The info popup window will have information like the full name, the short name, resolution, aspect ratio, framerate, status of the dump, and the individual roms. 5) Example Running Some Games 5a) Karnov http://adb.arcadeitalia.net/dettaglio_mame.php?game_name=karnov&arcade_only=0&autosearch=1 Karnov has all Good status as well as being a good dump. Under the required files for MAME It only requires the main romset karnov.zip. Single romset games like this can be run by dragging and dropping the single romset zip into the BizHawk window. Another way to run is to use File -> Open Advanced -> In Arcade section click Launch Game. 5b) Area 51 http://adb.arcadeitalia.net/dettaglio_mame.php?game_name=area51&arcade_only=0&autosearch=1 Area 51 has all Good status as well as being a good dump. By looking in the required files on the page we can see that Area 51 also requires a CHD file in addition to the romset zip area51.zip. To run Area 51,
  • From the menu select Tools -> Multi-disk Bundler. The Multidisk Bundler creates an xml file that alllows Bizhawk to load multiple files at once.
  • Under the Name section select Browse. Browse the location you want the xml file to be created, name the file something like the same name as the game, and save.
  • Then Under the System dropdown select "Arcade".
  • Below that there is the areas to select the files that will be loaded. The Order is Romset, CHD, Bios files.
  • For the first file load area51.zip, and in the second load area51.chd.
  • Click Save, or Save and Run.
Once the xml file is created it does not need to be recreated to run the game. The xml file can be dragged and dropped into the Bizhawk window to load the game. Download area51.xml
Language: xml

<BizHawk-XMLGame System="Arcade" Name="area51"> <LoadAssets> <Asset FileName=".\area51.zip" /> <Asset FileName=".\area51.chd" /> </LoadAssets> </BizHawk-XMLGame>
5c) Guilty Gear XX http://adb.arcadeitalia.net/dettaglio_mame.php?game_name=ggxx&arcade_only=0&autosearch=1 Guilty Gear XX has a preliminary status but it is a good dump. There are screen shots so it should run, but this game might have serious issues. By looking in the required files on the page we can see that Guilty Gear XX requires the romset, a chd file, and various Bios files. To run Guilty Gear XX ,
  • From the menu select Tools -> Multi-disk Bundler. The Multidisk Bundler creates an xml file that alllows Bizhawk to load multiple files at once.
  • Under the Name section select Browse. Browse the location you want the xml file to be created, name the file something like the same name as the game, and save.
  • Then Under the System dropdown select "Arcade".
  • Below that there is the areas to select the files that will be loaded. The Order is Romset, CHD, Bios files.
  • For the first file load ggxx.zip
  • In the second load gdl-0011.chd.
  • Use the "Add" button on the bottom to add additional spots to add more files.
  • Go through and add the additional Bios files.
  • Click Save, or Save and Run.
Once the xml file is created it does not need to be recreated to run the game. The xml file can be dragged and dropped into the Bizhawk window to load the game. XML where all the files are in the same directory: Download ggxx.xml
Language: xml

<BizHawk-XMLGame System="Arcade" Name="ggxx"> <LoadAssets> <Asset FileName=".\ggxx.zip" /> <Asset FileName=".\gdl-0011.chd" /> <Asset FileName=".\jvs13551.zip" /> <Asset FileName=".\mie.zip" /> <Asset FileName=".\naomigd.zip" /> <Asset FileName=".\segadimm.zip" /> </LoadAssets> </BizHawk-XMLGame>
XML file example if the files are in different directories using relative paths. Relative paths may be phased out. The order is: Game -> CHD -> Bios *from Spikestuff Guilty Gear XX as a full example of that: Download ggxx.xml
Language: xml

<BizHawk-XMLGame System="Arcade" Name="GGXX"> <LoadAssets> <Asset FileName="..\Arcade\ggxx.zip" /> <Asset FileName="..\Arcade\ggxx\gdl-0011.chd" /> <Asset FileName="..\Arcade\Naomi Bios\naomigd.zip" /> <Asset FileName="..\Arcade\Naomi Bios\jvs13551.zip" /> <Asset FileName="..\Arcade\Naomi Bios\segadimm.zip" /> <Asset FileName="..\Arcade\Naomi Bios\mie.zip" /> </LoadAssets> </BizHawk-XMLGame>
6) Where to access dipswitches in Bizhawk Game options for most arcade games are changed through Dipswitches which are manual electric switches. Some games have an in game menu that can change settings however. To change dipswitch settings for a game in Bizhawk,
  • Load the game
  • Look at the top Bizhawk Menu Select Arcade -> Settings.
  • After making changes you should Reboot the core. Reboot the core by selecting Emulation -> Reboot Core.
7) Arcade Inputs In BizHawk go to Config-> Controllers. For Arcade games most require Coin inputs, then after inputting the number of coins the game needs to run an additional start button is needed. Coin and Start can be found on the Console tab. To map the other buttons select the relevant player. The number and type of controls can vary depending on the game. Buttons, analog controls, lightguns, and some games have up to 5 players. 8) Ram Search and Ram Watch Ram Search (Tools->Ram Search) and Ram Watch (Tools -> Ram Watch) work as well. For the Memory Domains use the RAM domains. The SystemBus can cause de-syncs just by searching and reading the values so avoid this. Available Memory Domains will depend on the game. A Tutorial for Ram Search https://www.youtube.com/watch?v=9pM1kG5uorA 8) TAStudio In the input roll "C" is for coin and the "s" is usually the service button which might lead to other options depending on the game. Emulated machines with a lot of different inputs may have "!" for inputs. To find what those are it is necessary to test them. Robotron 2084 is an arcade game example where lots of "!" inputs would need to be tested for functionality. To hide specific players like Player 2 inputs, in the TAStudio window select "Show Columns" then deselect the "Show Player 2" for example. Arcade games will not show lag frames with the red coloring in TAStudio. To change the frame's color a LUA script will be needed. Open up LuaConsole by Tools-> LuaConsole. A script will need to be added to list and made active. You can tell if the script is active if the green play icon is displayed next to the script name. The script needs an address that changes based on whether or not the game is accepting input. This is something game dependent. A ManualSetLag Script can be downloaded from the link below. Just change the address on line 15 in the memory byte read. This script currently only works with Karnov so make sure to input an address that works for your game. https://tasvideos.org/UserFiles/Info/638459887754146781 *Original script is from feos AKA vadosnaprimer Introduction to TAStudio https://www.youtube.com/watch?v=AzDjBO7_fWk An Introduction tutorial for Lua can be found here: https://www.youtube.com/watch?v=KUj4j0le6x8the A Tutorial for the Lua Console can be found here. https://www.youtube.com/watch?v=N0D-OogDJOI A Tutorial for Common Lua Functions can be found here: https://www.youtube.com/watch?v=g1yEtXz7UqY 9) Arcade Load Error Troubleshooting If you load a game that is incomplete it is most like a merged file. When you attempt to load the game it fails to load the arcade game.
  • File-> Open Advanced -> "Launch Game" from the Mame Arcade area.
  • A "Choose File from Archive" window will pop up with the list of roms in the romset. This means the file has some sort of problem like being incomplete.
  • Click Cancel
  • An "Arcade Load Error" popup will appear that will list exactly the issue.
  • This will usually tell you the roms that are missing. If this is the case find a non merged romset zip for the game. Or you could find the missing files and add them to the romset zip. Make sure you also are getting the zips from the same MAME romset release version. MAME is frequently updated so trying to mix and match roms from different release sets may not work.
*Screenshots below show an example of a failed load using a merged romset zip of Karnov. It is missing several roms. Get a nonmerged romset or find the missing roms and add them to the merged romset zip to run in BizHawk. 10) Missing Dipswitch Options Troubleshooting If some Dipswitch options are missing from the Arcade -> Settings menu, then make sure that you are using the latest version of Bizhawk. One game that does not give BIOS selections is Fatal Fury 3 for Arcade for some older Bizhawk versions when it should. Upgrading to the latest Bizhawk version fixed that issue and displays the BIOS options in Fatal Fury 3 for example. 11) "Fatal error InvalidOperationException" OR "A single state must not be larger than buffer" Troubleshooting Using Bizhawk 2.9.1, This only happens with Naomi titles as far as is known due to their large save states. Eventually as the savestates get larger there comes a point when the default savestate settings are not enough and a fatal exception is thrown. If this happens:
  • In TAStudio go to Metadata -> Savestate History Settings
  • Increase the "Gaps Buffer - Size". Double it to test.
  • Click Ok
  • When prompted to Keep Old States click Yes. A "System.IO.IOException: A single state must not be larger than the buffer" error will occur is the increased amount was not enough.
  • Increase Gaps Buffer - Size more if you received the above error.
More information here: https://github.com/TASEmulators/BizHawk/issues/3898
discord: CoolHandMike#0352