Reading CDDA sound levels

From NeoGeo Development Wiki
Revision as of 04:14, 26 September 2023 by Furrtek (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Registers REG_CDDALEFTL and REG_CDDARIGHTL hold the values of the currently streamed CD audio data, in a reversed 16bit 2's complement format suited for the LC78815 DAC. They were only used to display the vu-meters in the CD player interface.

The CD system ROM uses the following code to reverse the bits:

;D1:Input, D0:Output
    moveq	#16-1,d7
	moveq	#0,d0
	lsr	    #1,d1
	bcc	zerobit
	bset	d7,d0
	dbf	    d7,rev

It reads both registers multiple times during each frame (every 16 raster lines, by using the raster interrupt) to get an average value.


File:Screencap cddaviz.png

This does NOT work on current emulators.


Source for AS and iso image:

[Youtube video]