| 1239 | } |
| 1240 | |
| 1241 | error_code cellAudioPortOpen(vm::ptr<CellAudioPortParam> audioParam, vm::ptr<u32> portNum) |
| 1242 | { |
| 1243 | cellAudio.warning("cellAudioPortOpen(audioParam=*0x%x, portNum=*0x%x)", audioParam, portNum); |
| 1244 | |
| 1245 | auto& g_audio = g_fxo->get<cell_audio>(); |
| 1246 | |
| 1247 | if (!g_audio.init) |
| 1248 | { |
| 1249 | return CELL_AUDIO_ERROR_NOT_INIT; |
| 1250 | } |
| 1251 | |
| 1252 | if (!audioParam || !portNum) |
| 1253 | { |
| 1254 | return CELL_AUDIO_ERROR_PARAM; |
| 1255 | } |
| 1256 | |
| 1257 | const u64 num_channels = audioParam->nChannel; |
| 1258 | const u64 num_blocks = audioParam->nBlock; |
| 1259 | const u64 attr = audioParam->attr; |
| 1260 | |
| 1261 | // check attributes |
| 1262 | if (num_channels != CELL_AUDIO_PORT_2CH && |
| 1263 | num_channels != CELL_AUDIO_PORT_8CH && |
| 1264 | num_channels != 0) |
| 1265 | { |
| 1266 | return CELL_AUDIO_ERROR_PARAM; |
| 1267 | } |
| 1268 | |
| 1269 | if (num_blocks != 2 && |
| 1270 | num_blocks != 4 && |
| 1271 | num_blocks != CELL_AUDIO_BLOCK_8 && |
| 1272 | num_blocks != CELL_AUDIO_BLOCK_16 && |
| 1273 | num_blocks != CELL_AUDIO_BLOCK_32) |
| 1274 | { |
| 1275 | return CELL_AUDIO_ERROR_PARAM; |
| 1276 | } |
| 1277 | |
| 1278 | // list unsupported flags |
| 1279 | if (attr & CELL_AUDIO_PORTATTR_BGM) |
| 1280 | { |
| 1281 | cellAudio.todo("cellAudioPortOpen(): CELL_AUDIO_PORTATTR_BGM"); |
| 1282 | } |
| 1283 | if (attr & CELL_AUDIO_PORTATTR_OUT_SECONDARY) |
| 1284 | { |
| 1285 | cellAudio.todo("cellAudioPortOpen(): CELL_AUDIO_PORTATTR_OUT_SECONDARY"); |
| 1286 | } |
| 1287 | if (attr & CELL_AUDIO_PORTATTR_OUT_PERSONAL_0) |
| 1288 | { |
| 1289 | cellAudio.todo("cellAudioPortOpen(): CELL_AUDIO_PORTATTR_OUT_PERSONAL_0"); |
| 1290 | } |
| 1291 | if (attr & CELL_AUDIO_PORTATTR_OUT_PERSONAL_1) |
| 1292 | { |
| 1293 | cellAudio.todo("cellAudioPortOpen(): CELL_AUDIO_PORTATTR_OUT_PERSONAL_1"); |
| 1294 | } |
| 1295 | if (attr & CELL_AUDIO_PORTATTR_OUT_PERSONAL_2) |
| 1296 | { |
| 1297 | cellAudio.todo("cellAudioPortOpen(): CELL_AUDIO_PORTATTR_OUT_PERSONAL_2"); |
| 1298 | } |
nothing calls this directly
no test coverage detected