* refined Recording, now can safely record commands (Power, Reset, Insert, Switch)
* new Lua scripts: SoundDisplay.lua, TrackNoise.lua
This commit is contained in:
parent
2c30bbe760
commit
a8ef2f72ce
|
@ -0,0 +1,57 @@
|
|||
---------------------------------------------------------------------------
|
||||
-- Display Sound Channels data
|
||||
---------------------------------------------------------------------------
|
||||
-- Showcases following functions:
|
||||
-- * sound.get()
|
||||
---------------------------------------------------------------------------
|
||||
-- Usage:
|
||||
-- The script allows you to observe raw data of 5 sound channels.
|
||||
-- Analysing such info you can notice some regularities in how
|
||||
-- the data oscillates/changes when ingame music plays.
|
||||
-- Then you can write scripts similar to \taseditor\TrackNoise.lua
|
||||
-- to facilitate synchronous dances in TAS movies.
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
function everyframe()
|
||||
snd = sound.get();
|
||||
|
||||
gui.text(0, 8, "Square 1:");
|
||||
gui.text(0, 16, snd.rp2a03.square1.volume);
|
||||
gui.text(0, 24, snd.rp2a03.square1.frequency);
|
||||
gui.text(0, 32, snd.rp2a03.square1.midikey);
|
||||
gui.text(0, 40, snd.rp2a03.square1.duty);
|
||||
gui.text(0, 48, snd.rp2a03.square1.regs.frequency);
|
||||
|
||||
gui.text(128, 8, "Square 2:");
|
||||
gui.text(128, 16, snd.rp2a03.square2.volume);
|
||||
gui.text(128, 24, snd.rp2a03.square2.frequency);
|
||||
gui.text(128, 32, snd.rp2a03.square2.midikey);
|
||||
gui.text(128, 40, snd.rp2a03.square2.duty);
|
||||
gui.text(128, 48, snd.rp2a03.square2.regs.frequency);
|
||||
|
||||
gui.text(0, 64, "Triangle:");
|
||||
gui.text(0, 72, snd.rp2a03.triangle.volume);
|
||||
gui.text(0, 80, snd.rp2a03.triangle.frequency);
|
||||
gui.text(0, 88, snd.rp2a03.triangle.midikey);
|
||||
gui.text(0, 96, snd.rp2a03.triangle.regs.frequency);
|
||||
|
||||
gui.text(128, 64, "Noise:");
|
||||
gui.text(128, 72, snd.rp2a03.noise.volume);
|
||||
gui.text(128, 80, tostring(snd.rp2a03.noise.short));
|
||||
gui.text(128, 88, snd.rp2a03.noise.frequency);
|
||||
gui.text(128, 96, snd.rp2a03.noise.midikey);
|
||||
gui.text(128, 104, snd.rp2a03.noise.regs.frequency);
|
||||
|
||||
gui.text(0, 120, "DPCM:");
|
||||
gui.text(0, 128, snd.rp2a03.dpcm.volume);
|
||||
gui.text(0, 136, snd.rp2a03.dpcm.frequency);
|
||||
gui.text(0, 144, snd.rp2a03.dpcm.midikey);
|
||||
gui.text(0, 152, snd.rp2a03.dpcm.dmcaddress);
|
||||
gui.text(0, 160, snd.rp2a03.dpcm.dmcsize);
|
||||
gui.text(0, 168, tostring(snd.rp2a03.dpcm.dmcloop));
|
||||
gui.text(0, 176, snd.rp2a03.dpcm.dmcseed);
|
||||
gui.text(0, 184, snd.rp2a03.dpcm.regs.frequency);
|
||||
end
|
||||
|
||||
emu.registerafter(everyframe);
|
||||
|
|
@ -34,7 +34,7 @@ function invert_selection()
|
|||
end
|
||||
|
||||
if (selection_table ~= nil) then
|
||||
-- Substract current selection from new selection set
|
||||
-- Substract old selection from new selection set
|
||||
for i = #old_sel, 1, -1 do
|
||||
selected_frame = old_sel[i];
|
||||
-- we're taking advantage of the fact that "old_sel" is sorted in ascending order
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
-- Run the script, unpause emulation (or simply Frame Advance once).
|
||||
-- Now you can select several frames of input data and then
|
||||
-- press "Run function" button to swap inputs of 1P and 2P.
|
||||
-- You can easily modify the script to swap any other joypads.
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
function swap()
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
---------------------------------------------------------------------------
|
||||
-- Tracking Noise channel volume peaks
|
||||
---------------------------------------------------------------------------
|
||||
-- Showcases following functions:
|
||||
-- * sound.get()
|
||||
-- * taseditor.markedframe()
|
||||
-- * taseditor.getmarker()
|
||||
-- * taseditor.setmarker()
|
||||
-- * taseditor.getnote()
|
||||
-- * taseditor.setnote()
|
||||
---------------------------------------------------------------------------
|
||||
-- Usage:
|
||||
-- Run the script, unpause emulation.
|
||||
-- When the "Auto function" checkbox is checked, the script will
|
||||
-- automatically create Markers on various frames according to ingame music.
|
||||
-- These Markers should help you see music patterns,
|
||||
-- so you can adjust input precisely creating nice Tool-Assisted dances.
|
||||
--
|
||||
-- This script uses Noise channel volume as an indicator for setting Markers,
|
||||
-- but it's possible to use any other property of sound channels
|
||||
-- as a factor to decide whether to set Marker on current frame.
|
||||
--
|
||||
-- The script was tested on Super Mario Bros, Megaman and Duck Tales.
|
||||
-- You may want to see it in slow-mo. Use -/= hotkeys to change emulation speed.
|
||||
--
|
||||
-- To create customized script for your game, first use SoundDisplay.lua
|
||||
-- to collect and analyse statistics about ingame music. Then choose
|
||||
-- which channel you want to sync your input to. Finally, change this script
|
||||
-- so that Markers will be created using new set of rules.
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
NOISE_VOL_FACTOR = 3.0;
|
||||
|
||||
function track_changes()
|
||||
if (taseditor.engaged()) then
|
||||
current_frame = movie.framecount();
|
||||
if (last_frame ~= current_frame) then
|
||||
-- Playback has moved
|
||||
-- Get current value of indicator for current_frame
|
||||
snd = sound.get();
|
||||
indicator = NOISE_VOL_FACTOR * snd.rp2a03.noise.volume;
|
||||
-- If Playback moved 1 frame forward, this was probably Frame Advance
|
||||
if (last_frame == current_frame - 1) then
|
||||
-- Looks like we advanced one frame from the last time
|
||||
-- Decide whether to set Marker
|
||||
if (indicator >= 1 and last_frame_indicator_value == 0) then
|
||||
-- this was a peak in volume! ____/\____
|
||||
-- Set Marker and show frequency of noise+triangle in its Note
|
||||
SetSoundMarker(current_frame - 1, "Sound: " .. (snd.rp2a03.noise.regs.frequency + snd.rp2a03.triangle.regs.frequency));
|
||||
end
|
||||
end
|
||||
last_frame = current_frame;
|
||||
last_frame_indicator_value = indicator;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SetSoundMarker(frame, new_note)
|
||||
if (taseditor.markedframe(frame)) then
|
||||
-- this frame is already marked
|
||||
old_note = taseditor.getnote(taseditor.getmarker(frame));
|
||||
-- check if the Note of the Marker already contains new_note text
|
||||
if (string.find(old_note, new_note) == nil) then
|
||||
-- append new_note text to the Marker's Note
|
||||
taseditor.setnote(taseditor.getmarker(frame), old_note .. " " .. new_note);
|
||||
end
|
||||
else
|
||||
-- this frame isn't marked
|
||||
-- create new Marker here
|
||||
new_marker = taseditor.setmarker(frame);
|
||||
taseditor.setnote(new_marker, new_note);
|
||||
end
|
||||
end
|
||||
|
||||
last_frame = 0;
|
||||
last_frame_indicator_value = 0;
|
||||
|
||||
taseditor.registerauto(track_changes);
|
||||
|
|
@ -336,7 +336,7 @@ enum EFCEUI
|
|||
FCEUI_STOPMOVIE, FCEUI_RECORDMOVIE, FCEUI_PLAYMOVIE,
|
||||
FCEUI_OPENGAME, FCEUI_CLOSEGAME,
|
||||
FCEUI_TASEDITOR,
|
||||
FCEUI_RESET, FCEUI_POWER,FCEUI_PLAYFROMBEGINNING
|
||||
FCEUI_RESET, FCEUI_POWER, FCEUI_PLAYFROMBEGINNING, FCEUI_EJECT_DISK, FCEUI_SWITCH_DISK
|
||||
};
|
||||
|
||||
//checks whether an EFCEUI is valid right now
|
||||
|
|
|
@ -717,3 +717,10 @@ void ClearTaseditorInput()
|
|||
JoystickClearBackgroundAccessBit(JOYBACKACCESS_TASEDITOR);
|
||||
}
|
||||
|
||||
// this getter contains formula to decide whether to record or replay movie
|
||||
bool TaseditorIsRecording()
|
||||
{
|
||||
if (movie_readonly || turbo || playback.pause_frame > currFrameCounter)
|
||||
return false; // replay
|
||||
return true; // record
|
||||
}
|
|
@ -28,3 +28,5 @@ void SetInputType(MovieData& md, int new_input_type);
|
|||
|
||||
void SetTaseditorInput();
|
||||
void ClearTaseditorInput();
|
||||
|
||||
bool TaseditorIsRecording();
|
||||
|
|
|
@ -120,9 +120,10 @@ void PLAYBACK::update()
|
|||
bookmarks.RedrawChangedBookmarks(lastCursor);
|
||||
list.RedrawRow(currFrameCounter);
|
||||
bookmarks.RedrawChangedBookmarks(currFrameCounter);
|
||||
// enforce redrawing now
|
||||
lastCursor = currFrameCounter;
|
||||
UpdateWindow(list.hwndList);
|
||||
if (taseditor_config.follow_playback && !turbo)
|
||||
// enforce redrawing now
|
||||
UpdateWindow(list.hwndList);
|
||||
// lazy update of "Playback's Marker text"
|
||||
int current_marker = markers_manager.GetMarkerUp(currFrameCounter);
|
||||
if (shown_marker != current_marker)
|
||||
|
@ -380,6 +381,19 @@ void PLAYBACK::SetProgressbar(int a, int b)
|
|||
{
|
||||
SendMessage(hwndProgressbar, PBM_SETPOS, PROGRESSBAR_WIDTH * a / b, 0);
|
||||
}
|
||||
void PLAYBACK::ClickOnProgressbar()
|
||||
{
|
||||
// delete lost_position pointer (green arrow)
|
||||
if (lost_position_frame)
|
||||
{
|
||||
int temp = lost_position_frame - 1;
|
||||
lost_position_frame = 0;
|
||||
list.RedrawRow(temp);
|
||||
}
|
||||
// and stop seeking
|
||||
if (pause_frame)
|
||||
SeekingStop();
|
||||
}
|
||||
// -------------------------------------------------------------------------
|
||||
LRESULT APIENTRY UpperMarkerEditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
|
||||
int GetFlashingPauseFrame();
|
||||
void SetProgressbar(int a, int b);
|
||||
void ClickOnProgressbar();
|
||||
|
||||
bool JumpToFrame(int index);
|
||||
|
||||
|
|
|
@ -220,6 +220,15 @@ void RECORDER::InputChanged()
|
|||
list.SetHeaderColumnLight(COLUMN_JOYPAD1_A + joy * NUM_JOYPAD_BUTTONS + button, HEADER_LIGHT_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
if (!changes_made)
|
||||
{
|
||||
// check if new commands were recorded
|
||||
if (currMovieData.records[currFrameCounter].commands != history.GetCurrentSnapshot().GetCommandsInfo(currFrameCounter))
|
||||
changes_made = true;
|
||||
}
|
||||
|
||||
// register changes
|
||||
if (changes_made)
|
||||
{
|
||||
history.RegisterRecording(currFrameCounter);
|
||||
|
|
|
@ -470,6 +470,11 @@ int SNAPSHOT::GetJoystickInfo(int frame, int joy)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
int SNAPSHOT::GetCommandsInfo(int frame)
|
||||
{
|
||||
if (frame < 0 || frame >= size) return 0;
|
||||
return commands[frame];
|
||||
}
|
||||
|
||||
void SNAPSHOT::insertFrames(int at, int frames)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,7 @@ public:
|
|||
int findFirstChange(MovieData& md, int start = 0, int end = -1);
|
||||
|
||||
int GetJoystickInfo(int frame, int joy);
|
||||
int GetCommandsInfo(int frame);
|
||||
|
||||
void insertFrames(int at, int frames);
|
||||
void eraseFrame(int frame);
|
||||
|
|
|
@ -11,8 +11,8 @@ TASEDITOR_CONFIG::TASEDITOR_CONFIG()
|
|||
wndheight = 0;
|
||||
findnote_wndx = 0;
|
||||
findnote_wndy = 0;
|
||||
follow_playback = true;
|
||||
turbo_seek = true;
|
||||
follow_playback = false;
|
||||
turbo_seek = false;
|
||||
show_lag_frames = true;
|
||||
show_markers = true;
|
||||
show_branch_screenshots = true;
|
||||
|
|
|
@ -116,6 +116,7 @@ int TASEDITOR_LUA::setmarker(int frame)
|
|||
// new marker was created - register changes in TAS Editor
|
||||
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_SET, frame);
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
list.RedrawRow(frame);
|
||||
list.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
|
||||
}
|
||||
}
|
||||
|
@ -135,6 +136,7 @@ void TASEDITOR_LUA::clearmarker(int frame)
|
|||
// marker was deleted - register changes in TAS Editor
|
||||
history.RegisterMarkersChange(MODTYPE_LUA_MARKER_UNSET, frame);
|
||||
selection.must_find_current_marker = playback.must_find_current_marker = true;
|
||||
list.RedrawRow(frame);
|
||||
list.SetHeaderColumnLight(COLUMN_FRAMENUM, HEADER_LIGHT_MAX);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1105,8 +1105,7 @@ BOOL CALLBACK WndprocTasEditor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||
taseditor_window.UpdateCheckedItems();
|
||||
break;
|
||||
case IDC_PROGRESS_BUTTON:
|
||||
// click on progressbar - stop seeking
|
||||
if (playback.pause_frame) playback.SeekingStop();
|
||||
playback.ClickOnProgressbar();
|
||||
break;
|
||||
case IDC_BRANCHES_BUTTON:
|
||||
// click on "Bookmarks/Branches" - switch "View Tree of branches"
|
||||
|
|
|
@ -2275,6 +2275,8 @@ adelikat: Outsourced this to a remappable hotkey
|
|||
UpdateMenuHotkeys();
|
||||
EnableMenuItem(fceumenu,MENU_RESET,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_RESET)?MF_ENABLED:MF_GRAYED));
|
||||
EnableMenuItem(fceumenu,MENU_POWER,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_POWER)?MF_ENABLED:MF_GRAYED));
|
||||
EnableMenuItem(fceumenu,MENU_EJECT_DISK,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_EJECT_DISK)?MF_ENABLED:MF_GRAYED));
|
||||
EnableMenuItem(fceumenu,MENU_SWITCH_DISK,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_SWITCH_DISK)?MF_ENABLED:MF_GRAYED));
|
||||
EnableMenuItem(fceumenu,MENU_TASEDITOR,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_TASEDITOR)?MF_ENABLED:MF_GRAYED));
|
||||
EnableMenuItem(fceumenu,MENU_CLOSE_FILE,MF_BYCOMMAND | (FCEU_IsValidUI(FCEUI_CLOSEGAME) && GameInfo ?MF_ENABLED:MF_GRAYED));
|
||||
EnableMenuItem(fceumenu,MENU_RECENT_FILES,MF_BYCOMMAND | ((FCEU_IsValidUI(FCEUI_OPENGAME) && HasRecentFiles()) ?MF_ENABLED:MF_GRAYED)); //adelikat - added && recent_files, otherwise this line prevents recent from ever being gray when TAS Editor is not engaged
|
||||
|
|
20
src/fceu.cpp
20
src/fceu.cpp
|
@ -55,6 +55,8 @@
|
|||
|
||||
#include "drivers/win/taseditor/greenzone.h"
|
||||
extern GREENZONE greenzone;
|
||||
|
||||
extern bool TaseditorIsRecording();
|
||||
#endif
|
||||
|
||||
#include <fstream>
|
||||
|
@ -740,6 +742,8 @@ void ResetNES(void)
|
|||
// clear back baffer
|
||||
extern uint8 *XBackBuf;
|
||||
memset(XBackBuf,0,256*256);
|
||||
|
||||
FCEU_DispMessage("Reset", 0);
|
||||
}
|
||||
|
||||
void FCEU_MemoryRand(uint8 *ptr, uint32 size)
|
||||
|
@ -813,6 +817,7 @@ void PowerNES(void)
|
|||
#ifdef WIN32
|
||||
Update_RAM_Search(); // Update_RAM_Watch() is also called.
|
||||
#endif
|
||||
FCEU_DispMessage("Power on", 0);
|
||||
}
|
||||
|
||||
void FCEU_ResetVidSys(void)
|
||||
|
@ -1031,25 +1036,28 @@ bool FCEU_IsValidUI(EFCEUI ui)
|
|||
break;
|
||||
|
||||
case FCEUI_STOPMOVIE:
|
||||
case FCEUI_PLAYFROMBEGINNING:
|
||||
return (FCEUMOV_Mode(MOVIEMODE_PLAY|MOVIEMODE_RECORD|MOVIEMODE_FINISHED));
|
||||
|
||||
case FCEUI_PLAYFROMBEGINNING:
|
||||
return (FCEUMOV_Mode(MOVIEMODE_PLAY|MOVIEMODE_RECORD|MOVIEMODE_TASEDITOR|MOVIEMODE_FINISHED));
|
||||
|
||||
case FCEUI_STOPAVI:
|
||||
return FCEUI_AviIsRecording();
|
||||
|
||||
case FCEUI_TASEDITOR:
|
||||
if(!GameInfo) return false;
|
||||
if(FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) return false;
|
||||
if(FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) return false; // can't run two TAS Editors
|
||||
break;
|
||||
|
||||
case FCEUI_RESET:
|
||||
if(!GameInfo) return false;
|
||||
if(FCEUMOV_Mode(MOVIEMODE_FINISHED|MOVIEMODE_TASEDITOR|MOVIEMODE_PLAY)) return false;
|
||||
break;
|
||||
|
||||
case FCEUI_POWER:
|
||||
case FCEUI_EJECT_DISK:
|
||||
case FCEUI_SWITCH_DISK:
|
||||
if(!GameInfo) return false;
|
||||
if(FCEUMOV_Mode(MOVIEMODE_RECORD)) return true;
|
||||
#ifdef WIN32
|
||||
if(FCEUMOV_Mode(MOVIEMODE_TASEDITOR) && TaseditorIsRecording()) return true;
|
||||
#endif
|
||||
if(!FCEUMOV_Mode(MOVIEMODE_INACTIVE)) return false;
|
||||
break;
|
||||
|
||||
|
|
|
@ -553,23 +553,31 @@ void FCEU_QSimpleCommand(int cmd)
|
|||
FCEUNET_SendCommand(cmd, 0);
|
||||
else
|
||||
{
|
||||
FCEU_DoSimpleCommand(cmd);
|
||||
if(FCEUMOV_Mode(MOVIEMODE_RECORD))
|
||||
if(!FCEUMOV_Mode(MOVIEMODE_TASEDITOR)) // TAS Editor will do the command himself
|
||||
FCEU_DoSimpleCommand(cmd);
|
||||
if(FCEUMOV_Mode(MOVIEMODE_RECORD|MOVIEMODE_TASEDITOR))
|
||||
FCEUMOV_AddCommand(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
void FCEUI_FDSSelect(void)
|
||||
{
|
||||
if(!FCEU_IsValidUI(FCEUI_SWITCH_DISK))
|
||||
return;
|
||||
|
||||
FCEU_DispMessage("Command: Switch disk side", 0);
|
||||
FCEU_QSimpleCommand(FCEUNPCMD_FDSSELECT);
|
||||
}
|
||||
|
||||
void FCEUI_FDSInsert(void)
|
||||
{
|
||||
if(!FCEU_IsValidUI(FCEUI_EJECT_DISK))
|
||||
return;
|
||||
|
||||
FCEU_DispMessage("Command: Insert/Eject disk", 0);
|
||||
FCEU_QSimpleCommand(FCEUNPCMD_FDSINSERT);
|
||||
}
|
||||
|
||||
|
||||
void FCEUI_VSUniToggleDIP(int w)
|
||||
{
|
||||
FCEU_QSimpleCommand(FCEUNPCMD_VSUNIDIP0 + w);
|
||||
|
@ -593,9 +601,10 @@ void FCEUI_ResetNES(void)
|
|||
{
|
||||
if(!FCEU_IsValidUI(FCEUI_RESET))
|
||||
return;
|
||||
|
||||
FCEU_DispMessage("Command: Soft reset", 0);
|
||||
FCEU_QSimpleCommand(FCEUNPCMD_RESET);
|
||||
ResetFrameCounter();
|
||||
FCEU_DispMessage("Soft reset", 0);
|
||||
}
|
||||
|
||||
//Powers off the NES
|
||||
|
@ -603,9 +612,10 @@ void FCEUI_PowerNES(void)
|
|||
{
|
||||
if(!FCEU_IsValidUI(FCEUI_POWER))
|
||||
return;
|
||||
|
||||
FCEU_DispMessage("Command: Power switch", 0);
|
||||
FCEU_QSimpleCommand(FCEUNPCMD_POWER);
|
||||
ResetFrameCounter();
|
||||
FCEU_DispMessage("Power switch", 0);
|
||||
}
|
||||
|
||||
const char* FCEUI_CommandTypeNames[]=
|
||||
|
@ -663,8 +673,8 @@ static void TaseditorRestorePlayback(void);
|
|||
|
||||
struct EMUCMDTABLE FCEUI_CommandTable[]=
|
||||
{
|
||||
{ EMUCMD_POWER, EMUCMDTYPE_MISC, FCEUI_PowerNES, 0, 0, "Power", 0 },
|
||||
{ EMUCMD_RESET, EMUCMDTYPE_MISC, FCEUI_ResetNES, 0, 0, "Reset", 0 },
|
||||
{ EMUCMD_POWER, EMUCMDTYPE_MISC, FCEUI_PowerNES, 0, 0, "Power", EMUCMDFLAG_TASEDITOR },
|
||||
{ EMUCMD_RESET, EMUCMDTYPE_MISC, FCEUI_ResetNES, 0, 0, "Reset", EMUCMDFLAG_TASEDITOR },
|
||||
{ EMUCMD_PAUSE, EMUCMDTYPE_MISC, FCEUI_ToggleEmulationPause, 0, 0, "Pause", EMUCMDFLAG_TASEDITOR },
|
||||
{ EMUCMD_FRAME_ADVANCE, EMUCMDTYPE_MISC, FCEUI_FrameAdvance, FCEUI_FrameAdvanceEnd, 0, "Frame Advance", EMUCMDFLAG_TASEDITOR },
|
||||
{ EMUCMD_SCREENSHOT, EMUCMDTYPE_MISC, FCEUI_SaveSnapshot, 0, 0, "Screenshot", EMUCMDFLAG_TASEDITOR },
|
||||
|
@ -737,8 +747,8 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
|
|||
{ EMUCMD_AVI_RECORD_AS, EMUCMDTYPE_AVI, FCEUD_AviRecordTo, 0, 0, "Record AVI As...", 0 },
|
||||
{ EMUCMD_AVI_STOP, EMUCMDTYPE_AVI, FCEUD_AviStop, 0, 0, "Stop AVI", 0 },
|
||||
|
||||
{ EMUCMD_FDS_EJECT_INSERT, EMUCMDTYPE_FDS, FCEUI_FDSInsert, 0, 0, "Eject or Insert FDS Disk", 0 },
|
||||
{ EMUCMD_FDS_SIDE_SELECT, EMUCMDTYPE_FDS, FCEUI_FDSSelect, 0, 0, "Switch FDS Disk Side", 0 },
|
||||
{ EMUCMD_FDS_EJECT_INSERT, EMUCMDTYPE_FDS, FCEUI_FDSInsert, 0, 0, "Eject or Insert FDS Disk", EMUCMDFLAG_TASEDITOR },
|
||||
{ EMUCMD_FDS_SIDE_SELECT, EMUCMDTYPE_FDS, FCEUI_FDSSelect, 0, 0, "Switch FDS Disk Side", EMUCMDFLAG_TASEDITOR },
|
||||
|
||||
{ EMUCMD_VSUNI_COIN, EMUCMDTYPE_VSUNI, FCEUI_VSUniCoin, 0, 0, "Insert Coin", 0 },
|
||||
{ EMUCMD_VSUNI_TOGGLE_DIP_0, EMUCMDTYPE_VSUNI, CommandToggleDip, 0, 0, "Toggle Dipswitch 0", 0 },
|
||||
|
@ -759,7 +769,7 @@ struct EMUCMDTABLE FCEUI_CommandTable[]=
|
|||
{ EMUCMD_MISC_DISPLAY_BG_TOGGLE, EMUCMDTYPE_MISC, BackgroundDisplayToggle, 0, 0, "Toggle Background Display", 0 },
|
||||
{ EMUCMD_MISC_DISPLAY_OBJ_TOGGLE, EMUCMDTYPE_MISC, ObjectDisplayToggle, 0, 0, "Toggle Object Display", 0 },
|
||||
{ EMUCMD_MISC_DISPLAY_LAGCOUNTER_TOGGLE,EMUCMDTYPE_MISC, LagCounterToggle, 0, 0, "Lag Counter Toggle", EMUCMDFLAG_TASEDITOR },
|
||||
{ EMUCMD_MISC_OPENTASEDITOR, EMUCMDTYPE_TOOL, LaunchTasEditor, 0, 0, "Open TAS Editor", 0},
|
||||
{ EMUCMD_MISC_OPENTASEDITOR, EMUCMDTYPE_TOOL, LaunchTasEditor, 0, 0, "Open TAS Editor", 0},
|
||||
{ EMUCMD_TOOL_OPENMEMORYWATCH, EMUCMDTYPE_TOOL, LaunchMemoryWatch,0, 0, "Open Memory Watch", EMUCMDFLAG_TASEDITOR },
|
||||
{ EMUCMD_TOOL_OPENCHEATS, EMUCMDTYPE_TOOL, LaunchCheats, 0, 0, "Open Cheats", 0},
|
||||
{ EMUCMD_TOOL_OPENDEBUGGER, EMUCMDTYPE_TOOL, LaunchDebugger, 0, 0, "Open Debugger", 0},
|
||||
|
|
|
@ -44,6 +44,8 @@ extern void AddRecentMovieFile(const char *filename);
|
|||
#include "./drivers/win/taseditor/recorder.h"
|
||||
extern PLAYBACK playback;
|
||||
extern RECORDER recorder;
|
||||
|
||||
extern bool TaseditorIsRecording();
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
@ -984,27 +986,27 @@ void FCEUMOV_AddInputState()
|
|||
currMovieData.insertEmpty(-1, 2 + currFrameCounter - (int)currMovieData.records.size());
|
||||
|
||||
MovieRecord* mr = &currMovieData.records[currFrameCounter];
|
||||
if(movie_readonly || turbo || playback.pause_frame > currFrameCounter)
|
||||
if(TaseditorIsRecording())
|
||||
{
|
||||
// replay buttons
|
||||
if(mr->command_reset())
|
||||
ResetNES();
|
||||
if(mr->command_fds_insert())
|
||||
FCEU_FDSInsert();
|
||||
if(mr->command_fds_select())
|
||||
FCEU_FDSSelect();
|
||||
joyports[0].load(mr);
|
||||
joyports[1].load(mr);
|
||||
} else
|
||||
{
|
||||
// record buttons
|
||||
// record commands and buttons
|
||||
mr->commands |= _currCommand;
|
||||
joyports[0].log(mr);
|
||||
joyports[1].log(mr);
|
||||
recorder.InputChanged();
|
||||
// return data from movie to joyports in case Recorder changed it (for example, by applying Superimpose)
|
||||
joyports[0].load(mr);
|
||||
joyports[1].load(mr);
|
||||
// replay buttons even when Recording - return data from movie to joyports in case Recorder changed it (for example, by applying Superimpose)
|
||||
}
|
||||
// replay buttons
|
||||
joyports[0].load(mr);
|
||||
joyports[1].load(mr);
|
||||
// replay commands
|
||||
if(mr->command_power())
|
||||
PowerNES();
|
||||
if(mr->command_reset())
|
||||
ResetNES();
|
||||
if(mr->command_fds_insert())
|
||||
FCEU_FDSInsert();
|
||||
if(mr->command_fds_select())
|
||||
FCEU_FDSSelect();
|
||||
_currCommand = 0;
|
||||
} else
|
||||
#endif
|
||||
|
@ -1022,13 +1024,10 @@ void FCEUMOV_AddInputState()
|
|||
//reset and power cycle if necessary
|
||||
if(mr->command_power())
|
||||
PowerNES();
|
||||
|
||||
if(mr->command_reset())
|
||||
ResetNES();
|
||||
|
||||
if(mr->command_fds_insert())
|
||||
FCEU_FDSInsert();
|
||||
|
||||
if(mr->command_fds_select())
|
||||
FCEU_FDSSelect();
|
||||
|
||||
|
@ -1083,7 +1082,7 @@ void FCEUMOV_AddInputState()
|
|||
void FCEUMOV_AddCommand(int cmd)
|
||||
{
|
||||
// do nothing if not recording a movie
|
||||
if(movieMode != MOVIEMODE_RECORD)
|
||||
if(movieMode != MOVIEMODE_RECORD && movieMode != MOVIEMODE_TASEDITOR)
|
||||
return;
|
||||
|
||||
//NOTE: EMOVIECMD matches FCEUNPCMD_RESET and FCEUNPCMD_POWER
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue