Skip to content

Commit

Permalink
decompile JASCalc
Browse files Browse the repository at this point in the history
  • Loading branch information
SwareJonge authored and HeartPiece44 committed Sep 15, 2023
1 parent eb5ee7c commit a1dd5f8
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 570 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
"JSystem/JAudio/JAS/JASDSPChannel",
"JSystem/JAudio/JAS/JASDSPInterface",
["JSystem/JAudio/JAS/JASAudioThread", True],
"JSystem/JAudio/JAS/JASCalc",
["JSystem/JAudio/JAS/JASCalc", True],
["JSystem/JAudio/JAS/JASCallback", True],
"JSystem/JAudio/JAS/JASCmdStack",
["JSystem/JAudio/JAS/JASDvdThread", True],
Expand Down
24 changes: 17 additions & 7 deletions include/JSystem/JAudio/JAS/JASCalc.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
#ifndef _JSYSTEM_JAS_JASCALC_H
#define _JSYSTEM_JAS_JASCALC_H

#include "stl/limits"
#include "types.h"

namespace JASCalc {
void imixcopy(const short*, const short*, short*, unsigned long);
void bcopy(const void*, void*, unsigned long);
void bzero(void*, unsigned long);

// TODO: The existence of this function likely implies the usage of standard C++ type limits API. We should adopt the same throughout.
/*
* --INFO--
* Address: 800A64D8
* Size: 000028
*/
template <typename A, typename B>
A clamp(B p1);
A clamp(B x)
{
if (std::numeric_limits<A>::min() >= x) {
return std::numeric_limits<A>::min();
}
if (x >= std::numeric_limits<A>::max()) {
return std::numeric_limits<A>::max();
}
return x;
}

/**
* @fabricated
* See JASChannel::updateAutoMixer
*/
inline f32 clamp_0_1(f32 value)
inline f32 clamp01(f32 value)
{
if (value <= 0.0f) {
return 0.0f;
Expand Down
Loading

0 comments on commit a1dd5f8

Please sign in to comment.