DMG-CPU Research
On this page
  1. tb_apu_regs - register file
  2. tb_apu_ch1 - channel 1 square
  3. tb_apu_ch2 - channel 2 square
  4. tb_apu_ch3 - channel 3 wave
  5. tb_apu_ch4 - channel 4 noise
  6. tb_apu_mix - mixer / volume / DAC enables

APU waves (issue #398)

Waveform documentation for the APU suite (HDL/soc/icarus/apu), rendered from the test VCDs with vcd2png.py (Pillow; .gtkw v3.3.128 save files sit next to each test). All timing facts below were measured on the real APU netlist (apu_wc.v, see Readme.md/STATUS.md).

tb_apu_regs - register file

CPU write/read cycles to $FF10-$FF2F + the wave-RAM window $FF30-$FF3F. Shown: the address/data bus, the soc_wr-derived decode (w188), the wave-RAM window decode w695 and the n_wave_wr/n_wave_rd strobes.

tb_apu_regs

Verified facts:

tb_apu_ch1 - channel 1 square

Two duty segments (50% then 75%, X=0x780): the square high interval is 1/2 (then 3/4) of the 262.144 us output period.

tb_apu_ch1

Verified facts:

tb_apu_ch2 - channel 2 square

Same structure as ch1 (no sweep) - works only with the w548 bus-model fix (apu_wc.v), see STATUS.md for the root cause.

tb_apu_ch2

tb_apu_ch3 - channel 3 wave

Vol-100% segment with a known wave-RAM image: ch3_out sits at the sample value F while ch3_active/wave_a step the RAM at (2048-X)*2 osc per sample (X=0x7F0 -> ~2 us/step in this window).

tb_apu_ch3

Verified facts:

tb_apu_ch4 - channel 4 noise

LFSR output at NR43 divisor 0, 15-bit width: the level toggles between 0 and F (NR42 volume) - a pseudo-random pattern, not a square.

tb_apu_ch4

tb_apu_mix - mixer / volume / DAC enables

CPU writes to NR51/NR50/NR52 while the mixer outputs (lmixer/rmixer, n_lvolume/n_rvolume, vin, n_ch*_amp_en) are probed.

tb_apu_mix

Verified facts: