Skip to content

Commit

Permalink
Updated assets, added last page tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
GrapheneCt committed May 7, 2023
1 parent 21e4526 commit 795d315
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 15 deletions.
Binary file modified NetStream/CONTENTS/sce_sys/livearea/contents/title-en.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions NetStream/NetStream.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<AdditionalOptions>--no-standard-libraries </AdditionalOptions>
<AdditionalLibraryDirectories>$(SCE_PSP2_SDK_DIR)\target\lib\vdsuite;$(ProjectDir)libs\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateSnMapFile>FullMapFile</GenerateSnMapFile>
<AdditionalDependencies>-lSceIpmi_stub;-lSceSysmem_stub;-lSceThreadMgr_stub;-lSceThreadmgrCoredumpTime_stub;-lSceModuleMgr_stub;-lSceProcessMgr_stub;-lSceTouch_stub;-lSceAppMgr_stub;-lSceAppMgrUser_stub;-lSceAppUtil_stub;-lSceAudio_stub;-lSceCtrl_stub;-lSceDisplay_stub;-lScePower_stub;-lSceSysmodule_stub;-lSceGxm_stub;-lSceDbg_stub;-lScePafThread_stub;-lScePafStdc_stub;-lScePafToplevel_stub;-lScePafResource_stub;-lScePafWidget_stub;-lScePafMisc_stub;-lScePafCommon_stub;-lScePafGraphics_stub;-lSceLibKernel_stub;-lSceNet_stub;-lSceNetCtl_stub;-lSceHttp_stub;-lSceSsl_stub;-lSceAppSettings_stub;-lSceCommonGuiDialog_stub;-lSceIniFileProcessor_stub;-lSceBEAVCorePlayer_stub;-lSceDmacmgr_stub;-lSceFiber_stub;-lSceVshBridge_stub;-ltaihenUnsafe_stub;-lInvidious_stub;-lLootkit_stub;-lcurl_stub;-lfmodstudio_stub;-lfmodngpext_stub;-lsnc;-lPafFileExt;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>-lSceIpmi_stub;-lSceSysmem_stub;-lSceThreadMgr_stub;-lSceThreadmgrCoredumpTime_stub;-lSceModuleMgr_stub;-lSceProcessMgr_stub;-lSceTouch_stub;-lSceAppMgr_stub;-lSceAppMgrUser_stub;-lSceAppUtil_stub;-lSceAudio_stub;-lSceCtrl_stub;-lSceDisplay_stub;-lScePower_stub;-lSceSysmodule_stub;-lSceGxm_stub;-lSceDbg_stub;-lScePafThread_stub;-lScePafStdc_stub;-lScePafToplevel_stub;-lScePafResource_stub;-lScePafWidget_stub;-lScePafMisc_stub;-lScePafCommon_stub;-lScePafGraphics_stub;-lSceLibKernel_stub;-lSceNet_stub;-lSceNetCtl_stub;-lSceAppSettings_stub;-lSceCommonGuiDialog_stub;-lSceIniFileProcessor_stub;-lSceBEAVCorePlayer_stub;-lSceDmacmgr_stub;-lSceFiber_stub;-lSceVshBridge_stub;-ltaihenUnsafe_stub;-lInvidious_stub;-lLootkit_stub;-lcurl_stub;-lfmodstudio_stub;-lfmodngpext_stub;-lsnc;-lPafFileExt;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>"$(SCE_PSP2_SDK_DIR)/host_tools/build/bin/vdsuite-pubprx.exe" --boot-param "$(ProjectDir)ebootparam.bin" "$(LocalDebuggerCommand)" "$(OutDir)eboot.bin"</Command>
Expand Down Expand Up @@ -161,7 +161,7 @@
</Link>
<Link>
<DuplicateStripping>true</DuplicateStripping>
<AdditionalOptions>--no-standard-libraries </AdditionalOptions>
<AdditionalOptions>--no-standard-libraries</AdditionalOptions>
<AdditionalDependencies>-lSceIpmi_stub;-lSceSysmem_stub;-lSceThreadMgr_stub;-lSceThreadmgrCoredumpTime_stub;-lSceModuleMgr_stub;-lSceProcessMgr_stub;-lSceTouch_stub;-lSceAppMgr_stub;-lSceAppMgrUser_stub;-lSceAppUtil_stub;-lSceAudio_stub;-lSceCtrl_stub;-lSceDisplay_stub;-lScePower_stub;-lSceSysmodule_stub;-lSceGxm_stub;-lSceDbg_stub;-lScePafThread_stub;-lScePafStdc_stub;-lScePafToplevel_stub;-lScePafResource_stub;-lScePafWidget_stub;-lScePafMisc_stub;-lScePafCommon_stub;-lScePafGraphics_stub;-lSceLibKernel_stub;-lSceNet_stub;-lSceNetCtl_stub;-lSceAppSettings_stub;-lSceCommonGuiDialog_stub;-lSceIniFileProcessor_stub;-lSceBEAVCorePlayer_stub;-lSceDmacmgr_stub;-lSceFiber_stub;-lSceVshBridge_stub;-ltaihenUnsafe_stub;-lInvidious_stub;-lLootkit_stub;-lcurl_stub;-lfmodstudio_stub;-lfmodngpext_stub;-lsnc;-lPafFileExt;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
Expand Down
6 changes: 6 additions & 0 deletions NetStream/include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ namespace utils

