DGEN isn’t a Retroarch core and uses its own config file ‘dgenrc’ located in /home/Pi/RetroPi/configs/all so you can’t configure it with retroarch.cfg
I recommend you use the latest RetroPie image 1.9.1 which uses Picodrive as the default Megadrive/Genesis emulator which is faster and can be configured with retroarch.cfg
You can also install it via the setup script:
Run RetroPie setup:
cd RetroPie-Setup
sudo ./retropie_setup.sh
Option 4 “Update RetroPie setup script”
restart RetroPie setup
Option 2 “Source based installation”
Then deselect all apart from :
‘install Genesis core Picodrive’
‘generate config file for emulation station’
Press ok and when done reboot