Commit Graph

194 Commits

Author SHA1 Message Date
zeromus 23f9b3e3dd fix that thing i just did 2012-09-20 00:42:50 +00:00
zeromus e8487b77d8 change lua drawing to use an offset specified by the emulator core, so that drawing in the nes core can have nes-relative coords instead of multiclient-display-relative coords 2012-09-20 00:22:24 +00:00
rolanmen1 f173aee3f4 LuaImplementation: forms.setproperty now works on int, double and bool properties. Added try catch to avoid crashes with these functions. 2012-09-17 19:55:11 +00:00
andres.delikat 0afd4f3c09 Lua - fix gui.drawLine/Pie/Ellipse/Polygon/Pixel/Bezier from commit 2908, the way those were done was causing exceptions after the 1st draw 2012-09-11 14:47:41 +00:00
zeromus b87af7d429 lua-try caching solidbrushes and pens for faster drawing 2012-09-07 03:34:16 +00:00
adelikat 8f408737da Movie refactoring - round 2 2012-09-03 19:42:53 +00:00
adelikat 27f4663125 Movies - round 1 of code cleanup (no functional changes) 2012-09-03 15:05:09 +00:00
adelikat 16bc441231 Lua - implement client.screenwidth() and client.screenheight() 2012-09-02 16:49:58 +00:00
pasky1382 df440e97ec (minor spacing edits in LuaImplementation.cs)
Added rondo of blood lua script in scripts folder for PC Engine.
2012-09-02 16:26:43 +00:00
adelikat 63ef0c0832 Lua - implement emu.registerbefore and emu.registerafter. Note that all lua work is done on the beginning of the frame (before) by default. also note that Registerbefore will run before normal lua processing. 2012-09-02 16:23:42 +00:00
pasky1382 bc3e9edb96 Fixed what i previously broke in the Lua bitwise functions. 2012-09-02 14:47:12 +00:00
pasky1382 6a8c87d598 Fixed bitwise operators, all function arguments take object types so they display correctly under the lua function list. 2012-09-02 14:20:08 +00:00
pasky1382 02c447becb Fixed gui.drawBox. Now draws correctly when width is a negative value. 2012-09-02 02:37:25 +00:00
pasky1382 cd292d7fd2 Added a gui.drawBox() function in the lua engine. Uses four coordinates to draw a box like other emulators rather than a height/width argument. 2012-09-02 01:15:18 +00:00
pasky1382 ff218af117 Added lua bitwise operators, AND, LSHIFT, RSHIFT, OR, XOR, NOT, ROTATE LEFT, ROTATE RIGHT. 2012-09-02 00:56:50 +00:00
rolanmen1 7a9e5d856b LuaImplementation: Implemented forms.setproperty and forms.getproperty. Kinda buggy though. 2012-08-25 22:45:44 +00:00
rolanmen1 6cec0f0182 LuaConsole: Call UpdateNumberOfScripts after you delete a script.
LuaImplementation: Added emu.ispaused(), also added the parameters width and height to forms.label and forms.button
2012-08-25 17:01:13 +00:00
adelikat 0ed2ec1be9 Ram Watch - oops, fixed last commit better 2012-08-15 01:14:25 +00:00
andres.delikat f7752584c6 Lua - implement input.getmouse() 2012-07-13 22:21:01 +00:00
andres.delikat f5a7dc2191 Lua - implement client.setwindowsize() 2012-07-12 22:20:48 +00:00
andres.delikat 15371b3cd9 Lua - implement emu.enablerewind(), also add on screen message when rewind is toggled 2012-07-12 19:42:13 +00:00
andres.delikat fcac19aed9 Lua - implement emu.displayvsync, also add on screen message when limit frame rate is toggled 2012-07-12 19:36:07 +00:00
andres.delikat 2304b2d4e2 Lua - implement emu.limitframerate, also add on screen message when limit frame rate is toggled 2012-07-12 19:23:39 +00:00
andres.delikat 9c947652f5 Lua - implement emu.minimizeframeskip() 2012-07-12 19:02:30 +00:00
andres.delikat 858f133f9e Lua - Implement emu.speedmode and emu.frameskip 2012-07-12 18:39:24 +00:00
andres.delikat 4aaeabb568 Lua - much improved lua function list including return type and parameters 2012-07-12 00:57:09 +00:00
andres.delikat 3a73f8a427 Lua - backend for more thorough self documenting, lua function list dialog has the same functionality as before but is primed for a better UI 2012-07-11 15:03:51 +00:00
andres.delikat 9da0cd3553 Lua - forms.textbox() add field to optionally set the textbox to signed, unsigned, or hex values 2012-07-10 23:09:06 +00:00
andres.delikat 3f81bc9cdb Lua - implement forms.addclick() and forms.clearclicks() 2012-07-10 22:52:06 +00:00
andres.delikat 04273ec3ee Lua - implement forms.settext() 2012-07-10 22:27:05 +00:00
andres.delikat 4542ae12d1 Lua forms library - implement SetLocation(), SetSize(), TextBox(), and Label() 2012-07-10 21:15:30 +00:00
andres.delikat 827e2150d7 Lua - implement forms.button(), and the basic backend for calling lua functions on events from user generated controls 2012-07-10 20:23:19 +00:00
zeromus 3a8fe7c464 lua-fix crashes when scripts terminate 2012-07-10 19:40:35 +00:00
andres.delikat ec9cf60d6d Lua - start forms creation library, implement forms.create(), forms.destroy(), and forms.destroyall(). Still TODO: make the forms do something! Also added console.log as an alias to console.output 2012-07-10 19:04:35 +00:00
adelikat c22ba4da32 Lua - gui.drawpixel - make color optional (and default to black if not specified) 2012-06-13 01:09:21 +00:00
zeromus fec1ee0958 fix more memory leaks in lua drawing (rectangle, pixel, line, bezier) 2012-06-12 03:24:15 +00:00
zeromus c7925d986c delete display manager threading. fix gdi+ leaks in lua code. add abstracted OSD drawing "blitter" system for sysdrawing/d3d dual compatibility and framework for future use for faster lua drawing. 2012-06-10 23:27:30 +00:00
zeromus 18eee77173 kill a bunch of warnings 2012-06-10 22:38:44 +00:00
phillip.grimsrud cb4c45eb70 1. Upgraded insert and delete functions in tastudio to support multiple selection.
2. Fixed issues with the light blue current frame pointer in tastudio
3. Removed a totally useless index that was being kept seperately in the movie log.
4. Moved the tastudio update after the check to see if the rest of the saved state list is valid.
5. Changed some function/variable names related to the movie log for clarity.
2012-06-07 04:47:54 +00:00
adelikat a9eeac6d64 Lua - fix bug that was causing lua functions to duplicate each time a lua script was toggled or opened, eventually causing crashes. 2012-06-04 02:33:34 +00:00
brandman211 23b3cedf7d Removed the now redundant TargetZoomFactor scaling for drawRectangle. Drawn shapes now scale nicely. Whether or not text should be drawn this way is a worthwhile discussion IMO, but as zeromus has said, it would require text to be drawn in the same way like shapes. 2012-05-11 21:11:29 +00:00
zeromus 857d0a5b39 voila, "emu" resolution lua drawing, hacked in place of the native resolution drawing because rolanmen1 decided to destroy my surface management paradigms (i can tell because the earth is scorched with spaces instead of tabs) 2012-05-06 07:09:04 +00:00
brandman211 05157997f1 -Added a very basic fix to the graphics scaling issue per adelikat's advice.
--Gets worse as the scale increases.
--For x3, the box doesn't increase size, but the box still changes position. I think there might be a difference between the TargetZoomFactor and the actual screen size, so perhaps we should tie this to something else.
-Working on very small optimizations to the NES PPU with CorruptedSyntax...this is more fun, so we'll do this first.
--Eliminated an entire loop.
--Branched to two loops instead of branching for every iteration in one loop.
--Got rid of some redundant instructions using temporary variables.
--This may be completely premature, but I seem to have gained a few FPS from doing this. For me, I get 38-39 FPS where I'd previously get 33-34.
2012-05-06 04:09:28 +00:00
Rolanmen1 2799d55f4a Now gui.drawNew and gui.drawFinish doesn't need to be invoked via Lua Scripts. However they are invoked every frame. Basically, this means that graphics are drawn and cleaned every frame. So, if you Pause/Stop a script, the graphics gets cleaned right away. 2012-05-01 14:43:17 +00:00
adelikat 54d1c873df Fix when guitext gets cleared, reduces most of the flickering and inconsistencies with ram watch on screen and lua gui.text, fix punchoutstats lua script 2012-04-30 01:14:23 +00:00
rolanmen1 3bcaa8f2e6 gui.clearGraphics implemented. This will allow the user to clear the graphics whenever he wants. I also created a function ClearDisplaySurface that is used to clear the graphics whenever the user stops a scripts. 2012-04-27 20:15:07 +00:00
rolanmen1 56b8d6d55e gui.drawImage implemented. It needs a Path, X and Y Points, Width (optional) and Height (optional). If Width or Height are null, their value will change to the original Width/Height. As with gui.drawIcon, the Path needs double backslash (\\).
Take in mind that if the image have transparent background, the background will be drawn in transparent.
2012-04-26 03:41:31 +00:00
rolanmen1 fd9005f361 gui.drawIcon implemented. It draws an Icon file (Path to File) in the specified X and Y Coordinates. It has 2 optional parameters, Width and Height. You can't resize the icon to be bigger than it's original size, only smaller. Oh, and Path must have double backslash (\\). 2012-04-25 20:34:50 +00:00
rolanmen1 93335d287a Fixed gui.alert anchoring. Since do.gui.text now have more parameters, it didn't worked. 2012-04-25 19:58:17 +00:00
Rolanmen1 f637f5f400 gui.text now has a line color parameter. 2012-04-24 15:23:56 +00:00
rolanmen1 cefc803425 gui.text now accepts BackgroundColor parameter. I didn't had enough time to check stuff, so i will check more deeply some other time. 2012-04-24 03:57:23 +00:00
Rolanmen1 cf9606eb49 Created 2 functions, GetPen and GetBrush. They will recieve an object variable to return a Pen/Brush of said color, this was made to clean the code of the draw functions. 2012-04-18 14:11:16 +00:00
rolanmen1 4db055ce36 gui.drawPie implemted. BizHawk now can make graphics. Quick Example: http://i44.tinypic.com/ibigs2.jpg 2012-04-17 21:41:21 +00:00
rolanmen1 ee8ff2c1cf gui.drawBezier, gui.drawPixel, gui.drawPolygon are all implemented. 2012-04-17 19:58:27 +00:00
rolanmen1 733a1e7bc6 gui.drawLine implemented 2012-04-17 17:48:37 +00:00
Rolanmen1 10a73f777d gui.drawRectangle now accepts both hex and string. Hex format is ARGB (Alpha, Red, Green and Blue respectively). 2012-04-17 16:12:14 +00:00
adelikat 68a8dd5f74 Lua - implement gui.drawEllipse() 2012-04-17 03:21:16 +00:00
rolanmen1 0fd023dc8c gui.drawRectangle now accepts Line Color and Background Color. Line Color is mandatory, background is not. If user decides to not specify background color, it won't fill. 2012-04-16 20:47:01 +00:00
rolanmen1 a4032aff51 gui.drawRectangle now accepts 4 parameters (X, Y, Width and Height). Should implement Line Color and Background Color as parameters. 2012-04-16 20:04:43 +00:00
zeromus 35fbe354c1 add threaded display manager to allow heavy OSD/compositing/filtering to happen on another thread. add a lua layer accessible via GDI+ which can be automatically composited and the simplest possible demo of it. add some filtering infrastructure and a hq2x filter set ported to c# but need to work on a minimal selector gui before its usable. separate OSD from RenderPanel so that gdi+ presentation mode now gets full OSD support. the OSD is now a little uglier because its drawn entirely differently and could use some finetuning 2012-04-16 08:18:41 +00:00
Rolanmen1 39e640aee9 gui.cleartext() Implemented. This Function Should Always Be Called After emu.yield() In Order For The Later To Work Correctly. 2012-04-04 20:09:50 +00:00
brandman211 557f437195 -As much as I dislike the new joypad.set() setup, the least I could do is make it consistent with joypad.get().
--If there is no controller parameter, then all of the buttons are returned as they are stored in the system, just like joypad.set(input) takes button names as is.
--If there is a controller parameter, all of the buttons for that controller are returned without the "PX ", just like joypad.set(input, controller) takes button names without the "PX " and assigns them to the matching buttons for that controller.
--No one approved this change, but seriously, this is common sense. I expect some "change denied" April Fool's stuff tomorrow...
-Implemented a blacklist for ButtonCount. By default, Lag, Pause, and Reset are blacklisted. I don't think any of these buttons should be tracked.
2012-04-01 08:08:40 +00:00
Rolanmen1 720b1cc2ba Joypad.Set - Added Slot Number As An Optional Parameter 2012-03-29 19:53:16 +00:00
Rolanmen1 1c6b792a28 Joypad.Set Nox Fixed 2012-03-29 19:16:25 +00:00
Rolanmen1 4337ea9d63 Joypad.Set() correctly implemented. 2012-03-29 19:03:14 +00:00
adelikat 5203286f34 Lua - movie.getrerecordcounting() and movie.setrerecordcounting() implemented 2012-03-29 03:16:55 +00:00
andres.delikat 50e357f345 Lua - start work to implement lua.get/setrerecordingcounting functions 2012-03-29 03:09:46 +00:00
andres.delikat de7bd1f346 Lua - implement anchor parameter to gui.alert() 2012-03-29 02:45:38 +00:00
andres.delikat 78ee40a546 Lua - remove mainmemory.readbyte() and mainmemory.writebyte(), these are not preferred since there are equivlant functions, and unlike the memory library, they are not useful for compatibility with scripts form other emulators. 2012-03-29 01:44:01 +00:00
Rolanmen1 b295d7cd23 Record Movie - User Can Choose To Save Movie Files As .tas or ."consolebeingran".tas
Play Movie - Same As Record Movie
2012-03-28 12:40:42 +00:00
adelikat 71396ad4b7 Lua - sort the functions in the lua function list (both in the console dialog, and console.luafunctionslist()) 2012-03-28 12:26:43 +00:00
Rolanmen1 f7f4e64985 Joypad.Get recieves a numeric parameter to return only the specified controller. Is there other way to know of what controller is a button other than the first 2 characters of the string? 2012-03-28 08:35:43 +00:00
adelikat b585a0a23a fix savestate.registerload 2012-03-28 01:24:32 +00:00
adelikat c88a6b4b7a Lua - savestate.registersave/load - pass state name as a string (ex:"quicksave0"). Put event after the save/load not before. Event no longer fires on non-saveslot events 2012-03-28 01:03:50 +00:00
adelikat 397f289493 Lua - savestate.registersave/load - show exception message on error 2012-03-28 00:13:25 +00:00
adelikat 8bc8ec0e5b Lua - output registersave/load error messages to the lua console not the screen 2012-03-27 23:58:56 +00:00
andres.delikat 655af69326 Lua - savestate.registerload() implemented 2012-03-27 21:17:20 +00:00
andres.delikat 0330e1f742 Lua - implement savestate.registersave() 2012-03-27 21:09:36 +00:00
andres.delikat 83fe222ba9 Lua - movie.getinput() - fix 2012-03-27 20:10:05 +00:00
andres.delikat 489086716d Lua - Better output for movie.getinput() 2012-03-27 19:21:10 +00:00
rolanmen1 3e84fc9936 Lua - Implemented movie.getinput()
NOTE: There may be uknown errors.
2012-03-27 15:45:50 +00:00
zeromus 46a638ee96 fix bug in lua coroutines which made error propagation get mixed up and possibly result in a bunch of other subtle bugs 2012-03-27 07:25:36 +00:00
Rolanmen1 adfa18694e Text Alignment Parameter Can Be Either Int Or Either A String 2012-03-27 01:49:27 +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
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
rolanmen1 5283b4c06c Avoid Crashing After Trying To Delete A Script With Errors. 2012-03-25 15:34:09 +00:00
rolanmen1 75c0a9f7d3 Script Errors Now Appears In OutputBox. 2012-03-25 09:47:31 +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
zeromus e7eb6d8dcd fix input.get 2012-03-24 18:39:55 +00:00
adelikat 96fc783107 Lua - implement input.get() 2012-03-24 15:55:22 +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 bc3e8606a2 refactor lua scripts to be more flexible 2012-03-23 19:44:47 +00:00
zeromus 0372969f13 change lua to use lua coroutines for multiple scripts instead of .net threads 2012-03-23 18:24:29 +00:00
adelikat 2e5ec4fdcb Fix bugs in input config regarding atari controllers, fix auto-fire controllers for atari (both controllers) 2012-03-23 02:15:58 +00:00
rolanmen1 dcaf724dae Fixed A Bug When Saving A Session That Prevented Them To Be Loaded Correctly. 2012-03-21 12:51:52 +00:00
brandman211 22feb43b78 joypad_set works. 2012-03-19 19:10:30 +00:00
brandman211 78d8effcfc Made joypad_get independent of mnemonics. Here's the Lua script I used to test:
while true do
	joypad.set("Up", true)
	local buttons = joypad.get()
	local result = {}
    for index, value in pairs(buttons) do
        table.insert(result, index .. ": " .. tostring(value))
    end
	gui.text(0, 36, table.concat(result, "\n"))
	emu.frameadvance()
end

For some bizarre reason, after a while, the ordering of the buttons goes from stable to chaotic, making it impossible to read the buttons pressed. adelikat says not to worry about this because order is meaningless in Lua. Still, this is very curious...

TODO: Set using a ClickyVirtualPadController and Global.StickyXORAdapter.SetSticky(Controller + " Up", false)...whatever that means.
2012-03-19 14:52:23 +00:00
brandman211 a4a8dec005 Lua glue for zeromus. 2012-03-19 03:39:56 +00:00
adelikat c92f1b556c Lua - implement movie.filename(), movie.getreadonly(), movie.setreadonly() 2012-03-18 19:52:28 +00:00