Releases: RealBitdancer/opal-zig
Releases · RealBitdancer/opal-zig
Release list
opal-zig v2.0.2-1
Changed
- Binds opal 2.0.2. NEW (register 105h bit 0) is a live mode bit: bank 1, waveforms
4-7, CHA and CHB, and four-operator pairing apply only while it is set. Disabling
4-op no longer clearspair_index. That field is the physical partner, orch_none
for channels that cannot pair.chan_typesays whether 4-op is active.initnow
sets every operator'seg_outto 0x1FF, so a snapshot taken before the first sample
is silent. A masked timer overflow now sets FT1 or FT2. IRQ (bit 7) is set only when
that timer is unmasked.
Added
version_major,version_minor,version_patch, and the packedversion
(major * 10000 + minor * 100 + patch), matching theOPAL_VERSION_*macros in
opal.h.- Tests for the 2.0.2 core fixes: pair-index wiring, NEW as a live mode bit, silence
after enabling OPL3 without writing C0, stored waveforms 4-7 while NEW is clear,
and a masked timer overflow that must still raise FT1.
Fixed
- The
pair_indexfield comment said it wasch_nonewhen 4-op was off. Init
pre-wires the physical partners, so a visualizer that treated a nonzeropair_index
as "4-op is on" would misread every capable channel afterinit.
opal-zig v2.0.1-1
Changed
- Binds opal 2.0.1, which fixes a 32-bit signed overflow in the output resampler.
The overflow was reachable whenever a track swings more than half of full scale
between two consecutive chip samples, and it aborted the process outright under
any toolchain that traps on signed overflow, which includes Zig's ReleaseSafe.
Added
- A regression test that drives the resampler across a full-scale step, the case
that used to overflow, and pins the interpolated result.
opal-zig v2.0.0-1
Changed
- Binds opal 2.0.0. Rendered output is bit-identical to 1.0.2, only the API shape
changed. - An
Opalinstance is now a plain value: upstream replaced every internal pointer
with an index, so copying, assigning, or relocating an instance is legal and a copy
is a complete save state. The no-copy rule is gone. Opal.initreturns the instance by value.createanddestroyremain as heap
helpers for the roughly 70 KiB struct.- Methods follow the upstream renames:
portis nowwriteReg,portBufferedis
writeRegBuffered,readisreadStatus. The raw externs areopalInit,
opalWriteReg, and so on. - Constants follow the upstream renames:
num_channelsis nowchannel_countand
num_operatorsisoperator_count. - Struct mirrors follow the new pointer-free layout:
op_slot,chan_index,
mod_source,pair_index, andout_sourceare index fields, boolean fields are
bool, andOpal.zero_modis gone.
Added
EnvelopeStageandChannelType, non-exhaustiveenum(c_int)types for the
envelope_stageandchan_typefields.- Index sentinels
op_none,mod_own_fb, andch_none. - A save-state test: a copied chip renders the same audio as the original.
Removed
- The
Boolalias foropal_bool, which upstream removed in favor of C11bool. - The optional cross-pointer fields (
master,chan,mod,channel_pair,
out_ptr), replaced by the index fields above.
opal-zig v1.0.2-1
Added
- First release, binding opal 1.0.2.
- The
opalmodule compiles the upstream C11 core from the pinned release tarball with
the Zig build system. No code generation step, no dependency beyond libc. Opal,Channel,Operator, andWriteBufmirrored asextern structwith
snake_case field names. The test suite verifies every struct size and field offset
against the C compiler, so layout drift fails loudly.- Methods wrapping the eight C functions (
init,setSampleRate,port,
portBuffered,flushWriteBuf,pan,sample,read), pluscreateand
destroyto heap-pin an instance under the C core's no-copy rule, andrenderto
fill interleaved stereo buffers. modulatorSlotandcarrierSlothelpers matching the channel-to-slot table
documented in the upstream header.- A demo (
zig build run) that renders a short FM arpeggio toopal-demo.wav.