Commit Graph
59 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5 909673f4ee sceAudiocodec: correct the 0x1004 note, record the ME's 0x68-byte view
me_wrapper.prx's dispatch table gives 0x1004 a handler that returns -1, so it
is plumbed through avcodec.prx but not implemented on 6.61 - not the real
sixth codec the earlier comment claimed.

Also records the bound that matters for the Atrac3 frame-size question: the ME
is handed a context whose first 0x68 bytes are the only ones made coherent, so
nothing outside that can be reaching it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 12:20:18 -06:00
Henrik RydgårdandClaude Opus 5 53eb468a28 sceAudiocodec: use the codec context for Atrac3 and MP3 instead of guessing
Atrac3 no longer hardcodes 384 bytes per frame. The context only carries the
joint-stereo flag for Atrac3 - libatrac3plus.prx writes nothing else there, and
AtracCtx2 already mirrors that - but exactly one of the five supported frame
sizes is joint stereo (66kbps stereo, 0xC0 bytes), so that flag identifies it
on its own. Everything else keeps the old 132kbps assumption, now via the
existing at3HeaderMap rather than a magic number.

MP3 was passing srcBytesRead as the input length, which is an output field
holding what the *previous* call consumed - zero on the first frame. Use the
bound at 0x28 instead, which is what the hardware uses and which the caller
guarantees is readable at inBuf, since it does a cache writeback over exactly
that range. Channels and sample rate now come from the context's channel
configuration and its version/sample-rate index pair, using the same table
avcodec.prx indexes, rather than being assumed stereo 44100.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 12:18:46 -06:00
Henrik RydgårdandClaude Opus 5 2c482a48b2 sceAudiocodec: name the codec context fields, and make the tail a union
The first 0x28 bytes of the context are the same for every codec - and for
sceVideocodec's own context, which annotates the same fields - so this is one
ME codec-context ABI. Everything after that is per-codec, with each library
writing a different set of fields, so it becomes a union.

Also documents that 0x28 is not a frame size for MP3: the hardware only uses it as a
cache-writeback length, so it is an upper bound - which is why the firmware
never bothers computing an exact one anywhere.

