MCPcopy Create free account
hub / github.com/TASEmulators/fceux / toggleInput

Method toggleInput

src/drivers/win/taseditor/editor.cpp:155–184  ·  view source on GitHub ↗

---------------------------------------------------------------------------------------------- following functions use function parameters to determine range of frames

Source from the content-addressed store, hash-verified

153// ----------------------------------------------------------------------------------------------
154// following functions use function parameters to determine range of frames
155void EDITOR::toggleInput(int start, int end, int joy, int button, int consecutivenessTag)
156{
157 if (joy < 0 || joy >= joysticksPerFrame[getInputType(currMovieData)]) return;
158
159 int check_frame = end;
160 if (start > end)
161 {
162 // swap
163 int temp_start = start;
164 start = end;
165 end = temp_start;
166 }
167 if (start < 0) start = end;
168 if (end >= currMovieData.getNumRecords())
169 return;
170
171 if (currMovieData.records[check_frame].checkBit(joy, button))
172 {
173 // clear range
174 for (int i = start; i <= end; ++i)
175 currMovieData.records[i].clearBit(joy, button);
176 greenzone.invalidateAndUpdatePlayback(history.registerChanges(MODTYPE_UNSET, start, end, 0, NULL, consecutivenessTag));
177 } else
178 {
179 // set range
180 for (int i = start; i <= end; ++i)
181 currMovieData.records[i].setBit(joy, button);
182 greenzone.invalidateAndUpdatePlayback(history.registerChanges(MODTYPE_SET, start, end, 0, NULL, consecutivenessTag));
183 }
184}
185void EDITOR::setInputUsingPattern(int start, int end, int joy, int button, int consecutivenessTag)
186{
187 if (joy < 0 || joy >= joysticksPerFrame[getInputType(currMovieData)]) return;

Callers 1

listWndProcFunction · 0.45

Calls 7

getNumRecordsMethod · 0.80
checkBitMethod · 0.80
clearBitMethod · 0.80
setBitMethod · 0.80
getInputTypeFunction · 0.50
registerChangesMethod · 0.45

Tested by

no test coverage detected