MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / cellGameGetParamInt

Function cellGameGetParamInt

ps3fw/cellGame.cpp:1557–1604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1555}
1556
1557error_code cellGameGetParamInt(s32 id, vm::ptr<s32> value)
1558{
1559 cellGame.warning("cellGameGetParamInt(id=%d, value=*0x%x)", id, value);
1560
1561 if (!value)
1562 {
1563 return CELL_GAME_ERROR_PARAM;
1564 }
1565
1566 lv2_sleep(2000);
1567
1568 auto& perm = g_fxo->get<content_permission>();
1569
1570 const auto init = acquire_access_lock(perm.init);
1571
1572 if (!init)
1573 {
1574 return CELL_GAME_ERROR_FAILURE;
1575 }
1576
1577 std::string key;
1578
1579 switch (id)
1580 {
1581 case CELL_GAME_PARAMID_PARENTAL_LEVEL:
1582 key = "PARENTAL_LEVEL";
1583 break;
1584 case CELL_GAME_PARAMID_RESOLUTION:
1585 key = "RESOLUTION";
1586 break;
1587 case CELL_GAME_PARAMID_SOUND_FORMAT:
1588 key = "SOUND_FORMAT";
1589 break;
1590 default:
1591 {
1592 return CELL_GAME_ERROR_INVALID_ID;
1593 }
1594 }
1595
1596 if (!perm.sfo.count(key))
1597 {
1598 // TODO: Check if special values need to be set here
1599 cellGame.warning("cellGameGetParamInt(): id=%d was not found", id);
1600 }
1601
1602 *value = psf::get_integer(perm.sfo, key, 0);
1603 return CELL_OK;
1604}
1605
1606// String key flags
1607enum class strkey_flag : u32

Callers

nothing calls this directly

Calls 4

lv2_sleepFunction · 0.85
acquire_access_lockFunction · 0.85
get_integerFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected