Commit Graph

1624 Commits

Author SHA1 Message Date
brandman211 d1b00e6d4d Added my converted ButtonCount.lua script (Original here: http://code.google.com/p/brandon-evans-tas/source/browse/Lua/ButtonCount.lua)
-As you'll recall, the script has 3 methods of keeping track of input:
--1. Tracking the button counts in real time. This took some minor adjustments, but seems to work fine.
--2. Parsing the button presses from a loaded, read-only TAS file when starting the script, if possible.
---This works well enough after a good amount of refactoring, but I only have it rigged to work for NES.
---As always, note that this method is very slow for big movies, which is why we only use it once.
--3. Caching the counts when saving a state and loading them when loading a state.
---savestate.registerload and savestate.registersave are not currently supported by BizHawk, so this is not functioning at all.
-I propose that a function called movie.getframe(frame) be added that gets status of all of the buttons, just like joypad.get(), for a given frame of a movie.
--This makes the would make method 2 trivial and fast.
--It would allow me to generalize the function for all platforms easily.
---Certainly there might be some discrepancies about which buttons should be disallowed, if any (Is Reset a button press?), but still. 
--If this method could somehow work for non-readonly movies, then I'd be able to use the movie to get the counts when I load a state that doesn't have cached data.
---Trust me when I tell you that this would be immensely useful for minimum button TASing. The process would be seamless, and all of these methods combined would provide perfect accuracy while being fairly efficient and only using intensive routines when absolutely necessary.

Note: Earlier, I came up with the idea for a function that lets you set what frame of the movie you are on, which would be useful for endless TASes like we've already discussed, adelikat. Do you still think this is worth having?
2012-03-27 06:44:47 +00:00
rolanmen1 36c4dee7b8 Show Errors On Lua In The Output Box More Accurately 2012-03-27 03:34:21 +00:00
zeromus b7eaa1eaf7 luainterface - throw exceptions when lua_resume errors 2012-03-27 03:15:57 +00:00
adelikat 5d483b9e55 revamp rbi baseball script for bizhawk special functions, such as sending script info to the output window. And right aligning display stuff 2012-03-27 02:56:59 +00:00
adelikat 701e0823d5 Really fix PunchOutStats.lua 2012-03-27 02:26:01 +00:00
adelikat 9e0e6407b3 Revamp the Punchout stats using the anchor property of gui.text() 2012-03-27 02:17:17 +00:00
Rolanmen1 adfa18694e Text Alignment Parameter Can Be Either Int Or Either A String 2012-03-27 01:49:27 +00:00
brandman211 e9bb960902 Removed .fm2 / .mc2 from the Play Movie dialog. 2012-03-27 01:39:06 +00:00
adelikat 3f83614629 Overhaul anchoring of messages on screen, anchor right now right aligns, and the x value is the number of pixels from the right edge. This fixes the behavior of the messages config as well as gui.text() and Ram Watch on screen option. 2012-03-27 00:46:58 +00:00
adelikat f145d8e655 Cheat Window, Ram Watc, Lua Console - fix exception when clicking Move Up on the first item in the list. 2012-03-26 23:38:29 +00:00
adelikat 602ee06ffc Lua Cosnole - output message at bottom of dialog to show if changes have occured and saved messages (same as other tool dialogs such as ram watch). Better minimize size parameters of dialog. 2012-03-26 23:31:21 +00:00
brandman211 cba68551d0 -Removed LuaVarArgs from gui_text. I think this function is pointless and over complicates things; let me know if you agree based on this example.
-Fixed DrawMessages, which was setting y = x, making the y parameter of gui.text useless.
2012-03-26 14:48:05 +00:00
rolanmen1 908a9a11c5 Lua Console - Save Session Menu Option Should Now Enable/Disable Correctly. Also Added The Condition That There Should Be At Least One Script To Be Able To Save. 2012-03-26 13:46:28 +00:00
rolanmen1 e2e3ee3301 Loading A Script With Errors Via Load Lua File Now Disables And Shows Error In Output Box. Toggling On A Script With Errors Disables Itself Right Away. 2012-03-26 08:52:06 +00:00
adelikat c5334cc639 gui.text() - fix so that screen is clearned at the beginning of each frame, so that the text stays drawn when paused 2012-03-26 03:01:39 +00:00
adelikat 7daf318134 gui.text() - add a 5th parameters "anchor" that will anchor the text to top, left, bottom, or right. Same functionality as the message config anchor option. 2012-03-26 02:58:24 +00:00
adelikat 74648bd806 add punchout stats lua script 2012-03-26 02:06:04 +00:00
adelikat 588888d439 check in my RBIBaseball luaScript modified for bizhawk (only had to change memory.writebyte to mainmemory.write_u8 and it worked fine) 2012-03-26 01:58:04 +00:00
adelikat f72fce15fd Lua Console - fix anchoring properties 2012-03-26 01:41:39 +00:00
rolanmen1 5283b4c06c Avoid Crashing After Trying To Delete A Script With Errors. 2012-03-25 15:34:09 +00:00
rolanmen1 35f42b94f3 Dragging A Lua Session Now Works. Script Errors From Dragging Sessions Now Appears In The Output Box. 2012-03-25 14:51:35 +00:00
rolanmen1 75c0a9f7d3 Script Errors Now Appears In OutputBox. 2012-03-25 09:47:31 +00:00
zeromus f694959da9 cleanup some transient junk in mainform, fix nametable viewer screenshots garbage pixels off by one bug, add shortcut buttons for common display area sizes (this last part was tricky since the nes graphics control dialog has a feature which prevents its size from changing in visual studio) 2012-03-25 08:52:52 +00:00
brandman211 81586afc20 Finished merging...499 lines. Not as good as I had hoped, but the file would have been significantly smaller if controller templates just used dictionaries and had just a little bit more consistency. 2012-03-25 07:10:11 +00:00
brandman211 da65f8bdd4 -Merged Atari.
-Line count: 583.

TODO: The one I really didn't want to deal with...Gameboy. Why did you have to make this a NESControllerTemplate instead of a GameboyControllerTemplate[]?
2012-03-25 07:00:21 +00:00
brandman211 bc1804dcdb -Made it so that the right controllers use the default settings.
-Merged Genesis.
--This was completely broken beforehand.
---Update updated PCE.
---It had 8 joypads instead of 1.
-Line count: 661.

Note: Atari Auto 2 throws an exception.
2012-03-25 06:42:31 +00:00
brandman211 b28cfca204 -Merged TI-83.
--As it'd be obnoxious to make CONTROLS a string, object dictionary and have casts all over the place, I just made a TI83Controls string array to match CONTROLS["TI-83"].
--Positioned the fields as well as I could.
--The config for ( and ) were switched. Fixed. Yet another example of redundant code failing! :)
-Line count: 741.
2012-03-25 06:05:13 +00:00
brandman211 5e126bf04f -Made the last two TI-83 buttons visible in the Config by increasing the height from 556 to 580.
-Started merging TI-83 to Do:
--This is going to be difficult because the field names are not the same as the label names, meaning that I'm going to have to use a dictionary for TI-83, if not for all of the controls.
--I have to create a formula that calculates the proper row / column for a given field to be placed. Sounds like fun.
2012-03-25 02:36:20 +00:00
brandman211 a07165cffd -"PC Engine / SGX" -> "PC Engine / SuperGrafx".
-Line count: 978.
2012-03-25 02:11:26 +00:00
brandman211 4f2ebdfbd4 -Fixed InputConfig_Load...forgot that the switch syntax from before acts like an OR statement; I thought it meant "don't do anything".
-PCE.
2012-03-25 01:58:33 +00:00
brandman211 1d21a89f3a Converting merges one at a time...here's SMS.
-Because of Reset and Pause being separate from everything else, I had to code a special condition for these.
-Line count: 1081.
2012-03-25 01:32:44 +00:00
brandman211 8686cc87ff Converted the switch statement in InputConfig_Load to a dictionary. 2012-03-25 00:54:40 +00:00
brandman211 0eae992403 Created general functions Do and Update.
-Because I have been advised not to convert the objects to dictionaries, and because using the equivalent of typedef seems confusing if it isn't outright impossible, I had to implement switch statements to handle certain aspects on a platform to platform basis.
-These will end up being much bigger than I would have hoped, but the entire file will be much, much smaller.

