420 lines
40 KiB
HTML
420 lines
40 KiB
HTML
<html>
|
||
|
||
<head>
|
||
<title>Implementation</title>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
<meta name="generator" content="HelpNDoc Personal Edition 3.8.0.560">
|
||
<link type="text/css" rel="stylesheet" media="all" href="css/reset.css" />
|
||
<link type="text/css" rel="stylesheet" media="all" href="css/base.css" />
|
||
<link type="text/css" rel="stylesheet" media="all" href="css/hnd.css" />
|
||
<!--[if lte IE 8]>
|
||
<link type="text/css" rel="stylesheet" media="all" href="css/ielte8.css" />
|
||
<![endif]-->
|
||
<style type="text/css">
|
||
#topic_header
|
||
{
|
||
background-color: #EFEFEF;
|
||
}
|
||
</style>
|
||
<script type="text/javascript" src="js/jquery.min.js"></script>
|
||
<script type="text/javascript" src="js/hnd.js"></script>
|
||
<script type="text/javascript">
|
||
$(document).ready(function()
|
||
{
|
||
if (top.frames.length == 0)
|
||
{
|
||
var sTopicUrl = top.location.href.substring(top.location.href.lastIndexOf("/") + 1, top.location.href.length);
|
||
top.location.href = "index.html?" + sTopicUrl;
|
||
}
|
||
else if (top && top.FrameTOC && top.FrameTOC.SelectTocItem)
|
||
{
|
||
top.FrameTOC.SelectTocItem("Implementation");
|
||
}
|
||
});
|
||
</script>
|
||
</head>
|
||
|
||
<body>
|
||
|
||
<div id="topic_header">
|
||
<div id="topic_header_content">
|
||
<h1>Implementation</h1>
|
||
|
||
<div id="topic_breadcrumb">
|
||
<a href="TASEditorInside.html">TAS Editor Inside</a> ›› </div>
|
||
</div>
|
||
<div id="topic_header_nav">
|
||
<a href="TASEditorInside.html"><img src="img/arrow_up.png" alt="Parent"/></a>
|
||
|
||
<a href="Ideas.html"><img src="img/arrow_left.png" alt="Previous"/></a>
|
||
|
||
<a href="MistakeProofing.html"><img src="img/arrow_right.png" alt="Next"/></a>
|
||
|
||
</div>
|
||
<div class="clear"></div>
|
||
</div>
|
||
<div id="topic_content">
|
||
|
||
<p></p>
|
||
<p><span class="rvts19">Implementation</span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts21">At first the TAS Editor was based on the codebase of experimental tool named TASEdit, using FCEUX 2.1.5 as a kick-start.</span></p>
|
||
<p class="rvps10"><span class="rvts21">The premise of TASEdit was to build an input editor (like TAS Movie Editor) into emulator, so that the delay between editing and checking results would greatly shrink. Since there was no research done on typical behaviors in TASing process, the concept was vague and the code wasn't scalable. Thus, soon after formulating the new vision of the editing tool the code of TAS Editor was fully rewritten to make adding new features easier.</span></p>
|
||
<p class="rvps10"><span class="rvts21">The following architecture of TAS Editor was designed according to author's notion of a methodical TASing and of features needed for such TASing.</span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<hr style="height: 1px; color : #000000; background-color : #000000; border-width : 0px;"/>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts75">TAS Editor modules (classes)</span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">taseditor.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Main – Main gate between emulator and Taseditor</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">the point of launching TAS Editor from emulator</span></li>
|
||
<li class="rvps10"><span class="rvts21">the point of quitting from TAS Editor</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly (at the end of every frame) updates all modules that need regular update</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements operations of the "File" menu: creating New project, opening a file, saving, compact saving, import, export</span></li>
|
||
<li class="rvps10"><span class="rvts21">handles some FCEUX hotkeys</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">taseditor_window.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Window – User Interface</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">implements all operations with TAS Editor window: creating, redrawing, resizing, moving, tooltips, clicks</span></li>
|
||
<li class="rvps10"><span class="rvts21">subclasses all buttons and checkboxes in TAS Editor window GUI in order to disable Spacebar key and process Middle clicks</span></li>
|
||
<li class="rvps10"><span class="rvts21">processes OS messages and sends signals from user to TAS Editor modules (also implements some minor commands on-site, like Greenzone capacity dialog and such)</span></li>
|
||
<li class="rvps10"><span class="rvts21">switches off/on emulator's keyboard input when the window loses/gains focus</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: updates the window caption; updates mouse cursor icon</span></li>
|
||
<li class="rvps10"><span class="rvts21">updates all checkboxes and menu items when some settings change</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores info about 10 last projects (File->Recent) and updates it when saving/loading files</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: window caption, help filename, size and other properties of all GUI items</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">bookmarks.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Bookmarks – Manager of Bookmarks</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores 10 Bookmarks</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements all operations with Bookmarks: initialization, setting Bookmarks, jumping to Bookmarks, deploying Branches</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: resets all Bookmarks and Branches</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of Bookmarks List: creating, redrawing, mouseover, clicks</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly updates flashings in Bookmarks List</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: updates colors of rows in Bookmarks List, reflecting conditions of respective Piano Roll rows</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: save id, ids of commands, labels for panel, gradients for flashings, id of default slot</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">branches.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Branches – Manager of Branches</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores info about Branches (relations of Bookmarks) and the id of current Branch</span></li>
|
||
<li class="rvps10"><span class="rvts21">also stores the time of the last modification (see fireball) and the time of project beginning (see cloudlet)</span></li>
|
||
<li class="rvps10"><span class="rvts21">also caches data used in calculations (cached_first_difference, cached_timelines)</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: sends warning to caller</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of Branches Tree: creating, recalculating relations, animating, redrawing, mouseover, clicks</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: reacts on Bookmarks/current Movie changes and recalculates the Branches Tree</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly updates animations in Branches Tree and calculates Playback cursor position on the Tree</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: coordinates for building Branches Tree, animation timings</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">bookmark.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Bookmark – Single Bookmark data</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores all info of one specific Bookmark: movie snapshot, a savestate of 1 frame, a screenshot of the frame, a state of flashing for this Bookmark's row</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: sends warning to caller</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements procedure of "Bookmark set": creating movie snapshot, setting key frame on current Playback position, copying savestate from Greenzone, making and compressing screenshot, launching flashing animation</span></li>
|
||
<li class="rvps10"><span class="rvts21">launches respective flashings for "Bookmark jump" and "Branch deploy"</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">snapshot.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Snapshot – Snapshot of all edited data</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores the data of specific snapshot of the movie: InputLog, LagLog, Markers at the moment of creating the snapshot, keyframe, start and end frame of operation, type of operation and description of the snapshot (including the time of creation)</span></li>
|
||
<li class="rvps10"><span class="rvts21">also stores info about sequential recording/drawing of input</span></li>
|
||
<li class="rvps10"><span class="rvts21">streamlines snapshot creation: copying Input from movie data, copying LagLog from Greenzone, copying Markers from Markers Manager, setting time of creation</span></li>
|
||
<li class="rvps10"><span class="rvts21">streamlines restoring Markers data from snapshot</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: sends warning to caller</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">inputlog.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">InputLog – Log of Input</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores the data about Input state: size, type of Input, Input Log data (commands and joysticks)</span></li>
|
||
<li class="rvps10"><span class="rvts21">optionally can store map of Hot Changes</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements InputLog creation: copying Input, copying Hot Changes</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements full/partial restoring of data from InputLog: Input, Hot Changes</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements compression and decompression of stored data</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: sends warning to caller</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements searching of first mismatch comparing two InputLogs or comparing this InputLog to a movie</span></li>
|
||
<li class="rvps10"><span class="rvts21">provides interface for reading specific data: reading Input of any given frame, reading value at any point of Hot Changes map</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements all operations with Hot Changes maps: copying (full/partial), updating/fading, setting new hot places by comparing two InputLogs</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">laglog.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">LagLog – Log of Lag occurrence</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores the frame-by-frame log of lag occurrence</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements compression and decompression of stored data</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: sends warning to caller</span></li>
|
||
<li class="rvps10"><span class="rvts21">provides interface for reading and writing log data</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">markers.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Markers – Snapshot of Markers state</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores the data about Markers state: array of distributing Markers among movie frames, and array of Notes</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements compression and decompression of stored data</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: sends warning to caller</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: max length of a Note</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">popup_display.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Popup display – Manager of popup windows</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">implements all operations with popup windows: initialization, redrawing, centering, screenshot decompression and conversion</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly inspects changes of Bookmarks Manager and shows/updates/hides popup windows</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: updates contents of popup windows</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: coordinates and appearance of popup windows, timings of fade in/out</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">history.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">History – History of movie modifications</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores array of History items (snapshots, backup_bookmarks, backup_current_branch) and pointer to current snapshot</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: clears the array and starts new history by making snapshot of current movie data</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: checks the difference between the last snapshot and current movie, and makes a decision to create new point of rollback. In special cases it can create a point of rollback without checking the difference, assuming that caller already checked it</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements all restoring operations: undo, redo, revert to any snapshot from the array</span></li>
|
||
<li class="rvps10"><span class="rvts21">also stores the state of "undo pointer"</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly updates the state of "undo pointer"</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly (when emulator is paused) searches for uncompressed items in the History Log and compresses first found item</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of History List: creating, redrawing, clicks, auto-scrolling</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: save id, ids and names of all possible types of modification, timings of "undo pointer"</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">piano_roll.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Piano Roll – Piano Roll interface</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">implements the working of Piano Roll List: creating, redrawing, scrolling, mouseover, clicks, drag</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly updates the size of the List according to current movie input</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: scrolls visible area of the List to any given item: to Playback Cursor, to Selection Cursor, to "undo pointer", to a Marker</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads current position of vertical scrolling from a project file. On error: scrolls the List to the beginning</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of Piano Roll List Header: creating, redrawing, animating, mouseover, clicks</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly updates lights in the Header according to button presses data from Recorder and Alt key state</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: launches flashes in the Header</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of mouse wheel: List scrolling, Playback cursor movement, Selection cursor movement, scrolling across gaps</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements context menu on Right-click</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: save id, ids of columns, widths of columns, tables of colors, gradient of Hot Changes, gradient of Header flashings, timings of flashes, all fonts used in TAS Editor, images</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">selection.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Selection – Manager of selections</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">contains definition of the type "Set of selected frames"</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores array of Sets of selected frames (History of selections)</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: clears the array and starts new history by making empty selection</span></li>
|
||
<li class="rvps10"><span class="rvts21">constantly tracks changes in selected rows of Piano Roll List, and makes a decision to create new point of selection rollback</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements all selection restoring operations: undo, redo</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: changes current selection: remove selection, jump to a frame with Selection cursor, select region, select all, select between Markers, reselect clipboard</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly ensures that selection doesn't go beyond curent Piano Roll limits, detects if selection moved to another Marker and updates Note in the lower text field</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of lower buttons << and >> (jumping on Markers)</span></li>
|
||
<li class="rvps10"><span class="rvts21">also here's the code of lower text field (for editing Marker Notes)</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resource: save id, lower text field prefix</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">editor.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Editor – Tool for editing</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">implements operations of changing Input: toggle input in region, set input by pattern, toggle selected region, apply pattern to input selection</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements operations of changing Markers: toggle Markers in selection, apply patern to Markers in selection, mark/unmark all selected frames</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores Autofire Patterns data and their loading/generating code</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: patterns filename, id of buttonpresses in patterns</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">splicer.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Splicer – Tool for montage</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">implements operations of mass-changing input: copy/paste, cloning, clearing region, insertion and deletion of frames, truncating</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores data about the selection used in last "Copy to Clipboard" operation</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly checks the state of current selection and displays info on GUI, also displays info about input in Clipboard</span></li>
|
||
<li class="rvps10"><span class="rvts21">when launching TAS Editor, it checks Clipboard contents</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: mnemonics of buttons, texts for selection/clipboard info on GUI</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">taseditor_config.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Config – Current settings</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores current state of all TAS Editor settings</span></li>
|
||
<li class="rvps10"><span class="rvts21">all TAS Editor modules can get or set any data within Config</span></li>
|
||
<li class="rvps10"><span class="rvts21">when launching FCEUX, the emulator writes data from fceux.cfg file to the Config, when exiting it reads the data back to fceux.cfg</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: default values of all settings, min/max values of settings</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">playback.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Playback – Player of emulation states</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">implements the working of movie player: show any frame (jump), run/cancel seekng. pause, rewinding</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly tracks and controls emulation process, prompts redrawing of Piano Roll List rows, finishes seeking when reaching target frame, animates target frame, makes Piano Roll follow Playback cursor, detects if Playback cursor moved to another Marker and updates Note in the upper text field</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of upper buttons << and >> (jumping on Markers)</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of buttons < and > (frame-by-frame movement)</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of button || (pause) and middle mouse button, also reacts on external changes of emulation pause</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of progressbar: init, reset, set value, click (cancel seeking)</span></li>
|
||
<li class="rvps10"><span class="rvts21">also here's the code of upper text field (for editing Marker Notes)</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: upper text field prefix, timings of target frame animation, response times of GUI buttons, progressbar scale</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">greenzone.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Greenzone – Access zone</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores array of savestates, used for faster movie navigation by Playback cursor</span></li>
|
||
<li class="rvps10"><span class="rvts21">also stores LagLog of current movie Input</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: truncates Greenzone to last successfully read savestate</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly checks if there's a savestate of current emulation state, if there's no such savestate in array then creates one and updates lag info for previous frame</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements the working of "Auto-adjust Input according to lag" feature</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly runs gradual cleaning of the savestates array (for memory saving), deleting oldest savestates</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: (when movie input was changed) truncates the size of Greenzone, deleting savestates that became irrelevant because of new input. After truncating it may also move Playback cursor (which must always reside within Greenzone) and may launch Playback seeking</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: save id, properties of gradual cleaning, timing of cleaning</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">recorder.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Recorder – Tool for input recording</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">at the moment of recording movie input (at the very end of a frame) by emulator's call the Recorder intercepts input data and applies its filters (multitracking/etc), then reflects input changes into History and Greenzone</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly tracks virtual joypad buttonpresses and provides data for Piano Roll List Header lights. Also reacts on external changes of Recording status, and updates GUI (Recorder panel and Bookmarks/Branches caption)</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements input editing in Read-only mode (ColumnSet by pressing buttons on virtual joypad)</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: ids and names of multitracking modes, suffixes for TAS Editor window caption</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">markers_manager.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Markers_manager – Manager of Markers</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores one snapshot of Markers, representing current state of Markers in the project</span></li>
|
||
<li class="rvps10"><span class="rvts21">saves and loads the data from a project file. On error: clears the data</span></li>
|
||
<li class="rvps10"><span class="rvts21">regularly ensures that the size of current Markers array is not less than the number of frames in current input</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements all operations with Markers: setting Marker to a frame, removing Marker, inserting/deleting frames between Markers, truncating Markers array, changing Notes, finding frame for any given Marker, access to the data of Snapshot of Markers state</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements full/partial copying of data between two Snapshots of Markers state, and searching for first difference between two Snapshots of Markers state</span></li>
|
||
<li class="rvps10"><span class="rvts21">also here's the code of searching for "similar" Notes</span></li>
|
||
<li class="rvps10"><span class="rvts21">also here's the code of editing Marker Notes</span></li>
|
||
<li class="rvps10"><span class="rvts21">also here's the code of Find Note dialog </span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: save id, properties of searching for similar Notes</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">taseditor_lua.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Lua – Manager of Lua features</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">implements logic of all functions of "taseditor" Lua library</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores the list of pending input changes</span></li>
|
||
<li class="rvps10"><span class="rvts21">on demand: (from FCEUX Lua engine) updates "</span><span class="rvts29">Run function</span><span class="rvts21">" button</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: ids of joypads for input changes, max length of a name for </span><span class="rvts20">applychanges()</span><span class="rvts21">, default caption for the "</span><span class="rvts29">Run function</span><span class="rvts21">" button</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts20">taseditor_project.cpp</span></p>
|
||
<p class="rvps10"><span class="rvts21">Project – Manager of working project</span></p>
|
||
<p class="rvps10"><span class="rvts39">[singleton]</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">stores the info about current project filename and about having unsaved changes</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements saving and loading project files from filesystem</span></li>
|
||
<li class="rvps10"><span class="rvts21">implements autosave function</span></li>
|
||
<li class="rvps10"><span class="rvts21">stores resources: autosave period scale, default filename, fm3 format offsets</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<hr style="height: 1px; color : #000000; background-color : #000000; border-width : 0px;"/>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts75">Emulator modifications</span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts21">Taseditor needs the following modifications to be applied to an emulator code.</span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts25">Main</span><span class="rvts21">/</span><span class="rvts25">Window</span><span class="rvts21">:</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">call Taseditor's update() function after every emulated frame and when emulation is paused, no less than 20 times per second (necessary for adequate animations and controls in TAS Editor window)</span></li>
|
||
<li class="rvps10"><span class="rvts21">dispatch OS messages to Taseditor window, including accelerator table commands</span></li>
|
||
<li class="rvps10"><span class="rvts21">if emulator doesn't make use of mouse wheel, it should resend WM_MOUSEWHEEL to Taseditor, same with middle mouse clicks on emulator's own window</span></li>
|
||
<li class="rvps24" style="text-indent: 30px"><span class="rvts21">on exit: emulator should ask Taseditor, so it can check unsaved changes in current project and allow user to save it before quitting. If the </span><span class="rvts20">AskSave()</span><span class="rvts21"> function returns </span><span class="rvts70">false</span><span class="rvts21">, the exit should be cancelled (means that user chose "Cancel")</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts25">Movie</span><span class="rvts21">:</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">there should be an interface for full control over current movie data (creating/reading/writing/any modification). The movie should be the last layer between user's input and emulated game, which means that the game should not take input from virtual pads, only from movie data. Alternative (FCEUX example) would be to always sync changes into virtual pads every time the movie data changes. Either way, Taseditor interacts with the game by reading and modifying movie data and doesn't poll virtual pads. Piano Roll displays current movie data and edits Input of current movie data</span></li>
|
||
<li class="rvps10"><span class="rvts21">in Recording mode: at the very beginning of a frame (right after the Input for the frame is written into current movie data) emulator should call Taseditor's Recorder function (and Recorder may change the movie data)</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts25">Input</span><span class="rvts21">:</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">provide an interface for reading which buttons are currently held (for Piano Roll's Header)</span></li>
|
||
<li class="rvps10"><span class="rvts21">hardware commands (Reset/Power/etc) should not be executed immediately after user invokes them, they should work as well as buttons input from virtual pads, meaning that when Taseditor is on it may either allow or prohibit the commands. Also when Taseditor is on and is not Recording, user should not be able to even invoke hardware commands</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts25">Output</span><span class="rvts21">:</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">provide read access to current state of lag indicator (needed at the end of every frame)</span></li>
|
||
<li class="rvps10"><span class="rvts21">have public function for storing current screenshot in RAM (also screenshot with Lua HUD)</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts25">SaveStates</span><span class="rvts21">:</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">have public function for making savestate in RAM and function for loading the state from RAM</span></li>
|
||
<li class="rvps10"><span class="rvts21">savestates must restore the game state precisely</span></li>
|
||
<li class="rvps10"><span class="rvts21">saving and loading should not take too much time, because the Greenzone automatically creates new savestate for every frame, which should be transparent for user</span></li>
|
||
<li class="rvps10"><span class="rvts21">savestates should be stored in compressed form, so that they don't take too much space, because for a comfortable work in Taseditor the Greenzone should have at least 1000 savestates for nearby frames</span></li>
|
||
<li class="rvps10"><span class="rvts21">savestates should not store current movie data (that would be a waste of space)</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts25">Config</span><span class="rvts21">:</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">on emulator start: emulator should load </span><span class="rvts70">taseditor_config</span><span class="rvts21"> data from the common settings file. If the file is not found, no changes should be made to </span><span class="rvts70">taseditor_config</span><span class="rvts21"> (it will have its settings by default)</span></li>
|
||
<li class="rvps10"><span class="rvts21">on emulator exit: save </span><span class="rvts70">taseditor_config</span><span class="rvts21"> data to the common settings file</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts25">Lua engine</span><span class="rvts21">:</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">add support for </span><span class="rvts20">taseditor</span><span class="rvts21"> library. The core of each function is implemented by Taseditor, but emulator should take parameters from Lua stack and send them to respective function of Taseditor's Lua gate, then receive returned data and push it into Lua stack</span></li>
|
||
<li class="rvps10"><span class="rvts21">add support for no more than one </span><a class="rvts27" href="LuaAPI.html#registermanual">Manual function</a><span class="rvts21"> and at least one </span><a class="rvts27" href="LuaAPI.html#registerauto">Auto function</a></li>
|
||
<li class="rvps10"><span class="rvts21">notify Taseditor about changing Manual function status (registered/re-registered/empty) so that it can change the state of the "</span><span class="rvts29">Run function</span><span class="rvts21">" button</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts25">Replay</span><span class="rvts21">:</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">emulator should be able to replay Taseditor project files as usual movie files, ignoring the additional data at the end of the file</span></li>
|
||
<li class="rvps10"><span class="rvts21">since Taseditor project file can be huge, emulator shouldn't load it into memory when opening</span></li>
|
||
<li class="rvps10"><span class="rvts21">emulator must distinguish between normal movie and Taseditor project file. If it's a project file: when user tries to rerecord, emulator should refuse and suggest launching TAS Editor instead. If user agrees, emulator should send Taseditor the reference to the project file</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts25">Other</span><span class="rvts21">:</span></p>
|
||
<ul style="text-indent: 30px; margin-left: 0px; list-style-position: inside;">
|
||
<li class="rvps10"><span class="rvts21">emulator environment should be stable and deterministic. Desyncs will invalidate Playback cursor navigation and make TASing unfeasible</span></li>
|
||
<li class="rvps10"><span class="rvts21">it's recommended to implement all the points mentioned in </span><a class="rvts27" href="MistakeProofing.html">Mistake-proofing</a><span class="rvts21"> that are related to emulator modification. In particular, Taseditor should be able to change certain settings, and user shouldn't be able to change them while Taseditor is on</span></li>
|
||
<li class="rvps10"><span class="rvts21">good emulation speed is necessary for adequate </span><a class="rvts27" href="NonlinearTASing.html#turbo-seeking">Turbo seeking</a><span class="rvts21"> feature. Also there should be an option to mute sound when turbo is on.</span></li>
|
||
</ul>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p class="rvps10"><span class="rvts21"><br/></span></p>
|
||
<p></p>
|
||
<p class="rvps8"><span class="rvts17">Created with the Personal Edition of HelpNDoc: </span><a class="rvts18" href="http://www.helpndoc.com/help-authoring-tool">Single source CHM, PDF, DOC and HTML Help creation</a></p>
|
||
</div>
|
||
|
||
<div id="topic_footer">
|
||
|
||
<div id="topic_footer_content">
|
||
Copyright © 2011-2012 AnS</div>
|
||
</div>
|
||
</body>
|
||
|
||
</html>
|
||
|