Adds codec id 0x1004, which the hardware accepts and handles much like MP3.
Unidentified, but the range check really does accept six codecs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 12:17:16 -06:00
Henrik Rydgård c5e4d0d90d Rename the get-memory-pointer functions to make it clear where CPU exceptions can happen. 2026-08-12 14:06:16 +02:00
Henrik Rydgård 55eee26c52 Assorted warning fixes 2026-08-03 18:55:35 +02:00
Henrik Rydgård 0fc7d430b4 Reimplement wave parsing more simply, for AtracCtx2. 2025-06-26 11:06:18 +02:00
Henrik Rydgård 80147f318e Remove PSP_CancelBoot, assorted cleanup 2025-05-13 13:58:28 +02:00
Henrik Rydgård 3cd1f2f832 sceAudioCodec: Fix AT3 and AAC playback (possibly limited to certain bitrates) but fixes Kosmodrones 2025-04-13 15:48:11 +02:00
Henrik Rydgård 9738a9511f Build and warning fixes 2025-04-07 23:17:56 +02:00
Henrik Rydgård 3d8233b7f8 Some sceAudiocodec MP3 work. Not yet working in Beats (trying to DisableHLE of sceMp3). 2025-04-07 10:27:53 +02:00
Henrik Rydgård 7d92f05688 Fix sceAudiocodec MP3 support, at least as used by Mega Drops 2
See #20160
2025-04-03 21:48:24 +02:00
Henrik Rydgård d82978d6e6 A bit of sceAudiocodec cleanup 2025-04-03 20:04:29 +02:00
Henrik Rydgård 651a972019 More sceAudioCodec implementation work. Atrac3+ partially works now. 2025-04-02 17:26:59 +02:00
Henrik Rydgård 77e1c9dd69 Work on audiocodec 2025-04-02 13:30:34 +02:00
Henrik Rydgård cf01e92125 ... 2025-04-02 13:30:34 +02:00
Henrik Rydgård 4e25f44eef Rename some module-related functions to include HLE where appropriate 2025-03-31 11:17:50 +02:00
Henrik Rydgård 9c02eab137 More work - start work on handling buffer wraparound properly. Passes the full test with 1 wraparound! 2025-03-18 09:36:32 +01:00
Henrik Rydgård 0516171bdf sceAudioCodec: Implement some findings 2025-03-15 15:56:05 +01:00
Henrik Rydgård 2a05dce105 Show sceMp3 in audio codecs window 2024-11-27 10:35:11 +01:00
Herman Semenov 192650f551 [Core/HLE/GPU/D3D11/GLES] Using for based loop C++17 and replaced on structured binding map C++17 2024-09-18 11:10:10 +02:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård 1b366afa35 Refactor: Change *outBytes to *outSamples in AudioDecoder::Decode. 2024-04-16 15:31:11 +02:00
Henrik Rydgård d402068745 Fix mono output from Atrac decoders. (sceAtrac*MOut* functions) 2024-04-15 11:50:32 +02:00
Henrik Rydgård 5ed77b58ca Improve the AudioDecoder API to avoid having to call a function to get the bytes consumed 2024-04-11 16:49:00 +02:00
Henrik Rydgård 1805910fac More refactoring 2024-04-10 12:22:58 +02:00
Henrik Rydgård 1938d3b876 More prep for plugging in alternate audio decoders 2024-04-10 12:14:58 +02:00
Herman Semenov 2a31f8c6c0 [Common/Core/HLE] Object out of scope optimization for better codegeneration (lower level scope) 2023-12-20 12:33:56 +03:00
fp64 5b6a14edeb Add a newline to "Leaving main" message.
Also implement SYSPROP_DISPLAY_XRES/SYSPROP_DISPLAY_YRES for SDL.
Also fix couple of warnings.
2022-08-16 18:29:14 -04:00
Henrik Rydgård e6403d7157 Split GetPointer into two versions, to help with const correctness 2022-07-24 13:26:19 +02:00
Unknown W. Brackets cc7366e63c HLE: Add a few syscall names. 2021-10-18 06:50:18 -07:00
Unknown W. Brackets 1e2a904fb7 Audiocodec: Fix warning on older clang. 2020-08-18 07:21:11 -07:00
Unknown W. Brackets b8342fb8ec SaveState: Rename ChunkFile files to Serialize.
Makes more sense and less weird than ChunkFileDoMap, etc.
2020-08-10 08:04:05 +00:00
Unknown W. Brackets 481181714b Audiocodec: Silence a known warning. 2020-08-10 08:03:44 +00:00
Unknown W. Brackets 4b4e3432cd SaveState: Split Do() into a separate header. 2020-08-10 08:03:41 +00:00
Unknown W. Brackets ef1dc583a2 Fix various minor warnings. 2016-03-20 14:17:51 -07:00
Unknown W. Brackets fcf0518223 Update all the HLE tables with arg and ret info. 2015-03-22 20:51:55 -07:00
Lioncash 4ccb838306 Core: Mark some module functions as static 2014-12-08 04:40:08 -05:00
Unknown W. Brackets 358462a7f4 Add a .gitattributes to normalize newlines.
No code changes.
2014-09-26 21:20:50 -07:00
Henrik Rydgard cefc0bc96f Play the game's SND0.AT3 when a game is selected in the menu and on the "game screen". 2014-06-22 17:02:04 +02:00
Henrik Rydgard 1d0cc3417c Audio stuff: Cleanup, delete dead code 2014-06-22 14:01:23 +02:00
Unknown W. Brackets 4bb6709eb2 More cleanup in sceAudiocodec. 2014-05-29 08:19:26 -07:00
Unknown W. Brackets 0b59cc4c35 Use a std::map in sceAudiocodec. 2014-05-29 08:16:47 -07:00
Unknown W. Brackets a09f1fd80f Clean up a leak in sceAudiocodec load state. 2014-05-29 08:11:00 -07:00
Unknown W. Brackets a229593105 Erp, forgot to amend, sorry. 2014-05-28 22:49:49 -07:00
Unknown W. Brackets 63bb52bc42 Use the correct size in sceAudioCodec savestates.
ARRAY_SIZE(ptr) ain't gonna work.  Fixes #6173, thanks Lioncash.
2014-05-28 22:45:51 -07:00
Unknown W. Brackets 29bd4b63e4 Fix a bunch of formatting warnings. 2014-05-21 07:59:58 -07:00
kaienfr a576420547 Remove decode function of SimpleAudioDec and use its class method. 2014-04-08 01:09:28 +02:00
Henrik Rydgard c53b8ed8bf Clean up some details in sceAudioCodec. 2014-03-27 22:53:57 +01:00
kaienfr 779d90b8c5 Add DoState for sceAudiocodec 2014-03-27 15:17:54 +01:00
kaienfr b18252b2b5 Support audio playing (AT3, AT3+, Mp3, AAC) 2014-03-23 19:45:08 +01:00