CurlFile::Share *GetShare();

uint32_t SafememGetSettingsSize();

void SafememWrite(string const& str, uint32_t offset = 0);

string SafememRead(uint32_t offset = 0);

class TimeoutListener : public TimerListener
{
public:
Expand Down
2 changes: 1 addition & 1 deletion NetStream/param.sfx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<paramsfo>
<param key="APP_VER">03.10</param>
<param key="APP_VER">03.11</param>
<param key="ATTRIBUTE">33408</param>
<param key="ATTRIBUTE_MINOR">16</param>
<param key="ATTRIBUTE2">0</param>
Expand Down
10 changes: 5 additions & 5 deletions NetStream/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ void menu::main::NetcheckJob::Run()
thread::Sleep(100);
}

ytutils::Init();

dialog::Close();

sceAppMgrAppParamGetString(SCE_KERNEL_PROCESS_ID_SELF, 12, titleid, 12);
if (sceAppMgrGetIdByName(&shellPid, "NPXS19999") == SCE_OK &&
_vshKernelSearchModuleByName("taihen", sarg) > 0)
{
string pluginPath = common::FormatString("ux0:app/%s/module/download_enabler_netstream.suprx", titleid);
taiLoadStartModuleForPid(shellPid, pluginPath.c_str(), 0, NULL, 0);
}

ytutils::Init();

dialog::Close();
}

void pluginLoadCB(Plugin *plugin)
Expand Down Expand Up @@ -151,9 +151,9 @@ int main()
sceSysmoduleLoadModuleInternal(SCE_SYSMODULE_INTERNAL_COMMON_GUI_DIALOG);
new Module("vs0:sys/external/libfios2.suprx");
new Module("vs0:sys/external/libc.suprx");
new Module("app0:module/libcurl.suprx");
new Module("app0:module/libInvidious.suprx");
new Module("app0:module/libLootkit.suprx");
new Module("app0:module/libcurl.suprx");

curl_global_memmanager_set_np(sce_paf_malloc, sce_paf_free, sce_paf_realloc);

Expand Down
13 changes: 12 additions & 1 deletion NetStream/source/menus/menu_first.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

using namespace paf;

static bool s_afterBoot = true;

