Skip to content

Commit

Permalink
Merge branch 'dev' into dev_overlay_update
Browse files Browse the repository at this point in the history
  • Loading branch information
alex47exe committed Nov 24, 2024
2 parents e981040 + c2467ee commit 74805c1
Show file tree
Hide file tree
Showing 23 changed files with 572 additions and 75 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/emu-build-all-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jobs:
- name: "Install required packages"
shell: "bash"
run: |
sudo dpkg --add-architecture i386
sudo apt update -y
sudo apt install -y coreutils # echo, printf, etc...
sudo apt install -y build-essential
Expand All @@ -100,6 +101,7 @@ jobs:
# sudo apt install -y clang
sudo apt install -y libglx-dev # needed for overlay build (header files such as GL/glx.h)
sudo apt install -y libgl-dev # needed for overlay build (header files such as GL/gl.h)
sudo apt install -y libx11-dev:i386 # needed for overlay build
# sudo apt install -y binutils # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff
# build target
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/emu-deps-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
- name: "Install required packages"
shell: "bash"
run: |
sudo dpkg --add-architecture i386
sudo apt update -y
sudo apt install -y coreutils # echo, printf, etc...
sudo apt install -y build-essential
Expand All @@ -76,6 +77,7 @@ jobs:
# sudo apt install -y clang
sudo apt install -y libglx-dev # needed for overlay build (header files such as GL/glx.h)
sudo apt install -y libgl-dev # needed for overlay build (header files such as GL/gl.h)
sudo apt install -y libx11-dev:i386 # needed for overlay build
# sudo apt install -y binutils # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff
- name: "Build deps"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ You can also find instructions here in [README.release.md](./post_build/README.r

Clone the repo and its submodules **recursively**
```shell
git clone --recurse-submodules -j8 https://github.com/otavepto/gbe_fork.git
git clone --recurse-submodules -j8 https://github.com/Detanup01/gbe_fork.git
```
The switch `-j8` is optional, it allows Git to fetch up to 8 submodules

Expand Down
35 changes: 34 additions & 1 deletion dll/dll/steam_timeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#include "base.h"

class Steam_Timeline :
public ISteamTimeline
public ISteamTimeline,
public ISteamTimeline001
{
private:
constexpr const static float PRIORITY_CLIP_MIN_SEC = 8.0f;
Expand Down Expand Up @@ -92,6 +93,38 @@ public ISteamTimeline

void SetTimelineGameMode( ETimelineGameMode eMode );

void SetTimelineTooltip(const char* pchDescription, float flTimeDelta);
void ClearTimelineTooltip(float flTimeDelta);

TimelineEventHandle_t AddInstantaneousTimelineEvent( const char *pchTitle, const char *pchDescription, const char *pchIcon, uint32 unIconPriority, float flStartOffsetSeconds = 0.f, ETimelineEventClipPriority ePossibleClip = k_ETimelineEventClipPriority_None );
TimelineEventHandle_t AddRangeTimelineEvent( const char *pchTitle, const char *pchDescription, const char *pchIcon, uint32 unIconPriority, float flStartOffsetSeconds = 0.f, float flDuration = 0.f, ETimelineEventClipPriority ePossibleClip = k_ETimelineEventClipPriority_None );

TimelineEventHandle_t StartRangeTimelineEvent( const char *pchTitle, const char *pchDescription, const char *pchIcon, uint32 unPriority, float flStartOffsetSeconds, ETimelineEventClipPriority ePossibleClip );

void UpdateRangeTimelineEvent( TimelineEventHandle_t ulEvent, const char *pchTitle, const char *pchDescription, const char *pchIcon, uint32 unPriority, ETimelineEventClipPriority ePossibleClip );

void EndRangeTimelineEvent( TimelineEventHandle_t ulEvent, float flEndOffsetSeconds );

void RemoveTimelineEvent( TimelineEventHandle_t ulEvent );

SteamAPICall_t DoesEventRecordingExist( TimelineEventHandle_t ulEvent );

void StartGamePhase();

void EndGamePhase();

void SetGamePhaseID( const char *pchPhaseID );

SteamAPICall_t DoesGamePhaseRecordingExist( const char *pchPhaseID );

void AddGamePhaseTag( const char *pchTagName, const char *pchTagIcon, const char *pchTagGroup, uint32 unPriority );

void SetGamePhaseAttribute( const char *pchAttributeGroup, const char *pchAttributeValue, uint32 unPriority );

void OpenOverlayToGamePhase( const char *pchPhaseID );

void OpenOverlayToTimelineEvent( const TimelineEventHandle_t ulEvent );

};

#endif // __INCLUDED_STEAM_TIMELINE_H__
124 changes: 120 additions & 4 deletions dll/flat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,11 @@ STEAMAPI_API steam_bool SteamAPI_ISteamRemoteStorage_EndFileWriteBatch( ISteamRe
return (get_steam_client()->steam_remote_storage)->EndFileWriteBatch();
}

STEAMAPI_API ISteamUserStats *SteamAPI_SteamUserStats_v013()
{
return get_steam_client()->GetISteamUserStats(flat_hsteamuser(), flat_hsteampipe(), "STEAMUSERSTATS_INTERFACE_VERSION013");
}

STEAMAPI_API ISteamUserStats *SteamAPI_SteamUserStats_v012()
{
return get_steam_client()->GetISteamUserStats(flat_hsteamuser(), flat_hsteampipe(), "STEAMUSERSTATS_INTERFACE_VERSION012");
Expand Down Expand Up @@ -2529,6 +2534,26 @@ STEAMAPI_API steam_bool SteamAPI_ISteamApps_SetDlcContext( ISteamApps* self, App
return self->SetDlcContext(nAppID);
}

// SDK 1.61 removed unAppID param
STEAMAPI_API int SteamAPI_ISteamApps_GetNumBetas(ISteamApps* self, int* pnAvailable, int* pnPrivate)
{
return self->GetNumBetas(pnAvailable, pnPrivate);
}

// SDK 1.61 removed unAppID param
STEAMAPI_API steam_bool SteamAPI_ISteamApps_GetBetaInfo(ISteamApps* self, int iBetaIndex, uint32* punFlags, uint32* punBuildID, char* pchBetaName, int cchBetaName, char* pchDescription, int cchDescription)
{
return self->GetBetaInfo(iBetaIndex, punFlags, punBuildID, pchBetaName, cchBetaName, pchDescription, cchDescription);
}

// SDK 1.61 removed unAppID param
STEAMAPI_API steam_bool SteamAPI_ISteamApps_SetActiveBeta(ISteamApps* self, const char* pchBetaName)
{
return self->SetActiveBeta(pchBetaName);
}

/*
//SDK 1.60
STEAMAPI_API int SteamAPI_ISteamApps_GetNumBetas( ISteamApps* self, AppId_t unAppID, int * pnAvailable, int * pnPrivate )
{
// in SDK 1.60 param unAppID is unused
Expand All @@ -2552,6 +2577,7 @@ STEAMAPI_API steam_bool SteamAPI_ISteamApps_SetActiveBeta( ISteamApps* self, App
return self->SetActiveBeta(pchBetaName);
}
*/

STEAMAPI_API ISteamNetworking *SteamAPI_SteamNetworking_v006()
{
Expand Down Expand Up @@ -5481,29 +5507,119 @@ STEAMAPI_API steam_bool SteamAPI_ISteamInventory_InspectItem( ISteamInventory* s
return (ptr)->InspectItem(pResultHandle, pchItemToken);
}

STEAMAPI_API ISteamTimeline *SteamAPI_SteamTimeline_v004()
{
return get_steam_client()->GetISteamTimeline(flat_hsteamuser(), flat_hsteampipe(), "STEAMTIMELINE_INTERFACE_V004");
}

STEAMAPI_API ISteamTimeline *SteamAPI_SteamTimeline_v001()
{
return get_steam_client()->GetISteamTimeline(flat_hsteamuser(), flat_hsteampipe(), "STEAMTIMELINE_INTERFACE_V001");
}

STEAMAPI_API void SteamAPI_ISteamTimeline_SetTimelineStateDescription( ISteamTimeline* self, const char * pchDescription, float flTimeDelta )
{
return self->SetTimelineStateDescription(pchDescription, flTimeDelta);
return (get_steam_client()->steam_timeline)->SetTimelineStateDescription(pchDescription, flTimeDelta);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_ClearTimelineStateDescription( ISteamTimeline* self, float flTimeDelta )
{
return self->ClearTimelineStateDescription(flTimeDelta);
return (get_steam_client()->steam_timeline)->ClearTimelineStateDescription(flTimeDelta);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_AddTimelineEvent( ISteamTimeline* self, const char * pchIcon, const char * pchTitle, const char * pchDescription, uint32 unPriority, float flStartOffsetSeconds, float flDurationSeconds, ETimelineEventClipPriority ePossibleClip )
{
self->AddTimelineEvent(pchIcon, pchTitle, pchDescription, unPriority, flStartOffsetSeconds, flDurationSeconds, ePossibleClip);
(get_steam_client()->steam_timeline)->AddTimelineEvent(pchIcon, pchTitle, pchDescription, unPriority, flStartOffsetSeconds, flDurationSeconds, ePossibleClip);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_SetTimelineGameMode( ISteamTimeline* self, ETimelineGameMode eMode )
{
self->SetTimelineGameMode(eMode);
(get_steam_client()->steam_timeline)->SetTimelineGameMode(eMode);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_SetTimelineTooltip(ISteamTimeline* self, const char* pchDescription, float flTimeDelta)
{
(get_steam_client()->steam_timeline)->SetTimelineTooltip(pchDescription, flTimeDelta);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_ClearTimelineTooltip(ISteamTimeline* self, float flTimeDelta)
{
return (get_steam_client()->steam_timeline)->ClearTimelineTooltip(flTimeDelta);
}

STEAMAPI_API TimelineEventHandle_t SteamAPI_ISteamTimeline_AddInstantaneousTimelineEvent(ISteamTimeline* self, const char* pchTitle, const char* pchDescription, const char* pchIcon, uint32 unIconPriority, float flStartOffsetSeconds, ETimelineEventClipPriority ePossibleClip)
{
return (get_steam_client()->steam_timeline)->AddInstantaneousTimelineEvent(pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, ePossibleClip);
}

STEAMAPI_API TimelineEventHandle_t SteamAPI_ISteamTimeline_AddRangeTimelineEvent(ISteamTimeline* self, const char* pchTitle, const char* pchDescription, const char* pchIcon, uint32 unIconPriority, float flStartOffsetSeconds, float flDuration, ETimelineEventClipPriority ePossibleClip)
{
return (get_steam_client()->steam_timeline)->AddRangeTimelineEvent(pchTitle, pchDescription, pchIcon, unIconPriority, flStartOffsetSeconds, flDuration, ePossibleClip);
}

STEAMAPI_API TimelineEventHandle_t SteamAPI_ISteamTimeline_StartRangeTimelineEvent(ISteamTimeline* self, const char* pchTitle, const char* pchDescription, const char* pchIcon, uint32 unPriority, float flStartOffsetSeconds, ETimelineEventClipPriority ePossibleClip)
{
return (get_steam_client()->steam_timeline)->StartRangeTimelineEvent(pchTitle, pchDescription, pchIcon, unPriority, flStartOffsetSeconds, ePossibleClip);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_UpdateRangeTimelineEvent(ISteamTimeline* self, TimelineEventHandle_t ulEvent, const char* pchTitle, const char* pchDescription, const char* pchIcon, uint32 unPriority, ETimelineEventClipPriority ePossibleClip)
{
return (get_steam_client()->steam_timeline)->UpdateRangeTimelineEvent(ulEvent, pchTitle, pchDescription, pchIcon, unPriority, ePossibleClip);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_EndRangeTimelineEvent(ISteamTimeline* self, TimelineEventHandle_t ulEvent, float flEndOffsetSeconds)
{
return (get_steam_client()->steam_timeline)->EndRangeTimelineEvent(ulEvent, flEndOffsetSeconds);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_RemoveTimelineEvent(ISteamTimeline* self, TimelineEventHandle_t ulEvent)
{
return (get_steam_client()->steam_timeline)->RemoveTimelineEvent(ulEvent);
}

STEAMAPI_API SteamAPICall_t SteamAPI_ISteamTimeline_DoesEventRecordingExist(ISteamTimeline* self, TimelineEventHandle_t ulEvent)
{
return (get_steam_client()->steam_timeline)->DoesEventRecordingExist(ulEvent);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_StartGamePhase(ISteamTimeline* self)
{
return (get_steam_client()->steam_timeline)->StartGamePhase();
}

STEAMAPI_API void SteamAPI_ISteamTimeline_EndGamePhase(ISteamTimeline* self)
{
return (get_steam_client()->steam_timeline)->EndGamePhase();
}

STEAMAPI_API void SteamAPI_ISteamTimeline_SetGamePhaseID(ISteamTimeline* self, const char* pchPhaseID)
{
return (get_steam_client()->steam_timeline)->SetGamePhaseID(pchPhaseID);
}

STEAMAPI_API SteamAPICall_t SteamAPI_ISteamTimeline_DoesGamePhaseRecordingExist(ISteamTimeline* self, const char* pchPhaseID)
{
return (get_steam_client()->steam_timeline)->DoesGamePhaseRecordingExist(pchPhaseID);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_AddGamePhaseTag(ISteamTimeline* self, const char* pchTagName, const char* pchTagIcon, const char* pchTagGroup, uint32 unPriority)
{
return (get_steam_client()->steam_timeline)->AddGamePhaseTag(pchTagName, pchTagIcon, pchTagGroup, unPriority);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_SetGamePhaseAttribute(ISteamTimeline* self, const char* pchAttributeGroup, const char* pchAttributeValue, uint32 unPriority)
{
return (get_steam_client()->steam_timeline)->SetGamePhaseAttribute(pchAttributeGroup, pchAttributeValue, unPriority);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_OpenOverlayToGamePhase(ISteamTimeline* self, const char* pchPhaseID)
{
return (get_steam_client()->steam_timeline)->OpenOverlayToGamePhase(pchPhaseID);
}

STEAMAPI_API void SteamAPI_ISteamTimeline_OpenOverlayToTimelineEvent(ISteamTimeline* self, const TimelineEventHandle_t ulEvent)
{
return (get_steam_client()->steam_timeline)->OpenOverlayToTimelineEvent(ulEvent);
}

STEAMAPI_API ISteamVideo *SteamAPI_SteamVideo_v001()
Expand Down
2 changes: 2 additions & 0 deletions dll/local_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ static std::string sanitize_file_name(std::string name)
name = replace_with(name, "*", ".ASTERISK.");
name = replace_with(name, "\"", ".QUOTE.");
name = replace_with(name, "?", ".Q_MARK.");
name = replace_with(name, "%", ".PERCENT.");

return name;
}
Expand All @@ -538,6 +539,7 @@ static std::string desanitize_file_name(std::string name)
name = replace_with(name, ".ASTERISK.", "*");
name = replace_with(name, ".QUOTE.", "\"");
name = replace_with(name, ".Q_MARK.", "?");
name = replace_with(name, ".PERCENT.", "%");

return name;
}
Expand Down
8 changes: 7 additions & 1 deletion dll/steam_client_interface_getter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ ISteamTimeline *Steam_Client::GetISteamTimeline( HSteamUser hSteamUser, HSteamPi
PRINT_DEBUG("%s", pchVersion);
if (!steam_pipes.count(hSteamPipe) || !hSteamUser) return nullptr;

if (strcmp(pchVersion, STEAMTIMELINE_INTERFACE_VERSION) == 0) {
if (strcmp(pchVersion, "STEAMTIMELINE_INTERFACE_V001") == 0) {
return reinterpret_cast<ISteamTimeline *>(static_cast<ISteamTimeline001 *>(steam_timeline));
}
// Todo: Add non existing but reversed v2-v3
else if (strcmp(pchVersion, STEAMTIMELINE_INTERFACE_VERSION) == 0) {
return reinterpret_cast<ISteamTimeline *>(static_cast<ISteamTimeline *>(steam_timeline));
}

Expand Down Expand Up @@ -485,6 +489,8 @@ ISteamUserStats *Steam_Client::GetISteamUserStats( HSteamUser hSteamUser, HSteam
return reinterpret_cast<ISteamUserStats *>(static_cast<ISteamUserStats010 *>(steam_user_stats));
} else if (strcmp(pchVersion, "STEAMUSERSTATS_INTERFACE_VERSION011") == 0) {
return reinterpret_cast<ISteamUserStats *>(static_cast<ISteamUserStats011 *>(steam_user_stats));
} else if (strcmp(pchVersion, "STEAMUSERSTATS_INTERFACE_VERSION012") == 0) {
return reinterpret_cast<ISteamUserStats *>(static_cast<ISteamUserStats *>(steam_user_stats));
} else if (strcmp(pchVersion, STEAMUSERSTATS_INTERFACE_VERSION) == 0) {
return reinterpret_cast<ISteamUserStats *>(static_cast<ISteamUserStats *>(steam_user_stats));
}
Expand Down
3 changes: 2 additions & 1 deletion dll/steam_http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ void Steam_HTTP::online_http_request(Steam_Http_Request *request, SteamAPICall_t
directory_path = ".";
file_name = request->target_filepath;
}
PRINT_DEBUG("directory: '%s', filename '%s'", directory_path.c_str(), file_name.c_str());
PRINT_DEBUG("directory: '%s', filename '%s', target_filepath '%s'", directory_path.c_str(), file_name.c_str(), request->target_filepath.c_str());
Local_Storage::store_file_data(directory_path, file_name, (char *)"", sizeof(""));
PRINT_DEBUG("Temp file created with empty data"); //TODO remove this

FILE *hfile = std::fopen(request->target_filepath.c_str(), "wb");
if (!hfile) {
Expand Down
Loading

0 comments on commit 74805c1

Please sign in to comment.