Refactor Base library into clean dependency layers, starting with Layer 0.
Single module with no Apus dependencies, minimal RTL dependencies.
Types:
Char8, String8, Char16, String16, String32- character/string type aliasesUIntPtr, PtrUInt- pointer-sized unsigned integersDWORD, QWORD- integer type aliasesByteArray, WordArray, IntArray, UIntArray, SingleArray, FloatArray, PointerArray- array typesStringArray8, StringArray16, StringArray- string arraysShortStr- short string[31]TProcedure, TObjProcedure- procedure typesTSplineFunc- spline function typem128- 128-bit vector recordhalf- 16-bit float with implicit conversion
CPU detection:
TCPUTypeenum (X86, ARM)CPU_TYPE,CPU_BITconstantscpuFeatures:TCPUFeatures- global record with feature flags (MMX, SSE, SSE2, SSE3, AVX, AVX2, AES, etc.)
Math functions:
- Min/Max (integer, single, double; 2 and 3 args)
- Clamp, Sat, Lerp, LerpC
- Swap, Toggle
- Pow2, GetPow2, Log2i
- IsNaN (single, double)
- FRound, PRound, SRound, FastFloor (to add)
- Ratio, FastInvSqrt, Wrap (to add)
- LinearMix (to add)
- PseudoRand (to add)
Memory operations: Mem scope
- Clear, Fill, FillW, FillD, FillQ, FillF
- Copy, Shift, IsZero
Bit manipulation: Bits scope
- HasAll, HasAny, SetFlag, Clear, Modify
- Get, SetBit (byte, word, cardinal, uint64)
Alignment:
- AlignUp, AlignDown, IsAligned (UIntPtr and pointer versions)
Pointers:
- PtrInside
Threading and synchronization primitives.
TMyCriticalSection+ Init/Delete/Enter/LeaveTSRWLockSpinLock- Thread registration
Note: Depends on platform APIs. May need simplified version without GetCaller dependency.
These types have methods with dependencies or are not simple:
TIntRange, TFloatRange- use Random()TNameValue, TNameValueList- use string parsing from CommonTBuffer, TWriteBuffer- binary buffer helpersTMyCriticalSection, TSRWLock- threading primitivesTArray<T>- generic container
- Create Apus.Core with basic math, memory, bits
- Add alignment functions
- Add tests (TestCore.dpr)
- Merge Apus.CPU into Apus.Core
- Add basic types from Apus.Types (simple ones only)
- Add CPU_TYPE/CPU_BIT constants
- Add more math functions (FRound, etc.)
- Update modules to use Apus.Core instead of Apus.Common for basic functions