Re: [hatari-devel] Removing magic values from PSG? |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
On 03/02/2012 23:00, Laurent Sallafranque wrote:
Hi, I'm OK with Eero's patch too. I was refering to the following lines : memset(PSGRegisters, 0, sizeof(PSGRegisters)); - for ( i=0 ; i<14 ; i++ ) /* Update sound's emulation registers */ + /* Update sound's emulation registers */ + for ( i=0 ; i< NUM_PSG_SOUND_REGISTERS; i++ ) Sound_WriteReg ( i , 0 ); Are these lines creating shadow registers for the sound ? I may misunderstand the code here, it's just in case, as there's no shadow register on the Falcon for the sound.
No, these lines don't create shadow registers ; they're just updating the sound generation engine with the '0' that were directly written in the array PSGRegisters without accessing ff8800/02
Shadow registers are not handled in psg.c/sound.c but in the ioMem*.c files.By the way eero, you should use PSG_REG_IO_PORTA (=14) instead of NUM_PSG_SOUND_REGISTERS. Only sound related psg's registers should be sent to Sound_WriteReg (values above 14 will be ignored, but it's useless to send them anyway)
Nicolas
Regards Laurent Le 03/02/2012 22:54, Nicolas Pomarède a écrit :On 03/02/2012 22:38, Laurent Sallafranque wrote:Hi, I just saw something from the PSG code you want to remote. If I understand it well, it generated shadow addresses for the PSG. But we should test for Falcon as there's no PSG shadow register in the falcon. Sorry if I misundersood something. Regards LaurentHello To me, Eero's patch only replaces some numerics with some enums, so I don't see any possible breakage here, unless I missed something, patch can be applied. Nicolas
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |