Skip to content

Commit

Permalink
Stop trophy thread on breakout
Browse files Browse the repository at this point in the history
  • Loading branch information
McCaulay committed Mar 16, 2023
1 parent b6f487f commit 26b3dad
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/include/offsets/ps/eboot/1.01.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#define IO_REGISTER_READ_HANDLER_ORIGINAL 0x005a9d60
#define INTERRUPT_WRITE_HANDLER_ORIGINAL 0x0047da10

// Threads
#define EBOOT_THREAD_TROPHY_PUMP 0x00856348
#define EBOOT_SEND_TROPHY_PUMP_COMMAND_FUNC 0x004e6c60

// Game Pad Handles
#define EBOOT_PADS 0x1d26890

Expand Down
2 changes: 2 additions & 0 deletions sdk/include/ps/ps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ namespace PS

int32_t PadSetLightBar(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);

void SendTrophyPumpCommand(uint32_t command, uint64_t handle, uint64_t trophyId);

void MountDisc(uint64_t mountDiscOptions);
char* GetMountedGameCode();
void SetMountOptionFilepath(const char* filepath);
Expand Down
8 changes: 8 additions & 0 deletions sdk/src/ps/breakout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#include <ps2/cdvd.hpp>
#include <offsets/ps/eboot/eboot.hpp>

namespace PS
{
void SendTrophyPumpCommand(uint32_t command, uint64_t handle, uint64_t trophyId);
}

PS::Breakout::Shared* PS::Breakout::shared = (PS::Breakout::Shared*)BREAKOUT_SHARED;
uint32_t PS::Breakout::nStatusIndex = 0;

Expand Down Expand Up @@ -43,6 +48,9 @@ void PS::Breakout::init()
PS::Breakout::shared->gadgetRet = GADGET(RET);
PS::Breakout::shared->gadgetPopRaxRet = GADGET(POP_RAX_RET);
PS::Breakout::shared->gadgetPopRbxRet = GADGET(POP_RBX_RET);

// Exit trophy thread
PS::SendTrophyPumpCommand(2002, 0, 0);
}

void PS::Breakout::restore()
Expand Down
5 changes: 5 additions & 0 deletions sdk/src/ps/ps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ int32_t PS::PadSetLightBar(uint8_t red, uint8_t green, uint8_t blue, uint8_t alp
return PS::Sce::PadSetLightBar(handle, &colour);
}

void PS::SendTrophyPumpCommand(uint32_t command, uint64_t handle, uint64_t trophyId)
{
PS::Breakout::call(EBOOT(EBOOT_SEND_TROPHY_PUMP_COMMAND_FUNC), command, handle, trophyId);
}

void PS::MountDisc(uint64_t mountDiscOptions)
{
PS::Breakout::call(EBOOT(EBOOT_MOUNT_DISC_FUNC), mountDiscOptions);
Expand Down

0 comments on commit 26b3dad

Please sign in to comment.