void menu::First::ListButtonCbFun(int32_t type, ui::Handler *self, ui::Event *e, void *userdata)
{
ui::Widget *wdg = (ui::Widget*)self;
Expand All @@ -32,7 +34,16 @@ void menu::First::ListButtonCbFun(int32_t type, ui::Handler *self, ui::Event *e,
break;
case 3:
menu::Local *lmenu = new menu::Local();
lmenu->PushBrowserPage(NULL);
if (s_afterBoot)
{
string ref = utils::SafememRead();
lmenu->PushBrowserPage(&ref);
s_afterBoot = false;
}
else
{
lmenu->PushBrowserPage(NULL);
}
break;
}
}
Expand Down
4 changes: 4 additions & 0 deletions NetStream/source/menus/menu_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ void menu::GenericServerMenu::GoToJob::Run()
}

currentPath = workObj->browser->GetPath();
if (workObj->GetMenuType() == MenuType_Local)
{
utils::SafememWrite(currentPath);
}
common::Utf8ToUtf16(currentPath, &text16);

thread::RMutex::main_thread_mutex.Lock();
Expand Down
5 changes: 2 additions & 3 deletions NetStream/source/menus/menu_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
using namespace paf;
using namespace sce;

const uint32_t k_safeMemIniLimit = 0x400;
const int32_t k_settingsVersion = 5;

static sce::AppSettings *s_appSet = NULL;
Expand Down Expand Up @@ -56,7 +55,7 @@ void menu::Settings::Init()
sparam.free_cb = sce_paf_free;
sparam.realloc_cb = sce_paf_realloc;
sparam.safemem_offset = 0;
sparam.safemem_size = k_safeMemIniLimit;
sparam.safemem_size = utils::SafememGetSettingsSize();

sce::AppSettings::GetInstance(sparam, &s_appSet);

Expand All @@ -75,7 +74,7 @@ void menu::Settings::Init()
*verinfo = L"RELEASE ";
#endif
*verinfo += WIDE(__DATE__);
*verinfo += L" v 3.10";
*verinfo += L" v 3.11";
s_verinfo = (wchar_t *)verinfo->c_str();
}

Expand Down
36 changes: 33 additions & 3 deletions NetStream/source/utils.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <kernel.h>
#include <apputil.h>
#include <power.h>
#include <libdbg.h>
#include <paf.h>
Expand Down Expand Up @@ -30,11 +31,9 @@ uint32_t utils::GetHash(const char *name)

wchar_t *utils::GetStringWithNum(const char *name, uint32_t num)
{
IDParam searchRequest;
char fullName[128];
sce_paf_snprintf(fullName, sizeof(fullName), "%s%u", name, num);
searchRequest.SetID(fullName);
return g_appPlugin->GetString(searchRequest);
return g_appPlugin->GetString(fullName);
}

void utils::SetPowerTickTask(PowerTick mode)
Expand Down Expand Up @@ -135,6 +134,37 @@ CurlFile::Share *utils::GetShare()
return s_curlShare;
}

uint32_t utils::SafememGetSettingsSize()
{
return 0x400;
}

void utils::SafememWrite(string const& str, uint32_t offset)
{
int32_t strlen = str.length();
uint32_t baseOffset = SafememGetSettingsSize();
sceAppUtilSaveSafeMemory(&strlen, 4, baseOffset + offset);
sceAppUtilSaveSafeMemory(str.c_str(), strlen, baseOffset + offset + 4);
}

string utils::SafememRead(uint32_t offset)
{
string ret;
int32_t strlen = 0;
uint32_t baseOffset = SafememGetSettingsSize();
sceAppUtilLoadSafeMemory(&strlen, 4, baseOffset + offset);
if (strlen <= 0 || strlen > SCE_KERNEL_64KiB - baseOffset + offset + 4)
{
return ret;
}
char *tmp = new char[strlen + 1];
tmp[strlen] = 0;
sceAppUtilLoadSafeMemory(tmp, strlen, baseOffset + offset + 4);
ret = tmp;
delete tmp;
return ret;
}

void utils::SetTimeout(TimeoutFunc func, float timeoutMs, void *userdata1, void *userdata2)
{
Timer *t = new Timer(timeoutMs);
Expand Down
Binary file modified logo.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 795d315

Please sign in to comment.