TODO: Implement all of the other platforms using these functions.

Note: It seems that the Enabled checkbox doesn't do anything other than persist its state. I checked the latest release, and the same issue was there, so I didn't break it!
2012-03-25 00:39:51 +00:00
Rolanmen1 e9e988a83e When Loading An Script With An Error, BizHawk Won't Crash. For Some Reason I Couldn't Show The Script Error In The OutputBox. 2012-03-24 21:55:37 +00:00
brandman211 d7453a3770 -Shrunk UpdateNES. 2012-03-24 21:06:47 +00:00
brandman211 f6a353196d -Started refactoring InputConfig.cs as adelikat requested:
--Created CONTROLS constant which contains all of the controls in one dictionary.
--Shrunk DoNES significantly.

TODO:
-Shrink UpdateNES.
-Generalize both functions and apply to NES.
-Have all of the platform specific functions utilize these generalized functions.
-Combine all of the platforms.
2012-03-24 19:45:50 +00:00
Rolanmen1 d0afec182f Pause/Resuming Scripts Have Been Implemented 2012-03-24 18:59:24 +00:00
zeromus e7eb6d8dcd fix input.get 2012-03-24 18:39:55 +00:00
zeromus 0bb9f65038 try not to crash when size of arrays in config file changes 2012-03-24 17:47:52 +00:00
adelikat 96fc783107 Lua - implement input.get() 2012-03-24 15:55:22 +00:00
rolanmen1 d0995970fc User Can't Toggle, Edit Nor Pause Or Resume To Separators. Edit Buttons Now Opens Multiple Scripts Instead Of The First Selected. 2012-03-24 13:25:19 +00:00
rolanmen1 87f9ace0d9 Added Resume/Pause Script Option Everwhere It Should Be And Also Added Pause Icon To All Of Them. 2012-03-24 12:43:11 +00:00
adelikat 8714b6da75 Small amount of code cleanup - remove unnecessary code in mainform load function, move function to a better file 2012-03-24 12:20:21 +00:00
rolanmen1 661565cf3e Added Pause Property To Scripts, Menu Option To Pause/Resume Scripts, Enabled And Paused Scripts Change It's Background To Red (May need to change this). Label Above ListView Shows How Many Scripts Are Paused. Need To Add Pause Icon To The Menu Option. 2012-03-24 10:53:26 +00:00
zeromus b9dd682f1d name the context menu items better things 2012-03-24 03:18:02 +00:00
zeromus 5f39ba5bbd add emu.yield, which when used allows a script to run while emulation is paused and interact with the gui/main window in realtime 2012-03-23 23:03:39 +00:00
zeromus 216a44e3f0 add input.getimmediate 2012-03-23 22:52:02 +00:00
zeromus adcb03f8d5 fix context menu open logic to not rely on indices 2012-03-23 22:06:42 +00:00
zeromus aaf92e0e25 how did that happen 2012-03-23 19:48:45 +00:00
zeromus bc3e8606a2 refactor lua scripts to be more flexible 2012-03-23 19:44:47 +00:00