Remove AUTO_VAR macro and _toString function (#592)

This commit is contained in:
void_17
2026-03-06 02:11:18 +07:00
committed by GitHub
parent 7d6658fe5b
commit 55231bb8d3
294 changed files with 5067 additions and 5773 deletions

View File

@@ -36,7 +36,7 @@ bool SQRNetworkManager_PS3::m_bCallPSNSignInCallback=false;
//unsigned int SQRNetworkManager_PS3::RoomSyncData::playerCount = 0;
// This maps internal to extern states, and needs to match element-by-element the eSQRNetworkManagerInternalState enumerated type
const SQRNetworkManager_PS3::eSQRNetworkManagerState SQRNetworkManager_PS3::m_INTtoEXTStateMappings[SQRNetworkManager_PS3::SNM_INT_STATE_COUNT] =
const SQRNetworkManager_PS3::eSQRNetworkManagerState SQRNetworkManager_PS3::m_INTtoEXTStateMappings[SQRNetworkManager_PS3::SNM_INT_STATE_COUNT] =
{
SNM_STATE_INITIALISING, // SNM_INT_STATE_UNINITIALISED
SNM_STATE_INITIALISING, // SNM_INT_STATE_SIGNING_IN
@@ -104,7 +104,7 @@ SQRNetworkManager_PS3::SQRNetworkManager_PS3(ISQRNetworkManagerListener *listene
InitializeCriticalSection(&m_csRoomSyncData);
InitializeCriticalSection(&m_csPlayerState);
InitializeCriticalSection(&m_csStateChangeQueue);
sys_event_port_create(&m_basicEventPort, SYS_EVENT_PORT_LOCAL, SYS_EVENT_PORT_NO_NAME);
sys_event_queue_attribute_t queue_attr = {SYS_SYNC_PRIORITY, SYS_PPU_QUEUE};
@@ -134,7 +134,7 @@ void SQRNetworkManager_PS3::Initialise()
SetState(SNM_INT_STATE_INITIALISE_FAILED);
return;
}
//Initialize libnetctl
ret = cellNetCtlInit();
#else
@@ -175,7 +175,7 @@ void SQRNetworkManager_PS3::Initialise()
memset(&netstart_param, 0, sizeof(netstart_param));
netstart_param.size = sizeof(netstart_param);
netstart_param.type = CELL_NET_CTL_NETSTART_TYPE_NP;
netstart_param.type = CELL_NET_CTL_NETSTART_TYPE_NP;
SetState(SNM_INT_STATE_SIGNING_IN);
ret = cellNetCtlNetStartDialogLoadAsync(&netstart_param);
@@ -305,7 +305,7 @@ void SQRNetworkManager_PS3::InitialiseAfterOnline()
}
app.DebugPrintf("SQRNetworkManager::InitialiseAfterOnline - matching context is now valid\n");
m_matchingContextValid = true;
bool bRet = RegisterCallbacks();
if( ( !bRet ) || ForceErrorPoint( SNM_FORCE_ERROR_REGISTER_CALLBACKS ) )
{
@@ -459,7 +459,7 @@ void SQRNetworkManager_PS3::ErrorHandlingTick()
DeleteServerContext();
break;
}
}
// Start hosting a game, by creating a room & joining it. We explicity create a server context here (via GetServerContext) as Sony suggest that
@@ -519,7 +519,7 @@ void SQRNetworkManager_PS3::UpdateExternalRoomData()
{
if( m_offlineGame ) return;
if( m_isHosting )
{
{
SceNpMatching2SetRoomDataExternalRequest reqParam;
memset( &reqParam, 0, sizeof(reqParam) );
reqParam.roomId = m_room;
@@ -655,13 +655,13 @@ int SQRNetworkManager_PS3::BasicEventThreadProc( void *lpParameter )
do
{
sys_event_queue_receive(manager->m_basicEventQueue, &event, 0);
// If the sys_event_t we've sent here from the handler has a non-zero data1 element, this is to signify that we should terminate the thread
if( event.data1 == 0 )
{
int iEvent;
SceNpUserInfo from;
uint8_t buffer[SCE_NP_BASIC_MAX_MESSAGE_SIZE];
uint8_t buffer[SCE_NP_BASIC_MAX_MESSAGE_SIZE];
size_t bufferSize = SCE_NP_BASIC_MAX_MESSAGE_SIZE;
int ret = sceNpBasicGetEvent(&iEvent, &from, &buffer, &bufferSize);
if( ret == 0 )
@@ -669,7 +669,7 @@ int SQRNetworkManager_PS3::BasicEventThreadProc( void *lpParameter )
if( iEvent == SCE_NP_BASIC_EVENT_INCOMING_BOOTABLE_INVITATION )
{
// 4J Stu - Don't do this here as it can be very disruptive to gameplay. Players can bring this up from LoadOrJoinMenu, PauseMenu and InGameInfoMenu
//sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID);
//sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID);
}
if( iEvent == SCE_NP_BASIC_EVENT_RECV_INVITATION_RESULT )
{
@@ -697,7 +697,7 @@ int SQRNetworkManager_PS3::GetFriendsThreadProc( void* lpParameter )
// This is likely when friend list hasn't been received from the server yet - will be returning SCE_NP_BASIC_ERROR_BUSY in this case
manager->m_friendCount = 0;
}
// There shouldn't ever be more than 100 friends returned but limit here just in case
if( manager->m_friendCount > 100 ) manager->m_friendCount = 100;
@@ -711,8 +711,8 @@ int SQRNetworkManager_PS3::GetFriendsThreadProc( void* lpParameter )
memset(&userInfo, 0x00, sizeof(userInfo));
memset(&presenceDetails, 0x00, sizeof(presenceDetails));
presenceDetails.struct_size = sizeof(presenceDetails);
int ret = sceNpBasicGetFriendPresenceByIndex2( i, &userInfo, &presenceDetails, 0 );
int ret = sceNpBasicGetFriendPresenceByIndex2( i, &userInfo, &presenceDetails, 0 );
if( ( ret == 0 ) && ( !manager->ForceErrorPoint( SNM_FORCE_ERROR_GET_FRIEND_LIST_ENTRY ) ) )
{
@@ -778,7 +778,7 @@ bool SQRNetworkManager_PS3::IsReadyToPlayOrIdle()
// Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The
// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and
// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and
// it also requires that it is informed of the state changes leading up to not being in the session, before this should report false.
bool SQRNetworkManager_PS3::IsInSession()
{
@@ -950,7 +950,7 @@ bool SQRNetworkManager_PS3::JoinRoom(SceNpMatching2RoomId roomId, SceNpMatching2
m_localPlayerJoinMask = localPlayerMask;
m_localPlayerCount = 0;
m_localPlayerJoined = 0;
for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ )
{
if( localPlayerMask & ( 1 << i ) ) m_localPlayerCount++;
@@ -1090,7 +1090,7 @@ bool SQRNetworkManager_PS3::AddLocalPlayerByUserIndex(int idx)
memset(&reqParam, 0, sizeof(reqParam));
memset(&binAttr, 0, sizeof(binAttr));
binAttr.id = SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID;
binAttr.ptr = &m_localPlayerJoinMask;
binAttr.size = sizeof(m_localPlayerJoinMask);
@@ -1174,7 +1174,7 @@ bool SQRNetworkManager_PS3::RemoveLocalPlayerByUserIndex(int idx)
memset(&reqParam, 0, sizeof(reqParam));
memset(&binAttr, 0, sizeof(binAttr));
binAttr.id = SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID;
binAttr.ptr = &m_localPlayerJoinMask;
binAttr.size = sizeof(m_localPlayerJoinMask);
@@ -1197,7 +1197,7 @@ bool SQRNetworkManager_PS3::RemoveLocalPlayerByUserIndex(int idx)
}
}
// Bring up a Gui to send an invite so a player that the user can select. This invite will contain the room Id so that
// Bring up a Gui to send an invite so a player that the user can select. This invite will contain the room Id so that
void SQRNetworkManager_PS3::SendInviteGUI()
{
SceNpBasicMessageDetails msg;
@@ -1270,8 +1270,8 @@ bool SQRNetworkManager_PS3::UpdateInviteData(SQRNetworkManager_PS3::PresenceSync
// and there's a period when starting up the host game where it doesn't accurately know the memberId for its own local players
void SQRNetworkManager_PS3::FindOrCreateNonNetworkPlayer(int slot, int playerType, SceNpMatching2RoomMemberId memberId, int localPlayerIdx, int smallId)
{
for(AUTO_VAR(it, m_vecTempPlayers.begin()); it != m_vecTempPlayers.end(); it++ )
{
for (auto it = m_vecTempPlayers.begin(); it != m_vecTempPlayers.end(); it++)
{
if( ((*it)->m_type == playerType ) && ( (*it)->m_localPlayerIdx == localPlayerIdx ) )
{
if( ( playerType != SQRNetworkPlayer::SNP_TYPE_REMOTE ) || ( (*it)->m_roomMemberId == memberId ) )
@@ -1329,7 +1329,7 @@ void SQRNetworkManager_PS3::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/)
{
EnterCriticalSection(&m_csRoomSyncData);
// If we pass an explicit roomSlotPlayerCount, it is because we are removing a player, and this is the count of slots that there were *before* the removal.
// If we pass an explicit roomSlotPlayerCount, it is because we are removing a player, and this is the count of slots that there were *before* the removal.
bool zeroLastSlot = false;
if( roomSlotPlayerCount == -1 )
{
@@ -1433,7 +1433,7 @@ void SQRNetworkManager_PS3::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/)
}
else
{
FindOrCreateNonNetworkPlayer( i, SQRNetworkPlayer::SNP_TYPE_REMOTE, m_roomSyncData.players[i].m_roomMemberId, m_roomSyncData.players[i].m_localIdx, m_roomSyncData.players[i].m_smallId);
FindOrCreateNonNetworkPlayer( i, SQRNetworkPlayer::SNP_TYPE_REMOTE, m_roomSyncData.players[i].m_roomMemberId, m_roomSyncData.players[i].m_localIdx, m_roomSyncData.players[i].m_smallId);
m_aRoomSlotPlayers[i]->SetUID(m_roomSyncData.players[i].m_UID); // On client, UIDs flow from m_roomSyncData->player data
}
}
@@ -1441,8 +1441,8 @@ void SQRNetworkManager_PS3::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/)
}
// Clear up any non-network players that are no longer required - this would be a good point to notify of players leaving when we support that
// FindOrCreateNonNetworkPlayer will have pulled any players that we Do need out of m_vecTempPlayers, so the ones that are remaining are no longer in the game
for(AUTO_VAR(it, m_vecTempPlayers.begin()); it != m_vecTempPlayers.end(); it++ )
{
for (auto it = m_vecTempPlayers.begin(); it != m_vecTempPlayers.end(); it++)
{
if( m_listener )
{
m_listener->HandlePlayerLeaving(*it);
@@ -1526,7 +1526,7 @@ bool SQRNetworkManager_PS3::AddRemotePlayersAndSync( SceNpMatching2RoomMemberId
}
// We want to keep all players from a particular machine together, so search through the room sync data to see if we can find
// any pre-existing players from this machine.
// any pre-existing players from this machine.
int firstIdx = -1;
for( int i = 0; i < m_roomSyncData.getPlayerCount(); i++ )
{
@@ -1629,7 +1629,7 @@ void SQRNetworkManager_PS3::RemoveRemotePlayersAndSync( SceNpMatching2RoomMember
// Update mapping from the room slot players to SQRNetworkPlayer instances
MapRoomSlotPlayers();
// And then synchronise this out to all other machines
SyncRoomData();
@@ -1643,8 +1643,8 @@ void SQRNetworkManager_PS3::RemoveNetworkPlayers( int mask )
{
assert( !m_isHosting );
for(AUTO_VAR(it, m_RudpCtxToPlayerMap.begin()); it != m_RudpCtxToPlayerMap.end(); )
{
for (auto it = m_RudpCtxToPlayerMap.begin(); it != m_RudpCtxToPlayerMap.end();)
{
SQRNetworkPlayer *player = it->second;
if( (player->m_roomMemberId == m_localMemberId ) && ( ( 1 << player->m_localPlayerIdx ) & mask ) )
{
@@ -1667,7 +1667,7 @@ void SQRNetworkManager_PS3::RemoveNetworkPlayers( int mask )
it = m_RudpCtxToPlayerMap.erase(it);
// Delete the player itself and the mapping from context to player map as this context is no longer valid
delete player;
delete player;
}
else
{
@@ -1770,7 +1770,7 @@ bool SQRNetworkManager_PS3::GetMatchingContext(eSQRNetworkManagerInternalState a
app.DebugPrintf("SQRNetworkManager::GetMatchingContext - sceNpMatching2ContextStartAsync failed with code 0x%08x\n", ret);
return false;
}
app.DebugPrintf("SQRNetworkManager::GetMatchingContext - matching context is now valid\n");
m_matchingContextValid = true;
return true;
@@ -1778,7 +1778,7 @@ bool SQRNetworkManager_PS3::GetMatchingContext(eSQRNetworkManagerInternalState a
// Starts the process of obtaining a server context. This is an asynchronous operation, at the end of which (if successful), we'll be creating
// a room. General procedure followed here is as suggested by Sony - we get a list of servers, then pick a random one, and see if it is available.
// If not we just cycle round trying other random ones until we either find an available one or fail.
// If not we just cycle round trying other random ones until we either find an available one or fail.
bool SQRNetworkManager_PS3::GetServerContext()
{
assert(m_state == SNM_INT_STATE_IDLE);
@@ -1803,7 +1803,7 @@ bool SQRNetworkManager_PS3::GetServerContext2()
( serverCount == SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED ) ) // Also checking for this as a means of simulating the previous error
{
sceNpMatching2DestroyContext(m_matchingContext);
m_matchingContextValid = false;
m_matchingContextValid = false;
if( !GetMatchingContext(SNM_INT_STATE_HOSTING_STARTING_MATCHING_CONTEXT) ) return false;
// If this caused an async thing to be started up, then we've done as much as we can here - the rest of the code will happen when the async matching 2 context starting completes
// ( event SCE_NP_MATCHING2_CONTEXT_EVENT_Start is received )
@@ -1860,7 +1860,7 @@ bool SQRNetworkManager_PS3::GetServerContext(SceNpMatching2ServerId serverId)
app.DebugPrintf("SQRNetworkManager::GetServerContext - sceNpMatching2GetServerIdListLocal failed with error 0x%08x\n", serverCount);
int ret = sceNpMatching2DestroyContext(m_matchingContext);
app.DebugPrintf("SQRNetworkManager::GetServerContext - sceNpMatching2DestroyContext returned 0x%08x\n", ret);
m_matchingContextValid = false;
m_matchingContextValid = false;
if( !GetMatchingContext(SNM_INT_STATE_JOINING_STARTING_MATCHING_CONTEXT) )
{
app.DebugPrintf("SQRNetworkManager::GetServerContext - Failed due to no matching context after recreating\n");
@@ -2003,7 +2003,7 @@ void SQRNetworkManager_PS3::NetworkPlayerConnectionComplete(SQRNetworkPlayer *pl
if( ( !wasReady ) && ( isReady ) )
{
HandlePlayerJoined( player );
HandlePlayerJoined( player );
}
}
@@ -2029,7 +2029,7 @@ void SQRNetworkManager_PS3::NetworkPlayerSmallIdAllocated(SQRNetworkPlayer *play
if( ( !wasReady ) && ( isReady ) )
{
HandlePlayerJoined( player );
HandlePlayerJoined( player );
}
}
@@ -2047,7 +2047,7 @@ void SQRNetworkManager_PS3::NetworkPlayerInitialDataReceived(SQRNetworkPlayer *p
if( ( !wasReady ) && ( isReady ) )
{
HandlePlayerJoined( player );
HandlePlayerJoined( player );
}
}
@@ -2063,7 +2063,7 @@ void SQRNetworkManager_PS3::HandlePlayerJoined(SQRNetworkPlayer *player)
{
if( m_listener )
{
m_listener->HandlePlayerJoined( player );
m_listener->HandlePlayerJoined( player );
}
// On client, keep a count of how many local players we have told the game about. We can only transition to telling the game that we are playing once the room is set up And all the local players are valid to use.
if( !m_isHosting )
@@ -2160,11 +2160,11 @@ bool SQRNetworkManager_PS3::CreateRudpConnections(SceNpMatching2RoomId roomId, S
sinp2pLocal.sin_family = AF_INET;
sinp2pLocal.sin_port = htons(SCE_NP_PORT);
// sinp2pLocal.sin_addr = netInfo.localAddr;
// ... and then the peer
memset(&sinp2pPeer, 0, sizeof(sinp2pPeer));
sinp2pPeer.sin_family = AF_INET;
ret = sceNpMatching2SignalingGetConnectionStatus(m_matchingContext, roomId, peerMemberId, &connStatus, &sinp2pPeer.sin_addr, &sinp2pPeer.sin_port);
app.DebugPrintf(CMinecraftApp::USER_RR,"sceNpMatching2SignalingGetConnectionStatus returned 0x%x, connStatus %d peer add:0x%x peer port:0x%x\n",ret, connStatus,sinp2pPeer.sin_addr,sinp2pPeer.sin_port);
@@ -2232,8 +2232,8 @@ bool SQRNetworkManager_PS3::CreateRudpConnections(SceNpMatching2RoomId roomId, S
SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerFromRudpCtx(int rudpCtx)
{
AUTO_VAR(it,m_RudpCtxToPlayerMap.find(rudpCtx));
if( it != m_RudpCtxToPlayerMap.end() )
auto it = m_RudpCtxToPlayerMap.find(rudpCtx);
if( it != m_RudpCtxToPlayerMap.end() )
{
return it->second;
}
@@ -2242,8 +2242,8 @@ SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerFromRudpCtx(int rudpCtx)
SQRNetworkPlayer *SQRNetworkManager_PS3::GetPlayerFromRoomMemberAndLocalIdx(int roomMember, int localIdx)
{
for(AUTO_VAR(it, m_RudpCtxToPlayerMap.begin()); it != m_RudpCtxToPlayerMap.end(); it++ )
{
for (auto it = m_RudpCtxToPlayerMap.begin(); it != m_RudpCtxToPlayerMap.end(); it++)
{
if( (it->second->m_roomMemberId == roomMember ) && ( it->second->m_localPlayerIdx == localIdx ) )
{
return it->second;
@@ -2329,7 +2329,7 @@ void SQRNetworkManager_PS3::ContextCallback(SceNpMatching2ContextId id, SceNpMa
manager->m_state == SNM_INT_STATE_JOINING_STARTING_MATCHING_CONTEXT)
{
// matching context failed to start (this can happen when you block the IP addresses of the matching servers on your router
// matching context failed to start (this can happen when you block the IP addresses of the matching servers on your router
// agent-0101.ww.sp-int.matching.playstation.net (198.107.157.191)
// static-resource.sp-int.community.playstation.net (203.105.77.140)
manager->SetState(SNM_INT_STATE_INITIALISE_FAILED);
@@ -2773,7 +2773,7 @@ void SQRNetworkManager_PS3::RoomEventCallback(SceNpMatching2ContextId id, SceNpM
#endif
{
SQRNetworkManager_PS3 *manager = (SQRNetworkManager_PS3 *)arg;
bool gotEventData = false;
switch( event )
{
@@ -2910,7 +2910,7 @@ void SQRNetworkManager_PS3::RoomEventCallback(SceNpMatching2ContextId id, SceNpM
int oldMask = manager->GetOldMask( pRoomMemberData->newRoomMemberDataInternal->memberId );
int addedMask = manager->GetAddedMask(playerMask, oldMask );
int removedMask = manager->GetRemovedMask(playerMask, oldMask );
if( addedMask != 0 )
{
bool success = manager->AddRemotePlayersAndSync( pRoomMemberData->newRoomMemberDataInternal->memberId, addedMask );
@@ -2927,7 +2927,7 @@ void SQRNetworkManager_PS3::RoomEventCallback(SceNpMatching2ContextId id, SceNpM
memset(&reqParam, 0, sizeof(reqParam));
memset(&binAttr, 0, sizeof(binAttr));
binAttr.id = SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID;
binAttr.ptr = &oldMask;
binAttr.size = sizeof(oldMask);
@@ -2983,7 +2983,7 @@ void SQRNetworkManager_PS3::RoomEventCallback(SceNpMatching2ContextId id, SceNpM
}
}
}
}
}
break;
@@ -3079,7 +3079,7 @@ void SQRNetworkManager_PS3::ManagerCallback(int event, int result, void *arg)
manager->InitialiseAfterOnline();
break;
case SCE_NP_MANAGER_EVENT_GOT_TICKET:
{
{
// Let the profile Manager deal with any tickets
SonyRemoteStorage_PS3* pRemote = (SonyRemoteStorage_PS3*)app.getRemoteStorage();
if(pRemote->isWaitingForTicket())
@@ -3427,7 +3427,7 @@ void SQRNetworkManager_PS3::GetExtDataForRoom( SceNpMatching2RoomId roomId, void
( ret == SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED ) ) // Also checking for this as a means of simulating the previous error
{
sceNpMatching2DestroyContext(m_matchingContext);
m_matchingContextValid = false;
m_matchingContextValid = false;
if( !GetMatchingContext(SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT) )
{
// No matching context, and failed to try and make one. We're really broken here.
@@ -3454,7 +3454,7 @@ bool SQRNetworkManager_PS3::ForceErrorPoint(eSQRForceError error)
return false;
}
#else
bool SQRNetworkManager_PS3::aForceError[SNM_FORCE_ERROR_COUNT] =
bool SQRNetworkManager_PS3::aForceError[SNM_FORCE_ERROR_COUNT] =
{
false, // SNM_FORCE_ERROR_NP2_INIT
false, // SNM_FORCE_ERROR_NET_INITIALIZE_NETWORK

View File

@@ -74,7 +74,7 @@ void SonyVoiceChat::setEnabled( bool bEnabled )
{
if(bEnabled)
startStream();
else
else
stopStream();
}
sm_bEnabled = bEnabled;
@@ -185,18 +185,18 @@ int SonyVoiceChat::eventcb_voiceDetected(CellSysutilAvc2EventId event_id, CellSy
UNUSED_VARIABLE( userdata );
// To the upper 32 bits, the room member ID of the player is passed.
// In the lower 32 bits, a value of 0 (mute) or a value between 1 (low volume)
// and 10 (high volume) is passed as the audio signal value when the notification
// method is the level method, or a value of 1 (start of speaking) or 0 (end of speaking)
// In the lower 32 bits, a value of 0 (mute) or a value between 1 (low volume)
// and 10 (high volume) is passed as the audio signal value when the notification
// method is the level method, or a value of 1 (start of speaking) or 0 (end of speaking)
// is stored when the notification method is the trigger method.
SceNpMatching2RoomMemberId roomMemberID = (SceNpMatching2RoomMemberId)(event_param >> 32);
uint32_t volume = (uint32_t)(event_param & 0xffffffff);
// The precision of voice detection is not very high. Since the audio signal values may
// always be relatively high depending on the audio input device and the noise level in the
// room, you should set a large reference value for determining whether or not a player is
// speaking. Relatively good results can be obtained when an audio signal value of at
// The precision of voice detection is not very high. Since the audio signal values may
// always be relatively high depending on the audio input device and the noise level in the
// room, you should set a large reference value for determining whether or not a player is
// speaking. Relatively good results can be obtained when an audio signal value of at
// least 9 is used to determine if a player is speaking.
bool bTalking = false;
if(volume >= 9)
@@ -514,7 +514,7 @@ void SonyVoiceChat::do_state_transition( state_transition_table *tbl, int tbl_si
}
if(bCalledFunc == false)
{
assert( (sm_event == AVC_EVENT_NON) ||
assert( (sm_event == AVC_EVENT_NON) ||
(sm_state == AVC_STATE_IDLE && sm_event == AVC_EVENT_EPSILON) );
}
}
@@ -547,7 +547,7 @@ void SonyVoiceChat::mute( bool bMute )
{
if(sm_bLoaded && !sm_bUnloading)
{
int err = cellSysutilAvc2SetVoiceMuting(bMute);
int err = cellSysutilAvc2SetVoiceMuting(bMute);
assert(err == CELL_OK);
}
}
@@ -576,14 +576,14 @@ bool SonyVoiceChat::isMuted()
if(sm_bLoaded && !sm_bUnloading)
{
uint8_t bMute;
int err = cellSysutilAvc2GetVoiceMuting(&bMute);
int err = cellSysutilAvc2GetVoiceMuting(&bMute);
assert(err == CELL_OK);
return bMute;
}
return false;
}
bool SonyVoiceChat::isMutedPlayer( const SceNpMatching2RoomMemberId member_id)
bool SonyVoiceChat::isMutedPlayer( const SceNpMatching2RoomMemberId member_id)
{
if(sm_bLoaded && !sm_bUnloading)
{
@@ -595,7 +595,7 @@ bool SonyVoiceChat::isMutedPlayer( const SceNpMatching2RoomMemberId member_id)
return false;
}
bool SonyVoiceChat::isMutedLocalPlayer()
bool SonyVoiceChat::isMutedLocalPlayer()
{
if(sm_bLoaded && !sm_bUnloading)
{
@@ -611,10 +611,10 @@ void SonyVoiceChat::setVolume( float vol )
{
if(sm_bLoaded && !sm_bUnloading)
{
// The volume level can be set to a value in the range 0.0 to 40.0.
// Volume levels are linear values such that if 1.0 is specified, the
// volume level will be 1 times the reference power (0dB), and if 0.5
// is specified, the volume level will be 0.5 times the reference power
// The volume level can be set to a value in the range 0.0 to 40.0.
// Volume levels are linear values such that if 1.0 is specified, the
// volume level will be 1 times the reference power (0dB), and if 0.5
// is specified, the volume level will be 0.5 times the reference power
// (-6dB). If 0.0 is specified, chat audio will no longer be audible.
int err =cellSysutilAvc2SetSpeakerVolumeLevel(vol * 40.0f);
@@ -636,8 +636,8 @@ float SonyVoiceChat::getVolume()
bool SonyVoiceChat::isTalking( SceNpMatching2RoomMemberId* players_id )
{
AUTO_VAR(it, sm_bTalkingMap.find(*players_id));
if (it != sm_bTalkingMap.end() )
auto it = sm_bTalkingMap.find(*players_id);
if (it != sm_bTalkingMap.end() )
return it->second;
return false;
}
@@ -648,11 +648,11 @@ void SonyVoiceChat::setBitRate()
return;
int numPlayers = sm_pNetworkManager->GetPlayerCount();
// This internal attribute represents the maximum voice bit rate. attr_param
// is an integer value. The units are bps, and the specifiable values are
// This internal attribute represents the maximum voice bit rate. attr_param
// is an integer value. The units are bps, and the specifiable values are
// 4000, 8000, 16000, 20000, 24000, and 28000. The initial value is 28000.
static int bitRates[8] = { 28000, 28000,
static int bitRates[8] = { 28000, 28000,
28000, 28000,
24000, 20000,
16000, 16000};
@@ -686,14 +686,14 @@ const char* getStateString(EAVCState state)
{
CASE_STR_VALUE(AVC_STATE_IDLE);
CASE_STR_VALUE(AVC_STATE_CHAT_INIT)
CASE_STR_VALUE(AVC_STATE_CHAT_LOAD);
CASE_STR_VALUE(AVC_STATE_CHAT_INIT)
CASE_STR_VALUE(AVC_STATE_CHAT_LOAD);
CASE_STR_VALUE(AVC_STATE_CHAT_JOIN);
CASE_STR_VALUE(AVC_STATE_CHAT_SESSION_PROCESSING);
CASE_STR_VALUE(AVC_STATE_CHAT_LEAVE);
CASE_STR_VALUE(AVC_STATE_CHAT_RESET);
CASE_STR_VALUE(AVC_STATE_CHAT_UNLOAD);
CASE_STR_VALUE(AVC_STATE_EXIT);
CASE_STR_VALUE(AVC_STATE_CHAT_UNLOAD);
CASE_STR_VALUE(AVC_STATE_EXIT);
default:
return "unknown state";
}

View File

@@ -5,7 +5,7 @@
#include <libsn.h>
#include <cell/cell_fs.h>
#include <sys/vm.h>
#include <sys/memory.h>
#include <sys/memory.h>
#undef __in
#undef __out
#include <cell/atomic.h>
@@ -31,49 +31,49 @@ vector<int> vOpenFileHandles;
namespace boost
{
void assertion_failed(char const * expr,
char const * function, char const * file, long line)
{
char const * function, char const * file, long line)
{
#ifndef _CONTENT_PACKAGE
printf("Assert failed!!!\n");
printf(expr);
printf("\n");
printf("----------------------\n %s failed. File %s at line %d \n----------------------\n", function, file, line);
printf("Assert failed!!!\n");
printf(expr);
printf("\n");
printf("----------------------\n %s failed. File %s at line %d \n----------------------\n", function, file, line);
snPause();
#endif
} // user defined
} // namespace boost
char* getConsoleHomePath()
{
return contentInfoPath;
char* getConsoleHomePath()
{
return contentInfoPath;
}
char* getUsrDirPath()
{
return usrdirPath;
char* getUsrDirPath()
{
return usrdirPath;
}
char* getConsoleHomePathBDPatch()
{
return contentInfoPathBDPatch;
char* getConsoleHomePathBDPatch()
{
return contentInfoPathBDPatch;
}
char* getUsrDirPathBDPatch()
{
return usrdirPathBDPatch;
char* getUsrDirPathBDPatch()
{
return usrdirPathBDPatch;
}
char* getDirName()
{
return dirName;
char* getDirName()
{
return dirName;
}
int _wcsicmp( const wchar_t * dst, const wchar_t * src )
{
wchar_t f,l;
// validation section
// validation section
// _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR);
// _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR);
@@ -101,7 +101,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize)
Cnullptr nullptr;
VOID GetSystemTime( LPSYSTEMTIME lpSystemTime)
VOID GetSystemTime( LPSYSTEMTIME lpSystemTime)
{
CellRtcDateTime dateTime;
int err = cellRtcGetCurrentClock(&dateTime, 0);
@@ -118,8 +118,8 @@ VOID GetSystemTime( LPSYSTEMTIME lpSystemTime)
}
BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) { PS3_STUBBED; return false; }
BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) { PS3_STUBBED; return false; }
VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
{
VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
{
CellRtcDateTime dateTime;
int err = cellRtcGetCurrentClockLocalTime(&dateTime);
assert(err == CELL_OK);
@@ -135,26 +135,26 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime)
}
HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { PS3_STUBBED; return NULL; }
VOID Sleep(DWORD dwMilliseconds)
{
VOID Sleep(DWORD dwMilliseconds)
{
C4JThread::Sleep(dwMilliseconds);
}
BOOL SetThreadPriority(HANDLE hThread, int nPriority) { PS3_STUBBED; return FALSE; }
DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) { PS3_STUBBED; return false; }
LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand )
{
LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand )
{
return cellAtomicCompareAndSwap32((uint32_t*)Destination, (uint32_t)Comperand, (uint32_t)Exchange);
}
LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand)
{
LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand)
{
return cellAtomicCompareAndSwap64((uint64_t*)Destination, (uint64_t)Comperand, (uint64_t)Exchange);
}
VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
{
sys_lwmutex_attribute_t attr;
// from the defaults in sys_lwmutex_attribute_initialize
@@ -167,7 +167,7 @@ VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection)
}
VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount)
VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount)
{
// no spin count on PS3
InitializeCriticalSection(CriticalSection);
@@ -179,9 +179,9 @@ VOID DeleteCriticalSection(PCRITICAL_SECTION CriticalSection)
PS3_ASSERT_CELL_ERROR(err);
}
extern CRITICAL_SECTION g_singleThreadCS;
extern CRITICAL_SECTION g_singleThreadCS;
VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection)
VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection)
{
// if(CriticalSection != &g_singleThreadCS &&(C4JThread::isMainThread() == false) )
// LeaveCriticalSection(&g_singleThreadCS);
@@ -192,7 +192,7 @@ VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection)
}
VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
{
int err = sys_lwmutex_unlock(CriticalSection);
PS3_ASSERT_CELL_ERROR(err);
@@ -200,7 +200,7 @@ VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection)
ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection)
{
int err = sys_lwmutex_trylock(CriticalSection);
int err = sys_lwmutex_trylock(CriticalSection);
if(err == CELL_OK)
return true;
return false;
@@ -209,8 +209,8 @@ DWORD WaitForMultipleObjects(DWORD nCount, CONST HANDLE *lpHandles,BOOL bWaitAll
BOOL CloseHandle(HANDLE hObject)
{
BOOL CloseHandle(HANDLE hObject)
{
if(hObject==INVALID_HANDLE_VALUE)
{
//printf("\n\nTRYING TO CLOSE AN INVALID FILE HANDLE\n\n");
@@ -219,13 +219,13 @@ BOOL CloseHandle(HANDLE hObject)
else
{
CellFsErrno err;
err=cellFsClose(int(hObject));
err=cellFsClose(int(hObject));
if(err==CELL_FS_SUCCEEDED)
{
iFilesOpen--;
AUTO_VAR(itEnd, vOpenFileHandles.end());
for (AUTO_VAR(it, vOpenFileHandles.begin()); it != itEnd; it++)
auto itEnd = vOpenFileHandles.end();
for ( auto it = vOpenFileHandles.begin(); it != itEnd; it++)
{
int iFH=(int)*it;
if(iFH==(int)hObject)
@@ -235,7 +235,7 @@ BOOL CloseHandle(HANDLE hObject)
}
}
//printf("\n\nFiles Open - %d\n\n",iFilesOpen);
return true;
return true;
}
else
{
@@ -249,8 +249,8 @@ BOOL SetEvent(HANDLE hEvent) { PS3_STUBBED; return false; }
HMODULE GetModuleHandle(LPCSTR lpModuleName) { PS3_STUBBED; return 0; }
sys_ppu_thread_t GetCurrentThreadId(VOID)
{
sys_ppu_thread_t GetCurrentThreadId(VOID)
{
sys_ppu_thread_t id;
int err = sys_ppu_thread_get_id(&id);
PS3_ASSERT_CELL_ERROR(err);
@@ -264,8 +264,8 @@ BOOL TlsFree(DWORD dwTlsIndex) { return TLSStoragePS3::Instance()->Free(dwTlsInd
LPVOID TlsGetValue(DWORD dwTlsIndex) { return TLSStoragePS3::Instance()->GetValue(dwTlsIndex); }
BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) { return TLSStoragePS3::Instance()->SetValue(dwTlsIndex, lpTlsValue); }
LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
{
LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect)
{
int err;
sys_addr_t newAddress = NULL;
if(lpAddress == NULL)
@@ -299,7 +299,7 @@ LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWO
return (LPVOID)newAddress;
}
BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
{
if(dwFreeType == MEM_DECOMMIT)
{
@@ -307,12 +307,12 @@ BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType)
sys_vm_statistics_t stat;
err = sys_vm_get_statistics((sys_addr_t)lpAddress, &stat);
PS3_ASSERT(err == CELL_OK);
// 4J Stu - We can only return what we have actually committed on PS3
// From PS3 Docs:
// The maximum amount of memory that can be returned is the difference of the total amount of physical memory used by the virtual memory area minus 1MB. When an amount exceeding this value is specified, EBUSY will return.
SIZE_T memToFree = stat.pmem_total - (1024 * 1024);
if(dwSize < memToFree)
if(dwSize < memToFree)
memToFree = dwSize;
app.DebugPrintf("VirtualFree: Requested size - %d, Actual size - %d\n", dwSize, memToFree);
@@ -349,10 +349,10 @@ BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPD
uint64_t bytesWritten;
CellFsErrno err = cellFsWrite(fd, lpBuffer, nNumberOfBytesToWrite, &bytesWritten);
*lpNumberOfBytesWritten = (DWORD)bytesWritten;
return (err == CELL_FS_OK);
return (err == CELL_FS_OK);
}
BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped )
BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped )
{
int fd = (int)hFile;
uint64_t bytesRead;
@@ -374,7 +374,7 @@ BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD
break;
}
return (err==CELL_FS_SUCCEEDED);
return (err==CELL_FS_SUCCEEDED);
}
BOOL SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
@@ -407,7 +407,7 @@ void replaceBackslashes(char* szFilename)
}
}
HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
{
char filePath[256];
std::string mountedPath;
@@ -445,7 +445,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
int fd = 0;
int flags = 0;
switch(dwDesiredAccess)
{
{
case GENERIC_READ:
flags = CELL_FS_O_RDONLY; break;
case GENERIC_WRITE:
@@ -508,7 +508,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
switch(err)
{
case CELL_FS_SUCCEEDED:
{
{
app.DebugPrintf("CELL_FS_SUCCEEDED\n");
DWORD dwFileSize = (DWORD)statData.st_size;
@@ -522,7 +522,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
// fd is invalid or the file system on a removable media has been unmounted
// When cellFsFstat() returns CELL_FS_EBADF, it can be deduced that the above error occurred because a disc was ejected.
// Explicitly call cellFsClose() and close the applicable file. When using stream supporting APIs, call cellFsStReadFinish() before calling cellFsClose().
// Explicitly call cellFsClose() and close the applicable file. When using stream supporting APIs, call cellFsStReadFinish() before calling cellFsClose().
app.DebugPrintf("CELL_FS_EBADF\n");
CloseHandle((HANDLE)fd);
@@ -531,7 +531,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
//ShutdownManager::StartShutdown();
return INVALID_HANDLE_VALUE;
case CELL_FS_EIO:
app.DebugPrintf("CELL_FS_EIO\n");
break;
@@ -550,8 +550,8 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
return (void*)fd;
}
BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
{
BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
{
char filePath[256];
sprintf(filePath,"%s/%s",usrdirPath, lpPathName );
CellFsErrno err = cellFsMkdir(filePath, CELL_FS_DEFAULT_CREATE_MODE_1);
@@ -563,12 +563,12 @@ BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttribu
BOOL DeleteFileA(LPCSTR lpFileName) { PS3_STUBBED; return false; }
// BOOL XCloseHandle(HANDLE a)
// {
// cellFsClose(int(a));
// BOOL XCloseHandle(HANDLE a)
// {
// cellFsClose(int(a));
// }
DWORD GetFileAttributesA(LPCSTR lpFileName)
DWORD GetFileAttributesA(LPCSTR lpFileName)
{
char filePath[256];
std::string mountedPath = StorageManager.GetMountedPath(lpFileName);
@@ -582,7 +582,7 @@ DWORD GetFileAttributesA(LPCSTR lpFileName)
sprintf(filePath,"%s/%s",usrdirPath, lpFileName ); // set to load from host
//strcat(filePath,".edat");
//printf("GetFileAttributesA - %s\n",filePath);
// check if the file exists first
@@ -606,7 +606,7 @@ VOID DebugBreak(VOID) { snPause(); }
DWORD GetLastError(VOID) { PS3_STUBBED; return 0; }
VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
{
malloc_managed_size stat;
int err = malloc_stats(&stat);
@@ -620,20 +620,20 @@ VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer)
lpBuffer->dwAvailVirtual = stat.max_system_size - stat.current_inuse_size;
}
DWORD GetTickCount()
DWORD GetTickCount()
{
// This function returns the current system time at this function is called.
// This function returns the current system time at this function is called.
// The system time is represented the time elapsed since the system starts up in microseconds.
system_time_t sysTime = sys_time_get_system_time();
return sysTime / 1000;
return sysTime / 1000;
}
// we should really use libperf for this kind of thing, but this will do for now.
BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency)
{
BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency)
{
// microseconds
lpFrequency->QuadPart = (1000 * 1000);
return false;
lpFrequency->QuadPart = (1000 * 1000);
return false;
}
BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount)
{
@@ -646,24 +646,24 @@ BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount)
}
#ifndef _FINAL_BUILD
VOID OutputDebugStringW(LPCWSTR lpOutputString)
{
wprintf(lpOutputString);
VOID OutputDebugStringW(LPCWSTR lpOutputString)
{
wprintf(lpOutputString);
}
VOID OutputDebugString(LPCSTR lpOutputString)
{
printf(lpOutputString);
VOID OutputDebugString(LPCSTR lpOutputString)
{
printf(lpOutputString);
}
VOID OutputDebugStringA(LPCSTR lpOutputString)
{
printf(lpOutputString);
VOID OutputDebugStringA(LPCSTR lpOutputString)
{
printf(lpOutputString);
}
#endif // _CONTENT_PACKAGE
BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation)
{
{
PS3_STUBBED;
return false;
}
@@ -680,13 +680,13 @@ int _wtoi(const wchar_t *_Str)
DWORD XGetLanguage()
{
DWORD XGetLanguage()
{
unsigned char ucLang = app.GetMinecraftLanguage(0);
int iLang;
// check if we should override the system language or not
if(ucLang==MINECRAFT_LANGUAGE_DEFAULT)
if(ucLang==MINECRAFT_LANGUAGE_DEFAULT)
{
cellSysutilGetSystemParamInt(CELL_SYSUTIL_SYSTEMPARAM_ID_LANG,&iLang);
}
@@ -701,7 +701,7 @@ DWORD XGetLanguage()
case CELL_SYSUTIL_LANG_ENGLISH_US : return XC_LANGUAGE_ENGLISH;
case CELL_SYSUTIL_LANG_FRENCH : return XC_LANGUAGE_FRENCH;
case CELL_SYSUTIL_LANG_SPANISH :
case CELL_SYSUTIL_LANG_SPANISH :
if(app.IsAmericanSKU())
{
return XC_LANGUAGE_LATINAMERICANSPANISH;
@@ -714,7 +714,7 @@ DWORD XGetLanguage()
case CELL_SYSUTIL_LANG_GERMAN : return XC_LANGUAGE_GERMAN;
case CELL_SYSUTIL_LANG_ITALIAN : return XC_LANGUAGE_ITALIAN;
case CELL_SYSUTIL_LANG_PORTUGUESE_PT : return XC_LANGUAGE_PORTUGUESE;
case CELL_SYSUTIL_LANG_RUSSIAN : return XC_LANGUAGE_RUSSIAN;
case CELL_SYSUTIL_LANG_KOREAN : return XC_LANGUAGE_KOREAN;
case CELL_SYSUTIL_LANG_CHINESE_T : return XC_LANGUAGE_TCHINESE;
@@ -735,8 +735,8 @@ DWORD XGetLanguage()
}
}
DWORD XGetLocale()
{
DWORD XGetLocale()
{
int iLang;
cellSysutilGetSystemParamInt(CELL_SYSUTIL_SYSTEMPARAM_ID_LANG,&iLang);
switch(iLang)
@@ -745,7 +745,7 @@ DWORD XGetLocale()
case CELL_SYSUTIL_LANG_ENGLISH_US : return XC_LOCALE_UNITED_STATES;
case CELL_SYSUTIL_LANG_FRENCH : return XC_LOCALE_FRANCE;
case CELL_SYSUTIL_LANG_SPANISH :
case CELL_SYSUTIL_LANG_SPANISH :
if(app.IsAmericanSKU())
{
return XC_LOCALE_LATIN_AMERICA;
@@ -753,7 +753,7 @@ DWORD XGetLocale()
else
{
return XC_LOCALE_SPAIN;
}
}
return XC_LOCALE_SPAIN;
case CELL_SYSUTIL_LANG_GERMAN : return XC_LOCALE_GERMANY;
@@ -777,11 +777,11 @@ DWORD XGetLocale()
case CELL_SYSUTIL_LANG_CHINESE_S : return XC_LOCALE_CHINA;
default : return XC_LOCALE_UNITED_STATES;
}
}
}
DWORD XEnableGuestSignin(BOOL fEnable)
{
return 0;
DWORD XEnableGuestSignin(BOOL fEnable)
{
return 0;
}
#endif // __PS3__

View File

@@ -35,29 +35,28 @@ using boost::hash;
// user the pool_allocator for all unordered_set and unordered_map instances
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = boost::pool_allocator<T> >
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = boost::pool_allocator<T> >
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
// {};
//
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = boost::pool_allocator<std::pair<const K,T> > >
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
//
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = boost::pool_allocator<std::pair<const K,T> > >
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
// {};
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = C4JPoolAllocator<T> >
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
// template < class T, class H = hash<T>, class P = std::equal_to<T>, class A = C4JPoolAllocator<T> >
// class unordered_set : public std::tr1::unordered_set<T, H, P, A >
// {};
//
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = C4JPoolAllocator<std::pair<const K,T> > >
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
//
// template <class K, class T, class H = hash<K>, class P = std::equal_to<K>, class A = C4JPoolAllocator<std::pair<const K,T> > >
// class unordered_map : public std::tr1::unordered_map<K, T, H, P, A >
// {};
// using boost::ublas::vector;
#define static_assert(a,b) BOOST_STATIC_ASSERT(a)
#define AUTO_VAR BOOST_AUTO
class Cnullptr{
public:

View File

@@ -31,7 +31,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
m_bVoiceChatAndUGCRestricted=false;
m_bDisplayFullVersionPurchase=false;
// #ifdef _DEBUG_MENUS_ENABLED
// #ifdef _DEBUG_MENUS_ENABLED
// debugOverlayCreated = false;
// #endif
@@ -173,7 +173,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
WRAPPED_READFILE(file,&pDLCInfo->iConfig,sizeof(int),&bytesRead,NULL);
// push this into a vector
wstring wstrTemp=convStringToWstring(chDLCTitle);
m_SONYDLCMap[wstrTemp]=pDLCInfo;
}
@@ -266,7 +266,7 @@ void CConsoleMinecraftApp::FatalLoadError()
aStrings[1] = L"Не удалось загрузить игру \"Minecraft: PlayStation®3 Edition\". Продолжить загрузку невозможно.";
aStrings[2] = L"Выйти из игры";
break;
case XC_LANGUAGE_TCHINESE:
case XC_LANGUAGE_TCHINESE:
aStrings[0] = L"載入錯誤";
aStrings[1] = L"無法載入「Minecraft: PlayStation®3 Edition」因此無法繼續。";
aStrings[2] = L"離開遊戲";
@@ -360,7 +360,7 @@ void CConsoleMinecraftApp::FatalLoadError()
}
app.DebugPrintf("Requesting Message Box for Fatal Error again due to BUSY\n");
eResult=InputManager.RequestMessageBox(EMSgBoxType_None,0,NULL,this,(char *)u8Message,0);
}
}
while(1)
{
@@ -467,7 +467,7 @@ void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType)
}
LoadSaveDataThreadParam* LoadSaveFromDisk(const wstring& pathName)
{
{
File saveFile(pathName);
__int64 fileSize = saveFile.length();
FileInputStream fis(saveFile);
@@ -595,7 +595,7 @@ void CConsoleMinecraftApp::CommerceTick()
break;
case eCommerce_State_GetProductList:
{
{
m_eCommerce_State=eCommerce_State_GetProductList_Pending;
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
std::list<SonyCommerce::CategoryInfoSub>::iterator iter = pCategories->subCategories.begin();
@@ -611,7 +611,7 @@ void CConsoleMinecraftApp::CommerceTick()
break;
case eCommerce_State_AddProductInfoDetailed:
{
{
m_eCommerce_State=eCommerce_State_AddProductInfoDetailed_Pending;
// for each of the products in the categories, get the detailed info. We really only need the long description and price info.
@@ -648,7 +648,7 @@ void CConsoleMinecraftApp::CommerceTick()
break;
case eCommerce_State_RegisterDLC:
{
{
m_eCommerce_State=eCommerce_State_Online;
// register the DLC info
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
@@ -738,16 +738,16 @@ void CConsoleMinecraftApp::ClearCommerceDetails()
{
for(int i=0;i<m_ProductListCategoriesC;i++)
{
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
pProductList->clear();
}
if(m_ProductListA!=NULL)
{
delete [] m_ProductListA;
delete [] m_ProductListA;
m_ProductListA=NULL;
}
m_ProductListRetrievedC=0;
m_ProductListAdditionalDetailsC=0;
m_ProductListCategoriesC=0;
@@ -772,17 +772,17 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch
for(int j=0;j<m_ProductListA[i].size();j++)
{
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
AUTO_VAR(itEnd, pProductList->end());
auto itEnd = pProductList->end();
for (AUTO_VAR(it, pProductList->begin()); it != itEnd; it++)
{
for (auto it = pProductList->begin(); it != itEnd; it++)
{
SonyCommerce::ProductInfo Info=*it;
if(strcmp(pchDLCProductID,Info.productId)==0)
{
{
memcpy(pchSkuID,Info.skuId,SCE_NP_COMMERCE2_SKU_ID_LEN);
return;
}
}
}
}
}
return;
@@ -791,7 +791,7 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch
void CConsoleMinecraftApp::Checkout(char *pchSkuID)
{
if(m_eCommerce_State==eCommerce_State_Online)
{
{
strcpy(m_pchSkuID,pchSkuID);
m_eCommerce_State=eCommerce_State_Checkout;
}
@@ -800,7 +800,7 @@ void CConsoleMinecraftApp::Checkout(char *pchSkuID)
void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID)
{
if(m_eCommerce_State==eCommerce_State_Online)
{
{
strcpy(m_pchSkuID,pchSkuID);
m_eCommerce_State=eCommerce_State_DownloadAlreadyPurchased;
}
@@ -809,7 +809,7 @@ void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID)
bool CConsoleMinecraftApp::UpgradeTrial()
{
if(m_eCommerce_State==eCommerce_State_Online)
{
{
m_eCommerce_State=eCommerce_State_UpgradeTrial;
return true;
}
@@ -845,13 +845,13 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle)
for(int j=0;j<m_ProductListA[i].size();j++)
{
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
AUTO_VAR(itEnd, pProductList->end());
for (AUTO_VAR(it, pProductList->begin()); it != itEnd; it++)
{
auto itEnd = pProductList->end();
for (auto it = pProductList->begin(); it != itEnd; it++)
{
SonyCommerce::ProductInfo Info=*it;
if(strcmp(pchTitle,Info.skuId)==0)
{
{
if(Info.purchasabilityFlag==SCE_NP_COMMERCE2_SKU_PURCHASABILITY_FLAG_OFF)
{
return true;
@@ -861,7 +861,7 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle)
return false;
}
}
}
}
}
}
return false;
@@ -896,7 +896,7 @@ void CConsoleMinecraftApp::CommerceGetCategoriesCallback(LPVOID lpParam,int err)
if(err==0)
{
pClass->m_ProductListCategoriesC=pClass->m_CategoryInfo.countOfSubCategories;
// allocate the memory for the product info for each categories
// allocate the memory for the product info for each categories
if(pClass->m_CategoryInfo.countOfSubCategories>0)
{
pClass->m_ProductListA = (std::vector<SonyCommerce::ProductInfo> *) new std::vector<SonyCommerce::ProductInfo> [pClass->m_CategoryInfo.countOfSubCategories];
@@ -928,7 +928,7 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err
{
// we're done, so now retrieve the additional product details for each product
pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed;
pClass->m_bCommerceProductListRetrieved=true;
pClass->m_bCommerceProductListRetrieved=true;
}
else
{
@@ -938,21 +938,21 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err
else
{
pClass->m_eCommerce_State=eCommerce_State_Error;
pClass->m_bCommerceProductListRetrieved=true;
pClass->m_bCommerceProductListRetrieved=true;
}
}
// void CConsoleMinecraftApp::CommerceGetDetailedProductInfoCallback(LPVOID lpParam,int err)
// {
// CConsoleMinecraftApp *pScene=(CConsoleMinecraftApp *)lpParam;
//
//
// if(err==0)
// {
// pScene->m_eCommerce_State=eCommerce_State_Idle;
// //pScene->m_bCommerceProductListRetrieved=true;
// //pScene->m_bCommerceProductListRetrieved=true;
// }
// //printf("Callback hit, error 0x%08x\n", err);
//
//
// }
void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam,int err)
@@ -971,7 +971,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam
{
// MGH - change this to a while loop so we can skip empty categories.
do
{
{
pClass->m_iCurrentCategory++;
}while(pClass->m_ProductListA[pClass->m_iCurrentCategory].size() == 0 && pClass->m_iCurrentCategory<pClass->m_ProductListCategoriesC);
@@ -980,12 +980,12 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam
{
// there are no more categories, so we're done
pClass->m_eCommerce_State=eCommerce_State_RegisterDLC;
pClass->m_bProductListAdditionalDetailsRetrieved=true;
pClass->m_bProductListAdditionalDetailsRetrieved=true;
}
else
{
// continue with the next category
pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed;
pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed;
}
}
else
@@ -997,7 +997,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam
else
{
pClass->m_eCommerce_State=eCommerce_State_Error;
pClass->m_bProductListAdditionalDetailsRetrieved=true;
pClass->m_bProductListAdditionalDetailsRetrieved=true;
pClass->m_iCurrentProduct=0;
pClass->m_iCurrentCategory=0;
}
@@ -1166,7 +1166,7 @@ char *PatchFilelist[] =
// "/TitleUpdate/res/font/Default.png",
"/TitleUpdate/res/font/Mojangles_7.png",
"/TitleUpdate/res/font/Mojangles_11.png",
"music/music/creative1.binka",
"music/music/creative2.binka",
"music/music/creative3.binka",
@@ -1227,7 +1227,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
bool bEmptyStore=true;
if(pCategories!=NULL)
{
{
if(pCategories->countOfProducts>0)
{
bEmptyStore=false;

View File

@@ -36,7 +36,7 @@ SYS_PROCESS_PARAM(1001, 0x10000); // thread priority, and stack size
#endif
/* Encrypted ID for protected data file (*) You must edit these binaries!! */
char secureFileId[CELL_SAVEDATA_SECUREFILEID_SIZE] =
char secureFileId[CELL_SAVEDATA_SECUREFILEID_SIZE] =
{
0xEE, 0xA9, 0x37, 0xCC,
0x5B, 0xD4, 0xD9, 0x0D,
@@ -51,7 +51,7 @@ char secureFileId[CELL_SAVEDATA_SECUREFILEID_SIZE] =
//#define HEAPINSPECTOR_PS3 1
// when defining HEAPINSPECTOR_PS3, add this line to the linker settings
// --wrap malloc --wrap free --wrap memalign --wrap calloc --wrap realloc --wrap reallocalign --wrap _malloc_init
// --wrap malloc --wrap free --wrap memalign --wrap calloc --wrap realloc --wrap reallocalign --wrap _malloc_init
#if HEAPINSPECTOR_PS3
#include "HeapInspector\Server\HeapInspectorServer.h"
@@ -149,13 +149,13 @@ extern "C" void* __wrap__malloc_init(size_t a_Boundary, size_t a_Size)
#endif // HEAPINSPECTOR_PS3
//-------------------------------------------------------------------------------------
// Time Since fAppTime is a float, we need to keep the quadword app time
// Time Since fAppTime is a float, we need to keep the quadword app time
// as a LARGE_INTEGER so that we don't lose precision after running
// for a long time.
//-------------------------------------------------------------------------------------
BOOL g_bWidescreen = TRUE;
//int g_numberOfSpeakersForMiles = 2; // number of speakers to pass to Miles, this is setup from init_audio_hardware
//int g_numberOfSpeakersForMiles = 2; // number of speakers to pass to Miles, this is setup from init_audio_hardware
void DefineActions(void)
{
@@ -216,12 +216,12 @@ void DefineActions(void)
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
if(InputManager.IsCircleCrossSwapped())
{
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_A, _360_JOY_BUTTON_B);
@@ -275,12 +275,12 @@ void DefineActions(void)
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X);
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_RTHUMB);
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK);
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT);
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT);
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP);
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
InputManager.SetGameJoypadMaps(MAP_STYLE_1,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
if(InputManager.IsCircleCrossSwapped())
{
InputManager.SetGameJoypadMaps(MAP_STYLE_2,ACTION_MENU_A, _360_JOY_BUTTON_B);
@@ -334,11 +334,11 @@ void DefineActions(void)
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X);
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB);
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK);
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT);
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT);
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP);
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
InputManager.SetGameJoypadMaps(MAP_STYLE_2,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
}
@@ -438,7 +438,7 @@ void LoadSysModule(uint16_t module, const char* moduleName)
#define LOAD_PS3_MODULE(m) LoadSysModule(m, #m)
int simpleMessageBoxCallback( UINT uiTitle, UINT uiText,
int simpleMessageBoxCallback( UINT uiTitle, UINT uiText,
UINT *uiOptionA, UINT uiOptionC, DWORD dwPad,
int(*Func) (LPVOID,int,const C4JStorage::EMessageResult),
LPVOID lpParam )
@@ -580,7 +580,7 @@ int LoadSysModules()
LOAD_PS3_MODULE(CELL_SYSMODULE_AVCONF_EXT);
LOAD_PS3_MODULE(CELL_SYSMODULE_SYSUTIL_SAVEDATA);
unsigned int uiType ;
unsigned int uiAttributes ;
CellGameContentSize size,sizeBD;
@@ -598,20 +598,20 @@ int LoadSysModules()
if(ret < 0)
{
DEBUG_PRINTF("cellGameBootCheck() Error: 0x%x\n", ret);
}
else
}
else
{
DEBUG_PRINTF("cellGameBootCheck() OK\n");
DEBUG_PRINTF(" get_type = [%d] get_attributes = [0x%08x] dirName = [%s]\n", uiType, uiAttributes, dirName);
DEBUG_PRINTF(" hddFreeSizeKB = [%d] sizeKB = [%d] sysSizeKB = [%d]\n", size.hddFreeSizeKB, size.sizeKB, size.sysSizeKB);
DEBUG_PRINTF(" hddFreeSizeKB = [%d] sizeKB = [%d] sysSizeKB = [%d]\n", size.hddFreeSizeKB, size.sizeKB, size.sysSizeKB);
}
if (uiAttributes & CELL_GAME_ATTRIBUTE_INVITE_MESSAGE)
if (uiAttributes & CELL_GAME_ATTRIBUTE_INVITE_MESSAGE)
{
g_bBootedFromInvite = true;
DEBUG_PRINTF("Booted from invite\n");
}
if (uiAttributes & CELL_GAME_ATTRIBUTE_CUSTOM_DATA_MESSAGE)
if (uiAttributes & CELL_GAME_ATTRIBUTE_CUSTOM_DATA_MESSAGE)
{
DEBUG_PRINTF("Booted from custom data\n");
//bootedFromCustomData = true;
@@ -623,12 +623,12 @@ int LoadSysModules()
bBootedFromBDPatch=true;
app.SetBootedFromDiscPatch();
}
// true if booting from disc, false if booting from HDD
// true if booting from disc, false if booting from HDD
StorageManager.SetBootTypeDisc(uiType == CELL_GAME_GAMETYPE_DISC);
StorageManager.SetMessageBoxCallback(&simpleMessageBoxCallback);
cellGameContentPermit(contentInfoPath,usrdirPath);
cellGameContentPermit(contentInfoPath,usrdirPath);
DEBUG_PRINTF("contentInfoPath - %s\n",contentInfoPath);
DEBUG_PRINTF("usrdirPath - %s\n",usrdirPath);
@@ -636,12 +636,12 @@ int LoadSysModules()
if(ret < 0)
{
DEBUG_PRINTF("cellGamePatchCheck() Error: 0x%x\n", ret);
}
else
}
else
{
DEBUG_PRINTF("cellGamePatchCheck() OK - we were booted from a disc patch!\n");
cellGameContentPermit(contentInfoPathBDPatch,usrdirPathBDPatch);
cellGameContentPermit(contentInfoPathBDPatch,usrdirPathBDPatch);
DEBUG_PRINTF("contentInfoPath - %s\n",contentInfoPathBDPatch);
DEBUG_PRINTF("usrdirPath - %s\n",usrdirPathBDPatch);
@@ -686,7 +686,7 @@ int main()
//
// initialize the ps3
//
//
int ihddFreeSizeKB=LoadSysModules();
ProfileManager.SetHDDFreeKB(ihddFreeSizeKB);
@@ -699,7 +699,7 @@ int main()
#ifndef DISABLE_MILES_SOUND
#ifdef USE_SPURS
#ifdef USE_SPURS
void * spurs_info[ 2 ];
spurs_info[ 0 ] = C4JThread_SPU::getSpurs2();
extern const CellSpursTaskBinInfo _binary_task_mssspurs_elf_taskbininfo;
@@ -753,7 +753,7 @@ int main()
//
// now initialize libAudio
//
cellAudioInit();
#endif // DISABLE_MILES_SOUND
@@ -784,7 +784,7 @@ int main()
{
case e_sku_SCEE:
// 4J-PB - need to be online to do this check, so let's stick with the 7+, and move this
if(StorageManager.GetBootTypeDisc())
{
// set Europe age, then hone down specific countries
@@ -961,10 +961,10 @@ int main()
}
else
{
StorageManager.SetGameSaveFolderTitle((WCHAR *)app.GetString(IDS_GAMENAME));//"Minecraft: PlayStation<6F>3 Edition");//GAMENAME);
StorageManager.SetGameSaveFolderTitle((WCHAR *)app.GetString(IDS_GAMENAME));//"Minecraft: PlayStation<6F>3 Edition");//GAMENAME);
}
StorageManager.SetSaveCacheFolderTitle((WCHAR *)app.GetString(IDS_SAVECACHEFILE));//"Minecraft: PlayStation<6F>3 Edition");//GAMENAME);
StorageManager.SetOptionsFolderTitle((WCHAR *)app.GetString(IDS_OPTIONSFILE));//"Minecraft: PlayStation<6F>3 Edition");//GAMENAME);
StorageManager.SetSaveCacheFolderTitle((WCHAR *)app.GetString(IDS_SAVECACHEFILE));//"Minecraft: PlayStation<6F>3 Edition");//GAMENAME);
StorageManager.SetOptionsFolderTitle((WCHAR *)app.GetString(IDS_OPTIONSFILE));//"Minecraft: PlayStation<6F>3 Edition");//GAMENAME);
StorageManager.SetGameSaveFolderPrefix(app.GetSaveFolderPrefix());
StorageManager.SetMaxSaves(99);
byteArray baOptionsIcon = app.getArchiveFile(L"DefaultOptionsImage320x176.png");
@@ -1014,7 +1014,7 @@ int main()
// Initialise TLS for AABB and Vec3 pools, for this main thread
AABB::CreateNewThreadStorage();
Vec3::CreateNewThreadStorage();
IntCache::CreateNewThreadStorage();
IntCache::CreateNewThreadStorage();
OldChunkStorage::CreateNewThreadStorage();
Level::enableLightingCache();
Tile::CreateNewThreadStorage();
@@ -1029,7 +1029,7 @@ int main()
// set the default profile values
// 4J-PB - InitGameSettings already does this
/*for(int i=0;i<XUSER_MAX_COUNT;i++)
{
{
#ifdef __PS3__
app.SetDefaultOptions(StorageManager.GetDashboardProfileSettings(i),i);
#else
@@ -1081,7 +1081,7 @@ int main()
// 4J-PB - we really need to know at this point if we are playing the trial or full game, so sleep until we know
while(app.GetCommerce()->LicenseChecked()==false)
{
cellSysutilCheckCallback();
cellSysutilCheckCallback();
Sleep(50);
}
// wait for the trophy init to complete - nonblocking semaphore
@@ -1112,7 +1112,7 @@ int main()
// 4J-PB - really want to wait until we've read the options, so we can set the right language if they've chosen one other than the default
// bool bOptionsRead=false;
//
//
// while((bOptionsRead==false) && ShutdownManager::ShouldRun(ShutdownManager::eMainThread))
// {
// switch(app.GetOptionsCallbackStatus(0))
@@ -1125,7 +1125,7 @@ int main()
// }
// StorageManager.Tick();
// }
//
//
// if(ShutdownManager::ShouldRun(ShutdownManager::eMainThread))
// {
// app.loadStringTable();
@@ -1163,7 +1163,7 @@ int main()
PIXBeginNamedEvent(0,"Social network manager tick");
// CSocialManager::Instance()->Tick();
PIXEndNamedEvent();
// Tick sentient.
PIXBeginNamedEvent(0,"Sentient tick");
MemSect(37);
@@ -1174,22 +1174,22 @@ int main()
PIXBeginNamedEvent(0,"Network manager do work #1");
g_NetworkManager.DoWork();
PIXEndNamedEvent();
// 4J-PB - these get set every tick causing the write profile flag to be true all the time -
// 4J-PB - these get set every tick causing the write profile flag to be true all the time -
// app.SetGameSettingsDebugMask(0,eDebugSetting_LoadSavesFromDisk);
// app.SetGameSettingsDebugMask(0,eDebugSetting_WriteSavesToDisk);
// app.SetLoadSavesFromFolderEnabled(true);
// app.SetWriteSavesToFolderEnabled(true);
LeaderboardManager::Instance()->Tick();
// Render game graphics.
if(app.GetGameStarted())
if(app.GetGameStarted())
{
// if(InputManager.ButtonPressed(0, MINECRAFT_ACTION_SNEAK_TOGGLE))
// {
// app.DebugPrintf("saving game...\n");
// debugSaveGameDirect();
//
//
// }
pMinecraft->run_middle();
app.SetAppPaused( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 && ui.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()) );
@@ -1272,7 +1272,7 @@ int main()
#ifdef _DEBUG_MENUS_ENABLED
if(app.DebugSettingsOn())
{
app.ActionDebugMask(i);
app.ActionDebugMask(i);
}
else
{
@@ -1323,7 +1323,7 @@ int main()
if(!ProfileManager.IsFullVersion())
{
// display the trial timer
if(app.GetGameStarted())
if(app.GetGameStarted())
{
// 4J-PB - if the game is paused, add the elapsed time to the trial timer count so it doesn't tick down
if(app.IsAppPaused())
@@ -1401,7 +1401,7 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes)
{
if( !trackStarted )
{
void *p = XMemAllocDefault(dwSize,dwAllocAttributes);
void *p = XMemAllocDefault(dwSize,dwAllocAttributes);
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
totalAllocGen += realSize;
return p;
@@ -1409,7 +1409,7 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes)
EnterCriticalSection(&memCS);
void *p=XMemAllocDefault(dwSize + 16,dwAllocAttributes);
void *p=XMemAllocDefault(dwSize + 16,dwAllocAttributes);
size_t realSize = XMemSizeDefault(p,dwAllocAttributes) - 16;
if( trackEnable )
@@ -1435,7 +1435,7 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes)
trackEnable = true;
}
}
LeaveCriticalSection(&memCS);
return p;
@@ -1470,7 +1470,7 @@ void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes)
if( pAddress )
{
size_t realSize = XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
if(trackEnable)
{
int sect = *(((unsigned char *)pAddress)+realSize);
@@ -1504,7 +1504,7 @@ SIZE_T WINAPI XMemSize(
void DumpMem()
{
int totalLeak = 0;
for(AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++ )
for( auto it = allocCounts.begin(); it != allocCounts.end(); it++ )
{
if(it->second > 0 )
{
@@ -1552,7 +1552,7 @@ void MemPixStuff()
int totals[MAX_SECT] = {0};
for(AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++ )
for( auto it = allocCounts.begin(); it != allocCounts.end(); it++ )
{
if(it->second > 0 )
{

View File

@@ -63,7 +63,7 @@ DWORD dwProfileSettingsA[NUM_PROFILE_VALUES]=
#endif
//-------------------------------------------------------------------------------------
// Time Since fAppTime is a float, we need to keep the quadword app time
// Time Since fAppTime is a float, we need to keep the quadword app time
// as a LARGE_INTEGER so that we don't lose precision after running
// for a long time.
//-------------------------------------------------------------------------------------
@@ -114,11 +114,11 @@ void DefineActions(void)
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_CRAFTING, _360_JOY_BUTTON_X);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_RENDER_THIRD_PERSON, _360_JOY_BUTTON_LTHUMB);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_GAME_INFO, _360_JOY_BUTTON_BACK);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_LEFT, _360_JOY_BUTTON_DPAD_LEFT);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_RIGHT, _360_JOY_BUTTON_DPAD_RIGHT);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_UP, _360_JOY_BUTTON_DPAD_UP);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
InputManager.SetGameJoypadMaps(MAP_STYLE_0,MINECRAFT_ACTION_DPAD_DOWN, _360_JOY_BUTTON_DPAD_DOWN);
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_A, _360_JOY_BUTTON_A);
InputManager.SetGameJoypadMaps(MAP_STYLE_1,ACTION_MENU_B, _360_JOY_BUTTON_B);
@@ -195,7 +195,7 @@ void DefineActions(void)
}
#if 0
HRESULT InitD3D( IDirect3DDevice9 **ppDevice,
HRESULT InitD3D( IDirect3DDevice9 **ppDevice,
D3DPRESENT_PARAMETERS *pd3dPP )
{
IDirect3D9 *pD3D;
@@ -222,14 +222,14 @@ HRESULT InitD3D( IDirect3DDevice9 **ppDevice,
//pd3dPP->Flags = D3DPRESENTFLAG_NO_LETTERBOX;
//ERR[D3D]: Can't set D3DPRESENTFLAG_NO_LETTERBOX when wide-screen is enabled
// in the launcher/dashboard.
if(g_bWidescreen)
if(g_bWidescreen)
pd3dPP->Flags=0;
else
else
pd3dPP->Flags = D3DPRESENTFLAG_NO_LETTERBOX;
// Create the device.
return pD3D->CreateDevice(
0,
0,
D3DDEVTYPE_HAL,
NULL,
D3DCREATE_HARDWARE_VERTEXPROCESSING|D3DCREATE_BUFFER_2_FRAMES,
@@ -535,18 +535,18 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
}
// Initialize the application, assuming sharing of the d3d interface.
hr = app.InitShared( pDevice, &d3dpp,
hr = app.InitShared( pDevice, &d3dpp,
XuiPNGTextureLoader );
if ( FAILED(hr) )
{
app.DebugPrintf
( "Failed initializing application.\n" );
return -1;
}
#endif
RenderManager.Initialise(g_pd3dDevice, g_pSwapChain);
@@ -642,7 +642,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
// set a function to be called when the ethernet is disconnected, so we can back out if required
ProfileManager.SetNotificationsCallback(&CXboxMinecraftApp::NotificationsCallback,(LPVOID)&app);
// Set a callback for the default player options to be set - when there is no profile data for the player
ProfileManager.SetDefaultOptionsCallback(&CXboxMinecraftApp::DefaultOptionsCallback,(LPVOID)&app);
// Set a callback to deal with old profile versions needing updated to new versions
@@ -669,13 +669,13 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
if(XNuiGetHardwareStatus()!=0)
{
// If the Kinect Sensor is not physically connected, this function returns 0.
NuiInitialize(NUI_INITIALIZE_FLAG_USES_HIGH_QUALITY_COLOR | NUI_INITIALIZE_FLAG_USES_DEPTH |
// If the Kinect Sensor is not physically connected, this function returns 0.
NuiInitialize(NUI_INITIALIZE_FLAG_USES_HIGH_QUALITY_COLOR | NUI_INITIALIZE_FLAG_USES_DEPTH |
NUI_INITIALIZE_FLAG_EXTRAPOLATE_FLOOR_PLANE | NUI_INITIALIZE_FLAG_USES_FITNESS | NUI_INITIALIZE_FLAG_NUI_GUIDE_DISABLED | NUI_INITIALIZE_FLAG_SUPPRESS_AUTOMATIC_UI,NUI_INITIALIZE_DEFAULT_HARDWARE_THREAD );
}
// Sentient !
hr = SentientManager.Init();
hr = SentientManager.Init();
#endif
@@ -763,7 +763,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
}
#endif
while( TRUE )
while( TRUE )
{
#if 0
if(pMinecraft->soundEngine->isStreamingWavebankReady() &&
@@ -792,7 +792,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
PIXBeginNamedEvent(0,"Social network manager tick");
// CSocialManager::Instance()->Tick();
PIXEndNamedEvent();
// Tick sentient.
PIXBeginNamedEvent(0,"Sentient tick");
MemSect(37);
@@ -806,7 +806,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
// LeaderboardManager::Instance()->Tick();
// Render game graphics.
if(app.GetGameStarted())
if(app.GetGameStarted())
{
pMinecraft->run_middle();
app.SetAppPaused( g_qNetManager.IsLocalGame() && g_qNetManager.GetPlayerCount() == 1 && app.IsPauseMenuDisplayed(ProfileManager.GetPrimaryPad()) );
@@ -881,7 +881,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
for(int i=0;i<8;i++)
{
if(RenderStateA2[i]!=RenderStateA[i])
if(RenderStateA2[i]!=RenderStateA[i])
{
//printf("Reseting RenderStateA[%d] after a XUI render\n",i);
pDevice->SetRenderState(RenderStateModes[i],RenderStateA[i]);
@@ -889,7 +889,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
}
for(int i=0;i<5;i++)
{
if(SamplerStateA2[i]!=SamplerStateA[i])
if(SamplerStateA2[i]!=SamplerStateA[i])
{
//printf("Reseting SamplerStateA[%d] after a XUI render\n",i);
pDevice->SetSamplerState(0,SamplerStateModes[i],SamplerStateA[i]);
@@ -923,7 +923,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
#ifdef _DEBUG_MENUS_ENABLED
if(app.DebugSettingsOn())
{
app.ActionDebugMask(i);
app.ActionDebugMask(i);
}
else
{
@@ -968,7 +968,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
if(!ProfileManager.IsFullVersion())
{
// display the trial timer
if(app.GetGameStarted())
if(app.GetGameStarted())
{
// 4J-PB - if the game is paused, add the elapsed time to the trial timer count so it doesn't tick down
if(app.IsAppPaused())
@@ -1016,7 +1016,7 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes)
{
if( !trackStarted )
{
void *p = XMemAllocDefault(dwSize,dwAllocAttributes);
void *p = XMemAllocDefault(dwSize,dwAllocAttributes);
size_t realSize = XMemSizeDefault(p, dwAllocAttributes);
totalAllocGen += realSize;
return p;
@@ -1024,7 +1024,7 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes)
EnterCriticalSection(&memCS);
void *p=XMemAllocDefault(dwSize + 16,dwAllocAttributes);
void *p=XMemAllocDefault(dwSize + 16,dwAllocAttributes);
size_t realSize = XMemSizeDefault(p,dwAllocAttributes) - 16;
if( trackEnable )
@@ -1050,7 +1050,7 @@ LPVOID XMemAlloc(SIZE_T dwSize, DWORD dwAllocAttributes)
trackEnable = true;
}
}
LeaveCriticalSection(&memCS);
return p;
@@ -1085,7 +1085,7 @@ void WINAPI XMemFree(PVOID pAddress, DWORD dwAllocAttributes)
if( pAddress )
{
size_t realSize = XMemSizeDefault(pAddress, dwAllocAttributes) - 16;
if(trackEnable)
{
int sect = *(((unsigned char *)pAddress)+realSize);
@@ -1121,7 +1121,7 @@ SIZE_T WINAPI XMemSize(
void DumpMem()
{
int totalLeak = 0;
for(AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++ )
for( auto it = allocCounts.begin(); it != allocCounts.end(); it++ )
{
if(it->second > 0 )
{
@@ -1169,7 +1169,7 @@ void MemPixStuff()
int totals[MAX_SECT] = {0};
for(AUTO_VAR(it, allocCounts.begin()); it != allocCounts.end(); it++ )
for( auto it = allocCounts.begin(); it != allocCounts.end(); it++ )
{
if(it->second > 0 )
{