Skip to content

Commit

Permalink
Merge pull request #1807 from grumpycoders/johnbaumann-patch-1
Browse files Browse the repository at this point in the history
Update redux-basics.md
  • Loading branch information
johnbaumann authored Nov 22, 2024
2 parents c7be0de + c88009b commit 138bbd1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/Lua/redux-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ This allows distributing complex "mods" as zip files, which can be loaded and ex

- `PCSX.quit([code])` schedules the emulator to quit. It's not instantaneous, and will only quit after the current block of Lua code has finished executing, which will be before the next main loop iteration. The `code` parameter is optional, and will be the exit code of the emulator. If not specified, it'll default to 0.

- `PCSX.getCPUCycles()` returns an unsigned 64-bit number indicating how many CPU cycles have elapsed. This can be paired with the `PCSX.CONSTS.CPU.CLOCKSPEED` constant to determine how much emulated time has passed.

- `PCSX.Adpcm.NewEncoder` will return an Adpcm encoder object. The object has the following methods:
- `:reset([mode])` will reset the encoder, and set the mode to the given mode. The mode can be `'Normal'`, `'XA'`, `'High'`, `'Low'`, `'FourBits'`. The default mode is `'Normal'`, which enables all the filters available in the SPU. The `'XA'` mode limits the encoder to the filters available in the XA ADPCM format. The `'High'` mode uses the high-pass filter, and the `'Low'` mode uses the low-pass filter. The `'FourBits'` mode forces plain 4-bit Adpcm encoding.
- `:processBlock(inData, [outData], [channels])` will encode the given ffi input buffer, and write the result to the given ffi output buffer. The input buffer should be a buffer of 16-bit signed integers, and the output buffer should be a buffer of 16-bit signed integers. The channels parameter is optional, and will default to 2. The input buffer should contain exactly 28 samples, and so does the output buffer. If the output buffer is not given, the function will return a new buffer with the result. LuaBuffers are also accepted as input and output buffers. The function will return three values: the output buffer, the filter index used, and the shifting used. The function is intended to be used as an intermediate computation step, and the output still needs to be processed into 4 bits or 8 bits samples.
Expand Down

0 comments on commit 138bbd1

Please sign in to comment.