-- Sweep the PPI's port C -- which is where the X68000 puts ADPCM pan and the -- chip's clock divider -- and feed a loud burst under each value, so that the -- WAV says which value un-mutes the chip. Nothing here is assumed: the segment -- boundaries are printed and the analysis reads the wave against them. M = manager.machine local sp = M.devices[":maincpu"].spaces["program"] local CTRL, DATA, PPIC = 0xE92001, 0xE92003, 0xE9A005 local SEG = 40 -- host frames per segment local n = 0 SUB = emu.add_machine_frame_notifier(function() n = n + 1 if n <= 20 then return end local k = n - 20 local seg = math.floor((k - 1) / SEG) local off = (k - 1) % SEG if seg > 15 then print("[AD] done"); M:exit(); return end if off == 0 then sp:write_u8(PPIC, seg) sp:write_u8(CTRL, 1) print(string.format("[AD] seg %2d portC=$%02X starts at host frame %d", seg, seg, n)) elseif off <= 30 then sp:write_u8(DATA, 0x77) -- two loud positive nibbles end end)