even with ishii 148fc7f36727c5a6947386368acf6066d61c11a4

This commit is contained in:
R2DLiu 2020-12-07 00:58:00 -05:00
commit 084e805a0a
5 changed files with 32 additions and 3 deletions

View file

@ -956,6 +956,8 @@ void CEXISlippi::prepareGeckoList()
{0x80376200, true}, // Binary/LagReduction/PD+VB.bin
{0x801A5018, true}, // Binary/LagReduction/PD+VB.bin
{0x80218D68, true}, // Binary/LagReduction/PD+VB.bin
{0x8016E9AC, true}, // Binary/Force2PCenterHud.bin
{0x80030E44, true}, // Binary/DisableScreenShake.bin
{0x800055f0, true}, // Common/EXITransferBuffer.asm
{0x800055f8, true}, // Common/GetIsFollower.asm
@ -986,7 +988,6 @@ void CEXISlippi::prepareGeckoList()
{0x800C0148, true}, // External/FlashRedFailedLCancel/ChangeColor.asm
{0x8008D690, true}, // External/FlashRedFailedLCancel/TriggerColor.asm
{0x8006A880, true}, // Online/Core/BrawlOffscreenDamage.asm
{0x801A4DB4, true}, // Online/Core/ForceEngineOnRollback.asm
{0x8016D310, true}, // Online/Core/HandleLRAS.asm
{0x8034DED8, true}, // Online/Core/HandleRumble.asm
@ -1013,6 +1014,10 @@ void CEXISlippi::prepareGeckoList()
{0x801A45BC, true}, // Online/Slippi Online Scene/main.asm
{0x801a45b8, true}, // Online/Slippi Online Scene/main.asm (https://bit.ly/3kxohf4)
{0x801BFA20, true}, // Online/Slippi Online Scene/boot.asm
{0x800cc818, true}, // External/GreenDuringWait/fall.asm
{0x8008a478, true}, // External/GreenDuringWait/wait.asm
{0x802f6690, true}, // HUD Transparency v1.1
};
std::unordered_map<u32, bool> blacklist;
@ -1583,8 +1588,10 @@ void CEXISlippi::prepareOpponentInputs(u8* payload)
void CEXISlippi::handleCaptureSavestate(u8* payload)
{
#ifndef IS_PLAYBACK
if (isDisconnected())
return;
#endif
s32 frame = payload[0] << 24 | payload[1] << 16 | payload[2] << 8 | payload[3];
@ -2106,6 +2113,15 @@ void CEXISlippi::handleConnectionCleanup()
ERROR_LOG(SLIPPI_ONLINE, "Connection cleanup completed...");
}
void CEXISlippi::prepareNewSeed()
{
m_read_queue.clear();
u32 newSeed = generator() % 0xFFFFFFFF;
appendWordToBuffer(&m_read_queue, newSeed);
}
void CEXISlippi::DMAWrite(u32 _uAddr, u32 _uSize)
{
u8* memPtr = Memory::GetPointer(_uAddr);
@ -2136,6 +2152,7 @@ void CEXISlippi::DMAWrite(u32 _uAddr, u32 _uSize)
if (byte == CMD_MENU_FRAME)
{
SlippiSpectateServer::getInstance().write(&memPtr[0], _uSize);
// g_needInputForFrame = true;
}
INFO_LOG(EXPANSIONINTERFACE, "EXI SLIPPI DMAWrite: addr: 0x%08x size: %d, bufLoc:[%02x %02x %02x %02x %02x]",
@ -2224,6 +2241,9 @@ void CEXISlippi::DMAWrite(u32 _uAddr, u32 _uSize)
case CMD_UPDATE:
handleUpdateAppRequest();
break;
case CMD_GET_NEW_SEED:
prepareNewSeed();
break;
default:
writeToFileAsync(&memPtr[bufLoc], payloadLen + 1, "");
SlippiSpectateServer::getInstance().write(&memPtr[bufLoc], payloadLen + 1);

View file

@ -70,7 +70,7 @@ namespace ExpansionInterface
CMD_UPDATE = 0xB8,
CMD_GET_ONLINE_STATUS = 0xB9,
CMD_CLEANUP_CONNECTION = 0xBA,
CMD_GET_NEW_SEED = 0xBC,
// Misc
CMD_LOG_MESSAGE = 0xD0,
CMD_FILE_LENGTH = 0xD1,
@ -112,7 +112,7 @@ namespace ExpansionInterface
{CMD_UPDATE, 0},
{CMD_GET_ONLINE_STATUS, 0},
{CMD_CLEANUP_CONNECTION, 0},
{CMD_GET_NEW_SEED, 0},
// Misc
{CMD_LOG_MESSAGE, 0xFFFF}, // Variable size... will only work if by itself
{CMD_FILE_LENGTH, 0x40},
@ -165,6 +165,7 @@ namespace ExpansionInterface
void handleUpdateAppRequest();
void prepareOnlineStatus();
void handleConnectionCleanup();
void prepareNewSeed();
// replay playback stuff
void prepareGameInfo(u8* payload);

View file

@ -210,12 +210,14 @@ int main(int argc, char* argv[])
UICommon::SetUserDirectory(user_directory);
UICommon::Init();
#ifdef IS_PLAYBACK
std::optional<std::string> slippi_input_path;
if (options.is_set("slippi_input"))
{
slippi_input_path = static_cast<const char*>(options.get("slippi_input"));
SConfig::GetInstance().m_strSlippiInput = slippi_input_path.value();
}
#endif
s_platform = GetPlatform(options);
if (!s_platform || !s_platform->Init())

View file

@ -162,6 +162,10 @@ void PipeDevice::UpdateInput()
// then dequeue a command off the front of m_buf and parse it.
char buf[32];
s32 bytes_read = readFromPipe(m_fd, buf, sizeof buf);
if (bytes_read == 0) {
// Pipe died, so just quit out
return;
}
while (bytes_read > 0)
{
m_buf.append(buf, bytes_read);

View file

@ -118,11 +118,13 @@ std::unique_ptr<optparse::OptionParser> CreateParser(ParserOptions options)
parser->add_option("-a", "--audio_emulation")
.choices({"HLE", "LLE"})
.help("Choose audio emulation from [%choices]");
#ifdef IS_PLAYBACK
parser->add_option("-i", "--slippi_input")
.action("store")
.metavar("<file>")
.type("string")
.help("Path to Slippi replay config file (default: Slippi/playback.txt)");
#endif
parser->add_option("-hs", "--hide-seekbar")
.action("store_true")
.help("Disable and hide seekbar during playback");