vgmrips / vgmtools

A collection of tools for the VGM file format
GNU General Public License v2.0
118 stars 18 forks source link

small bug in vgm2txt YM2151 TEST register 0x01 #5

Closed vampirefrog closed 1 year ago

vampirefrog commented 6 years ago

Hello. For YM2151, the second bit (mask 0x02) of the 0x01 TEST register is called LFO Reset, not LFO On/Off as vgm2txt outputs.

http://img.vampi.tech/089c07b3.png

superctr commented 6 years ago

That bit in the register also resets the lfo and that's what it is usually used for. So I don't consider it a bug.

Den 16 nov. 2017 10:28 em skrev "vampirefrog" notifications@github.com:

Hello. For YM2151, the second bit (mask 0x02) of the 0x01 TEST register is called LFO Reset, not LFO On/Off as vgm2txt outputs.

http://img.vampi.tech/089c07b3.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vgmrips/vgmtools/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGw8ZhSSJgP-9Wy-i5UD8VlxakqpKgeks5s3KkXgaJpZM4QhKsE .

superctr commented 6 years ago

mame docs actually call the bit "HLFO". Apparently the LFO is halted at max amplitude when the bit is set, and when it is cleared (from being set), then the LFO is reset.

vampirefrog commented 6 years ago

MXDRV writes 1 then 0 to that bit in order to reset the LFO phase. The YM151 User Manual calls it "LFO RESET". I suppose vgm2txt could output: 54 01 02 YM2151: Test Register, LFO Halt (max amplitude) 54 01 00 YM2151: Test Register, LFO Reset Ideally, vgm2txt would remember the last LFO Halt and call it a 'reset' only then, otherwise calling it 'unexpected'. Either way, "LFO Off" is incorrect for when the bit is zero, as is "LFO On" incorrect for when the bit is set.

ValleyBell commented 1 year ago

Fixed by d60d736e6ad18259ed8b8ac9ea1f54c8b3b299fb.